Pipekit Python SDK
Project description
Pipekit allows you to manage your workflows at scale. The control plane configures Argo Workflows for you in your infrastructure, enabling you to optimize multi-cluster workloads while reducing your cloud spend. The team at Pipekit is also happy to support you through your Argo Workflows journey via commercial support.
Pipekit Python SDK
Installation
pip install pipekit-sdk
Usage
from hera.workflows import (
DAG,
Parameter,
Script,
Workflow,
)
from pipekit_sdk.service import PipekitService
# Create a Pipekit service that is used to talk to the Pipekit API
pipekit = PipekitService(token="<Bearer Token>")
# List clusters and Pipes
clusters = pipekit.list_clusters()
pipes = pipekit.list_pipes()
# Create a Workflow and submit it to Pipekit.
# Hera's dag-diamond example
def my_print_script(message):
print(message)
def get_script(callable):
# Note that we have the _option_ to set `inputs=Parameter(name="message")`, but
# Hera infers the Parameters that are necessary based on the passed-in callable.
return Script(
name=callable.__name__.replace("_", "-"),
source=callable,
add_cwd_to_sys_path=False,
image="python:alpine3.6",
)
with Workflow(
generate_name="dag-diamond-",
entrypoint="diamond",
namespace="default",
) as w:
echo = get_script(my_print_script)
with DAG(name="diamond"):
A = echo(name="A", arguments=[Parameter(name="message", value="A")])
B = echo(name="B", arguments=[Parameter(name="message", value="B")])
C = echo(name="C", arguments=[Parameter(name="message", value="C")])
D = echo(name="D", arguments=[Parameter(name="message", value="D")])
A >> [B, C] >> D
# Submit the Workflow to Pipekit
pipe_run = pipekit.submit(w, "<cluster-name>")
# Tail the logs
pipekit.print_logs(pipe_run["uuid"])
Further help
Please refer to the Pipekit Documentation for more information.
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
pipekit_sdk-1.1.0.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for pipekit_sdk-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f33bb594d2a9bf762f18fbc9e2af8c1c934e16b67a10c054ac2620e1719229c |
|
MD5 | 1a29f26a56b1896ea431823e0cca53e1 |
|
BLAKE2b-256 | 51a50429756cf15749d4395feb5668c8503150bc930d188f2738374234c273df |