References

Ways to deploy models with Dotscience

We explore the different ways to deploy ML models into production with Dotscience

Deploying Models via REST API / Batch Endpoints

You can deploy models into Kubernetes with dotscience in the following ways

In addition to that there are two other ways to deploy a model, particularly integrated into a development workflow.

  • Using the REST API:

Get deployments:

curl --request GET \

--url http://localhost:8080/v2/deployers/1295427a-57bb-428d-8448-4ee9505f5b9b/deployments \

--header 'authorization: Basic username:password' \

--header 'content-type: application/json'

Create deployment:

curl --request POST \

--url http://localhost:8080/v2/deployers/1295427a-57bb-428d-8448-4ee9505f5b9b/deployments \

--header 'authorization: Basic username:password' \

--header 'content-type: application/json' \

--data '{

    "name": "roadsigns",

    "namespace": "default",

    "container_port": 8501,

    "model_id": "YOUR-MODEL-ID",

    "replicas": 1

}'

Delete deployment:

curl --request DELETE \

--url http://localhost:8080/v2/deployers/1295427a-57bb-428d-8448-4ee9505f5b9b/deployments/110afea2-ffb8-4f49-9ca3-bb55374babe8 \

--header 'authorization: Basic username:password' \

--header 'content-type: application/json'
  • Using the ds command line tool.

The ds command line tool can be used to create, list, and delete deployments.

ds deployment --help
Manage deployment - create, list and modify deployments

Usage:
  ds deployment [flags]
  ds deployment [command]

Available Commands:
  create      Create a new deployment
  ls          List deployments
  rm          Remove one or more deployments

Flags:
  -h, --help   help for deployment

Use "ds deployment [command] --help" for more information about a command.

An example command used to create a deployment

ds deployment create --model-name roadsigns11 -d eu-west --model-classes classes.json -i[ quay.io/dotmesh/dotscience-model-pipeline:ds-version-276ae14c-e20d-416e-9891-317b745b0cc1](http://quay.io/dotmesh/dotscience-model-pipeline:ds-version-276ae14c-e20d-416e-9891-317b745b0cc1) --host[ my-mdl.webrelay.io](http://my-mdl.webrelay.io/)

For more information on ds please refer to the section on ds command line