Spoj0 for students
Table of Contents
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:
- Web part
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..
- Participation in live contests.
- Practicing old contests.
- Grouping contests by categories.
- Grouping problems by categories.
- Evaluation of regular input/output tasks
- Answer evaluation using checker
- Supported programming languages:
- Python 2 & 3
- Possibility for integrating more than one grader on different machines.
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.
- MySQL Server 5.5+ or MariaDB is preferred
- Ruby 2.1+ (the easiest way is to use RVM or rbenv)
(for the virtual environment)
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
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
After you have successfully set up the project you can log in with the dummy admin account:
username: admin password: 123123