Metadata-Version: 2.1
Name: ewoksjob
Version: 0.3.2
Summary: Asynchronous and distributed scheduling of Ewoks workflows from python
Home-page: https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/
Author: ESRF
Author-email: wout.de_nolf@esrf.fr
License: MIT
Project-URL: Source, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/
Project-URL: Documentation, https://ewoksjob.readthedocs.io/
Project-URL: Tracker, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/issues/
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: celery[tblib]!=5.3.0rc1,>=5
Requires-Dist: kombu!=5.3.0rc1,!=5.3.0rc2
Requires-Dist: importlib-metadata<5.0; python_version < "3.8"
Requires-Dist: ewoksutils>=0.1.1
Provides-Extra: worker
Requires-Dist: ewokscore>=0.5; extra == "worker"
Requires-Dist: ewoks>=0.3; extra == "worker"
Provides-Extra: redis
Requires-Dist: redis<5; extra == "redis"
Provides-Extra: sql
Requires-Dist: sqlalchemy<2; extra == "sql"
Provides-Extra: monitor
Requires-Dist: flower; extra == "monitor"
Provides-Extra: slurm
Requires-Dist: pyslurmutils>=0.1.0rc; extra == "slurm"
Requires-Dist: gevent; extra == "slurm"
Provides-Extra: beacon
Requires-Dist: blissdata; extra == "beacon"
Provides-Extra: blissworker
Requires-Dist: ewokscore>=0.5; extra == "blissworker"
Requires-Dist: ewoks>=0.3; extra == "blissworker"
Requires-Dist: redis<5; extra == "blissworker"
Requires-Dist: blissdata; extra == "blissworker"
Requires-Dist: pyslurmutils>=0.1.0rc; extra == "blissworker"
Requires-Dist: gevent; extra == "blissworker"
Requires-Dist: flower; extra == "blissworker"
Requires-Dist: ewoks[esrf-data-portal]; extra == "blissworker"
Provides-Extra: test
Requires-Dist: ewokscore>=0.5; extra == "test"
Requires-Dist: ewoks>=0.3; extra == "test"
Requires-Dist: redis<5; extra == "test"
Requires-Dist: blissdata; extra == "test"
Requires-Dist: pyslurmutils>=0.1.0rc; extra == "test"
Requires-Dist: gevent; extra == "test"
Requires-Dist: flower; extra == "test"
Requires-Dist: ewoks[esrf-data-portal]; extra == "test"
Requires-Dist: sqlalchemy<2; extra == "test"
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-celery; extra == "test"
Requires-Dist: pytest-redis; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Provides-Extra: dev
Requires-Dist: ewokscore>=0.5; extra == "dev"
Requires-Dist: ewoks>=0.3; extra == "dev"
Requires-Dist: redis<5; extra == "dev"
Requires-Dist: blissdata; extra == "dev"
Requires-Dist: pyslurmutils>=0.1.0rc; extra == "dev"
Requires-Dist: gevent; extra == "dev"
Requires-Dist: flower; extra == "dev"
Requires-Dist: ewoks[esrf-data-portal]; extra == "dev"
Requires-Dist: sqlalchemy<2; extra == "dev"
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-celery; extra == "dev"
Requires-Dist: pytest-redis; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: black>=22; extra == "dev"
Requires-Dist: flake8>=4; extra == "dev"
Provides-Extra: doc
Requires-Dist: ewokscore>=0.5; extra == "doc"
Requires-Dist: ewoks>=0.3; extra == "doc"
Requires-Dist: redis<5; extra == "doc"
Requires-Dist: sphinx>=4.5; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"

# ewoksjob

Utilities for job scheduling of [ewoks](https://ewoks.readthedocs.io/) workflows.

Ewoksjob provides an ewoks interface for asynchronous and distributed scheduling of [ewoks](https://ewoks.readthedocs.io/) from python.

Note that *ewoksjob* distributes the execution of workflows while [ewoksdask](https://ewoks.readthedocs.io/)
distributes the execution of tasks in a workflow. So in the context of workflows, job scheduling exists on two levels.

The primary clients that need to schedule workflows are
* [Ewoksserver](https://gitlab.esrf.fr/workflow/ewoks/ewoksserver): web backend for ewoks.
* [Bliss](https://gitlab.esrf.fr/bliss/bliss): the ESRF beamline control system.
* [Daiquiri](https://gitlab.esrf.fr/ui/daiquiri): web backend for Bliss.

## Installation

Install on the client side

```bash
pip install ewoksjob
```

Install on the worker side

```bash
pip install ewoksjob[worker]
```

## Getting started

Start a worker pool that can execute ewoks graphs

```bash
ewoksjob worker
```

Start a workflow on the client side

```python
from ewoksjob.client import submit

workflow = {"graph": {"id": "mygraph"}}
future = submit(args=(workflow,))
result = future.get()
```

Note that both environments need to be able to import `celeryconfig` which
contains celery configuration (mainly the message broker and result backend URL's).

## Hello world example

Clone the git repository and start a worker pool

```bash
scripts/worker.sh --sql
```

Submit workflows

```bash
scripts/runjobs.sh --sql
```

## Tests

```bash
pytest --pyargs ewoksjob
```

To run the redis tests you need `redis-server` (e.g. `conda install redis-server`).

## Documentation

https://ewoksjob.readthedocs.io/
