File: job.rst

package info (click to toggle)
python-ewoks 0.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 552 kB
  • sloc: python: 1,311; makefile: 5
file content (76 lines) | stat: -rw-r--r-- 1,664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Submit a job to a worker
========================

The client may want to start a workflow execution remotely and wait for the result
while doing other work.

Installation
------------

Install on the client side

.. code:: bash

    pip install ewoksjob[redis]

Install on the worker side

.. code:: bash

    pip install ewoksjob[worker,redis,monitor]

The communication between client and worker goes through *Redis*, *RabbitMQ* or *Sqlite3*.
Depending on which one you choose, the `redis` installation option may vary. Both client and
worker need access to a configuration that specifies the URL of the database and/or broker.
For more information see the `ewoksjob documentation <https://ewoksjob.readthedocs.io/>`_.

Start a workflow
-----------------

Start a worker that can execute *ewoks* graphs

.. code:: bash

    ewoksjob worker

Start a workflow from python, possible from another machine

.. code:: python

    from ewoksjob.client import submit

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

Start a workflow from the command line, possible from another machine

.. code:: bash

    ewoks submit empty --test

Start a workflow in *BLISS*
---------------------------

In the context of *Bliss*

.. code:: bash

    BEACON_HOST=hostname:25000 ewoksjob worker

Submit a workflow as usual

.. code:: bash

    BEACON_HOST=hostname:25000 ewoks submit empty --test

The environment variables are needed for communication between worker and client via the message broker.

Workflow monitoring
-------------------

Start a web server for monitoring jobs

.. code:: bash

    ewoksjob monitor