Skip to content

sio2project/oioioi

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
40b2df4

Git stats

Files

Permalink
Failed to load latest commit information.

OIOIOI

SIO2 is a free platform for carrying out algorithmic contests and OIOIOI is its main component — the web interface.

Installation

Easy Installer

You can easily install and run oioioi out of the box with oioioi_easy_installer. Just download the oioioi_easy_installer archive, unpack it and run:

./oioioi.sh install

to install oioioi. Then you can run:

./oioioi.sh start
./oioioi.sh stop

to start and stop oioioi.

Make sure to change default superuser password. To do that:
  1. Login to the superuser with default credentials (username:admin, password:admin).
  2. Click username ("admin") in upper-right corner of the webpage.
  3. Click "Change password".
  4. Fill and submit password change form.

You can also update your oioioi instance by typing:

./oioioi.sh update

Docker (for deployment)

The easy installer method above uses Docker under the hood. Additionally, you can manually use docker files to create images containing our services.

To run the infrastructure simply:

"OIOIOI_CONFIGDIR=<config directory>" "OIOIOI_VERSION=<oioioi_version>" docker-compose up

Make sure to change default superuser password, same as in the automatic method.

To start additional number of workers:

"OIOIOI_CONFIGDIR=<config directory>" "OIOIOI_VERSION=<oioioi_version>" docker-compose up --scale worker=<number>

as described in Docker docs.

Docker (for development)

Make sure you installed docker properly. The easiest way to do this:

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh

Start docker service:

sudo systemctl start docker

Then add yourself to group docker -- to create a group use:

sudo groupadd docker
gpasswd -a $USER docker
newgrp docker

It is possible that you will need to log out and log in. Type docker ps into your terminal to check if everything was installed properly. If you skip the step above, you will either have to use sudo every time you use docker or use docker above 19.03 version with experimental features enabled.

Prepare the image with:

OIOIOI_UID=$(id -u) docker-compose -f docker-compose-dev.yml -f extra/docker/docker-compose-dev-noserver.yml build

Then you can start oioioi with:

OIOIOI_UID=$(id -u) docker-compose -f docker-compose-dev.yml -f extra/docker/docker-compose-dev-noserver.yml up -d
OIOIOI_UID=$(id -u) docker-compose -f docker-compose-dev.yml -f extra/docker/docker-compose-dev-noserver.yml exec web python3 manage.py runserver 0.0.0.0:8000

to start the infrastructure in the development mode. Current dirrectory with the source code will be bound to /sio2/oioioi/ inside the running container.

oioioi web interface will be available at localhost:8000, and the user admin with password admin will be created.

Additionally you can bind config files and logs folder to the host:

id=$(docker create oioioi-dev)  #Create oioioi container
docker cp $id:/sio2/deployment deployment  #Copy initial deployment folder from oioioi contanier
docker rm -v $id  #Remove unneeded container

Remember to also uncomment the appropriate volume binding in the web service description in the docker-compose-dev.yml.

Running tests on Docker

For testing purposes we use test.sh script located in oioioi directory. Note it's not the same directory you are connected to after using docker exec -it “web” /bin/bash. The default container id that you should use for running tests is "web":

docker-compose -f docker-compose-dev.yml -f extra/docker/docker-compose-dev-noserver.yml exec "web" ../oioioi/test.sh
docker-compose -f docker-compose-dev.yml -f extra/docker/docker-compose-dev-noserver.yml exec "web" ../oioioi/test.sh oioioi/{name_of_the_app}/

Running static code analysis tools locally (requires Docker)

The static code analysis tools currently in use for python code are black, isort, pep8 and pylint. All of them can be run locally using the run_static.sh shell script. In order for the script to work the web container from docker-compose-dev.yml needs to be running. The docker image for the project needs to be rebuild if you are migrating from and older Dockerfile version (rebuild the image if you are getting error messages that isort or black are not installed). Commands for building the image and starting up the containers are listed in the paragraphs above.

When running all tools at once or when running pep8 and pylint independently only the recently modified files (files modified in the most recent commit or staged changes) will be processed.

To run all tools at once:

./run_static.sh

To run one of the tools:

./run_static.sh black
./run_static.sh isort
./run_static.sh pylint
./run_static.sh pep8

Script toolbox for Docker (development)

Copy-pasting all Docker commands from GitHub can be tedious. Instead use a set of pre-prepared commands embedded into easy_toolbox.py. For help run easy_toolbox.py -h. Add custom commands by editing RAW_COMMANDS in the file. Script can be used with user-friendly CLI or by passing commands as arguments. Developer environment can be easily set up by running:

./easy_toolbox.py build
./easy_toolbox.py up
# wait for the scripts to finish migration (up to one minute)
./easy_toolbox.py run

For system requirements check easy_toolbox.py.

Manual installation (deprecated)

See INSTALL for instructions.

Upgrading

See UPGRADING for instructions.

Backup

Amanda is recommended for doing OIOIOI backups. Sample configuration with README is available in extra/amanda directory.

For developers

Documentation for developers:

Testing

OIOIOI has a big suite of unit tests. You can run them in following way:

  • test.sh - a simple test runner, use from virtualenv
  • test_selenium.sh - long selenium tests, use from virtualenv
  • tox [path/to/module[::TestClass[::test_method]]] [-- arg1 arg2 ...] - runs pytest in isolated environemnt

Supported args:

  • -n NUM - run tests using NUM CPUs
  • -v - increase verbosity
  • -q - decrease verbosity
  • -x - exit after first failure
  • -lf - runs only tests that failed last time
  • --runslow - runs also tests marked as slow

Usage

Well, we don't have a full-fledged User's Guide, but feel free to propose what should be added here.

Creating task packages

To run a contest, you obviously need some tasks. To add a task to a contest in OIOIOI, you need to create an archive, called task package. Here are some pointers, how it should look like:

Contact us

Here are some useful links: