Skip to main content

Custom Image

stay Dependency managementPart of the dependency installation will be introduced in "Model deployment" Execute at startup. To accelerate service startup, you can use custom images. Pre install all dependencies in custom images.

Prepare Dockerfile

first. The purpose of custom images is to accelerate the startup speed of model deployment. Avoid unnecessary dependency installations.therefore. All custom images must be in HyperAI Built on the official image provided.

Please go "administrators" - "image" Get image address.

Here is one of them Python GPU Example of preparing dependencies in mode:

FROM uhub.service.ucloud.cn/hyperairuntimes/pytorch:1.7.0-py36-cpu.55

RUN pip install --no-cache-dir opencv-python==4.2.0.34

You can see. In this example, for Python GPU Pre installed dependencies in mode: opencv-python.

Build and push the image to the image repository

Build an image and push it to the image repository. Here we use UCloud Taking the mirror repository 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 images when creating model deployment

When creating model deployment. Fill in the image constructed above into"Custom Image"position. The specified image will be used during deployment instead of the official default image.