参考文档:
https://github.com/PaddlePaddle/Serving/blob/v0.8.3/doc/Run_On_Kubernetes_CN.md
https://gitee.com/AI-Mart/Serving
步骤一
安装指令
yum install git
步骤二
下载repo
git clone https://github.com/PaddlePaddle/Serving.git
步骤三
切换目录
cd Serving
步骤四
查看能生成镜像的参数配置
bash tools/generate_runtime_docker.sh --help
生成特定镜像
bash tools/generate_runtime_docker.sh --env cuda10.1 --python 3.7 --serving 0.8.3 --paddle 2.2.2 --image_name paddle_serving_runtime:cuda10.1-py37-sv0.8.3-pd2.2.2
步骤五
登陆到镜像仓库
docker login -u xx -p xx xx-docker.pkg.coding.net
上传到特定仓库repo xx-docker.pkg.coding.net/xx/xx/xx
docker push xx-docker.pkg.coding.net/xx/xx/xx:cuda10.1-py37-sv0.8.3-pd2.2.2
步骤六
此时可以在dockerfile里面继承这个基础镜像做进一步的应用开发和部署
FROM xx-docker.pkg.coding.net/xx/xx/xx:cuda10.1-py37-sv0.8.3-pd2.2.2
COPY . /deploy
WORKDIR /deploy
# Install requirements
RUN pip config set global.index-url https://mirror.baidu.com/pypi/simple \
&& python3.7 -m pip install --upgrade setuptools \
&& python3.7 -m pip install --upgrade pip \
&& pip3.7 install -r requirements.txt \
&& python3.7 paddle_model.py
ENTRYPOINT python3.7 web_service.py