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 full service list
Section titled “The full service list”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 likemariadb
- 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
Docker Compose Deployment
Section titled “Docker Compose Deployment”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 variableMASTER_ENCRYPTION_KEY=
# DatabasesDB_HOST=mysqlDB_PORT=3306DB_USERNAME=rootDB_PASSWORD=rootSCHEDULER_DB_NAME=scheduler_db
BASE_DB_HOST=mysqlBASE_DB_NAME=scheduler_baseBASE_DB_USERNAME=rootBASE_DB_PASSWORD=rootBASE_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 :
- First we pull the latest images
docker-compose pull
- 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.
- 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