pipekit-sdk


Namepipekit-sdk JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://pipekit.io
SummaryPipekit Python SDK
upload_time2024-10-11 15:05:16
maintainerNone
docs_urlNone
authorPipekit
requires_python<4,>=3.8
licenseBSD-3-Clause
keywords pipekit hera argo workflows orchestration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Pipekit Logo](https://helm.pipekit.io/assets/pipekit-logo.png)](https://pipekit.io)

[Pipekit](https://pipekit.io) 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

```bash
pip install pipekit-sdk
```

## Usage

```py
# The Pipekit SDK interacts with Hera Workflows classes
from hera.workflows import Container, Step, Steps, Workflow, script
from pipekit_sdk.service import PipekitService

# Create a Pipekit service that is used to talk to the Pipekit API
pipekit = PipekitService(token="<token>")

# List clusters and Pipes
clusters = pipekit.list_clusters()
pipes = pipekit.list_pipes()

@script()
def flip_coin() -> None:
    import random

    result = "heads" if random.randint(0, 1) == 0 else "tails"
    print(result)

# Create a Workflow using Hera
with Workflow(
    generate_name="coinflip-",
    annotations={
        "workflows.argoproj.io/description": (
            "This is an example of coin flip defined as a sequence of conditional steps."
        ),
    },
    entrypoint="coinflip",
    namespace="argo",
    service_account_name="argo",
) as w:
    heads = Container(
        name="heads",
        image="alpine:3.6",
        command=["sh", "-c"],
        args=['echo "it was heads"'],
    )
    tails = Container(
        name="tails",
        image="alpine:3.6",
        command=["sh", "-c"],
        args=['echo "it was tails"'],
    )

    with Steps(name="coinflip") as s:
        fc: Step = flip_coin()

        with s.parallel():
            heads(when=f"{fc.result} == heads")
            tails(when=f"{fc.result} == tails")

# Submit the Workflow to Pipekit
pipekit.submit(w, "<cluster-name>")

# Tail the logs
pipekit.print_logs(pipe_run.uuid)
```

## Further help
Please refer to the [Pipekit Documentation](https://docs.pipekit.io) for more information.


            

Raw data

            {
    "_id": null,
    "home_page": "https://pipekit.io",
    "name": "pipekit-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": null,
    "keywords": "pipekit, hera, argo, workflows, orchestration",
    "author": "Pipekit",
    "author_email": "ci@pipekit.io",
    "download_url": "https://files.pythonhosted.org/packages/2b/b4/6db4c565d6538e50d01d2ab892b814ca8db0107694752b633926eec21fdc/pipekit_sdk-2.0.1.tar.gz",
    "platform": null,
    "description": "[![Pipekit Logo](https://helm.pipekit.io/assets/pipekit-logo.png)](https://pipekit.io)\n\n[Pipekit](https://pipekit.io) 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.\n\n# Pipekit Python SDK\n\n## Installation\n\n```bash\npip install pipekit-sdk\n```\n\n## Usage\n\n```py\n# The Pipekit SDK interacts with Hera Workflows classes\nfrom hera.workflows import Container, Step, Steps, Workflow, script\nfrom pipekit_sdk.service import PipekitService\n\n# Create a Pipekit service that is used to talk to the Pipekit API\npipekit = PipekitService(token=\"<token>\")\n\n# List clusters and Pipes\nclusters = pipekit.list_clusters()\npipes = pipekit.list_pipes()\n\n@script()\ndef flip_coin() -> None:\n    import random\n\n    result = \"heads\" if random.randint(0, 1) == 0 else \"tails\"\n    print(result)\n\n# Create a Workflow using Hera\nwith Workflow(\n    generate_name=\"coinflip-\",\n    annotations={\n        \"workflows.argoproj.io/description\": (\n            \"This is an example of coin flip defined as a sequence of conditional steps.\"\n        ),\n    },\n    entrypoint=\"coinflip\",\n    namespace=\"argo\",\n    service_account_name=\"argo\",\n) as w:\n    heads = Container(\n        name=\"heads\",\n        image=\"alpine:3.6\",\n        command=[\"sh\", \"-c\"],\n        args=['echo \"it was heads\"'],\n    )\n    tails = Container(\n        name=\"tails\",\n        image=\"alpine:3.6\",\n        command=[\"sh\", \"-c\"],\n        args=['echo \"it was tails\"'],\n    )\n\n    with Steps(name=\"coinflip\") as s:\n        fc: Step = flip_coin()\n\n        with s.parallel():\n            heads(when=f\"{fc.result} == heads\")\n            tails(when=f\"{fc.result} == tails\")\n\n# Submit the Workflow to Pipekit\npipekit.submit(w, \"<cluster-name>\")\n\n# Tail the logs\npipekit.print_logs(pipe_run.uuid)\n```\n\n## Further help\nPlease refer to the [Pipekit Documentation](https://docs.pipekit.io) for more information.\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Pipekit Python SDK",
    "version": "2.0.1",
    "project_urls": {
        "Documentation": "https://docs.pipekit.io/",
        "Homepage": "https://pipekit.io"
    },
    "split_keywords": [
        "pipekit",
        " hera",
        " argo",
        " workflows",
        " orchestration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd039268717f1407c9125b1a96f734752dfb76e6da606cf4e09b6e16481a0b42",
                "md5": "e0f4eb52030491fe9474d5de38889a07",
                "sha256": "a04b111240db32edb2b624a167e6252c4ec690b0d82b9e8d1942aae0c836f080"
            },
            "downloads": -1,
            "filename": "pipekit_sdk-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0f4eb52030491fe9474d5de38889a07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 47961,
            "upload_time": "2024-10-11T15:05:14",
            "upload_time_iso_8601": "2024-10-11T15:05:14.945474Z",
            "url": "https://files.pythonhosted.org/packages/bd/03/9268717f1407c9125b1a96f734752dfb76e6da606cf4e09b6e16481a0b42/pipekit_sdk-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bb46db4c565d6538e50d01d2ab892b814ca8db0107694752b633926eec21fdc",
                "md5": "72366b4ad84a8f5de47e4e67eca7df6e",
                "sha256": "553fcfa1eb93cdccaf857f095589ac5eca84920a789264337c4e744f6e082f1a"
            },
            "downloads": -1,
            "filename": "pipekit_sdk-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "72366b4ad84a8f5de47e4e67eca7df6e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 45939,
            "upload_time": "2024-10-11T15:05:16",
            "upload_time_iso_8601": "2024-10-11T15:05:16.587127Z",
            "url": "https://files.pythonhosted.org/packages/2b/b4/6db4c565d6538e50d01d2ab892b814ca8db0107694752b633926eec21fdc/pipekit_sdk-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-11 15:05:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pipekit-sdk"
}
        
Elapsed time: 0.34427s