Community Maintained Python client for Argo Workflows
Project description
Argo Workflows Python Client
Python client for Argo Workflows
Installation
pip install argo-workflows
Usage
If you're familiar with Kubernetes client, the Argo client follows the same behaviour.
from argo.workflows.client import V1alpha1Api
from argo.workflows.config import load_kube_config
load_kube_config() # loads local configuration from ~/.kube/config
And to list Workflows from a namespace (say argo
):
v1alpha1 = V1alpha1Api()
wfs = v1alpha1.list_namespaced_workflows(namespace="argo")
To submit a Workflow
, one would simply load it from a YAML* and submit it as such:
import requests
import yaml
namespace = "argo"
# hello-world example
resp = requests.get("https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml")
resp.raise_for_status()
manifest: dict = yaml.safe_load(resp.text)
# Submit the Workflow to the `argo` namespace
v1alpha1.create_namespaced_workflow(namespace, manifest)
When working on a higher level of abstraction, check out the following projects:
- Argo Python DSL provides a pythonic workflow interface that can be extended to your specific needs (such as Data Science, ETL, etc)
- Couler provides a simplified and unified interface for constructing and managing workflows
Versioning
The client is generated from the Argo and Kubernetes OpenAPI specification.
We follow semantic versioning, the client starts at version 1.0
which matches Argo release 2.3.0
and continues onwards.
Current Version Mapping
Argo Python SDK: 3.6 Argo: 2.11.7 Kubernetes:
Key:
✓
Exactly the same features / API objects in both client-python and the Kubernetes version.+
client-python has features or api objects that may not be present in the Kubernetes cluster, but everything they have in common will work.-
The Kubernetes cluster has features the client-python library can't use (additional API objects, etc).
We try to be consistent with Argo as much as possible and hence we created special branches for user convenience --- for example argo/v2.4.0 is identical with Argo release v2.10.2.
These can be then installed directly from github:
pip install -e "git+https://github.com/argoproj-labs/argo-client-python.git@argo/v2.10.2#egg=argo-workflows"
Code generation
The generated SDK will correspond to the argo version specified in the ARGO_VERSION file.
If you wish to generate code yourself, you can do so by reproducing the build environment (image): make builder_image
, then running make builder_make
to generate the client.
Dependencies
Usually these will be kept up to date (or at least in sync in the branch named after the argo version that you are looking for)
- a compatible
KUBERNETES_BRANCH
according to Argo's Gopkg.toml - a compatible version of kubernetes-client
- requirements.txt and Pipfile
For additional configuration check out the Makefile.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file argo-workflows-3.6.0.tar.gz
.
File metadata
- Download URL: argo-workflows-3.6.0.tar.gz
- Upload date:
- Size: 237.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4d502c600d0fe7d1609eaa90223bc0212f4e5ef013628238aacc38728d64a3 |
|
MD5 | 9e6bbcd03964dd9daaa7f7ddf6aa04d3 |
|
BLAKE2b-256 | 6f9070eee8bd3fe1bbe8da5be32110e9f7f7bf40caed6b97d2e32627a472a582 |
File details
Details for the file argo_workflows-3.6.0-py3-none-any.whl
.
File metadata
- Download URL: argo_workflows-3.6.0-py3-none-any.whl
- Upload date:
- Size: 403.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a9c6ddb942119dde0b3f7f64f5de9c1f5a7ef3e9c97ff54b13161c1e6fa1249 |
|
MD5 | 161e9bf7316252b43449495ca0223f0c |
|
BLAKE2b-256 | fd281b9e95f35aaf4262ec363eaf16c2d5b8a560f9b9604573f376cb49d6e906 |