Custom Images
:::info This feature is only supported in private deployments. :::
The dependency installation described in the Dependency Management section is executed when "Model Deployment" starts. To accelerate service startup, you can use custom images with all dependencies pre-installed.
Prepare Dockerfile
First, the purpose of custom images is to accelerate the startup speed of model deployment and avoid unnecessary dependency installation. Therefore, all custom images must be built based on the official images provided by HyperAI.
Please go to "Administrator" - "Images" to get the image address.
Here's an example of preparing dependencies in Python GPU mode:
FROM uhub.service.ucloud.cn/openbayesruntimes/pytorch:1.7.0-py36-cpu.55
RUN pip install --no-cache-dir opencv-python==4.2.0.34As you can see, this example pre-installs the dependency opencv-python for Python GPU mode.
Build and Push the Image to Image Registry
Build the image and push it to the image registry. Here we use UCloud's image registry as an example:
docker login uhub.service.ucloud.cn
Username:
Password:
# Login Succeeded
docker build . -t uhub.service.ucloud.cn/<your-registry>/<your-image-name>
docker push uhub.service.ucloud.cn/<your-registry>/<your-image-name>Use Custom Image When Creating Model Deployment
When creating a model deployment, fill in the image built above in the "Custom Image" field. The specified image will be used instead of the official default image during deployment.