argo-python-dsl
argo-python-dsl copied to clipboard
new install from master - as require the full body posted on submit
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.
seems the abc is not compiling in the props which contain the required metadata..
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
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
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)
@rosscdh https://github.com/argoproj-labs/argo-python-dsl
yep well aware of it thanks.. got a PR there too ;)
switching to https://github.com/couler-proj/couler soon tho..