Seldon Deploy SDK
This repository holds different SDK implementations to interact with the Seldon Deploy API.
⚠️NOTE: The Seldon Deploy SDK only supports Seldon Deploy
To install the stable version of the SDK run:
pip install seldon-deploy-sdk
To install the latest version from source run:
pip install -e git+https://github.com/SeldonIO/seldon-deploy-sdk.git#egg=seldon-deploy-sdk\&subdirectory=python
The Python version of the SDK includes support for common authentication workflows.
You can see an example usage below:
from seldon_deploy_sdk import EnvironmentApi, Configuration, ApiClient from seldon_deploy_sdk.auth import AuthMethod, OIDCAuthenticator config = Configuration() config.host = "http://X.X.X.X/seldon-deploy/api/v1alpha1" config.oidc_client_id = "sd-api" config.oidc_client_secret = "sd-api-secret" config.oidc_server = "http://X.X.X.X/auth/realms/deploy-realm" config.auth_method = AuthMethod.AUTH_CODE auth = OIDCAuthenticator(config) config.id_token = auth.authenticate() api_client = ApiClient(configuration=config, authenticator=auth) env_api = EnvironmentApi(api_client) user = env_api.read_user() print(user)
You can find more details on the Python SDK documentation.
To generate a new version of the SDK, you can use the
For example, for Python you could do:
make -C python install-dev make python
There is some custom logic added on top of each client.
These extra files and customisation can be found in the
For Seldon Deploy model metadata service, we are having to patch two additional dict type parameters namely
metrics to the generated docs and sdk code. We do this manually, using the same make command, by applying the patch file file to the code, post sdk generation task. In some cases the patch apply cmd may fail, and there might be a requirement to re-generate the patch manually by changing the generated docs/sdk files as required.
How to create a new release?
Update the swagger file with latest specification.
Update config file to bump the package version.
make pythonto re-generate the sdk api files from new specifications. If you get error
error: patch failedthen update the template customisation patch file. See templates section above for more details.
make -C python build pushto build & push latest release to PyPi. There's also the
push-testtarget, for testing.
Create a new Github Tag and Release with latest version and notes.