云原生AI系统框架

云主机,预装 CentOS:

云平台地址:https://console.cloud.tencent.com/cvm/instance/index?rid=8

安装 / 启动 Docker

yum update
# 安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
# 启动
sudo systemctl start docker
# 开机启动脚本位置
vi /etc/rc.local 

搭建容器镜像服务

容器镜像服务:https://console.cloud.tencent.com/tcr/instance?rid=8
创建临时登陆访问权限:https://console.cloud.tencent.com/tcr/instance/details/tcr-dd5yuo3b/credentials

镜像管理:


docker tag
docker push

Docker 主机

# 1) list 当前docker里的可用镜像:
sudo docker images
# 2)装载镜像到docker容器中,并执行:
sudo docker run --gpus '"device=7"' -itd --name sj -v /data/share:/share_data [image_fa2b51415ac4] /bin/bash /share_data/sj_docker.sh
sudo docker run --cpuset-cpus="1,3" -itd --name sj 31be0957e941 /bin/bash
# 3)当前容器管理
sudo docker ps -a
sudo docker start [container_7dc24ba62794]
sudo docker stop [container_7dc24ba62794]
sudo docker rm [container_7dc24ba62794]
sudo docker rmi [image_fa2b51415ac4]
sudo docker exec -it [container_7dc24ba62794] /bin/bash
sudo docker run --gpus '"device=7"' -itd --name sj -v /data/share:/share_data [image_fa2b51415ac4] /bin/bash /share_data/sj_docker.sh
sudo docker run -itd --name sj 31be0957e941 /bin/bash ~/dev/aurora/shell/run.sh
# 同步系统时区
docker cp /usr/share/zoneinfo/Asia/Shanghai [container_7dc24ba62794]:/etc/localtime

sudo docket commit -a "sijiu.duan" -m "2020 09 04 redo_xa_dyf" ab9e1f00e735 opvn_redo:0.0.0

docker exec -d sj /bin/bash ~/dev/aurora/shell/run/PersonShapeTraces.sh
docker exec -d sj /bin/bash ~/dev/aurora/shell/run/CosUpload.sh
docker exec -it sj /bin/bash ~/dev/aurora/shell/aurora/7145.sh
redis-cli -h 172.21.0.10 -p 6380 -a Abcd1234

# NUC
sudo docker run -v /home/pi/share/:/data -v /dev/shm:/dev/shm -itd --name="ubuntu18_04_ffmpeg" --privileged --net=host -e LIBVA_DRIVER_NAME=iHD -e DISPLAY=$DISPLAY ubuntu:18.04 /bin/bash

/root/bin/ffmpeg -hwaccel qsv -c:v hevc_qsv -i 140002.mp4 -vf hwdownload,format=nv12 -update 1 -f image2 -c:v mjpeg_qsv /dev/shm/img1.jpeg

任务服务参考架构

服务分发、负载架构

服务调度架构 参考
WorkerSever内部架构