Cicada scheduler
Centralized Distributed Scheduler
Overview
- Cicada is best understood as a lightweight management layer between linux CRON and the end executables
- It requires a central database for setting up and monitoring schedules
- Schedules can be launched on any node that has registered itself to the database
- Nodes act as agents pulling scheduling information from the database.
Advantages over using only CRON
- A central log is kept of schedule executions and results
- Offers some schedule dependance management
- Non-running schedules can easily be moved from one node to another
- Running schedules can easily be terminated
Execution flow diagram
Setup Central Database
Verified on PostgreSQL versions 12.9 to 15.14
- Execute as postgres user setup/db_and_user.sql
- Change cicada user password
- Execute as cicada user setup/schema.sql
Database ERD
Setup Node
Verified on Ubuntu 18.04, 20.04 LTS and 22.04 LTS
Prerequisites
- ntpd
- cron
- python3.8
# Install Cicada Scheduler
sudo mkdir -p /opt/cicada
sudo chown -R $USER:$USER /opt/cicada
cd /opt/cicada
DIR=$(pwd)
cd $DIR
git clone git@github.com:transferwise/cicada.git .
make python=python3.8
# Update the db_cicada section of the environmental config file
cp $DIR/config/example.yml $DIR/config/definitions.yml
vim $DIR/config/definitions.yml
# Register new Node in Database
$DIR/bin/cicada register_server
# Add linux CRON job to check central scheduler every minute
echo "* * * * * $DIR/venv/bin/python3 $DIR/venv/bin/cicada exec_server_schedules" | crontab
Administration
cli help
cicada --help
(Re)register a server to Cicada
cicada register_server
Add or Update a new schedule
cicada upsert_schedule --help
schedule_id | Id of the schedule
schedule_description | Schedule description and comments
server_id | Id of the server where the schedule will run
schedule_order | run order for the schedule. lowest is first. is_async jobs will be execute in parallel
is_async | 0=Disabled 1=Enabled | is_async jobs execute in parallel
is_enabled | 0=Disabled 1=Enabled
adhoc_execute | 0=Disabled 1=Enabled | Execute at next minute, regardless of other settings
abort_running | 0=Disabled 1=Enabled | If the job is running, it will be terminated as soon as possible
interval_mask | When to execute the command | unix crontab (minute hour dom month dow)
first_run_date | The schedule will not execute before this datetime
last_run_date | The schedule will not execute after this datetime
exec_command | Command to execute
parameters | Parameters for exec_command
adhoc_parameters | If specified, will override parameters for one run
schedule_group_id | Optional field to help with schedule grouping
Launch a schedule once, as soon as possible
- adhoc_execute is a one-time schedule modification.
- As soon as adhoc_execution has been used, it is reset.
cicada upsert_schedule --schedule_id={schedule_id} --adhoc_execute={1}
Launch the next run of a schedule with different parameters
- adhoc_parameters is a one-time schedule modification.
- As soon as adhoc_parameters has been used, it is reset.
cicada upsert_schedule --schedule_id={schedule_id} ==adhoc_parameters={do something diffident}
Abort a running schedule
- abort_running is a one-time schedule modification.
- As soon as abort_running has been used, it is reset.
- Cicada keeps the schedule marked as running until the launched process exits.
- Additional abort requests are consumed while Cicada waits for the process to exit.
cicada upsert_schedule --schedule_id={schedule_id} --abort_running={1}
Metadata
Release files for cicada 0.10.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cicada-0.10.6.tar.gz | 53.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cicada-0.10.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 93.0 kB
Release files / cicada-0.10.6.tar.gz
| Download URL | cicada-0.10.6.tar.gz |
|---|---|
| Size | 53.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b87e1bbca2bc69a6f1f02d91244ca09353e41cec38f56bdf6bc2fe28f5d34867
|
|
BLAKE2b-256 checksum How to use checksums |
d0d6e12a4fdb728e538d5ffdc64a65d0a994c1cfc17ae091a0b8c65546e95f12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / cicada-0.10.6-py3-none-any.whl
| Download URL | cicada-0.10.6-py3-none-any.whl |
|---|---|
| Size | 39.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85d4d8c7944016e959599cfb4798ac7f94a3f2d4e6bdf301f3fea86015f0fd0d
|
|
BLAKE2b-256 checksum How to use checksums |
d34bae929edf4541256cf512e3e318a94a5b4442133b254b7d6a1caefac8cba9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency log