Skip to main content

Hera

Hera mascot Hera is the go-to Python SDK to make Argo Workflows simple and intuitive. Easily turn Python functions into containerised templates that run on Kubernetes, with full access to its capabilities.

See the Quick Start guide to start using Hera to orchestrate your Argo Workflows!

The Argo was constructed by the shipwright Argus,
and its crew were specially protected by the goddess Hera.

PyPI stats

PyPI Versions

Downloads Downloads/month Downloads/week

Repo information

License: Apache-2.0 CICD Docs codecov

Hera at a glance

from hera.workflows import DAG, Workflow, script


# Turn a function into a reusable "Script template"
# using the script decorator
@script()
def echo(message: str):
    print(message)


# Orchestration logic lives *outside* of business logic
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  # Define execution order

# Create the workflow directly on your Argo Workflows cluster!
w.create()

Check out the Walkthrough to learn how to construct and submit Argo Workflows with Hera!

Requirements

Hera requires an Argo Workflows server to be deployed to a Kubernetes cluster. To learn how to deploy Argo to your own Kubernetes cluster you can follow the Argo Workflows guide!

Authenticating in Hera

Hera assumes that the Argo server sits behind an authentication layer, so workflow submission requests are authenticated using a Bearer token on the request. Another option for workflow submission without the authentication layer is using port forwarding to your Argo server deployment and submitting workflows to localhost:2746.

There are a few ways to authenticate in Hera - read more in the authentication walkthrough - for now, with the argo cli tool installed, and the server port-forwarded to localhost:2746, this example will get you up and running:

from hera.workflows import Workflow, Container
from hera.shared import global_config
from hera.auth import ArgoCLITokenGenerator

global_config.host = "http://localhost:2746"
global_config.token = ArgoCLITokenGenerator

with Workflow(generate_name="local-test-", entrypoint="c") as w:
    Container(name="c", image="docker/whalesay", command=["cowsay", "hello"])

w.create()

Installation

Source Command
PyPI pip install hera
GitHub repo python -m pip install git+https://github.com/argoproj-labs/hera --ignore-installed

Optional dependencies

yaml

  • Install via hera[yaml]
  • PyYAML is required for the yaml output format, which is accessible via hera.workflows.Workflow.to_yaml(*args, **kwargs). This enables GitOps practices and easier debugging.

cli

  • Install via hera[cli]. The [cli] option installs the extra dependencies including Cappa which is required for the CLI
  • The CLI aims to enable GitOps practices, easier onboarding to Hera, and a more seamless experience with Argo Workflows.
  • It currently supports converting workflows between YAML and Python source codes. See hera generate yaml --help, and hera generate python --help for more information.
  • The CLI is an experimental feature and subject to change!

async-client

  • Install via hera[async-client]. The [async-client] option installs httpx to allow the use of the async_* Workflow functions through the AsyncWorkflowsService.

Presentations

More presentations

Blogs

More blogs

Contributing

Use one of the following to open the repo in a cloud dev box:

Open in GitHub Codespaces Open in Gitpod

Read more in the contributing guide!

Hera Emeritus Maintainers

These emeritus maintainers dedicated a part of their career to Hera and reviewed code, triaged bugs and pushed the project forward over a substantial period of time. Their contribution is greatly appreciated:

License

Hera is licensed under Apache 2.0. See License for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hera-7.1.0.tar.gz (306.7 kB view details)

Uploaded Source

Built Distribution

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

hera-7.1.0-py3-none-any.whl (356.5 kB view details)

Uploaded Python 3

File details

Details for the file hera-7.1.0.tar.gz.

File metadata

  • Download URL: hera-7.1.0.tar.gz
  • Upload date:
  • Size: 306.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for hera-7.1.0.tar.gz
Algorithm Hash digest
SHA256 cf65e390cf1798b2f5ac4a68a53d30051639e8e9e89e9d670d248d6c229a9e89
MD5 ef2ff6e6c6ec08df4d228e1d724e8de5
BLAKE2b-256 0c903f5f605f919f923244e236e53f5971eb26f206b62be6ef547d10e32ddcc2

See more details on using hashes here.

File details

Details for the file hera-7.1.0-py3-none-any.whl.

File metadata

  • Download URL: hera-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 356.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.20

File hashes

Hashes for hera-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1957348f770c06aec1b8f8c10c83b62fc03ec51df3c65208dcff672ff5ed145c
MD5 124ca17d46990b97687bec32cef0b46e
BLAKE2b-256 1642ae0f96054a6326499929bddeddf96bd5282e90e3b56380ec275030a9db2f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

7.1.0 This release

2 files

7.0.0

2 files

6.0.0

2 files

5.27.0

2 files

5.26.1

2 files

5.26.0

2 files

5.25.1

2 files

5.25.0

2 files

5.24.0

2 files

5.23.0

2 files

5.22.0

2 files

5.21.1

2 files

5.21.0

2 files

5.20.1

2 files

5.20.0

2 files

5.19.0

2 files

5.18.0

2 files

5.17.1

2 files

5.17.0

2 files

5.16.3

2 files

5.16.2

2 files

5.16.1

2 files

5.16.0

2 files

5.15.1

2 files

5.15.0

2 files

5.14.4

2 files

5.14.3

2 files

5.14.2

2 files

5.14.1

2 files

5.14.0

2 files

5.13.1

2 files

5.13.0

2 files

5.12.0

2 files

5.11.0

2 files

5.10.1

2 files

5.10.0

2 files

5.9.0

2 files

5.8.0

2 files

5.7.4

2 files

5.7.3

2 files

5.7.2

2 files

5.7.1

2 files

5.7.0

2 files

5.6.0

2 files

5.5.2

2 files

5.5.1

2 files

5.5.0

2 files

5.4.1

2 files

5.4.0

2 files

5.3.0

2 files

5.2.1

2 files

5.2.0

2 files

5.1.7

2 files

5.1.6

2 files

5.1.5

2 files

5.1.4

2 files

5.1.3

2 files

5.1.2

2 files

5.1.1

2 files

5.1.0

2 files

5.0.4

2 files

5.0.3

2 files

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

Supported by

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