Command Line Interface

sd CLI reference.

The sd command line interface allows you to access Seldon Deploy programatically. This allows you to trigger deployments and promotions directly from your training or CI pipelines.

overview

Getting Started

To use it, you can run the pre-built seldonio/sd image. Note that you can use this image directly as a container on your CI pipeline.

docker run -it --rm seldonio/sd:0.1.3 sd

Authentication

The sd CLI supports authentication by providing your Seldon Deploy user and password on each call. This means that it can be used from outside the Kubernetes cluster, pointing the tool the external Seldon Deploy domain. You can see an example below:

sd list \
  --server https://ml.example.org/seldon-deploy \
  --user jdoe \
  --password 232323 \
  --namespace staging

At the moment, authentication from the CLI only works with Dex configured at the ingress gateway level. There is also the added restriction that Dex must only have a single authentication provider configured. For example, if you configure access to an LDAP server in Dex, you must disable other sources of credentials like the static passwords added by default.

Authentication at the application level is not supported at the moment.

Usage

Some of the most common workflows you can perform using sd are deploying a new version of your model and requesting a promotion between environments. These workflows can be automated as part of your CI pipeline, regardless of your CI provider.

Deploying a Seldon model

To deploy a new version of your model you can use the sd deploy command. This will generate a SeldonDeployment spec from the parameters passed in as flags and will deploy it on a given namespace. If GitOps is enabled, this will also create (or update) the relevant files in your GitOps repository.

For example, to deploy a model named my-model in the staging namespace you can run:

sd deploy my-model \
  --server https://ml.example.org/seldon-deploy \
  --user jdoe \
  --password 232323 \
  --namespace staging \
  --model-image seldonio/my-model:2.0

You can see all the supported flags in the sd deploy reference page.

Requesting a promotion between environments

To request a promotion of your Seldon deployment between different environments you can use the sd promote command. This will fetch the latest version of your deployment from the source environment and will create a pull request with the relevant changes on the target environment.

Note that this workflow is only supported if GitOps is enabled.

For example, to request a promotion for a deployment named my-model from the staging environment to the production environment you can run:

sd promote my-model \
  --server https://ml.example.org/seldon-deploy \
  --user jdoe \
  --password 232323 \
  --git-user git-ci \
  --git-password 242424 \
  --from staging \
  --to production \
  --promotion-author 'Jane Doe' \
  --promotion-email jdoe@example.org

You can see more details in the sd promote reference page.

Reference