Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the default buildpacks to use paketo and add a tip for tilt #119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/modelserving/v1beta1/custom/custom_model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ to run the image build on the cloud and continuously build/deploy new versions f

### Use pack to build and push the custom model server image
```bash
pack build --builder=heroku/buildpacks:20 ${DOCKER_USER}/custom-model:v1
pack build --builder paketobuildpacks/builder:full ${DOCKER_USER}/custom-model:v1
docker push ${DOCKER_USER}/custom-model:v1
```

Expand Down Expand Up @@ -93,6 +93,8 @@ curl localhost:8080/v1/models/custom-model:predict -d @./input.json

{"predictions": [[14.861763000488281, 13.94291877746582, 13.924378395080566, 12.182709693908691, 12.00634765625]]}
```
!!! tip
You can also use [`tilt`](https://tilt.dev/) along with `pack` and [`paketo`](https://paketo.io/) Buildpacks allowing you make code changes and have them reflected live in your custom inference service. For more details see - [Paketo Python Buildpacks - Enable Process Reloading](https://paketo.io/docs/howto/python/#enable-process-reloading)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks cool, you can create the Tiltfile like following for continuous dev development, we might want to add a bit more instruction for how to do this.

load('ext://pack', 'pack')
k8s_kind('InferenceService', api_version='serving.kserve.io/v1beta1', image_json_path='{.spec.predictor.containers[*].image}')

allow_k8s_contexts('docker-desktop')

pack(
  'yuzisun/tilt-demo-2022',
  ignore=[
    'Tiltfile',
    'service.yaml',
    '.*',
  ],
  live_update = [
    sync('.', '/workspace'),
  ],
  deps=["."],
)
k8s_yaml('service.yaml')
k8s_resource('tilt-demo', extra_pod_selectors={'serving.kserve.io/inferenceservice':'tilt-demo'})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tiltfile I am using looks a bit like -

# -*- mode: Python -*-

version_settings(constraint='>=0.22.1')
load('ext://pack', 'pack')
docker_compose('docker-compose.yml')

pack('myapp',
  builder="paketobuildpacks/builder:full",
  live_update=[
    sync('.', '/workspace'),
  ]
)


## Deploy the Custom Predictor on KServe
### Create the InferenceService
Expand Down