hera
Hera makes Python code easy to orchestrate on Argo Workflows through native Python integrations. It lets you construct and submit your Workflows entirely in Pyt
What is hera?
Hera makes Python code easy to orchestrate on Argo Workflows through native Python integrations. It lets you construct and submit your Workflows entirely in Python. ⭐️ Remember to star!
Overview of hera
What it is
Hera is a Python SDK for Argo Workflows that enables constructing and submitting workflows entirely in Python. It turns Python functions into containerised templates that run on Kubernetes, providing native Python integration with Argo Workflows.
Key features
- Script decorator to convert Python functions into reusable Argo Workflows script templates - DAG construction using Python context managers and operators (e.g.,
>>) - Direct workflow submission to an Argo Workflows cluster via
w.create() - Authentication support through Bearer tokens or the
ArgoCLITokenGenerator - Optional YAML output for GitOps practices and debugging - CLI (experimental) for converting workflows between YAML and Python source code - Async client support via
hera[async-client]for asynchronous workflow operations
Use cases
- Data science workflows (as presented at KubeCon/ArgoCon NA 2024)
- Orchestrating rocket simulations (KubeCon/ArgoCon NA 2023)
- Training large language models (KubeCon/ArgoCon NA 2023)
- Scaling gene therapy research (KubeCon/ArgoCon EU 2023)
- Migrating data pipelines to Argo Workflows (DoKC Town Hall #2)
Getting started
Install Hera from PyPI: pip install hera The following example creates and submits a simple workflow using the @script decorator and a DAG: python from hera.workflows import DAG, Workflow, script @script() def echo(message: str): print(message) with Workflow( generate_name='dag-diamond-', entrypoint='diamond', ) as w: with DAG(name='diamond'): A = echo(name='A', arguments={'message': 'A'}) B = echo(name='B', arguments={'message': 'B'}) C = echo(name='C', arguments={'message': 'C'}) D = echo(name='D', arguments={'message': 'D'}) A >> [B, C] >> D w.create() An Argo Workflows server must be deployed to a Kubernetes cluster. For authentication, see the repository README.
License and pricing
Hera is licensed under Apache 2.0 and is open source.
Based on the project's public README and repository metadata.