Skip to content

Argo Python SDK #9

Closed
Closed

Description

@zhujiangyou

Where can I find a python SDK to replace Argo's various command-line interfaces?

Activity

  1. CermakM commented on Dec 9, 2019

    @CermakM
    Owner

    Hey @zhujiangyou, thanks for the question!

    I'll try to clarify the purpose of this client and see if I answer your question.

    This library currently doesn't have the Argo CLI ported to Python, if that's what you mean. I am sorry to disappoint you if that's what you have expected.

    This client acts similarly to the kubernetes-python-client. It is basically an extension to the Kubernetes client providing Argo models and API paths to create, list, delete and in general manipulate workflows and workflow templates as you would do with any other Kubernetes resource.

  2. yxue-kabam commented on Dec 9, 2019

    @yxue-kabam

    @CermakM just wanted to let you know what you have done is very valuable to me. I didn't make much progress on this after I tried to generate python sdk from argo swag definition (with Kubernetes client generator). I were able to generate the models but I couldn't fix the dependency problems where some Argo models just assume kubernetes models were there. So would love to know how you have resolved that.

    Other than that it's been great, I have been able to build dags on top of your sdk and on my way to work a workflow framework on top of your client. Thank you!

  3. CermakM commented on Dec 10, 2019

    @CermakM
    Owner

    Hey @yxue-kabam. Thanks a lot for the feedback! :) I am glad it helps!

    Yep, it's been somewhat complicated to include the kubernetes models. I solved it by tweaking the code generation and including the Python Kubernetes models.

  4. CermakM commented on Dec 18, 2019

    @CermakM
    Owner

    The SDK is currently under development: https://github.com/CermakM/argo-python-sdk

  5. changed the title [-]Programming implementation of Argo[/-] [+]Argo Python SDK[/+] on Jan 3, 2020
  6. CermakM commented on Jan 3, 2020

    @CermakM
    Owner

    Here is a hello-world example of the Argo Python SDK.
    Feel free to visit https://github.com/CermakM/argo-python-sdk for more examples.


    Argo YAMLArgo Python

    # @file: hello-world.yaml
    apiVersion: argoproj.io/v1alpha1
    kind: Workflow
    metadata:
      name: hello-world
      generateName: hello-world-
    spec:
      entrypoint: whalesay
      templates:
      - name: whalesay
        container:
          name: whalesay
          image: docker/whalesay:latest
          command: [cowsay]
          args: ["hello world"]

    from argo.workflows.sdk import Workflow
    from argo.workflows.sdk import template
    
    from argo.workflows.sdk.templates import V1Container
    
    
    class HelloWorld(Workflow):
    
        entrypoint = "whalesay"
    
        @template
        def whalesay(self) -> V1Container:
            container = V1Container(
                image="docker/whalesay:latest",
                name="whalesay",
                command=["cowsay"],
                args=["hello world"]
            )
    
            return container

  7. pinned this issue on Jan 26, 2020
  8. CermakM commented on Jan 30, 2020

    @CermakM
    Owner

    If you want an API for Argo CLI directly, please check https://github.com/argoproj-labs/argo-workflows-python-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions