Skip to content

Instantly share code, notes, and snippets.

@hkumarmk
Last active August 1, 2016 18:54
Show Gist options
  • Save hkumarmk/c6ea683ea1f1237e03b392e1dad8de37 to your computer and use it in GitHub Desktop.
Save hkumarmk/c6ea683ea1f1237e03b392e1dad8de37 to your computer and use it in GitHub Desktop.
  • Get contrail-docker code from https://github.com/hkumarmk/contrail-docker (master)

  • Build the images: you may use build.sh script it is rather a convenient script as of now for me – I made few hardcoded defaults (like contrail-install-package url) which probably only make sense to my environment – but you may just provide appropriate parameters

    run script.sh with appropriate possitional params ./script.sh <package_url> <image_path> where component is one of the component name like config, control, database, lb, analytics package_url is the web url from which contrail-install-package url to be downloaded image_path - a local path to a directory to which container image will be copied

  root@nodei16:~# cd ~/contrail-docker/docker/
  root@nodei16:~/contrail-docker/docker# ls
  analytics  build.sh  common.sh  config  control  database  lb  pyj2.py
  root@nodei16:~/contrail-docker/docker# ./build.sh control http://nodei16/contrail-install-packages_3.0.2.0-35~liberty_all.deb /cs-shared/images/docker-images/contrail/ # To build control 
  for i in analytics config control database lb; do ./build.sh $i & done # To build all containers with default params
  • Prepare testbed.py Add entry "contrail_docker_image_base_url" to testbed.py - this should be a web url or local directory path (local directory path only work in single node environments as of yet). contrail_docker_image_base_url="http://10.204.217.158/images/docker-images/contrail/"

  • Prepare deployment/management/build node (the node from which you run deployment code) - in case of single node environment, deployment node may be same as destination node. This is a temporary step, will go away in future

    root@harishku-vm4:~# cd ~/contrail-docker/
    

root@harishku-vm4:/contrail-docker# export CONTRAIL_INSTALL_PACKAGE_URL='http://nodei16/contrail-install-packages_3.0.2.0-35~liberty_all.deb' root@harishku-vm4:/contrail-docker# export TESTBED=/root/testbed_harishku-vm4.py root@harishku-vm4:~/contrail-docker# ls contrail_orc.py docker LICENSE.md prepare_build_node.sh README.md

root@harishku-vm4:~/contrail-docker# ./prepare_build_node.sh

* run contrail_orc.py with appropriate parameters - this will deploy both contrail and openstack at this moment,
but it is easy to make openstack deployment optional

root@nodei16:~# cd /contrail-docker/ root@nodei16:/contrail-docker# ls contrail_orc.py docker LICENSE.md prepare_build_node.sh README.md

Currently help will print the date in it because of the log configuration from fab, which need to be fixed

root@nodei16:~/contrail-docker# ./contrail_orc.py -h usage: contrail_orc.py [-h] {provision} ... 2016-08-01 23:06:49:935121: 2016-08-01 23:06:49:935121: Contrail orchestrator 2016-08-01 23:06:49:935121: 2016-08-01 23:06:49:935121: positional arguments: 2016-08-01 23:06:49:935121: {provision} 2016-08-01 23:06:49:935121: provision manage provisioning 2016-08-01 23:06:49:935121: 2016-08-01 23:06:49:935121: optional arguments: 2016-08-01 23:06:49:935121: -h, --help show this help message and exit

root@nodei16:~/contrail-docker# ./contrail_orc.py provision -h usage: contrail_orc.py provision [-h] -c CONTRAIL_VERSION -o 2016-08-01 23:06:57:818871: {juno,kilo,liberty,mitaka} [-n] -u 2016-08-01 23:06:57:818871: CONTRAIL_PACKAGE_URL 2016-08-01 23:06:57:818871: testbed 2016-08-01 23:06:57:818871: 2016-08-01 23:06:57:818871: positional arguments: 2016-08-01 23:06:57:818871: testbed Testbed url/path, it can be localpath or web url 2016-08-01 23:06:57:818871: 2016-08-01 23:06:57:818871: optional arguments: 2016-08-01 23:06:57:818871: -h, --help show this help message and exit 2016-08-01 23:06:57:818871: -c CONTRAIL_VERSION, --contrail-version CONTRAIL_VERSION 2016-08-01 23:06:57:818871: Contrail version 2016-08-01 23:06:57:818871: -o {juno,kilo,liberty,mitaka}, --openstack-sku {juno,kilo,liberty,mitaka} 2016-08-01 23:06:57:818871: Openstack release 2016-08-01 23:06:57:818871: -n, --no-host-setup Contrail version 2016-08-01 23:06:57:818871: -u CONTRAIL_PACKAGE_URL, --contrail-package-url CONTRAIL_PACKAGE_URL 2016-08-01 23:06:57:818871: Contrail install package http[s] url or local path

root@nodei16:~/contrail-docker# ./contrail_orc.py provision -n -c 3.0.2.0-35 -o liberty
-u http://nodei16/contrail-install-packages_3.0.2.0-35~liberty_all.deb /opt/contrail/utils/fabfile/testbeds/testbed.py



## Pending actions

1. containerizing contrail-vrouter-agent - this is pending just because I was working on finishing controller part but this is not much difficuilt to get done
2. Moving redis to contrail-analytics container
3. Some of the provisioning part (like provisioning linklocal address for metadata) is still to be moved to container startup

## current known issues
1. I just see today I see some of the analytics applications are failing - need to check why

I built the containers with a specific contrail version and kept under http://10.204.217.158/images/docker-images/contrail/ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment