Metadata-Version: 2.0
Name: deck-chores
Version: 0.1b2
Summary: Job scheduler for Docker containers, configured via container labels.
Home-page: https://github.com/funkyfuture/deck_chores
Author: Frank Sachsenheim
Author-email: funkyfuture@riseup.net
License: ISC license
Keywords: docker,cron,scheduler,jobs
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: ISC License (ISCL)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Dist: APScheduler
Requires-Dist: cerberus
Requires-Dist: docker-py
Requires-Dist: fasteners

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

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

* Documentation: http://deck-chores.rtfd.io
* 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


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

* `APScheduler <https://apscheduler.readthedocs.io>`_ for managing jobs
* `cerberus <http://python-cerberus.org>`_ for processing metadata
* `docker-py <https://docker-py.readthedocs.io>`_ for Docker interaction
* `flake8 <http://flake8.pycqa.org/>`_, `mypy <http://mypy-lang.org>`_,
  `pytest <http://pytest.org>`_ and `tox <https://tox.readthedocs.io>`_ for testing
* `Python <https://python.org>`_


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


