Skip to content

Deployment

Docker deployments are the only way to get starting with The Scheduler for now. The basis for this tutorial is the starter template available on github. starter-template. This is the best way to start with the project as well as this documentation as reference.

The Scheduler needs some more services to fully work, even though only the 2 main containers (backend & frontend) are required. here is the list of all the services:

  • Main backend: The scheduler backend, this is based on ghcr.io/moda20/scheduler_backend:latest image
  • Main frontend: The scheduler frontend, this is based on ghcr.io/moda20/scheduler_ui:latest image
  • Database service: MySQL database or something compatible like mariadb
  • Gotify service (Optional): This is still the default notification service for job events, but you can still disable it and/or use a custom notification service.
  • Browserless service (Optional): this is an external service that acts like an http client, it’s usages are limited and will be deleted in the future for a custom plugin that you can be setup manually
  • Grafana Loki service (Optional): This is the main logging service and is used to save most logs including job and instance logs and without it you won’t be able to read single task run logs. it is optional

The best way to deploy the entire stack is using the example compose.yml. it also requires some env variables in order to launch properly. The mandatory env variables are the following (from .env.example)

# Mandatory Env variable
MASTER_ENCRYPTION_KEY=
# Databases
DB_HOST=mysql
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=root
SCHEDULER_DB_NAME=scheduler_db
BASE_DB_HOST=mysql
BASE_DB_NAME=scheduler_base
BASE_DB_USERNAME=root
BASE_DB_PASSWORD=root
BASE_DB_PORT=3306

More on these variables can be found on this documentation page or on github

once your .env file is ready, you should pull all the images without running them. this is an important step to ensure the typed experience when creating tasks and the extra plugins/services.

Based on the compose.yml file in the starter project :

  1. First we pull the latest images
docker-compose pull
  1. We run the following command to copy the automatically generated types from the scheduler_backend image
docker create --name=scc_b ghcr.io/moda20/scheduler_backend:latest && docker cp scc_b:/usr/src/app/extraTypes/types.d.ts ./types.d.ts && docker container rm scc_b

This will copy a types.d.ts file to your current project that you can use to have a clearer code experience when creating your tasks and using the included features, like the networking tools and all base classes that the user code will extend from.

  1. The next step is running the entire stack : We can simply use the regular docker-compose up command, but in case you encounter some issues on the scheduler_backend side, it’s much better to run the compose services individually while running the scheduler_backend last.
docker-compose up -d

Note : This will not work correctly from the get go as no databases were created yet, the next section will detail the configuration needed to get started