Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Single Machine Development Environment

Manohar Castelino edited this page Sep 6, 2016 · 26 revisions

Ciao Single Machine Development and Test Environment

Developing cluster software is complicated if you must actually run a whole cluster on a set of physical machines. This begs for a development environment that is self contained and can be run without any setup. This page documents a way to set up an entire Ciao cluster inside a single machine. This cluster-in-an-machine mode is ideal for developers that desire the ability to build Ciao from sources, make changes and perform quick end to end functional integration testing without requiring multiple machines/VM's or creating a custom networking environment or maintaining a bevy of physical machines and a physical network.

In this case Ciao is configured in a special all in one development mode where cluster nodes have dual roles (i.e launcher can be a Network Node and a Compute Node at the same time)

Components running on the Machine

  1. Controller 	
  2. Scheduler 	
  3. Compute+Network Node Agent (i.e. CN + NN Launcher)
  4. Workloads (Containers and VMs)
  5. WebUI
  6. Mock Openstack Services
  7. Machine Local DHCP Server
  ...

The one machine acts as the ciao compute node, network node, ciao-controller, ciao-scheduler and also hosts the ciao-webui as well as other openstack and dhcp services.

Graphical Overview

When the system is functioning the overall setup manifests as follows:

As you can see below the Cluster runs on a isolated virtual network resident on the host. Hence the cluster is invisible outside the host and completely self contained.


   _____________________________________________________________________________________
  |                                                                                     |
  |                                                                                     |
  |                                                                                     |
  |                                                        [Tenant VMs]    [CNCI VMs]   |
  |                                                           |  |  |         ||        |
  |                                           Tenant Bridges ----------       ||        |
  |                                                                 |         ||        |
  |                                                                 |         ||        |
  |    [scheduler]  [controller] [keystone] [CN+NN Launcher]        |         ||        |
  |          ||        ||          ||           ||                  |         ||        |
  |          ||        ||          ||           ||                  |         ||        |
  |          ||        ||          ||           ||                  |         ||        |
  |          ||        ||          ||           ||                  |         ||        |
  |          ||        ||          ||           ||                  |         ||        |
  |          ||        ||          ||           ||      [DHCP/DNS   |         ||        |
  |          ||        ||          ||           ||        Server]   |         ||        |
  |          ||        ||          ||           ||           ||     |         ||        |
  |      --------------------------------------------------------------------------     |                            
  |                      Host Local Network Bridge (macvlan - eth10)                    |
  |                                                                                     |
  |
  |                                                                                     |
  | ____________________________________________________________________________________|

                                Development Machine


Getting Started

Install Go

Install the latest release of go for your distribution Installing Go.

Install Docker

Install latest docker for your distribution based on the instructions from Docker Installing Docker.

Install ciao dependencies

Install the following packages which are required:

  1. qemu-system-x86_64 and qemu-img, to launch the VMs and create qcow images
  2. xorriso, to create ISO images for cloudinit
  3. fuser, part of most distro's psmisc package
  4. gcc, required to build some of the ciao dependencies
  5. dnsmasq, required to setup a test DHCP server

On clearlinux all of these dependencies can be satisfied by installing the following bundles:

swupd bundle-add cloud-control go-basic os-core-dev kvm-host

Setup password less sudo

Setup passwordless sudo for the user who will be running the script below.

Download and build the sources

Download ciao sources:

cd $GOPATH/src
go get -v -u github.com/01org/ciao/...
cd $GOPATH/src/github.com/01org/ciao
go install -v --tags 'debug' ./...

You should see no errors.

Verify that Ciao is fully functional

You can now quickly verify that all aspects of Ciao including VM launch, container launch, and networking. TO do this simply run the following:

cd $GOPATH/src/github.com/01org/ciao/testutil/singlevm
#Cleanup any previous setup
./cleanup.sh
#Perform a full cluster test
./setup.sh

The setup.sh script will:

  • Create multiple Instances of Tenant VMs and Containers
  • Test network connectivity between containers
  • Test for ssh reach ability into VMs
  • Delete all the VM's and Container that were created

If the script reports success, it indicates to the developer that any changes made have not broken any functionality across all the Ciao components.

Meeting the goal originally outlined at the top of the page, build/setup/running your cluster all-in-one all transpires quickly and easily from the single script. The time needed for ./setup.sh to build ciao from source, configure it components into a virtual cluster, then launch and teardown containers and VMs is on the order of one minute total elapsed time.

Ongoing Usage

At the end, the setup.sh script leaves behind a virtual cluster which the user can then continue to use. Ie: the virtual cluster can also be used to perform additional manual tests in addition to those automated in the script.

Cleanup / Teardown

To cleanup and tear down the cluster:

cd $GOPATH/src/github.com/01org/ciao/testutil/singlevm
#Cleanup any previous setup
./cleanup.sh

Known Issues

Clone this wiki locally