You can use Domino to export model images built in Domino to an external container registry. These images include all the information needed to run the model including the model code, artifacts, environment, and project files.
Your CI/CD pipeline or workflow can call Domino’s REST APIs to programmatically build and export the model image. By default, the images are built in Model API format. You can deploy these images in an environment that runs Docker containers.
Build Model Image API
This API builds a Docker image for a model and stores it in Domino’s internal Registry. This can later be fetched from the registry (using other export APIs) by your CI/CD pipeline. The exported image can be deployed in your runtime environment (outside Domino). Your CI/CD pipeline can add more layers to this image to do more customizations (such as adding Auth).
Export model image API
Use this API to push a model image to a third-party container registry outside Domino. This assumes the image was already built and available in Domino. As part of the API request, provide credentials for your registry to push the image to it. These credentials are not saved in Domino and can have a time to live (TTL) attached.
Export model image for Sagemaker API
This API builds a Docker image for a given version of a Model API in an AWS Sagemaker-compliant format, and then exports it to AWS ECR or any third-party container registry outside Domino. As part of the API request, provide credentials for your registry to push the image to it. These credentials are not saved in Domino and can have a time to live (TTL) attached.
Sagemaker can train and then deploy a model to serve requests. Model export functionality in Domino only supports the serve use case since train operation would have already happened in Domino. The image is ready to be deployed in the Sagemaker environment. All the files required to make predictions are packaged in the container.
Export model image for Snowflake
Use this API to export the Model API that you created in Domino to Snowflake as a Snowpark Python UDF for hosting. As part of the API request, you must provide credentials, database, and stage information. These credentials are not saved in Domino.
Publish the Domino model with a prediction function as a Snowpark UDF to Snowflake. You can call this function from your Snowflake application or as part of a SQL query to operate on DataFrames and other scalar or tabular data types used in Snowflake.
See Model Requirements.
When you export a Domino model to Amazon Sagemaker and create an endpoint from the exported model, the Sagemaker endpoint might fail with the error The primary container for production variant variant-name-1 did not pass the ping health check
.
Use the following steps to work around the issue:
-
Add
USER root
in the environmentDockerfile
instructions. -
Publish the model API from the new instructions.
-
Export the same image in Sagemaker and create an endpoint.