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

Installation

olaan edited this page Oct 30, 2015 · 17 revisions

Install Calvin

Download

The latest version of Calvin can be found on github.

Choose installation option

There are two major options when it comes to installing Calvin: systemwide or in a virtual environment.

If you are considering making any changes to Calvin rather than just writing applications on top of it, installing in a virtual environment as outlined in Alternative 2 below is a good idea. In fact, even if you are not planning on making changes to Calvin, it might still be a good idea, since you don't have to re-install if you pull an update from github.

Actually, to be honest, there is a third option. If you don't like the idea of virtual environments, but still want to be able to pull updates without having to re-install Calvin, skip to Installing Calvin and do an "editable install".

For an easy step-by-step walkthrough of a clean Calvin installation on some common Linux distributions, see Detailed installation below.

Alternative 1: Install systemwide

To install Calvin, use the accompanying setup.py

$ python setup.py install

Alternatively, install the requirements using pip

$ pip install -r requirements.txt

Alternative 2: Install in a virtual environment

Install pip and virtualenv

Check if pip is installed:

which pip

should list it. If not, use

sudo easy_install pip

to install it.

Next, use pip to install virtualenv:

sudo pip install virtualenv

N.B. From now on, do not use sudo with you commands.

Create a virtual environment

First create a location to store your virtual environments (I chose ~/.virtualenvs/, use that or whatever suits your taste), then create a new virtual environment:

mkdir ~/.virtualenvs/
virtualenv ~/.virtualenvs/test-calvin

Activate the new test-calvin environment

source ~/.virtualenvs/test-calvin/bin/activate

and your prompt should change to indicate the activation by prepending (test-calvin) to whatever was there before. Use deactivate if you should want to leave the virtual environment. A good intro to using virtualenv can be found here

Installing Calvin

Go to a directory of your choice and clone calvin using one of the following:

git clone git://github.com/EricssonResearch/calvin-base
git clone https://github.com/EricssonResearch/calvin-base
git clone http://github.com/EricssonResearch/calvin-base

At least one of them should work.

Step into cavin-base and use pip to install required packages and set up Calvin for development:

pip install -e .

A quick check with which csruntime should return ~/.virtualenvs/test-calvin/bin/csruntime. The beauty of pip install -e . is that you don't have to re-install calvin every time you change the code or pull update from github. See this link for more info on pip and pip install -e . (aka "Editable Installs").

If you want to run tests (and you know you do), you need to install the packages listed in test-requirements.txt:

pip install -r test-requirements.txt

Detailed installation

Here follows quite detailed installation instructions for some common Linux distros.

Installing Calvin on Ubuntu 15.10

Starting with clean, bare naked Ubuntu Wily Werwolf (15.10), the following should give you a complete, workable Calvin installation. Some commands require super user priviledges, normally done using sudo. Always ensure you have the proper authorization before sudoing anything.

First, ensure apt is up to date

$ sudo apt-get update                                                                                   

Install git, necessary in order to fetch Calvin from github.

$ sudo apt-get install git                                                                              

Install python, as yet there is no support for python3, so 2.7 is necessary.

$ sudo apt-get intall python2.7                                                                         

Install python package handler

$ sudo apt-get install python-pip                                                                       

Python development libraries, necessary for some python dependencies of Calvin's

$ sudo apt-get install python-dev                                                                       

Install python test framework

$ sudo apt-get install python-pytest                                                                    

Install python package requests, needed by pip

$ pip install requests                                                                             

Finally, fetch the Calvin sources from GitHub

$ git clone https://www.github.com/EricssonResearch/calvin-base calvin                             

Dive into the rabbit hole

$ cd calvin                                                                                        

Install Calvin dependencies

$ pip install -t requirements.txt                                                                  

Install Calvin test dependencies

$ pip install -t test-requirements.txt                                                             

Install Calvin.

$ sudo python setup.py install                                                                          

Run tests.

$ py.test