Using with Hera
Pair the Pipekit CLI with Hera workflows and the Pipekit Python SDK.
Generate a token
pipekit login # one-time
pipekit hera # prints a token to stdoutpipekit hera -rUse the token in Python
from pipekit_sdk.service import PipekitService
import os
pipekit = PipekitService(token=os.environ["PIPEKIT_TOKEN"])from hera.workflows import DAG, Workflow, script
@script(image="python:3.12")
def echo(message):
print(message)
with Workflow(
generate_name="dag-diamond-",
entrypoint="diamond",
namespace="argo",
service_account_name="argo-workflow",
) 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
pipe_run = pipekit.submit(w, "<cluster-name>")
print(pipe_run["uuid"])CronWorkflows with Hera
Token lifetime
Last updated