Skip to main content

No project description provided

Project description

iwf-python-sdk

Python SDK for iWF workflow engine

pip install iwf-python-sdk==0.2.0

See samples for use case examples.

Requirements

Concepts

To implement a workflow, the two most core interfaces are

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:

  1. Before installing Poetry, create and activate a new Conda env (e.g. conda create -n langchain python=3.9)
  2. Install Poetry (see above)
  3. Tell Poetry to use the virtualenv python environment (poetry config virtualenvs.prefer-active-python true)
  4. 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:

mkdir iwf/iwf_api/iwf_api
cd iwf && poetry run openapi-python-client update --path ../iwf-idl/iwf-sdk.yaml --config .openapi-python-client-config.yaml
cd .. && cp -R iwf/iwf_api/iwf_api/* iwf/iwf_api && rm -R iwf/iwf_api/iwf_api && poetry update

The last command will:

  • 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

iwf_python_sdk-0.7.0.tar.gz (69.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iwf_python_sdk-0.7.0-py3-none-any.whl (163.3 kB view details)

Uploaded Python 3

File details

Details for the file iwf_python_sdk-0.7.0.tar.gz.

File metadata

  • Download URL: iwf_python_sdk-0.7.0.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.9.21 Linux/6.8.0-1021-azure

File hashes

Hashes for iwf_python_sdk-0.7.0.tar.gz
Algorithm Hash digest
SHA256 bcef86826ca6423066f018d314216875f09e35c139099493625634a3682becbe
MD5 9719e0d8ea104f69307dfa7a00f6d2a7
BLAKE2b-256 ef9b40bcbd96f765d30fe81e84bb3f04e2f7c84eab1dceab21da6316b00b8742

See more details on using hashes here.

File details

Details for the file iwf_python_sdk-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: iwf_python_sdk-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 163.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.9.21 Linux/6.8.0-1021-azure

File hashes

Hashes for iwf_python_sdk-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 577630f7a7799339bf7e7c06d147127f5af341365de1b5d324edc931a0ea4b00
MD5 56eb43523b931906e1585224f3969077
BLAKE2b-256 73fbd13c8e21a13b6a8feb1ccab3aae8cdadbe5fb2acbff88f22168217e4201f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page