Wiki

Clone wiki

occam-web / Installation / Arch

Installation on Arch Linux

We have tested it on the following versions of Arch Linux:

  • 4.0.7.2

1 - Install dependencies

Note: If you are using a virtual machine through VirtualBox, your life will be tremendously easier if you enable shared clipboard! Go to "Devices" on the menubar and within the "Shared Clipboard" section select at least the "Host to Guest" option. You can right click in the Ubuntu terminal and select Paste whenever you copy something from this document.

Install docker package along with build dependencies:

sudo pacman -Sy docker git sqlite curl

Add your user to the docker group so that you have permissions to run docker and enter your user password for the computer when prompted.

sudo gpasswd -a ${USER} docker

You will likely want to enable (or at least start) the services for the database, and docker. If you would like to change the configurations of these services, do so now. Refer to Docker pages on the Arch wiki for more instruction or hints on how to resolve any errors.

Using "enable" will cause the services to automatically start when the computer boots. You can simply use "start" if you just want them to run in the current session.

sudo systemctl enable docker

Now, we must install our language environments. We require ruby 2.0 and python 3. The easiest option is to install or make use of your existing ruby/python virtual environment. If you don't know what that means, that is ok! We'll just install rvm for ruby and pyenv for python: (Look at the websites here for more up-to-date information on their installation)

curl -sSL https://get.rvm.io | bash -s stable
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc

This is assuming you are using a bash shell, by the way. If you don't know what shell you are using, then it is likely bash but you find out with:

echo $SHELL

However, if you are using a zsh shell then do the following:

curl -sSL https://get.rvm.io | bash -s stable
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshenv
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshenv
echo 'eval "$(pyenv init -)"' >> ~/.zshenv

You should restart your terminal now.

Now we can install or build the ruby and python we need to use:

rvm install ruby-2.3.0
pyenv install 3.3.3
pyenv rehash

Once that is done, everything should be all set up!

2 - Download OCCAM Source

Pull down occam source code. You'll probably want to create a directory to serve as the root for everything:

mkdir occam
cd occam

Then, pull in all occam source code:

git clone https://bitbucket.org/occam/occam-web
git clone https://bitbucket.org/occam/occam-worker

3 - Set up OCCAM Worker Process

From your root OCCAM path, go into the occam-worker code and install its dependencies:

cd occam-worker
pyenv local 3.3.3
pip install -r dev-requirements.txt

To set up a database and initialize OCCAM:

./occam initialize

You will want to put this directory in your PATH.

export PATH=$PATH:`pwd`

Once you have created a database, you can run the worker in the background using that same database:

./occam-worker.py

To start an AMQP server:

./occam-queue.py

These are optional and are only useful for queuing tasks to run and for cluster setups (where you have several machines cooperating.) You can then run as many of these processes as you see fit.

You can just CTRL+C to quit it once you have seen it start without any trouble. This program is meant to run indefinitely and wait for a job to run. It will build objects and run experiments whenever there are any. If there aren't, well, just like most of us it will just sit there and do nothing.

4 - Set up OCCAM Web Server

Now, go into the web portal and server code and run the following to install dependencies:

cd occam-web
gem install bundler
bundle install --without production

To start a development HTTPS server on port 9292:

./dev-start.sh

You can see this in a web-browser by opening up https://localhost:9292/

You can then create an account. The first account automatically gets the administrator role. You can then click on 'Admin' in the links on the footer to set up the server to your specifications.

5 - Build an OCCAM Base Image

Within your occam directory, pull down the base image we typically use:

git clone https://bitbucket.org/occam/docker-environment-ubuntu-14.04

This will build the base ubuntu image that other objects use to build from. To build, make sure occam-worker is in your path. Go into the occam-base directory and build the images:

cd occam-docker-environment-ubuntu-14.04
occam pull .
occam build

Note: If you receive an error about "permission denied" and docker.sock, then you do not have permissions to run a docker VM process. You will have to be in the docker group. Try running this command again and restarting the machine:

sudo gpasswd -a ${USER} docker

After this is done, you can build occam objects. In the future this step may not be necessary because the base occam images can be pulled from servers which already have them built.

Updated