... | ... | @@ -20,36 +20,3 @@ Allgo gives to users the possibility to create jobs, which are operation with on |
|
|
# Infrastructure
|
|
|
![infrastructure](http://gitlab.irisa.fr/uploads/charly.maupetit/rails-allgo/25e0900ad2/infrastructure.png)
|
|
|
|
|
|
All our machines are running on Debian 8.
|
|
|
|
|
|
## Webapp
|
|
|
It contains the Web application, the datastore and the Swarm master to manage the cluster. It depends on Ruby 2.2.2-dev, Nginx, MariaDB, Ruby + Rails via rvm, Capistrano, redis, git, zip, curl, sudo.
|
|
|
|
|
|
## Cargo
|
|
|
Cargo runs the Docker image [registry](https://registry.hub.docker.com/_/registry/) which allow us to store private Docker images. We use a NAS to replicate the created images in case of an accident with our main server.
|
|
|
|
|
|
## Node<x>
|
|
|
A node is a server that executes jobs created by users on Allgo. It receives order from the Swarm manager (contained in the Webapp machine) through TCP and send pull requests to Cargo. The datastore from Webapp is mounted through ssh so that Worker can write in it.
|
|
|
As we do not have an HTTPS certification yet, we added a link to Cargo in the configuration file of all the workers to pull images from Cargo instead of Docker Hub.
|
|
|
|
|
|
## Sandbox
|
|
|
It's working like a worker, but it is also used when an application is created. It will create the docker image from the instructions given and push it into Cargo.
|
|
|
|
|
|
# Installation
|
|
|
Everything is in a `Vagrantfile`, you just need to install [Vagrant](https://www.vagrantup.com/) and run a `vagrant up` in `rails-allgo/deploy/` to have an up and running development environment. The thing you'll need after that is to create and migrate the database and then run the Rails app. Do a `vagrant ssh webapp` followed by these commands:
|
|
|
|
|
|
```zsh
|
|
|
$ cd allgo/
|
|
|
$ rake db:create ( RAILS_ENV=production )
|
|
|
$ rake db:migrate ( RAILS_ENV=production )
|
|
|
$ rails s -b 192.168.50.2
|
|
|
|
|
|
On another tab, do:
|
|
|
```zsh
|
|
|
$ cd allgo/
|
|
|
$ bundle exec sidekiq
|
|
|
```
|
|
|
|
|
|
The first time you'll create an application Sidekiq and Rails will ask you passwords, be careful and enter `vagrant` when a password is asked.
|
|
|
|
|
|
To learn more about the configuration of our machines, check the files in `rails-allgo/deploy/`. |
|
|
\ No newline at end of file |