https://github.com/Juniper/contrail-dev-env
2. Clone dev setup repo
git clone https://github.com/Juniper/contrail-dev-env
cd contrail-dev-env
3. Execute script to start 3 containers
sudo ./startup.sh -t R5.1
Note: This command runs container opencontrailnightly/developer-sandbox:master from opencontrailnightly docker hubby default. You can specify different image and/or tag using flags, e.g.
- to develop on nightly R5.0 container use:
sudo ./startup.sh -t R5.0 - to develop code based on a tagged
r5.0release, use:sudo ./startup.sh -i opencontrail/developer-sandbox -t r5.0
docker ps -a should show these 3 containers
contrail-developer-sandbox [For running scons, unit-tests etc]
contrail-dev-env-rpm-repo [Repo server for contrail RPMs after they are build]
contrail-dev-env-registry [Registry for contrail containers after they are built]
4. Attach to developer-sandbox container
docker attach contrail-developer-sandbox
5. Prepare developer-sandbox container
Required first steps in the container:
cd /root/contrail-dev-env
make sync # get latest code
make fetch_packages # pull third_party dependencies
make setup # set up docker container
make dep # install build dependencies
sudo curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
chmod +x /usr/bin/repo
sudo vim /usr/bin/repo
REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
The descriptions of targets:
make sync- sync code in./contraildirectory usingrepotoolmake fetch_packages- pull./third_partydependencies (after code checkout)make setup- initial configuration of image (required to run once)make dep- installs all build dependenciesmake dep-<pkg_name>- installs build dependencies for <pkg_name>
6. Make artifacts
RPM packages
make list- lists all available RPM targetsmake rpm- builds all RPMsmake rpm-<pkg_name>- builds single RPM for <pkg_name>
Container images
make list-containers- lists all container targetsmake containers- builds all containers' images, requires RPM packages in /root/contrail/RPMSmake container-<container_name>- builds single container as a target, with all docker dependencies
Deployers
make list-deployers- lists all deployers container targetsmake deployers- builds all deployersmake deployer-<container_name>- builds single deployer as a target, with all docker dependencies
Clean
make clean{-containers,-deployers,-repo,-rpm}- delete artifacts
-v /dev/pts:/dev/pts
before make containers, you can export SB_BRANCH=R5.1

本文介绍如何使用 Juniper 的 contrail-dev-env 项目搭建 Contrail 的开发环境,包括克隆 devsetup 仓库、运行容器、配置开发沙箱等步骤,并提供了 RPM 包制作及容器镜像构建的方法。
1373

被折叠的 条评论
为什么被折叠?



