Metadata-Version: 2.4
Name: ewoksjob
Version: 1.3.2
Summary: Asynchronous and distributed scheduling of Ewoks workflows from python
Author-email: ESRF <dau-pydev@esrf.fr>
License: # MIT License
        
        **Copyright (c) 2021 European Synchrotron Radiation Facility**
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
        the Software, and to permit persons to whom the Software is furnished to do so,
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/
Project-URL: Documentation, https://ewoksjob.readthedocs.io/
Project-URL: Repository, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/
Project-URL: Issues, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/issues
Project-URL: Changelog, https://gitlab.esrf.fr/workflow/ewoks/ewoksjob/-/blob/main/CHANGELOG.md
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: celery[tblib]>=5.5
Requires-Dist: ewoksutils[full]>=1.6.0
Requires-Dist: pyyaml
Provides-Extra: worker
Requires-Dist: ewokscore>=3.0.0; extra == "worker"
Requires-Dist: ewoks>=0.3; extra == "worker"
Provides-Extra: redis
Requires-Dist: redis!=5.3.0b1,!=5.3.0b3; extra == "redis"
Provides-Extra: sql
Requires-Dist: sqlalchemy; extra == "sql"
Provides-Extra: monitor
Requires-Dist: flower; extra == "monitor"
Provides-Extra: slurm
Requires-Dist: pyslurmutils>=1.0; extra == "slurm"
Requires-Dist: gevent; extra == "slurm"
Provides-Extra: beacon
Requires-Dist: blissdata; extra == "beacon"
Provides-Extra: blissclient
Requires-Dist: ewoksjob[redis]; extra == "blissclient"
Requires-Dist: ewoksjob[beacon]; extra == "blissclient"
Provides-Extra: blissworker
Requires-Dist: ewoksjob[worker]; extra == "blissworker"
Requires-Dist: ewoksjob[redis]; extra == "blissworker"
Requires-Dist: ewoksjob[beacon]; extra == "blissworker"
Requires-Dist: ewoksjob[slurm]; extra == "blissworker"
Requires-Dist: ewoksjob[monitor]; extra == "blissworker"
Requires-Dist: ewoks[esrf-data-portal]; extra == "blissworker"
Requires-Dist: blissdata[tango]; extra == "blissworker"
Provides-Extra: test
Requires-Dist: ewoksjob[blissworker]; extra == "test"
Requires-Dist: ewoksjob[sql]; extra == "test"
Requires-Dist: pytest>=7; extra == "test"
Requires-Dist: pytest-celery; extra == "test"
Requires-Dist: pytest-redis; extra == "test"
Requires-Dist: mirakuru<3; python_version < "3.10" and extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: tzdata; extra == "test"
Requires-Dist: pytest-timeout; extra == "test"
Provides-Extra: dev
Requires-Dist: ewoksjob[test]; extra == "dev"
Requires-Dist: black>=25; extra == "dev"
Requires-Dist: flake8>=4; extra == "dev"
Requires-Dist: isort; extra == "dev"
Provides-Extra: doc
Requires-Dist: ewoksjob[worker]; extra == "doc"
Requires-Dist: ewoksjob[redis]; extra == "doc"
Requires-Dist: sphinx>=4.5; extra == "doc"
Requires-Dist: sphinx-autodoc-typehints>=1.16; extra == "doc"
Requires-Dist: pydata_sphinx_theme<0.15; extra == "doc"
Requires-Dist: sphinx-copybutton; extra == "doc"
Dynamic: license-file

# 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
```

Submit a workflow on the client side

```python
from ewoksjob.client import submit

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

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/
