部署3D点云服务

部署方式

  • 基于kubernetes部署

基于kubernetes部署

note
  • 环境准备

在 docker 环境下,使用下面脚本另存为 DockerFile 文件

FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu18.04
WORKDIR /workspace
RUN chmod 777 /tmp
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A4B469963BF863CC
RUN rm -rf /etc/apt/sources.list.d
RUN apt update
RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libglib2.0-dev libssl-dev libreadline-dev libffi-dev wget apt-file libsm6 libxrender1 libsm-dev libxrender1 libxext6 -y
RUN wget https://registry.npmmirror.com/-/binary/python/3.8.0/Python-3.8.0.tgz && \
tar -xf Python-3.8.0.tgz && rm -rf Python-3.8.0.tgz && \
cd Python-3.8.0 && ./configure --enable-optimizations --prefix=/usr/local/python3 && \
make && make install
RUN ln -s /usr/local/python3/bin/python3.8 /usr/bin/python
RUN ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip
RUN python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
RUN pip config set global.index-url https://pypi.douban.com/simple/
RUN pip install torch==1.5.0 && \
pip install Pillow==8.4.0 && \
pip install torchvision==0.6.0 && \
pip install torch==1.5.0 && \
pip install torchvision==0.6.0 && \
pip install easydict==1.9 && \
pip install opencv-python==4.2.0.34 && \
pip install numpy==1.18.3 && \
pip install torchsummary==1.5.1 && \
pip install tensorboard==2.2.1 && \
pip install scikit-learn==0.22.2 && \
pip install wget==3.2 && \
pip install tqdm==4.54.0 && \
pip install matplotlib==3.3.3 && \
pip install protobuf==3.19.1
  • 执行生成镜像并推送到 harbor 中,保存tar包,通过镜像管理上传点云镜像
# 打包镜像(请替换 [harbor-url] 为 Harbor 域名),[镜像名],[版本号]均可自定义
$ docker build -t [harbor-url]/dubhe/[镜像名]:[版本号] .
# 登录 Harbor 镜像仓库(请替换 [harbor-url] 为 Harbor 域名):
$ docker login https://[harbor-url]
# 推送打包好的镜像到 Harbor 仓库(请替换 [harbor-url] 为 Harbor 域名):
$ docker push [harbor-url]/dubhe/[镜像名]:[版本号] .
# 保存为tar压缩文件,用于在镜像管理上传
$ docker save [harbor-url]/dubhe/[镜像名]:[版本号] -o [镜像名].tar
  • 导出tar包,通过镜像管理上传镜像功能,上传镜像后,即可在点云自动标记功能选择该镜像;

镜像上传和保存示例:

# 打包镜像(请替换 [harbor-url] 为 Harbor 域名):
$ docker build -t [harbor-url]/dubhe/pointcloud-gpu:base .
# 登录 Harbor 镜像仓库(请替换 [harbor-url] 为 Harbor 域名):
$ docker login https://[harbor-url]
# 推送打包好的镜像到 Harbor 仓库(请替换 [harbor-url] 为 Harbor 域名):
$ docker push [harbor-url]/dubhe/pointcloud-gpu:base .
#保存为tar压缩文件,用于在镜像管理上传
$ docker save [harbor-url]/dubhe/pointcloud-gpu:base -o pointcloud-gpu.tar