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

fix(sdk): Update SDK to pull artifact related information from annotations #259

Merged
merged 4 commits into from
Aug 10, 2020

Conversation

Tomcli
Copy link
Member

@Tomcli Tomcli commented Aug 4, 2020

Which issue is resolved by this Pull Request:
Related #241

Description of your changes:
As we move to multi-user for KFP, we want to inject certain artifact config via the annotations because we cannot change the Tekton API Spec. Thus, update the SDK to pull the related information from annotations without adding any breaking change.

Also we add few extra information to the annotations related to the artifact keys, so the UI can pull them based on similar requirements in #241.

Environment tested:

  • Python Version (use python --version): 3.7
  • Tekton Version (use tkn version): 1.14.0
  • Kubernetes Version (use kubectl version): 1.16
  • OS (e.g. from /etc/os-release):

Checklist:

  • The title for your pull request (PR) should follow our title convention. Learn more about the pull request title convention used in this repository.

    PR titles examples:

    • fix(frontend): fixes empty page. Fixes #1234
      Use fix to indicate that this PR fixes a bug.
    • feat(backend): configurable service account. Fixes #1234, fixes #1235
      Use feat to indicate that this PR adds a new feature.
    • chore: set up changelog generation tools
      Use chore to indicate that this PR makes some changes that users don't need to know.
    • test: fix CI failure. Part of #1234
      Use part of to indicate that a PR is working on an issue, but shouldn't close the issue when merged.
  • Do you want this pull request (PR) cherry-picked into the current release branch?

    If yes, use one of the following options:

    • (Recommended.) Ask the PR approver to add the cherrypick-approved label to this PR. The release manager adds this PR to the release branch in a batch update.
    • After this PR is merged, create a cherry-pick PR to add these changes to the release branch. (For more information about creating a cherry-pick PR, see the Kubeflow Pipelines release guide.)

@kubeflow-bot
Copy link

This change is Reviewable

@Tomcli
Copy link
Member Author

Tomcli commented Aug 4, 2020

/cc @ckadner

@k8s-ci-robot k8s-ci-robot requested a review from ckadner August 4, 2020 20:55
@drewbutlerbb4
Copy link
Member

/lgtm
Thanks @Tomcli looks like it has everything needed from a UI perspective

@@ -464,8 +464,8 @@ def _op_to_template(op: BaseOp, pipelinerun_output_artifacts={}, enable_artifact
output_annotation = pipelinerun_output_artifacts.get(processed_op.name, [])
output_annotation.append(
{
'name': output_artifact['name'],
'path': output_artifact['path'],
'name': output_artifact.get('name'),
Copy link
Member

Choose a reason for hiding this comment

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

can output_artifact['name'] or output_artifact['path'] ever be missing here (raising a KeyError)? If so, should the get return a default value like empty string ""?

output_artifact['name'] is used 2 lines down with direct key access as opposed to using dict.get()

Copy link
Member Author

Choose a reason for hiding this comment

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

It was a merge from feng's PR yesterday, I can replace all of them to use .get() with defaults to make it consistent.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Aug 7, 2020
Copy link
Member

@ckadner ckadner left a comment

Choose a reason for hiding this comment

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

/lgtm

@animeshsingh
Copy link
Collaborator

/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: animeshsingh

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 ab108d4 into kubeflow:master Aug 10, 2020
@Tomcli
Copy link
Member Author

Tomcli commented Aug 14, 2020

/close

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.

6 participants