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

SDK - Compiler - Add optional Argo validation #3094

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Feb 15, 2020

Argo CLI tool must be in path for this feature to work


This change is Reviewable

argo CLI tool must be in path for this feature to work
@Ark-kun
Copy link
Contributor Author

Ark-kun commented Feb 18, 2020

/retest

@numerology
Copy link

IIUC after this change it's possible to generate an invalid workflow spec, right? Is there any use case where we need such whitelisting? Thanks

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Feb 19, 2020

IIUC after this change it's possible to generate an invalid workflow spec, right? Is there any use case where we need such whitelisting? Thanks

After this change it should be impossible to generate an invalid workflow spec. It relies on the presence of argo binary in PATH, so if it's missing, the check is skipped.

@numerology
Copy link

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: numerology

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a33ae25 into kubeflow:master Feb 19, 2020
Ark-kun added a commit to Ark-kun/pipelines that referenced this pull request Feb 19, 2020
Add Argo CLI so that the validation introduced in kubeflow#3094 is triggered.
import subprocess
argo_path = shutil.which('argo')
if argo_path:
result = subprocess.run([argo_path, 'lint', '/dev/stdin'], input=yaml_text, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it (maybe intentionally or accidentally) drop Python 3.5 support, because subprocess.run() does not seem to have encoding arg in python 3.5 [1]. As a result, it would cause TypeError.

[1] https://docs.python.org/3.5/library/subprocess.html#subprocess.run

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... In Travis CI [1] we do test against Python 3.5 and it does not complain about this change. Will take a closer look to it.

Did you find anything wrong @ucdmkt ?

[1] https://github.com/kubeflow/pipelines/blob/master/.travis.yml#L54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay in Travis, the unit tests we run _compile() instead of compile() Thus this line was not covered.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay in Travis, the unit tests we run _compile() instead of compile() Thus this line was not covered.

Took back my word. It's because in Travis Argo CLI is missing so it's not triggered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ucdmkt Thanks for reporting this! We've fixed the bug in #3122

k8s-ci-robot pushed a commit that referenced this pull request Mar 17, 2020
Add Argo CLI so that the validation introduced in #3094 is triggered.
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
argo CLI tool must be in path for this feature to work
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
Add Argo CLI so that the validation introduced in kubeflow#3094 is triggered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants