No project description provided
Project description
iwf-python-sdk
Python SDK for iWF workflow engine
pip install iwf-python-sdk==0.1.2
See samples for use case examples.
Requirements
- Python 3.9+
- iWF server
Concepts
To implement a workflow, the two most core interfaces are
-
Workflow interface defines the workflow definition
-
WorkflowState interface defines the workflow states for workflow definitions
A workflow can contain any number of WorkflowStates.
See more in https://github.com/indeedeng/iwf#what-is-iwf
Development Plan
1.0 -- the basic and most frequently needed features
- Start workflow API
- Executing
wait_until
/execute
APIs and completing workflow - Parallel execution of multiple states
- GetWorkflowResultsWithWait API
- StateOption: WaitUntil(optional)/Execute API timeout and retry policy
- Get workflow with wait API
- Timer command
- AnyCommandCompleted and AllCommandCompleted waitingType
- InternalChannel command
- DataAttribute
- Stop workflow API
- Improve workflow uncompleted error return(canceled, failed, timeout, terminated)
- Support execute API failure policy
- Support workflow RPC
- Signal command
- Reset workflow API
- Skip timer API for testing/operation
Running iwf-server locally
Option 1: use docker compose
See iwf README
Option 2: VSCode Dev Container
Dev Container is an easy way to get iwf-server running locally. Follow these steps to launch a dev container:
- Install Docker, VSCode, and VSCode Dev Container plugin.
- Open the project in VSCode.
cd iwf-python-sdk code .
- Launch the Remote-Containers: Reopen in Container command from Command Palette (Ctrl + Shift + P). You can also click in the bottom left corner to access the remote container menu.
- Once the dev container starts, iwf-server will be listening on port 8801.
How To Contribute
This project uses Poetry as a dependency manager. Check out Poetry's documentation on how to install it on your system before proceeding.
❗Note: If you use Conda or Pyenv as your environment / package manager, avoid dependency conflicts by doing the following first:
- Before installing Poetry, create and activate a new Conda env (e.g. conda create -n langchain python=3.9)
- Install Poetry (see above)
- Tell Poetry to use the virtualenv python environment (poetry config virtualenvs.prefer-active-python true)
- Continue with the following steps.
To install requirements:
poetry install
Update IDL
Initialize the IDL Git submodule
git submodule update --init --recursive
Update IDL to the latest commit.
git submodule update --remote --merge
Generate API client from IDL
This project uses openapi-python-client to generate an API client from the IDL. To update the generated client:
cd iwf && poetry run openapi-python-client update --path ../iwf-idl/iwf-sdk.yaml --config .openapi-python-client-config.yaml
Then run cd .. && cp -R iwf/iwf_api/iwf_api/* iwf/iwf_api && rm -R iwf/iwf_api/iwf_api && poetry update
to
- Fix the api package path
- Update the local path dependency.
Linting
To run linting for this project:
poetry run pre-commit run --show-diff-on-failure --color=always --all-files
Code of Conduct
This project is governed by the Contributor Covenant v 1.4.1. (Review the Code of Conduct and remove this sentence before publishing your project.)
License
This project uses the Apache 2.0 license. (Update this and the LICENSE file if your project uses a different license.)
Project details
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 iwf_python_sdk-0.1.3.tar.gz
.
File metadata
- Download URL: iwf_python_sdk-0.1.3.tar.gz
- Upload date:
- Size: 65.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b406ad7f1751c2981fc00bb8e9bcbf548ff14b095f380a5e1bf636e49708e78 |
|
MD5 | 4548c53d2a224fe58b51f817712944b3 |
|
BLAKE2b-256 | bc21bfe42a70cd5bcec2ad38e4cf3867fbcb6da691f6c263a874947a1a8ba5ab |
File details
Details for the file iwf_python_sdk-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: iwf_python_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 145.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c11caa8d8a449108c3690673f0b86a030d1b3d2b02422bf2907d76b84313f3 |
|
MD5 | 6926c19c51eae511fbd3f3803ad946c2 |
|
BLAKE2b-256 | 061d494f6cb940f0ec2aa00fc1f12624298efeedde17508e29622eef7d77bbad |