<commit_before>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/en/latest/
* 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 <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.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
-------

- <NAME> (maintaining)<commit_msg>README: Adds authors and a badge w/ Docker Hub pulls.<commit_after>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/en/latest/
* 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 <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.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
-------

- <NAME> (maintaining)
- aeri4list
- alpine-digger
- <NAME>
{'fraction_non_alphanumeric': 0.1299626739056668, 'fraction_numerical': 0.003902273498473023, 'mean_word_length': 3.281045751633987, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 24, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5465473', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1755, 'n_words': 575}