Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
huolongshe 23b9a7c871 | 11 months ago | |
---|---|---|
app | 1 year ago | |
deploy | 1 year ago | |
webapp | 1 year ago | |
.gitignore | 1 year ago | |
Dockerfile | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 11 months ago | |
application.yml | 1 year ago | |
build-docker.sh | 1 year ago | |
pip-install-reqs.sh | 1 year ago | |
requirements.txt | 1 year ago | |
start.py | 1 year ago |
本程序为 CubeAI智立方 系列软件中的一个独立组件,可运行于k8s容器之中,用于将 《CubeAI模型示范库》 中的AI模型推理服务程序打包为Docker镜像并部署运行。
本程序以Docker容器服务形式运行于k8s云环境中,使用方法和步骤如下:
环境准备
Docker打包服务器
因为Docker容器内部无法打包Docker镜像,因此需要选择k8s集群的一个节点作为Docker打包服务器,并在此节点上开放2375端口。
Docker镜像仓库服务器
用于打包完成后将镜像推送至该镜像仓库服务器进行存储。
部署k8s容器服务:
kubectl apply -f ./deploy/cubeai-model-deployer-k8s.yml
在在浏览器中输入网址打开网页: <k8s入口IP>:<端口号>, 其中<端口号>可通过如下命令获得。
kubectl get service cubeai-model-deployer-k8s
在打开的浏览器页面的URL输入栏中填入如下信息,然后点击“确定”按钮开始构建模型Docker镜像。
欲打包Docker镜像的AI模型推理服务程序的git代码仓库URL,例如:
https://openi.pcl.ac.cn/cubeai-model-zoo/openvino-face-detector.git
Docker打包服务器IP地址:端口号
Docker镜像仓库的URL前缀、用户名和密码
构建成功后,可根据提示信息将刚刚打包生成的模型推理服务程序Docker镜像部署至本地Docker容器或k8s环境运行。
本地部署
在本地terminal窗口中执行如下命令来查看刚刚打包生成的Docker镜像,并在Docker容器中运行该服务:
docker images
docker run -p 3330:80 <模型Docker镜像ID或镜像名>
或(如果本机系统中存在NVIDIA GPU卡):
docker run -p 3330:80 --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -e LD_LIBRARY_PATH=/usr/local/cuda/lib64 -v /usr/local/cuda:/usr/local/cuda <模型Docker镜像ID或镜像名>
部署至Kubernetes
向Kubernetes云环境部署时,需要提供Kubernetes端点URL和Kubernetes Token。
如果部署至本机Minikube,可通过执行以下命令来获取Kubernetes URL和Kubernetes Token的值:
# Kubernetes URL, 使用以下命令的返回值
echo 'https://'$(kubectl get ep kubernetes --no-headers|awk '{print $2}')
# Kubernetes Token, 使用以下命令的返回值
kubectl -nkube-system get $(kubectl get secret -nkube-system -oname|grep remote-admin-token) -ojsonpath={.data.token}|base64 -d
No Description
TypeScript Python HTML Shell Dockerfile other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》