Skip to content

Deployment

Docker automatic deployment

Requirements

To be able to succesfully register users, you will need a working email address. You can easily use any email provider, put the necessary configuration in the variables.env.

By default, the application creates an admin account with the default credentials set to admin and admin. This can again be configured.

Docker setup

The application can be deployed using Docker compose. The docker-compose.yml file is located in the directory scripts/docker. Configuration of the necessary variables can be done in the variables.env files, which is read while creating the Docker containers.

You will need to have docker and docker compose installed on your machine.

You can install docker from here, and docker-compose from here.

Then you can deploy the application by running:

bash
cd scripts/docker
docker compose build
docker compose up

To delete the containers, you can run:

bash
docker compose down

If you wish to delete the volumes as well, you can run:

bash
docker volume rm <volume_name>

3 Docker containers are created:

  • web - the main container with the web application (the frontend and the backend)
  • db - the database container with the PostgreSQL database
  • evaluator - the evaluator container what evaluates the submissions uploaded (evaluation backend)

INFO

The application is then available on localhost:8000, port can be changed in the docker-compose.yml file.

Manual deployment

Requirements

  • Python 3.11

    • python-dotenv
    • psycopg2
    • flask
    • flask-mail
    • toml
    • markdown
  • PostgreSQL

  • Apache2 / Nginx / gnuicorn (or any other WSGI server)

Setup

  1. Clone the repository
bash
git clone https://gitlab.fel.cvut.cz/b35apo/qtrvsim-eval-web.git
  1. Install the necessary packages
bash
cd qtrvsim-eval-web
pip install -r requirements.txt
  1. Create the database from scripts/create_database.sql
bash
cd scripts
./create_database.sh
  1. Set up the WSGI server

You can either use the configuration file in scripts/qtrvsim.conf using a Pipfile venv, or you can use the gunicorn server.

  1. Set up the evaluator systemd service

The evaluator is a separate service that evaluates the submissions. You can set it up as a systemd service.

bash
cd scripts
sudo cp evaluator.service /etc/systemd/system/evaluator.service
sudo systemctl daemon-reload
sudo systemctl enable evaluator
sudo systemctl start evaluator