argo-python-dsl
argo-python-dsl copied to clipboard
Issue with the calling the sdk/dsl import models error
Hi all trying to use argo-workflows-sdk, getting this problem with the api, any help would be appreciated from argo.workflows import models ImportError: cannot import name 'models'example taken from here
from argo.workflows.sdk import Workflow
from argo.workflows.sdk import templatefrom argo.workflows.sdk.templates import V1Containerclass Sample(Workflow):
entrypoint = "whalesay"
@template
def whalesay(self) -> V1Container:
container = V1Container(
image="docker/whalesay:latest",
name="whalesay",
command=["cowsay"],
args=["hello world"]
) return container
Calling in to launch this helloworld workflow
import yaml
import requests
from argo.workflows.client import (ApiClient,
WorkflowServiceApi,
Configuration,
V1alpha1WorkflowCreateRequest)
# assume we ran `kubectl -n argo port-forward deployment/argo-server 2746:2746`
from helloworld import Sample
config = Configuration(host="http://localhost:2746")
client = ApiClient(configuration=config)
service = WorkflowServiceApi(api_client=client)
wf = Sample()
manifest = wfservice.create_workflow('argo', V1alpha1WorkflowCreateRequest(workflow=manifest))
The problem is here
Traceback (most recent call last):
File "/Users//Git/datapipeline-api/gg.py", line 9, in