Metadata-Version: 2.1
Name: ewoksserver
Version: 0.0.4b0
Summary: Backend for ewoksweb
Home-page: https://gitlab.esrf.fr/workflow/ewoks/ewoksserver
Author: ESRF
License: MIT
Project-URL: Source, https://gitlab.esrf.fr/workflow/ewoks/ewoksserver
Project-URL: Documentation, https://workflow.gitlab-pages.esrf.fr/ewoks/ewoksserver
Project-URL: Tracker, https://gitlab.esrf.fr/workflow/ewoks/ewoksserver/issues
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: frontend
Provides-Extra: test
Provides-Extra: dev
Provides-Extra: doc
License-File: LICENSE.md

# ewoksserver

ewoksserver is a REST server to manage and execute [ewoks](https://ewoks.readthedocs.io/) workflows.

It serves as a backend for [ewoksweb](https://ewoksweb.readthedocs.io/) and emits ewoks execution events over websocket.

## Development

Install from source

```bash
python3 -m pip install -e .[dev]
```

Run tests

```bash
pytest
```

Launch the backend

```bash
ewoks-server
```

or for an installation with the system python

```bash
python3 -m ewoksserver.server
```

## Configuration

The configuration keys are uppercase variables in a python script:

```python
# /tmp/config.py
RESOURCE_DIRECTORY = "/path/to/resource/directory/"

EWOKS = {"handlers": ...}

CELERY = {"broker_url":...}
```

Specify the configuration file through the CLI

```bash
ewoks-server --config /tmp/config.py
```

or using the environment variable EWOKSSERVER_SETTINGS

```bash
export EWOKSSERVER_SETTINGS=/tmp/config.py
ewoks-server
```

### Example

```python
import os

_SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))

RESOURCE_DIRECTORY = os.path.join(_SCRIPT_DIR, "resources")

EWOKS = {
    "handlers": [
        {
            "class": "ewokscore.events.handlers.Sqlite3EwoksEventHandler",
            "arguments": [
                {
                    "name": "uri",
                    "value": "file:" + os.path.join(_SCRIPT_DIR, "ewoks_events.db"),
                }
            ],
        }
    ]
}
```

## Documentation

https://ewoksserver.readthedocs.io/
