This is the API server for Dolos.
It is a rails application that enables users to upload datasets, which will be analyzed with the Dolos CLI (running in a docker container) and the results will be available on a secret URL.
Refer to the installation instructions in the root of this repository how to self-host a fully working Dolos web app.
The next steps will guide you through the installation process to start developing:
This is a Rails 7 running on Ruby 3. We use a MariaDB / MySQL database and have a delayed_job job worker that will spawn docker containers.
If you have Nix installed, you can use the provided flake.nix to get a shell with all dependencies (except docker) using with the following command:
nix develop # provides a shell with all dependencies
bundle install # conventionally install ruby dependenciesThe flake also provides the command server:start to start the database and job worker services. However, you need to set up the database first (see step 2).
The docker-compose.yml in this directory will start the development API server, job worker and MySQL database.
You can start this environment with docker-compose up.
Note: the job worker needs access to spawn new docker containers, the docker daemon socket (unix:///var/run/docker.sock) will be mounted in the worker service.
If you want to use your own environment, you will need to install the following dependencies:
- The correct version of Ruby (see
.ruby-version) - MySQL or MariaDB (see
config/database.yml) - Docker
You will also need to install the dependencies with bundle install and the job worker with rails jobs:work.
You only really need to run one command: rails db:prepare. This will create the database, run all migrations and run the seeds (if any).
Useful commands that you might need to perform these steps manually:
rails db:createwill create the databaserails db:migratewill run migrationsrails db:seedwill run seedsrails db:dropwill drop the database (all data will be lost)
You can start the server with rails server. This will start the API server on http://localhost:3000.
To be able to analyze datasets, you need to have the latest image of the Dolos docker
docker pull ghcr.io/dodona-ede/dolos:latestYou can start the job worker with rails jobs:work.
This will start the job worker and will spawn docker containers to analyze datasets once they are uploaded.
To interact with the API server you should run the dolos-web front-end in server mode.
Refer to the instructions in the web/ directory of this repository.
You can also run the Ruby on Rails application directly without the use of docker-compose.
System requirements:
- Ruby (see
.ruby-version) - A MariaDB or MySQL database
- Docker Engine
- Recommended: a reverse proxy (Nginx, Apache, ...)
This application is deployed using capistrano.
You can deploy the application with cap production deploy.