Home

Awesome

Maycamp Arena


Status

Gemnasium Status Travis CI Status


Table of Contents


Description

The idea of this project is to provide a grading system for competitions in informatics (IOI style). The main target group is high school students.

The system contains two main components:

The web part is a Ruby on Rails application, contained in the app folder.

The grader compiles the source code and runs the binary inside multiple docker containers and feeds each one with the given test cases. It monitors the consumption of the system resources - time limit, memory limit, etc..

Go back


Features

Go back


Installation

The following steps describe how to run the project on a local environment for developing purposes. The best and fastest way to get the project up and running is to use the already configured Vagrant virtual development environment.

Dependencies

General

Additional

(for the virtual environment)

Setup

Web part

Download the project and initialize the virtual environment.

$ git clone https://github.com/valo/maycamp_arena.git
$ cd maycamp_arena
$ vagrant up

This last command may take a while to execute, considering the fact that the proper virtual box binary must be downloaded and provisioned.

Configure the ruby version. Keep in mind that rvm is already installed on the virtual machine.

NB! vm is just a placeholder for vagrant@vagrant-ubuntu-trusty64

$ vagrant ssh
vm$ rvm install 2.1.1
vm$ rvm use 2.1.1
vm$ cd /vagrant

Install the MySQL server. It is recommended to leave the root user without password (blank password), otherwise you should change the configurations.

vm$ sudo apt-get install mysql-server

Install the package dependencies and run the database migrations with:

vm$ bundle install
vm$ bundle exec rake db:create db:setup

After you have successfully completed the installation process of the web application you can start the server with:

$vm /vagrant/bin/rails server -b 0.0.0.0

and access it in your browser on localhost:3030.

Grader

Getting the grader up and running is done with:

vm$ cd /vagrant
vm$ gem install god
vm$ docker build -t grader .
vm$ printf "vagrant-ubuntu-trusty-64:\n rsync: /vagrant/sets" > config/grader.yml

and running it with:

vm$ /home/vagrant/.rvm/bin/rvm 2.1 do bundle exec rake RAILS_ENV=production grader:start

Running the tests

To run the tests execute:

$ bundle exec cucumber

Access

After you have successfully set up the project you can log in with the dummy admin account:

username: root
password: 123123

Go back

Deployment

Deployment is done using docker stack. Follow these steps:

The app should be accessible from the IP address of the provisioned machine. By default it binds on port 80.

WARNING: The current deployment has some limitations: