-
Notifications
You must be signed in to change notification settings - Fork 1
Doc: migrate engine pages from ewoks.esrf.fr #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| button.copybtn { | ||
| opacity: 0.3; | ||
| opacity: 0.3; | ||
| } | ||
|
|
||
| button.copybtn:hover { | ||
| opacity: 1; | ||
| opacity: 1; | ||
| } | ||
|
|
||
| .table td.red { | ||
| color: red; | ||
| } | ||
|
|
||
| .table td.green { | ||
| color: green; | ||
| } | ||
|
|
||
| .table td.orange { | ||
| color: orange; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| Choosing an engine for execution | ||
| ================================= | ||
|
|
||
| Ewoks workflows can be executed using several engines, each with its own capabilities: | ||
|
|
||
| - `Dask <https://www.dask.org/>`_: Distributed and parallel computing framework. | ||
| - `Pypushflow <https://pypushflow.readthedocs.io/>`_: Scheduler for acyclic and cyclic task graphs. | ||
| - `Orange <https://orangedatamining.com/>`_: Visual programming and data visualization platform. | ||
|
|
||
| New engines can be added following the :doc:`./new_engine` procedure. | ||
|
|
||
| Using a Supported Engine | ||
| ------------------------ | ||
|
|
||
| To run workflows with a specific engine, install the appropriate extra: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| pip install ewoks[dask] # For Dask | ||
| pip install ewoks[ppf] # For Pypushflow | ||
| pip install ewoks[orange] # For Orange | ||
|
|
||
| If no engine is installed, Ewoks defaults to a basic sequential engine (``"core"``). | ||
|
|
||
| To specify the engine explicitly, use the ``--engine`` option: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| ewoks execute --test demo --engine dask | ||
|
|
||
| .. warning:: | ||
|
|
||
| **Orange execution is GUI-driven** and cannot run without the Orange GUI. | ||
|
|
||
| Running: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| ewoks execute --test demo --engine orange | ||
|
|
||
| ...will open the Orange GUI, where you can edit the workflow. | ||
|
|
||
| To execute it: | ||
|
|
||
| - Double-click on ``task0`` in the workflow. | ||
| - Use the **Trigger** button in the **Task** widget. | ||
|
|
||
| For guidance, see `Orange's getting started docs <https://orangedatamining.com/getting-started/>`_. | ||
|
|
||
|
|
||
| Engine Feature Comparison | ||
| ------------------------- | ||
|
|
||
| Some engines support more advanced features, like loops or GUI interaction: | ||
|
|
||
| .. raw:: html | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The table was a bit painful to migrate. Rather than doing a mix-and-match of RST and HTML, I preferred to use HTML all the way. |
||
|
|
||
| <table class="table"> | ||
| <thead> | ||
| <tr> | ||
| <th>engine</th> | ||
| <th>Loops</th> | ||
| <th>Conditional Links</th> | ||
| <th>Parallel execution</th> | ||
| <th>Interaction (GUI)</th> | ||
| <th>Native support</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td><code>core</code></td> | ||
| <td class="red">✗</td> | ||
| <td class="red">✗</td> | ||
| <td class="red">✗</td> | ||
| <td class="red">✗</td> | ||
| <td class="green">✓</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>dask</code></td> | ||
| <td class="red">✗</td> | ||
| <td class="red">✗</td> | ||
| <td class="green">✓</td> | ||
| <td class="red">✗</td> | ||
| <td class="green">✓</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>ppf</code></td> | ||
| <td class="green">✓</td> | ||
| <td class="green">✓</td> | ||
| <td class="green">✓</td> | ||
| <td class="red">✗</td> | ||
| <td class="green">✓</td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>"orange"</code></td> | ||
| <td class="red">✗</td> | ||
| <td class="red">✗</td> | ||
| <td class="orange">✓</td> | ||
| <td class="green">✓</td> | ||
| <td class="red">✗</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
|
|
||
|
|
||
| .. note:: | ||
|
|
||
| **Native support** means that Ewoks tasks can be executed without modification. | ||
|
|
||
| For Orange, you must wrap each Ewoks task in a corresponding Orange widget. See the | ||
| `Orange widget tutorial <https://ewoksorange.readthedocs.io/en/stable/tutorials/my_first_widget.html>`_ | ||
| in the ``ewoksorange`` documentation. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| Adding a new engine to Ewoks | ||
| ============================ | ||
|
|
||
| This page shows how to create a custom engine named ``"abc"`` which can be used like this | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| ewoks execute --test demo --engine abc | ||
|
|
||
| Create a Python package with the appropriate entry point in ``pyproject.toml``: | ||
|
|
||
| .. code-block:: toml | ||
|
|
||
| [project] | ||
| name = "ewoksabc" | ||
|
|
||
| [project.entry-points."ewoks.engines"] | ||
| "abc" = "ewoksabc.engine:AbcWorkflowEngine" | ||
|
|
||
| Your engine must implement the abstract interface ``WorkflowEngine`` from ``ewokscore``: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| from ewokscore.graph import TaskGraph | ||
| from ewokscore.engine_interface import WorkflowEngine | ||
|
|
||
| class AbcWorkflowEngine(WorkflowEngine): | ||
|
|
||
| def execute_graph(self, graph: TaskGraph, ...) -> Optional[dict]: | ||
| ... | ||
|
|
||
|
|
||
| (Optional) Workflow Serialization Support | ||
| ------------------------------------------ | ||
|
|
||
| If your engine also handles workflow (de)serialization (e.g., from ``.xyz`` files), add another entry point: | ||
|
|
||
| .. code-block:: toml | ||
|
|
||
| [project.entry-points."ewoks.engines.serialization.representations"] | ||
| "xyz" = "ewoksabc.engine:AbcWorkflowEngine" | ||
|
|
||
| Your engine should implement ``WorkflowEngineWithSerialization``: | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| from ewokscore.engine_interface import WorkflowEngineWithSerialization | ||
|
|
||
| class AbcWorkflowEngine(WorkflowEngineWithSerialization): | ||
|
|
||
| def execute_graph(self, graph: TaskGraph, ...) -> Optional[dict]: | ||
| ... | ||
|
|
||
| def deserialize_graph(self, graph: Any, ...) -> TaskGraph: | ||
| ... | ||
|
|
||
| def serialize_graph(self, graph: TaskGraph, ...) -> Any: | ||
| ... | ||
|
|
||
| def get_graph_representation(self, graph: Any) -> Optional[str]: | ||
| ... | ||
|
|
||
| This allows Ewoks to recognize and delegate serialization/deserialization to your engine when the `ewoksabc` package is installed. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.