Scheduler

The djinn-scheduler is the component that handles the scheduling of cron jobs that have been submitted via the server. Every minute this will invoke the cron jobs in batches of 1000 that are ready to be invoked.

External Dependencies

Detailed below are the software dependencies that the scheduler needs in order to start and run,

DEPENDENCY REASON
PostgreSQL Primary data store for the scheduler.
Redis Data store used as the build queue.

Configuring the Scheduler

Scheduler parameters
NAMETYPEDESCRIPTION

drivers

string[]

The list of drivers supported on the server. This should match what is in the server configuration.

crypto

object

Configuration settings for generating names for artifacts.

crypto.salt

string

Salt the is used to generate secrets. Must match what is in the server configuration.

database

object

Provides connection information to the PostgreSQL database.

database.addr

string

The address of the PostgreSQL server to connect to.

database.name

string

The name of the database to use.

database.username

string

The name of the database user.

database.password

string

The password of the database user.

database.tls

object

TLS configuration for connecting via TLS.

database.tls.ca

string

Path to the CA root to use.

database.tls.cert

string

Path to the certificate to use.

database.tls.key

string

Path to the key to use.

redis

object

Providers connection information to the Redis database.

redis.addr

string

The address of the Redis server to connect to.

redis.password

string

The password used if the Redis server is password protected.

EXAMPLE

pidfile "/var/run/djinn/scheduler.pid"

log info "/var/log/djinn/scheduler.log"

drivers [
    "docker",
    "qemu-x86_64",
]

crypto {
    salt  "1a2b3c4d5e6f7g8h1a2b3c4d5e6f7g8h"
}

database {
    addr "localhost:5432"
    name "djinn"

    username "djinn-scheduler"
    password "secret"
}

redis {
    addr "localhost:6379"
}

Running the Scheduler

To run the scheduler simply invoke the djinn-scheduler binary. There is only one flag that can be given to the djinn-scheduler binary.

  • -config - This specifies the configuration file to use, by default this will be djinn-scheduler.conf.

Configuring the Scheduler Daemon

The dist directory contains files for running the Djinn Scheduler as a daemon on Linux systems that use systemd and SysVinit for daemon management. Use whichever suits your needs, and modify accordingly.

If deploying to a Linux system that uses systemd, then be sure to run systemctl daemon-reload upon placement of the service file.