Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Deploy CE platform on qianmo

guochaorong edited this page Jun 21, 2018 · 11 revisions

CE厂内机器搭建

teamcity server

docker run -it --name teamcity-server-instance  \
    -v $(pwd)/teamcity_runtime/data:/data/teamcity_server/datadir \
    -v $(pwd)/teamcity_runtime/logs:/opt/teamcity/logs  \
    -p 8111:8111 \
    -d \
    jetbrains/teamcity-server

安装postpgres 保存teamcity server数据

docker run -d --name postgres-db \
-p 5432:5432 \
-e POSTGRES_PASSWORD=XXXXX \
postgres \
-c "synchronous_commit=off" -c 'shared_buffers=512MB' -c 'max_wal_size=1500MB' -c 'checkpoint_completion_target=0.9'

teamcity agent

按照下面wiki中的步骤配置、启动teamcity agent
https://github.com/PaddlePaddle/Paddle/wiki/PaddlePaddle-CI-on-TeamCity#setup-teamcity-agents

启动后, 在机器的work目录下会生成一个16位的hashcode目录(该目录是agent的工作目录)。
如:/home/teamcity/work/c2d32ca74e31c299,
在该目录下执行启动teamcity agent tasks的docker

nvidia-docker run -it --name=teamcity-agent --net=host \
-v $(pwd):/workspace \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/teamcity/system/git/:/home/teamcity/system/git/ \ #在docker中git 查看teamcity pull到宿主机的代码
-v /root/.cache/paddle/dataset/:/root/.cache/paddle/dataset/ \
-w /workspace/modelce \     
teamcity-agent-new:latest  #V100机器用cuda9.0的docker镜像
/bin/bash

进到该docker中,安装依赖包:

apt install mongodb python3 python3-pip
pip3 install xonsh numpy pymongo

不同环境的具体依赖
http://wiki.baidu.com/pages/viewpage.action?pageId=501925174

在机器上调试编译paddle、执行models命令:

docker exec -i teamcity-agent bash -c "./build_paddle.xsh"
docker exec -i teamcity-agent bash -c "source ~/.bashrc; ./main.xsh "

调试通过后设置到teamcity build step中。

CE db

源码安装mongodb,使用默认配置
启动db

nohup mongod --dbpath mongo.db(db数据保存路径) &

CE web

nvidia-docker run -it --name=teamcity-db --net=host \
-v $(pwd):/workspace \
-v /var/run/docker.sock:/var/run/docker.sock \
paddle_ce:latest /bin/bash

启动teamcity web(默认80端口)

nohup python3 main.py &

安装的依赖包

apt install python3 python3-pip mongodb openjdk-8-jdk
pip3 install flask==1.0 flask-cache pymongo

在浏览器中输入host地址,可以访问CE web http://10.255.100.55/

备份和容错

teamcity aegnts 和 teamcity db 镜像每天零点向qianmo镜像仓库push
mongodb 数据每日备份

Clone this wiki locally