Job scheduler for Docker containers, configured via labels.
Frank Sachsenheim 1ab6e28a9b Code formatted with black 1 month ago
deck_chores Code formatted with black 1 month ago
docs Makes some parts of the docs more explicit 3 months ago
hooks Changes version detection in hooks/build again 3 months ago
tests Code formatted with black 1 month ago
.dockerignore Do not include scripts from /hooks in images 1 year ago
.gitignore Uses the Docker Python SDK 2.4 10 months ago
.pyup.yml create pyup.io config file 1 year ago
.readthedocs.yml docs: Adds config for rtd to build w/ Python 3.6 4 months ago
.travis.yml Drops tests with Python 3.5 11 months ago
CONTRIBUTING.rst Code formatted with black 1 month ago
Dockerfile Some updates of the build process. 4 months ago
Dockerfile-dev Some updates of the build process. 4 months ago
HISTORY.rst Bumps to version 0.2 3 months ago
LICENSE Initial commit 1 year ago
MANIFEST.in Fixes and simplifies how build metadata is obtained. 4 months ago
Makefile Code formatted with black 1 month ago
README.rst Uses just the doc's domain as reference in the README 3 months ago
mypy.ini Streamlines tox.ini 1 year ago
requirements-dev.txt Code formatted with black 1 month ago
setup.py Code formatted with black 1 month ago
tox.ini Adds test coverage report w/o constraint yet 10 months ago

README.rst

deck-chores
===========

.. image:: https://img.shields.io/docker/pulls/funkyfuture/deck-chores.svg
:target: https://hub.docker.com/r/funkyfuture/deck-chores/

.. image:: https://images.microbadger.com/badges/image/funkyfuture/deck-chores.svg
:target: https://microbadger.com/images/funkyfuture/deck-chores

.. image:: https://img.shields.io/pypi/v/deck-chores.svg
:target: https://pypi.python.org/pypi/deck-chores

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

* Documentation: https://deck-chores.readthedocs.io
* Image repository: https://hub.docker.com/r/funkyfuture/deck-chores
* Code repository: https://github.com/funkyfuture/deck-chores
* Issue tracker: https://github.com/funkyfuture/deck-chores/issues
* Free software: ISC license


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
- multi-architecture image supports ``amd64`` and ``armv7l`` platforms, no emulator involved


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*:

.. code-block:: yaml

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 to 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*.


Limitations
-----------

At the moment *deck-chores* is designed to run on a single Docker node, not
within a cluster of these. Code and documentation contribution covering this
are highly encouraged.


Acknowledgements
----------------

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

* `APScheduler `_ for managing jobs
* `cerberus `_ for processing metadata
* `docker-py `_ for Docker interaction
* `flake8 `_, `mypy `_,
`pytest `_ and `tox `_ for testing
* `Python `_


Roadmap
-------

0.3
...

- parse time units for interval triggers
- handle a global limit on concurrent jobs
- print jobs when receiving SIGUSR1
- support for configuring APScheduler's jitter option on Cron- & IntervalTrigger


0.4
...

- keep output of job executions
- a rudimentary web ui


Authors
-------

- Frank Sachsenheim (maintaining)
- aeri4list
- alpine-digger
- Brynjar Smári Bjarnason