Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new install from master - as require the full body posted on submit #20

Open
rosscdh opened this issue Apr 5, 2020 · 6 comments
Open
Labels
bug Something isn't working

Comments

@rosscdh
Copy link

rosscdh commented Apr 5, 2020

Describe the bug

On use trying to use argo 2.6.3 which requires the kind and version and various other metadata which should always be sent (because crons and templates are important) am getting

% python manage.py ps_k8s_post_workflow                                                                                                                                                                                             rosscdh@s
Traceback (most recent call last):
  File "manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/backend/pagesnap/apps/default/management/commands/ps_k8s_post_workflow.py", line 173, in handle
    wf = service.process()
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/backend/pagesnap/apps/default/management/commands/ps_k8s_post_workflow.py", line 159, in process
    self.workflows = [workflow_id for workflow_id in self.send()]
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/backend/pagesnap/apps/default/management/commands/ps_k8s_post_workflow.py", line 159, in <listcomp>
    self.workflows = [workflow_id for workflow_id in self.send()]
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/backend/pagesnap/apps/default/management/commands/ps_k8s_post_workflow.py", line 156, in send
    yield service.submit(client=service.client, namespace="argo")
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/argo/workflows/dsl/_workflow.py", line 430, in submit
    body = client.api_client.sanitize_for_serialization(self)
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/argo/workflows/client/api_client.py", line 242, in sanitize_for_serialization
    for key, val in six.iteritems(obj_dict)}
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/argo/workflows/client/api_client.py", line 242, in <dictcomp>
    for key, val in six.iteritems(obj_dict)}
  File "/Users/rosscdh/p/PageSnap/v1/pagesnap/venv/lib/python3.7/site-packages/argo/workflows/client/api_client.py", line 238, in sanitize_for_serialization
    for attr, _ in six.iteritems(obj.openapi_types)
AttributeError: 'V1ObjectMeta' object has no attribute 'openapi_types'

seems an invalid type reference?

Versions

-e git+https://github.com/CermakM/argo-python-dsl@6ee661685ff87abd594714a3e8a0493eac4960b6#egg=argo_workflows_dsl

and

argo-workflows==3.2.0

To Reproduce
in order to get the updated post whole kubernetes resource to argo 2.6.3

pip install -e 'git+https://github.com/CermakM/argo-python-dsl#egg=argo-workflows-dsl'

Expected behaviour
The library works

Screenshots

Additional context
Add any other context about the problem here.

@rosscdh rosscdh added the bug Something isn't working label Apr 5, 2020
@rosscdh
Copy link
Author

rosscdh commented Apr 5, 2020

seems the abc is not compiling in the props which contain the required metadata..

@rosscdh
Copy link
Author

rosscdh commented Apr 5, 2020

nothing seems to work.. have rolled back and forward even running argo 2.5.3 always gets

argo.workflows.client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 05 Apr 2020 10:14:46 GMT', 'Transfer-Encoding': 'chunked'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Workflow in version \"v1alpha1\" cannot be handled as a Workflow: unmarshalerDecoder: Object 'Kind' is missing in

@rosscdh
Copy link
Author

rosscdh commented Apr 5, 2020

installed the official release versions (again) none of them result in the desired yaml

is missing from all generated yaml..

api_version: argoproj.io/v1alpha1
kind: Workflow

@rosscdh
Copy link
Author

rosscdh commented Apr 10, 2020

Only way to make it work.. currently installing dsl from master

            service = V1WorkflowExampleDag(
                **kwargs
            )
            service.metadata.name = None # set the name to none so the generatedname is used
            base_yaml = f"""apiVersion: argoproj.io/v1alpha1
kind: Workflow
{service.to_yaml()}"""
            body = yaml.safe_load(base_yaml)
            body['metadata']['generateName'] = body['metadata']['generate_name'] # the client models are a little broken
            yield V1ALPHA1.create_namespaced_workflow(namespace='argo', body=body)

@binarycrayon
Copy link
Contributor

@rosscdh
Copy link
Author

rosscdh commented Oct 12, 2020

yep well aware of it thanks.. got a PR there too ;)

switching to https://github.com/couler-proj/couler soon tho..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants