Clone the CORD repository
From the home directory, use repo to clone the repository
mkdir cord && cd cord && \ repo init -u https://gerrit.opencord.org/manifest -b master && \ repo sync
Master is only used as example. You can substitute it with your favorite branch, for example cord-2.0 or cord-3.0. You can also use “flavour” specific manifests such as “mcord” or “ecord”. The “flavour” you use here is not correlated to the profile you will choose to run later but it’s suggested that you use the corresponding manifest for the deployment you want. AN example is using the “ecord” profile and then deploy the ecord.yml service_profile.
When this is complete, a listing (ls) inside this directory should yield output similar to:
ls -F build/ incubator/ onos-apps/ orchestration/ test/
Build the cord dev VM
Install manually all the software needed, directly on the dev machine, might be a long and non trivial task. This is why the environment leverages Vagrant to spawn a VM with the tools required to build and deploy CORD.
To create the development machine the following Vagrant command can be used.
cd ~/cord/build && \ vagrant up corddev
This will create an Ubuntu 14.04 LTS virtual machine and will install some required packages, such as Docker, Docker Compose, and Oracle Java 8.
Make sure the VM can obtain sufficient resources. It may takes several minutes for the first command vagrant up corddev to complete, as it will include creating the VM, as well as downloading and installing various software packages.
Once the Vagrant VM is created and provisioned, you will see output ending with:
==> corddev: PLAY RECAP ********************************************************************* ==> corddev: localhost : ok=29 changed=25 unreachable=0 failed=0 The important thing is that the unreachable and failed counts are both zero.
From the moment the VM gets created, it shares a folder with the OS below (the one of the server or of your personal computer). This means that what was the installation root directory (~/cord), will be also available in the VM under /cord.
Log into the CORD dev VM
From the build directory, run the following command to connect to the development VM created
vagrant ssh corddev
Once inside the VM, you can find the deployment artifacts in the /cord directory.
In the VM, let’s move to the /cord/build directory before continuing.
cd /cord/build
Fetch the Docker images
The fetching phase of the deployment pulls Docker images from the public repository down to the VM, and clones the git submodules that are part of the project. This phase can be initiated with the following command:
./gradlew fetch
The first time you run ./gradlew it will download the gradle binary from the Internet and installs it locally. This is a one time operation, but may be time consuming, depending on the speed of your Internet connection.
it’s unfortunately still quite common to see this command fail due to network timeouts. If happens, please be patient and run again the command.
Once the fetch command has successfully run, the step is complete. After the command completes you should be able to see the Docker images that were downloaded using the docker images command on the development machine:
docker images REPOSITORY TAG IMAGE ID CREATED SIZE opencord/onos <none> e1ade494f06e 3 days ago 936.5 MB python 2.7-alpine c80455665c57 2 weeks ago 71.46 MB xosproject/xos-base <none> 2b791db4def0 4 weeks ago 756.4 MB redis <none> 74b99a81add5 11 weeks ago 182.8 MB xosproject/xos-postgres <none> 95312a611414 11 weeks ago 393.8 MB xosproject/cord-app-build <none> 003a1c20e34a 5 months ago 1.108 GB consul <none> 62f109a3299c 6 months ago 41.05 MB swarm <none> 47dc182ea74b 8 months ago 19.32 MB nginx <none> 3c69047c6034 8 months ago 182.7 MB xosproject/vsg <none> dd026689aff3 9 months ago 336 MB
Build the Docker images
Bare metal provisioning leverages utilities built and packaged as Docker container images. The images can be built by using the following command.
./gradlew buildImages
Once the buildImages command successfully runs the task is complete. The CORD artifacts have been built and the Docker images can be viewed by using the docker images command on the dev VM:
docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.ID}}' REPOSITORY TAG SIZE IMAGE ID opencord/mavenrepo latest 338.2 MB 2e29009df740 cord-maas-switchq latest 337.7 MB 73b084b48796 cord-provisioner latest 822.4 MB bd26a7001dd8 cord-dhcp-harvester latest 346.8 MB d3cfa30cf38c config-generator latest 278.4 MB e58059b1afb2 cord-maas-bootstrap latest 359.4 MB c70c437c6039 cord-maas-automation latest 371.8 MB 9757ac34e7f6 cord-ip-allocator latest 276.5 MB 0f399f8389aa opencord/onos <none> 936.5 MB e1ade494f06e python 2.7-alpine 71.46 MB c80455665c57 golang alpine 240.5 MB 00371bbb49d5 golang 1.6-alpine 283 MB 1ea38172de32 nginx latest 181.6 MB 01f818af747d xosproject/xos-base <none> 756.4 MB 2b791db4def0 ubuntu 14.04 187.9 MB 3f755ca42730 redis <none> 182.8 MB 74b99a81add5 xosproject/xos-postgres <none> 393.8 MB 95312a611414 xosproject/cord-app-build <none> 1.108 GB 003a1c20e34a consul <none> 41.05 MB 62f109a3299c swarm <none> 19.32 MB 47dc182ea74b nginx <none> 182.7 MB 3c69047c6034 xosproject/vsg <none> 336 MB dd026689aff3
Not all the docker machines listed are created by the CORD project but are instead used as a base to create other images.