Plugin SDK for Python for the Arcaflow workflow engine
Project description
Python SDK for the Arcaflow workflow engine (WIP)
How this SDK works
In order to create an Arcaflow plugin, you must specify a schema for each step you want to support. This schema describes two things:
- What your input parameters are and what their type is
- What your output parameters are and what their type is
Note, that you can specify several possible outputs, depending on what the outcome of your plugin execution is. You should, however, never raise exceptions that bubble outside your plugin. If you do, your plugin will crash and Arcaflow will not be able to retrieve the result data, including the error, from it.
With the schema, the plugin can run in the following modes:
- CLI mode, where a file with the data is loaded and the plugin is executed
- GRPC mode (under development) where the plugin works in conjunction with the Arcaflow Engine to enable more complex workflows
For a detailed description please see the Arcalot website.
Requirements
In order to use this SDK you need at least Python 3.9.
Run the example plugin
In order to run the example plugin run the following steps:
- Checkout this repository
- Create a
venv
in the current directory withpython3 -m venv $(pwd)/venv
- Activate the
venv
by runningsource venv/bin/activate
- Run
pip install -r requirements.txt
- Run
./example_plugin.py -f example.yaml
This should result in the following placeholder result being printed:
output_id: success
output_data:
message: Hello, Arca Lot!
Generating a JSON schema file
Arcaflow plugins can generate their own JSON schema for both the input and the output schema. You can run the schema generation by calling:
./example_plugin.py --json-schema input
./example_plugin.py --json-schema output
If your plugin defines more than one step, you may need to pass the --step
parameter.
Note: The Arcaflow schema system supports a few features that cannot be represented in JSON schema. The generated schema is for editor integration only.
Generating documentation
- Checkout this repository
- Create a
venv
in the current directory withpython3 -m venv $(pwd)/venv
- Activate the
venv
by runningsource venv/bin/activate
- Run
pip install -r requirements.txt
- Run
pip install sphinx
- Run
pip install sphinx-rtd-theme
- Run
sphinx-apidoc -o docs/ -f -a -e src/ --doc-project "Python SDK for Arcaflow"
- Run
make -C docs html
Developing your plugin
We have a detailed guide on developing Python plugins on the Arcalot website.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file arcaflow_plugin_sdk-0.14.3.tar.gz
.
File metadata
- Download URL: arcaflow_plugin_sdk-0.14.3.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 496e9fba5931d4957bddfcc15286d4ab51b780d48fbd6955d97dfea45eac8a1b |
|
MD5 | bcb284347e6f81d892dcbc0199c79f86 |
|
BLAKE2b-256 | a4cc399c1544b08906acb135b1cf4be70740413af49990f93b0b705ff0dd95cf |
File details
Details for the file arcaflow_plugin_sdk-0.14.3-py3-none-any.whl
.
File metadata
- Download URL: arcaflow_plugin_sdk-0.14.3-py3-none-any.whl
- Upload date:
- Size: 65.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53eb69114753854a2774265b9a262d900b1cce90eec8f1e585d209820c07f71d |
|
MD5 | 90e48ae4f2c64a61ac74f6b04209d654 |
|
BLAKE2b-256 | 6b58b62e695c03bf7968c3706b7adb199126823be71f7f2f773b6ff59555422a |