Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Latest commit

 

History

History
79 lines (57 loc) · 4.07 KB

README.md

File metadata and controls

79 lines (57 loc) · 4.07 KB

Local single-node development using Vagrant and Virtualbox

Quick start

First - install: Vagrant, VirtualBox and Git. Then you just need to execute the following commands (they should work on any flavour of Linux):

To run Vagrant development environment, the $SWAN_DEVELOPMENT_ENVIRONMENT variable must be set. If you want to use your local Glide cache in the Vagrant development environment the $SHARE_GLIDE_CACHE variable must be set.

git clone [email protected]:intelsdi-x/swan.git
cd swan/vagrant
export SWAN_DEVELOPMENT_ENVIRONMENT=true
vagrant plugin install vagrant-vbguest  # automatic guest additions
vagrant up
vagrant ssh

When you ssh to your virtual machine execute:

cd swan
make deps build dist install

You will need to build mutilate by hand and the result binary need to be available in $PATH. Consider copying binary to /opt/swan/bin and run:

sudo ln -svf /opt/swan/bin/* /usr/bin/

Now you should be able to run an experiment on the Kubernetes cluster or your virtual machine.

If you want to be able to use iBench they you will need to compile binaries and make then available in $PATH (see mutilate description above). Keep in mind that compiling iBench binaries may require a lot of RAM and can't be done on default Vagrant VM configuration.

Tuning VM parameters

Vagrant will allocate 2 CPUs and 4096 MB RAM for the VM by default. You can consider changing these values but:

  • You need to provide at least 2 CPUs.
  • You need to provide at least 4096 MB of RAM.

Deeper dive

If you want to learn more about VM configuration and installed packages refer to provisioning script. It calls three other scripts and their names should be self explanatory.

Note that the ~/.glide directory from your host will be mounted on the VM to speed up Go dependency management.

The scripts are responsible for:

  • Installing all the necessary CentOS packages that are needed to build Swan, run experiments and analyse their results.
  • Installing Snap and its plugins that are responsible for gathering experiment results.
  • Installing Docker that allows running experiment on Kubernetes cluster.
  • Enabling Cassandra and Etcd systemd services.
  • Installing hyperkube that is used to set up Kubernetes cluster for experimantation purposes.
  • Setting up SSH for root.
  • Installing Go.

If you wish to setup experiment environment on another host then you should be able to run provision_experiment_environment.sh on the host. You will need to provide following environmental variables when calling the script:

  • SWAN_USER - name of the user that will run experiments.
  • HOME_DIR - home directory of SWAN_USER

Example call can be found in the provisioning script.

Provisioners

There are two provisioners defined in the Vagrantfile: aws and virtualbox. Our CI infracture uses the first of them while the second should be used for development. If you try to use aws provider on your own it will fail as AMI is not publicly available.