Skip to main content

Hera is a Python framework for constructing and submitting Argo Workflows. The main goal of Hera is to make Argo Workflows more accessible by abstracting away some setup that is typically necessary for constructing Argo workflows.

Reason this release was yanked:

Bad release with a bug that causes Hera to not work with a live cluster due to strict pydantic schema. Please update to 5.10.1 instead.

Project description

Hera

Hera is a Python framework for constructing and submitting Argo Workflows. The main goal of Hera is to make the Argo ecosystem accessible by simplifying workflow construction and submission.

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.

Links

Open in GitHub Codespaces

Open in Gitpod

CICD Docs codecov License: MIT

Pypi Versions

CondaForge

PyPi stats for hera

Downloads Downloads/month Downloads/week

PyPi stats for hera-workflows

⚠ Note ⚠ The hera-workflows package is deprecated since the project renamed to Hera for V5. Please install from the hera PyPi package.

Downloads Downloads/month Downloads/week

Hera at a glance

Steps diamond

from hera.workflows import Steps, Workflow, script

@script()
def echo(message: str):
    print(message)

with Workflow(
    generate_name="single-script-",
    entrypoint="steps",
) as w:
    with Steps(name="steps") as s:
        echo(name="A", arguments={"message": "I'm a step"})
        with s.parallel():
            echo(name="B", arguments={"message": "We're steps"})
            echo(name="C", arguments={"message": "in parallel!"})
        echo(name="D", arguments={"message": "I'm another step!"})

w.create()

DAG diamond

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()

See the examples for a collection of Argo workflow construction and submission via Hera!

Requirements

Hera requires an Argo server to be deployed to a Kubernetes cluster. Currently, Hera assumes that the Argo server sits behind an authentication layer that can authenticate workflow submission requests by using the Bearer token on the request. To learn how to deploy Argo to your own Kubernetes cluster you can follow the Argo Workflows guide!

Another option for workflow submission without the authentication layer is using port forwarding to your Argo server deployment and submitting workflows to localhost:2746 (2746 is the default, but you are free to change it). Please refer to the documentation of Argo Workflows to see the command for port forward!

Note Since the deprecation of tokens being automatically created for ServiceAccounts and Argo using Bearer tokens in place, it is necessary to use --auth=server and/or --auth=client when setting up Argo Workflows on Kubernetes v1.24+ in order for hera to communicate to the Argo Server.

Authenticating in Hera

There are a few ways to authenticate in Hera - read more in the authentication walk through - for now, with the argo cli tool installed, 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

Note Hera went through a name change - from hera-workflows to hera. This is reflected in the published Python package. If you'd like to install versions prior to 5.0.0, you have to use hera-workflows. Hera currently publishes releases to both hera and hera-workflows for backwards compatibility purposes.

Source Command
PyPi pip install hera
PyPi pip install hera-workflows
Conda conda install -c conda-forge hera-workflows
GitHub repo python -m pip install git+https://github.com/argoproj-labs/hera --ignore-installed/pip install .

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.

Presentations

Blogs

Contributing

See the contributing guide!

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

hera-5.10.0.tar.gz (271.3 kB view details)

Uploaded Source

Built Distribution

hera-5.10.0-py3-none-any.whl (313.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hera-5.10.0.tar.gz
  • Upload date:
  • Size: 271.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for hera-5.10.0.tar.gz
Algorithm Hash digest
SHA256 05f1e6714d5f998cd7aacb50bb63dcac2cff4ed5459fa20a4f272f3eb08b5750
MD5 c3b5606ab8c5ab80d11c6d1668a0a802
BLAKE2b-256 441c3f5daceb6b97734d4273ba93cbd08612823eedb15becaa4d71ec77e2d9c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hera-5.10.0-py3-none-any.whl
  • Upload date:
  • Size: 313.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for hera-5.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e64b3fbfe32098f6201f20688cf7857949f35bd9f782e05860cdc311a30d4bb7
MD5 1966ff0adcfb4486c9fc295879173276
BLAKE2b-256 0cd4ae1f3ec3a4d69fd7a7358e126e98c77873099f9227251010585544276be6

See more details on using hashes here.

Supported by

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