You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we have written and tested our custom model, the next step is to deploy it.
251
+
With that goal in mind, the rough outline of steps will be to first build a custom image containing our code, and then deploy it.
252
+
253
+
254
+
### Building a custom image
255
+
256
+
```{note}
257
+
This section expects that Docker is available and running in the background.
258
+
```
259
+
260
+
MLServer offers helpers to build a custom Docker image containing your code.
261
+
In this example, we will use the `mlserver build` subcommand to create an image, which we'll be able to deploy later.
262
+
263
+
264
+
Note that this section expects that Docker is available and running in the background, as well as a functional cluster with Seldon Core installed and some familiarity with `kubectl`.
265
+
266
+
267
+
```bash
268
+
%%bash
269
+
mlserver build . -t 'my-custom-numpyro-server'
270
+
```
271
+
272
+
To ensure that the image is fully functional, we can spin up a container and then send a test request. To start the container, you can run something along the following lines in a separate terminal:
273
+
274
+
```bash
275
+
docker run -it --rm -p 8080:8080 my-custom-numpyro-server
As we should be able to see, the server running within our Docker image responds as expected.
301
+
302
+
### Deploying our custom image
303
+
304
+
```{note}
305
+
This section expects access to a functional Kubernetes cluster with Seldon Core installed and some familiarity with `kubectl`.
306
+
```
307
+
308
+
Now that we've built a custom image and verified that it works as expected, we can move to the next step and deploy it.
309
+
There is a large number of tools out there to deploy images.
310
+
However, for our example, we will focus on deploying it to a cluster running [Seldon Core](https://docs.seldon.io/projects/seldon-core/en/latest/).
311
+
312
+
For that, we will need to create a `SeldonDeployment` resource which instructs Seldon Core to deploy a model embedded within our custom image and compliant with the [V2 Inference Protocol](https://github.com/kserve/kserve/tree/master/docs/predict-api/v2).
313
+
This can be achieved by _applying_ (i.e. `kubectl apply`) a `SeldonDeployment` manifest to the cluster, similar to the one below:
0 commit comments