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.0
release, 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./contrail
directory usingrepo
toolmake fetch_packages
- pull./third_party
dependencies (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