Install the gem bundler to download the dependancies
```zsh
gem install bundler
```
The Gemfile will install the gem mysql2 that needs MariaDB and Sidekiq that needs Redis:
```zsh
sudo yuminstall mariadb-devel
sudo yum install redis
sudo apt-getinstall mariadb-devel redis -y
sudo service redis enable(to launch at boot)
sudo service redis start
sudo service mariadb enable
sudo service mariadb start
```
To run the project you need to migrate the project's database:
To run the project you need to migrate the project's database, there are backup in db/backup
```zsh
rake db:migrate
rake db:create (RAILS_ENV=production )
rake db:migrate (RAILS_ENV=production )
```
Then launch the project and check if there is no error message in the correct port:
...
...
@@ -25,21 +53,31 @@ Then launch the project and check if there is no error message in the correct po
rails s
```
## Infrastructure
There is three types of machines in the infrastructure (other than Woody):
- The workers, not connected to Internet. There are just here to do the jobs asked.
- Sid, a worker with an internet connection.
- Cargo, the Docker registry used by workers to do ```docker pull``` commands.
The best way to create the infrastructure is to build your first worker then you can clone your machines to create more workers, Sid and Cargo.
We also need to run sidekiq separately :
```zsh
bundle exec sidekiq (-e production)
```
###Installation of Debian and Docker
We're using VM VirtualBox to simulate the workers. Download a .iso of Debian, launch your VM and configure it (we're creating a new user called 'allgo' in this example). Once it boots, you need to configure it to be ready for Docker:
##WorkerX
### What
The worker are server that will execute job created by users in Allgo.
we sent the command through ssh from Woody and send a docker pull request to cargo (see below)
the datastore from woody is mount through ssh so Worker can write in.
### Need
Docker 1.6, openssh-server
### How
```zsh
sudo
su -c"adduser allgo sudo"
curl + curl -sSL https://test.docker.com/ | sh #to get last docker version
su -c"apt-get update && apt-get install sudo openssh-server -y"
As we do not have an HTTPS certification yet, you need to allow insecure registries:
*Allowing insecure registry*
As we do not have an HTTPS certification yet, you need to allow an insecure registry in cargo server (see below) :
####Debian < v8
```zsh
sudo nano /etc/default/docker
```
Then modify the line concerning DOCKER_OPTS to have: ```DOCKER_OPTS="--insecure-registry cargo.irisa.fr:5000"```.
####Debian >= v8
(or myregistry:5000 if development or other server)
#####Debian >= v8
```zsh
sudo nano /lib/systemd/system/docker.service
```
...
...
@@ -74,8 +112,28 @@ sudo systemctl daemon-reload
sudo /etc/init.d/docker restart
```
###A different IP address for every machine
All the workers should have a different IP address configured. Add in VirtualBox second host-only adapter in the Network tab. This adapter sould be in promiscuous mode allowing VMs witha connected cable.
##Sid - Sandbox
It's the same as worker, but we use it when an user install an application/algorithm.
We create the docker image and push it to the registry
##Cargo
Cargo run the docker image registry, which allow us to store our own docker images.
We use a NAS to replicate the created images, it's safer.
Install docker (same as above)
*To run the registry, with external storage*
```zsh
docker pull registry
docker run -d-p 5000:5000 -eSETTING_FLAVOR=dev -eSTORAGE_PATH=/the_folder_of/your_choice_on_container/ -v /the_folder_of/your_choice/on_host:/the_folder_of/your_choice_on_container/ registry:latest
```
It's unsecure for the moment.
#The development environment :
You can use the Vagrantfile for Virtualbox (no provisioning yet)
Or follow those instructions :
Create 4 or 5 VM (depends of if you want to use your host as web server)
Add in VirtualBox second host-only adapter in the Network tab, with DHCP.
Relaunch your VM and modify the network interfaces:
...
...
@@ -115,15 +173,4 @@ sudo nano /etc/hostname
Change the name and then:
```zsh
sudo /etc/init.d/hostname.sh start
```
##Cargo
You need to install docker-registry on it:
```zsh
docker pull registry
```
When running the registry, you need to mount a datastore:
```zsh
docker run -d-p 5000:5000 -eSETTING_FLAVOR=dev -eSTORAGE_PATH=/the_folder_of/your_choice_on_container/ -v /the_folder_of/your_choice/on_host:/the_folder_of/your_choice_on_container/ registry:latest