Alternative Build Instructions

Last modified by Kevin Austin on 2018/08/21 07:12

How to run ATDD


  • Build Kilda controller. See Installation Guide 
  • Run Kilda controller in *"test mode"*.
  • make up-test-mode

  • Update your /etc/hosts file. Replace localhost to {}
  • Run ATDD using
  • make atdd

  • Profit?!? emoticon_smile

How to run floodlight-modules locally

From the base directory run these commands:

make build-floodligh
make run-floodlight

How to build / test locally without containers

Start with the following

'''make unit'''
From there, you can go to specific projects to build / develop / unit test. Just follow the make unit trail. Most projects have a maven target.

NB: Several projects have a dependency on the maven parent; look at make unit

How to build / test key use cases

Look in the base/hacks/usecase directory and you'll find several makefiles that will assist with the development and testing of that use case.

As an example, you can execute the following command for more information on the network discovery use case:

make -f base/hacks/usecase/network.disco.make help
# or
cd base/hacks/usecase
make -f network.disco.make help
How to use a VM to do development

VirtualBox and Vagrant are popular options for creating VMs. A VM may be your best bet for doing development with Kilda. There are a set of files in the source tree that will facilitate this.

NB1: Ensure you have VirtualBox and Vagrant installed and on the path
NB2: You'll re-clone kilda so that there aren't any write permission issues between the guest VM and the host.

From the root directory, look at the Vagrantfile; feel free to change its parameters.
vagrant up - create the VM; it'll be running after this step.
vagrant ssh - this will log you into the vm.
ssh-keygen -t rsa -C "" - you'll use this for GitHub. Press <return> for each question; three in total.
Add the /.ssh/ key to your GitHub account so that you can clone kilda
cat /.ssh/
Clone and Build
# NB: Instead of putting it in vm-dev, you can use /vagrant/vm-dev
#     This has the added benefit that the code will appear outside the VM
#     i.e. /vagrant is shared with the same directory as the Vagrantfile
git clone<your_github_account>/open-kilda.git vm-dev
cd vm-dev
git checkout mvp1rc
make build-base
docker-compose build
make unit
make up-test-mode
make atdd
How to use ansible for config/properties templating

We have ansible playbook for managing config/properties files from templates which is placed in templates/ folder. This playbook contains three files with variables. One for default options (like endpoints, all defaults should be here): templates/defaults/main.yaml and second one for paths of template and destinations: templates/vars/path.yaml and last one for overriding defaults: templates/vars/vars.yaml

For now default options are the same which was before this playbook implementation and suitable for docker-compose build.

How should I add new template

Pre-requirements: You have to add localhost ansible_connection=local to /etc/ansible/hosts

create and place jinja template file to templates/templates/ folder
add it to templates/vars/path.yaml
change (if needed) vars in templates/defaults/main.yaml
run: make update-props-dryrun for checking that template behaviour is ok
run: make update-props for applying templates
How should I change/add/override default var values

Add new vars, edit: templates/defaults/main.yaml
If you need override default vars, edit: templates/vars/vars.yaml
run: make update-props-dryrun for checking that template behaviour is ok
run: make update-props for applying templates
Common use cases

An exmaplte, you already have neo4j server, and want to use it instead of dockerized neo4j. You can add neo4j endpoints to templates/defaults/main.yaml and create properties template for services which use neo4j:


neo4j_host: "neo4j"
neo4j_user: "neo4j"
neo4j_password: "temppass"

topology.topic={{ kafka_topic }}
bootstrap.servers={{ kafka_hosts }}
hosts={{ zookeeper_hosts }}
host={{ neo4j_host }}
user={{ neo4j_user }}
pass={{ neo4j_password }}

- topology_engine_properties:
  dest: services/topology-engine/queue-engine/
  tmpl: templates/topology-engine/
In this example we will generate file services/topology-engine/queue-engine/ from template templates/topology-engine/

How enable travis CI

Someone with admin rights should log in using github account to and on the page activate telstra/open-kilda repository. All configurations for travis are located in .travis.yml. For adding new scripts you should create new line under script parameter.

- make run-test
- new command

Created by Kevin Austin on 2018/08/21 06:55
©2018 OpenKilda