Skip to main content

Job scheduler for Docker containers, configured via container labels.

Project description

deck-chores

** A job scheduler for Docker containers, configured via container labels.**

Features

  • define regular jobs to run within a container context with container and optionally with image labels

  • use date, interval and cron-like triggers

  • set a maximum of simultaneously running instances per job

  • restrict job scheduling to one container per service

Example

Let’s say you want to dump the database of a Wordpress once a day. Here’s a docker-compose.yml that defines a job that will be handled by deck-chores:

version: '2'

services:
  wordpress:
    image: wordpress
  mysql:
    image: mariadb
    volumes:
      - ./database_dumps:/dumps
    labels:
      deck-chores.dump.command: sh -c "mysqldump --all-databases > /dumps/dump-$$(date -Idate)"
      deck-chores.dump.interval: daily

It is however recommended use scripts with a proper shebang for such actions. Their outputs to stdout and stderr as well as their exit code will be logged by deck-chores.

Acknowledgements

It wouldn’t be as charming to write this piece of software without these projects:

Roadmap

0.1

  • also parse image’s labels - omit when magic label is set

0.2

  • parse time units for interval triggers

  • handle a global limit on concurrent jobs

  • print jobs when receiving SIGHUP

  • randomization of interval triggered events

  • maybe add a randomize expression for cron triggers

0.3

  • keep output of job executions

  • a rudimentary web ui

Authors

  • Frank Sachsenheim (maintaining)

History

unreleased

  • new: set log format per :envvar:LOG_FORMAT

  • new: an options label to set behavioural flags

  • new: containers can be identified as a service by configurable labels

  • new: job definitions for further containers of a service are ignored

    (default, opt-out can be configured)

  • new: image labels can also be parsed for job definitions

    (default, opt-out can be configured)

0.1.beta1 (2016-12-04)

  • First release with full documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deck-chores-0.1b2.tar.gz (31.6 kB view hashes)

Uploaded Source

Built Distribution

deck_chores-0.1b2-py3-none-any.whl (14.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page