Giter Club home page Giter Club logo

contrail-dev-env's Introduction

contrail-dev-env: Contrail Developer Environment

Problems? Need Help?

This repository is actively maintained via Gerrit so please let us know about any problems you find. You can ask for help on Slack but if no one replies right away, go ahead and open a bug on Launchpad and tag the bug with the tag "dev-env" and it will get looked at soon. You can also post to the new Google Group if you're having trouble but don't know if the problem is a bug or a mistake on your part.

Container-based (standard)

1. Install docker

For mac:          https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac

For CentOS/RHEL/Fedora linux host:

yum install docker

For Ubuntu linux host:

apt install docker.io

NOTE (only if you hit any issues): Make sure that your docker engine supports images bigger than 10GB. For instructions, see here: https://stackoverflow.com/questions/37100065/resize-disk-usage-of-a-docker-container Make sure that there is TCP connectivity allowed between the containers in the default docker bridge network, (for example disable firewall).

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
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. Run scons, UT, make RPMS or make containers

Required first steps in the container:

cd /root/contrail-dev-env
make sync           # get latest code using repo tool
make fetch_packages # pull third_party dependencies
make setup          # set up docker container
make dep            # install dependencies

Now you can run any commands using the source code sandbox, e.g.

cd /root/contrail
scons # ( or "scons test" etc)

Or use any of additional make targets provided by contrail-dev-env/Makefile:

  • make setup - initial configuration of image (required to run once)
  • make sync - sync code in contrail directory using repo tool
  • make fetch_packages - pull third_party dependencies (after code checkout)
  • make dep - installs all build dependencies
  • make dep-<pkg_name> - installs build dependencies for <pkg_name>
  • make list - lists all available rpm targets
  • make rpm - builds all RPMs
  • make rpm-<pkg_name> - builds single RPM for <pkg_name>
  • make list-containers - lists all container targets
  • make containers - builds all containers, requires RPM packages in /root/contrail/RPMS
  • make container-<container_name> - builds single container as a target, with all docker dependencies
  • make clean{-containers,-repo,-rpm} - artifacts cleanup

6. Testing the deployment

See https://github.com/Juniper/contrail-ansible-deployer/wiki/Contrail-with-Kolla-Ocata . Set CONTAINER_REGISTRY to registry:5000 to use containers built in step 5.

Bring-your-own-VM (experimental)

Note: only RedHat 7 and CentOS 7 are supported at this time!

  1. Clone this repository to a directory on a VM.
  2. Run vm-dev-env/init.sh (you might be asked for your password as some steps require the use of sudo). a. You can also run vm-dev-env/init.sh -n if you don't want to clone work directory on a VM. Then you have to mount sandbox to directory named contrail next to contrail-dev-env.
  3. Run make fetch_packages to pull dependencies to contrail/third_party
  4. Run sudo ./startup.sh -b to start required containers.
  5. You can use the Makefile targets described above to build contrail.

contrail-dev-env's People

Contributors

alexandrelevine avatar ananth-at-camphor-networks avatar opencontrail-ci-admin avatar pcarver avatar pjrusak avatar rrugge avatar vmahuli avatar wurbanski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.