{"id":20074320,"url":"https://github.com/juniper/contrail-dev-env","last_synced_at":"2025-06-19T18:33:53.048Z","repository":{"id":137206030,"uuid":"118640327","full_name":"Juniper/contrail-dev-env","owner":"Juniper","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-23T12:37:54.000Z","size":309,"stargazers_count":14,"open_issues_count":11,"forks_count":22,"subscribers_count":140,"default_branch":"master","last_synced_at":"2025-04-09T04:27:09.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Juniper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-23T16:53:23.000Z","updated_at":"2024-06-20T23:46:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"caecb342-8e07-48c6-b18a-8fea8f8bf896","html_url":"https://github.com/Juniper/contrail-dev-env","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-dev-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-dev-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-dev-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fcontrail-dev-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Juniper","download_url":"https://codeload.github.com/Juniper/contrail-dev-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252580035,"owners_count":21771253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T14:50:34.076Z","updated_at":"2025-05-05T21:31:40.964Z","avatar_url":"https://github.com/Juniper.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contrail-dev-env: Contrail Developer Environment\n\n## Problems? Need Help?\n\nThis repository is actively maintained via [Gerrit] so please let us know about\nany problems you find. You can ask for help on [Slack] but if no one replies\nright away, go ahead and open a bug on [JIRA] and label the bug with the\nlabel \"dev-env\" and it will get looked at soon. You can also post to the new\n[Google Group] if you're having trouble but don't know if the problem is a bug\nor a mistake on your part.\n\n## Documentation for dev-env components\n\nSince dev-env uses generally available contrail components, please refer to following documentation pages:\n\n1. for packages generation: [contrail-packages](https://github.com/Juniper/contrail-packages/blob/master/README.md)\n2. for building containers: [contrail-container-builder](https://github.com/Juniper/contrail-container-builder/blob/master/README.md) and [contrail-deployers-containers](https://github.com/Juniper/contrail-deployers-containers/blob/master/README.md)\n3. for deployments: [contrail-ansible-deployer](https://github.com/Juniper/contrail-ansible-deployer/blob/master/README.md)\n\n## Container-based (standard)\n\nThere are 2 official sources of containers for dev-env:\n\n1. Released images on docker hub [opencontrail](https://hub.docker.com/r/opencontrail/developer-sandbox/), tagged with released version.\n2. Nightly images on docker hub [opencontrailnightly](https://hub.docker.com/r/opencontrailnightly/developer-sandbox/), tagged with corresponding development branch.\n   *Note:* tag `latest` points to `master` branch.\n\nYou can also use your own image, built using `container/build.sh` script.\n\n### 1. Install docker\n```\nFor mac:          https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac\n```\nFor CentOS/RHEL/Fedora linux host:\n```\nyum install docker\n```\nFor Ubuntu linux host:\n```\napt install docker.io\n```\n\nNOTE (only if you hit any issues):\nMake sure that your docker engine supports images bigger than 10GB. For instructions,\nsee here: https://stackoverflow.com/questions/37100065/resize-disk-usage-of-a-docker-container\nMake sure that there is TCP connectivity allowed between the containers in the default docker bridge network,\n(for example disable firewall).\n\n### 2. Clone dev setup repo\n```\ngit clone https://github.com/Juniper/contrail-dev-env\ncd contrail-dev-env\n```\n\n### 3. Execute script to start 3 containers\n```\nsudo ./startup.sh\n```\n\n**Note:** This command runs container `opencontrailnightly/developer-sandbox:master` from [opencontrailnightly docker hub](https://hub.docker.com/r/opencontrailnightly/developer-sandbox/) by\ndefault. You can specify different image and/or tag using flags, e.g.\n\n1. to develop on nightly R5.0 container use: `sudo ./startup.sh -t R5.0`\n2. to develop code based on a tagged `r5.0` release, use: `sudo ./startup.sh -i opencontrail/developer-sandbox -t r5.0`\n\n##### docker ps -a should show these 3 containers #####\n```\ncontrail-developer-sandbox [For running scons, unit-tests etc]\ncontrail-dev-env-rpm-repo  [Repo server for contrail RPMs after they are build]\ncontrail-dev-env-registry  [Registry for contrail containers after they are built]\n```\n\n### 4. Attach to developer-sandbox container\n\n```\ndocker attach contrail-developer-sandbox\n```\n\n### 5. Prepare developer-sandbox container\n\nRequired first steps in the container:\n\n```\ncd /root/contrail-dev-env\nmake sync           # get latest code\nmake fetch_packages # pull third_party dependencies\nmake setup          # set up docker container\nmake dep            # install build dependencies\n```\n\nThe descriptions of targets:\n\n* `make sync` - sync code in `./contrail` directory using `repo` tool\n* `make fetch_packages` - pull `./third_party` dependencies (after code checkout)\n* `make setup` - initial configuration of image (required to run once)\n* `make dep` - installs all build dependencies\n* `make dep-\u003cpkg_name\u003e` - installs build dependencies for \u003cpkg_name\u003e\n\n### 6. Make artifacts\n\n#### RPM packages\n\n* `make list` - lists all available RPM targets\n* `make rpm` - builds all RPMs\n* `make rpm-\u003cpkg_name\u003e` - builds single RPM for \u003cpkg_name\u003e\n\n#### Container images\n\n* `make list-containers` - lists all container targets\n* `make containers` - builds all containers' images, requires RPM packages in /root/contrail/RPMS\n* `make container-\u003ccontainer_name\u003e` - builds single container as a target, with all docker dependencies\n\n#### Deployers\n\n* `make list-deployers` - lists all deployers container targets\n* `make deployers` - builds all deployers\n* `make deployer-\u003ccontainer_name\u003e` - builds single deployer as a target, with all docker dependencies\n\n#### Test containers\n\n* `make test-containers` - build test containers\n\n#### Clean\n\n* `make clean{-containers,-deployers,-repo,-rpm}` - delete artifacts\n\n### 7. Testing the deployment\n\nSee https://github.com/Juniper/contrail-ansible-deployer/wiki/Contrail-with-Openstack-Kolla .\nSet `CONTAINER_REGISTRY` to `registry:5000` to use containers built in the previous step.\n\n### Alternate build methods\n\nInstead of step 5 above (which runs `scons` inside `make`), you can use `scons` directly. The steps 1-4 are still required. \n\n```\ncd /root/contrail\nscons # ( or \"scons test\" etc)\n```\n\nNOTE:\nAbove example build whole TungstenFabric project with default kernel headers and those\nare headers for running kernel (`uname -r`). If you want to customize your manual build and\nuse i.e newer kernel header take a look at below examples.\n\nIn case you want to compile TungstenFabric with latest or another custom kernel headers installed\nin `contrail-developer-sanbox` container, then you have to run scons with extra arguments:\n\n```\nRTE_KERNELDIR=/path/to/custom_kernel_headers scons --kernel-dir=/path/to/custom_kernel_headers\n```\n\nTo alter default behaviour and build TF without support for DPDK just provide the `--without-dpdk` flag:\n\n```\nscons --kernel-dir=/path/to/custom_kernel_headers --without-dpdk\n```\n\nTo build only specific module like i.e `vrouter`:\n\n```\nscons --kernel-dir=/path/to/custom_kernel_headers vrouter\n```\n\nTo build and run unit test against your code:\n\n```\nRTE_KERNELDIR=/path/to/custom_kernel_headers scons --kernel-dir=/path/to/custom_kernel_headers test\n```\n\n\n## Bring-your-own-VM (experimental)\n\n*Note:* only RedHat 7 and CentOS 7 are supported at this time!\n\n1. Clone this repository to a directory on a VM.\n2. Run `vm-dev-env/init.sh` (you might be asked for your password as some steps require the use of sudo).\n  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`.\n3. Run `make fetch_packages` to pull dependencies to `contrail/third_party`\n4. Run `sudo ./startup.sh -b` to start required containers.\n4. You can use the Makefile targets described above to build contrail.\n\n[Gerrit]: https://review.opencontrail.org/#/admin/projects/Juniper/contrail-dev-env\n[Slack]: https://tungstenfabric.slack.com/messages/C0DQ23SJF/\n[JIRA]: https://jira.tungsten.io/secure/Dashboard.jspa\n[Google Group]: https://groups.google.com/forum/#!forum/tungsten-dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fcontrail-dev-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniper%2Fcontrail-dev-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fcontrail-dev-env/lists"}