Commit 83441148 authored by MAUPETIT Charly's avatar MAUPETIT Charly
Browse files

fix previous merging

parent 0af2bd1b
......@@ -8,8 +8,9 @@ capybara-*.html
.rvmrc
.bundle
vendor/bundle
log
log/*
log/development.log
tmp/
tmp/*
db/*.sqlite3
public/system/*
......
......@@ -82,11 +82,8 @@ GEM
multi_test (>= 0.1.2)
cucumber-core (1.1.3)
gherkin (~> 2.12.0)
<<<<<<< HEAD
=======
d3js-rails (3.1.6)
railties (>= 3.0, < 5.0)
>>>>>>> cmaupeti
daemons (1.2.2)
devise (3.5.1)
bcrypt (~> 3.0)
......@@ -129,15 +126,9 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
<<<<<<< HEAD
mime-types (2.5)
mini_portile (0.6.2)
minitest (5.6.1)
=======
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.7.0)
>>>>>>> cmaupeti
multi_json (1.11.0)
multi_test (0.1.2)
mysql2 (0.3.18)
......@@ -233,11 +224,7 @@ GEM
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
<<<<<<< HEAD
sprockets (3.0.3)
=======
sprockets (3.2.0)
>>>>>>> cmaupeti
rack (~> 1.0)
sprockets-rails (2.3.1)
actionpack (>= 3.0)
......@@ -280,18 +267,11 @@ DEPENDENCIES
bootstrap-sass
capistrano (= 2.15.5)
capybara
<<<<<<< HEAD
coffee-rails (>= 4.0.0)
cucumber
devise
jbuilder (>= 1.2)
=======
coffee-rails
cucumber
d3js-rails
devise
jbuilder
>>>>>>> cmaupeti
jquery-fileupload-rails
jquery-rails
mysql2
......
<<<<<<< HEAD
#Configuration to run Allgo
##Woody (your computer)
Needs: Ruby 2.2.2-dev, Nginx, mariadb, ruby + rails via rvm, rails app (via capistrano), redis, docker, git, zip, curl,sudo
Use RVM to install the correct version of Ruby and make it the default one.
```zsh
rvm --default use ruby-2.2.2-dev
```
The Gemfile will install the gem mysql2 that needs MariaDB and Sidekiq that needs Redis:
```zsh
sudo yum install mariadb-devel
sudo yum install redis
sudo service redis start
```
To run the project you need to migrate the project's database:
```zsh
rake db:migrate
=======
_
_ | | _____ ____
/\ | | | | / ____|/ __ \
/ \ | | | | | | __| | | |
/ /\ \ | | | | | | |_ | | | |
/ ____ \| |____ | | | |__| | |__| |
/_/ \_\______| | | \_____|\____/
|_|
_ | | _____ ____
/\ | | | | / ____|/ __ \
/ \ | | | | | | __| | | |
/ /\ \ | | | | | | |_ | | | |
/ ____ \| |____ | | | |__| | |__| |
/_/ \_\______| | | \_____|\____/
|_|
#What is Allgo (A||Go)
A||Go est une infrastructure web pour mettre en ligne le plus rapidement et simplement
......@@ -46,11 +24,11 @@ Un job est l'action d'exécuter une application, avc un ou plusieurs fichier(s)
![](doc/allgo.jpg)
## Woody (web server) - Debian 8
### What
### What
Allgo frontend via the web application in RoR. We also have the datastore on Woody, to store files from jobs, and the SQL database.
### Need
### Need
Ruby 2.2.2-dev, Nginx, mariadb, ruby + rails via rvm, rails app (via capistrano), redis, git, zip, curl, sudo
### How
### How
su -c "adduser allgo"
su -c "usermod -aG sudo allgo"
su allgo
......@@ -78,7 +56,6 @@ To run the project you need to migrate the project's database, there are backup
```zsh
rake db:create ( RAILS_ENV=production )
rake db:migrate ( RAILS_ENV=production )
>>>>>>> cmaupeti
```
Then launch the project and check if there is no error message in the correct port:
......@@ -86,36 +63,17 @@ Then launch the project and check if there is no error message in the correct po
rails s
```
<<<<<<< HEAD
## 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.
###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:
```zsh
sudo
su -c "adduser allgo sudo"
sudo apt-get install curl
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker allgo
sudo systemctl enable docker
=======
We also need to run sidekiq separately :
```zsh
bundle exec sidekiq (-e production)
bundle exec sidekiq (-e production)
```
##WorkerX
### What
### 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
the datastore from woody is mount through ssh so Worker can write in.
### Need
Docker 1.6, openssh-server
### How
......@@ -130,7 +88,6 @@ Install the last docker version docker :
curl + curl -sSL https://test.docker.com/ | sh
sudo usermod -aG docker allgo
/etc/init.d/docker start
>>>>>>> cmaupeti
```
Try a Docker command to see if it works:
......@@ -144,26 +101,18 @@ sudo chown allgo /home/allgo/.docker/
sudo chown allgo /home/allgo/.docker/key.json
```
<<<<<<< HEAD
###Allowing insecuring registries
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) :
>>>>>>> cmaupeti
####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"```.
<<<<<<< HEAD
####Debian >= v8
=======
(or myregistry:5000 if development or other server)
#####Debian >= v8
>>>>>>> cmaupeti
```zsh
sudo nano /lib/systemd/system/docker.service
```
......@@ -175,12 +124,8 @@ sudo systemctl daemon-reload
sudo /etc/init.d/docker restart
```
<<<<<<< HEAD
###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.
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
......@@ -195,13 +140,12 @@ docker run -d -p 5000:5000 -e SETTING_FLAVOR=dev -e STORAGE_PATH=/the_folder_of/
```
It's unsecure for the moment.
#The development environment :
#The development environment :
You can use the Vagrantfile for Virtualbox (no provisioning yet)
Or follow those instructions :
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.
>>>>>>> cmaupeti
Relaunch your VM and modify the network interfaces:
......@@ -216,11 +160,8 @@ iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
<<<<<<< HEAD
```
=======
```
>>>>>>> cmaupeti
Once you've done the modifications, use the command ``sudo /etc/init.d/networking restart`` to restart the network card of your VM.
When duplicating the first worker don't forget to check the option to change the MAC address. Run a ```sudo ifconfig``` on each machine to get the IP address and copy-paste them into ``config/environments/development.rb`` in the corresponding line of rails-allgo.
......@@ -228,7 +169,7 @@ When duplicating the first worker don't forget to check the option to change the
###Installing ssh
You'll use ssh a lot on the workers thus we need to install it on the workers and aloow Woody to do a ssh without having to enter a password. First, install openssh-server:
```zsh
sudo apt-get install openssh-server
sudo apt-get install openssh-server
```
Then on Woody, assuming that you already have a ssh key, do this for the workers and Sid:
......@@ -246,17 +187,3 @@ Change the name and then:
```zsh
sudo /etc/init.d/hostname.sh start
```
<<<<<<< HEAD
##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 -e SETTING_FLAVOR=dev -e STORAGE_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
```
=======
>>>>>>> cmaupeti
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment