Skip to content

Commit

Permalink
Merge branch 'master' into api_improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
matihope authored Jan 31, 2025
2 parents 3d9b4d6 + 7291229 commit ab826d7
Show file tree
Hide file tree
Showing 149 changed files with 5,051 additions and 1,773 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @twalen
* @MasloMaslane
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install apt dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install apt dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install apt dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/translations-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install apt dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/translations-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install apt dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:
- libpq-dev
- libdb-dev
tools:
python: "3.8"
python: "3.10"
jobs:
pre_create_environment:
- echo "Command run at 'pre_create_environment' step"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.10

ENV PYTHONUNBUFFERED 1

Expand Down Expand Up @@ -60,7 +60,7 @@ RUN pip3 install --user bsddb3==6.2.7
WORKDIR /sio2/oioioi

COPY --chown=oioioi:oioioi setup.py requirements.txt ./
RUN pip3 install -r requirements.txt --user
RUN pip3 install -r requirements.txt --user filetracker[server]
COPY --chown=oioioi:oioioi requirements_static.txt ./
RUN pip3 install -r requirements_static.txt --user

Expand Down
20 changes: 10 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ You can manually use docker files to create images containing our services.

To run the infrastructure simply::

"OIOIOI_VERSION=<oioioi_version>" docker-compose up
"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_VERSION=<oioioi_version>" docker-compose up --scale worker=<number>
"OIOIOI_VERSION=<oioioi_version>" docker compose up --scale worker=<number>

as described `in Docker docs`_.

Expand Down Expand Up @@ -51,21 +51,21 @@ experimental features enabled.

Prepare the image with::

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

Then you can start oioioi with::

OIOIOI_UID=$(id -u) docker-compose -f docker-compose-dev.yml up -d
OIOIOI_UID=$(id -u) docker-compose -f docker-compose-dev.yml exec web python3 manage.py runserver 0.0.0.0:8000
OIOIOI_UID=$(id -u) docker compose -f docker-compose-dev.yml up -d
OIOIOI_UID=$(id -u) docker compose -f docker-compose-dev.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.
to start the infrastructure in the development mode. Current directory 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 sio2project/oioioi-dev) #Create oioioi container
docker cp $id:/sio2/deployment deployment #Copy initial deployment folder from oioioi contanier
docker cp $id:/sio2/deployment deployment #Copy initial deployment folder from oioioi container
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.
Expand All @@ -76,8 +76,8 @@ 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 exec "web" ../oioioi/test.sh
docker-compose -f docker-compose-dev.yml exec "web" ../oioioi/test.sh oioioi/{name_of_the_app}/
docker compose -f docker-compose-dev.yml exec "web" ../oioioi/test.sh
docker compose -f docker-compose-dev.yml exec "web" ../oioioi/test.sh oioioi/{name_of_the_app}/

Running static code analysis tools locally (requires Docker)
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -152,7 +152,7 @@ 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
* ``tox [path/to/module[::TestClass[::test_method]]] [-- arg1 arg2 ...]`` - runs pytest in isolated environemnt
* ``tox [path/to/module[::TestClass[::test_method]]] [-- arg1 arg2 ...]`` - runs pytest in isolated environment

Supported args:

Expand Down
4 changes: 2 additions & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '2.4'
# https://github.com/docker/cli/issues/1293
services:
db:
image: library/postgres:12.2
Expand Down Expand Up @@ -27,6 +25,7 @@ services:
# - "7887:7887"
volumes:
- .:/sio2/oioioi
- filetracker-data-dev:/sio2/deployment/media
# - ./deployment:/sio2/deployment
stop_grace_period: 3m
depends_on:
Expand All @@ -50,3 +49,4 @@ services:
stop_grace_period: 1m
volumes:
postgress-data-dev:
filetracker-data-dev:
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
db:
image: library/postgres:12.2
Expand All @@ -18,6 +17,8 @@ services:
depends_on:
- db
- broker
volumes:
- filetracker-data:/sio2/deployment/media
worker:
image: sio2project/oioioi:$OIOIOI_VERSION
command: ["/sio2/oioioi/worker_init.sh"]
Expand All @@ -34,3 +35,4 @@ services:
stop_grace_period: 1m
volumes:
postgress-data:
filetracker-data:
7 changes: 4 additions & 3 deletions easy_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# system:
# docker
# docker-compose
# docker compose (V2)


# This script was created in order to help the users
Expand All @@ -19,13 +19,14 @@
import sys
from shlex import quote

BASE_DOCKER_COMMAND = "OIOIOI_UID=$(id -u) docker-compose" + \
BASE_DOCKER_COMMAND = "OIOIOI_UID=$(id -u) docker compose" + \
" -f docker-compose-dev.yml"

RAW_COMMANDS = [
("build", "Build OIOIOI container from source.", "build", True),
("up", "Run all SIO2 containers", "up -d"),
("down", "Stop and remove all SIO2 containers", "down", True),
("down", "Stop and remove all SIO2 containers", "down"),
("wipe", "Stop all SIO2 containers and DESTROY all data", "down -v", True),
("run", "Run server", "{exec} web python3 manage.py runserver 0.0.0.0:8000"),
("stop", "Stop all SIO2 containers", "stop"),
("bash", "Open command prompt on web container.", "{exec} web bash"),
Expand Down
Binary file modified oioioi/_locale/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit ab826d7

Please sign in to comment.