4.7 KiB
4.7 KiB
天枢后台服务部署
- 下载一键部署脚本
- 下载部署脚本
git clone https://gitee.com/zhijiangtianshu/dubhe-deploy.git
- 修改参数配置
- 2.1 进入代码目录
cd dubhe-deploy/
- 2.2 修改 configmap.yaml 文件
vim configmap.yaml
# 如果是 K8s集群部署,则依赖 storageclassname, 请填写 storage.classname 为具体的名字。(例:/data) # 修改镜像仓库仓库 及 对应服务器IP --- data: # define csi name # If Dubhe is deployed in one node, then we can config storage.classname as hostpath. # That means all data will be located in local path defined in "storage.path". storage.classname: "hostpath" # Dubhe-Storage storage.size: "50Gi" # Local data path when storage.calssname is "hostpath" storage.path: "/data" # Harbor config (填入你自己的镜像仓库地址及账号密码,支持阿里云镜像仓库) harbor.server: "docker.hub" harbor.username: "admin" harbor.password: "Harbor12345" # 将下面IP替换成你自己服务器的IP地址(内网) # k8s prometheus 服务内网ip和端口 prometheus.server: "127.0.0.1:30003" # 填服务器的ip地址 elasticsearch.server: "127.0.0.1" #填服务器的ip地址 backend.terminal.host: "127.0.0.1" # If defined, web service will visit node ip instead of services defined in k8s. #假如您的服务器在公网,请把下面的ip换成公网的IP,如果只有内网IP即填写内网IP web.proxy.host: "127.0.0.1"
- 修改证书参数
# admin.conf 如果不存在进行创建 vim /etc/kubernetes/admin.conf # 修改参数 server 将域名修改为 IP, 如果服务有多个ip, 一个ip不行,请尝试换另外一个 server: https://{服务器IP}:6443 sudo cp /root/.kube/config /etc/kubernetes/admin.conf
- 2.1 进入代码目录
- 将kubeconfig文件添加到kubeconfig.yaml
cd dubhe-deploy/ cat /etc/kubernetes/admin.conf > template/kubeconfig.yaml
- 执行构建镜像操作
需要时间和网络有关,耐心等待,构建失败使用ps -ef | grep dubhe|grep -v grep |awk '{print $2}' | xargs kill -9 终止进程 下面的命令后台镜像可以打包好,前端的镜像打包会出错,不用管,后面会单独做前端镜像./dubhectl build-image all
- 安装dubhe服务
./dubhectl install
- 修改前端配置文件并部署前端
- 6.1 修改配置文件
cd dubhe-deploy vim Dubhe/webapp/.env.production ENV = 'production' # 默认BASE URL, 后端服务backend-gateway的ip:port, 使用 kubectl get svc -n dubhe-system | grep backend-gateway 查看 # 构建出的yaml没有暴露出nodeport, 需要自己修改yaml文件暴露nodeport才可以访问 VUE_APP_BASE_API = 'http://173.15.15.70:32023' # TODO: 目前后端连接位于 8960端口 k8s 服务,需要后端调整后再同步调整 # WebSocket 连接地址 VUE_APP_WS_API = 'ws://173.15.15.70:30960/ws' # 数据管理 VUE_APP_DATA_API = '' # 训练可视化 VUE_APP_VISUAL_API = '' # 用户 minio 访问地址 VUE_APP_MINIO_API = 'http://173.15.15.70:30900/minio' # atlas 服务,需要单独部署 VUE_APP_ATLAS_HOST = 'http://127.0.0.1' # 医疗影像 DCM4CHEE 服务访问地址 # 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-algorithm VUE_APP_DCM_API = 'http://173.15.15.70:30088/dcm4chee/dcm4chee-arc/aets/DCM4CHEE_ADMIN' # minIO 服务 IP, 服务器的ip地址 # 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-minio VUE_APP_MINIO_ENDPOINT = '173.15.15.70' # minIO 服务 端口 VUE_APP_MINIO_PORT = '30900' # 是否开启 SSL VUE_APP_MINIO_USESSL = 'false' # bucketName VUE_APP_MINIO_BUCKETNAME = 'dubhe-prod' # 文档链接 VUE_APP_DOCS_URL = http://docs.tianshu.org.cn/docs/
- 6.2 前端代码编译
cd dubhe-deploy # 编译前端代码 docker run --rm --entrypoint="" -v $PWD/Dubhe:/Dubhe node:12.22.4 /bin/bash -c 'cd /Dubhe/webapp/ && npm install && npm run build:prod'
- 6.3 前端镜像打包
cd dubhe-deploy cp -rf Dubhe/web/dist images/web/Dubhe/ cd images/web docker build -t web:v1 .
- 6.4 前端部署
./dubhectl reinstall web