Help Center/ ModelArts/ Troubleshooting/ Inference Deployment/ AI Application Management/ Invalid Runtime Dependency Configured in an Imported Custom Image
Updated on 2023-06-12 GMT+08:00

Invalid Runtime Dependency Configured in an Imported Custom Image

Symptom

When a custom image is imported through an API to create an AI application, the runtime dependency is configured, but the pip dependency package is not properly installed.

Possible Causes

An imported custom image does not support the runtime dependency. The system does not automatically install the required pip dependency package.

Solution

Create a custom image again.

Install the pip dependency package (for example, the Flask dependency package) in the Dockerfile file that is used to create the image.

# Configure the Huawei Cloud source and install Python, Python3-PIP, and Flask.
RUN cp -a /etc/apt/sources.list /etc/apt/sources.list.bak && \   
sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.comxxx@g" /etc/apt/sources.list && \   
sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.comxxx@g" /etc/apt/sources.list && \   
apt-get update && \   
apt-get install -y python3 python3-pip && \   
pip3 install  --trusted-host https://repo.huaweicloud.comxxx -i https://repo.huaweicloud.comxxx/repository/pypi/simple  Flask