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

feat(sdk): Add an API to return prepared workflow as python dicts. #757

Merged
merged 2 commits into from
Oct 22, 2021

Conversation

ScrapCodes
Copy link
Contributor

Which issue is resolved by this Pull Request:
Resolves #737

Description of your changes:
Add an API (i.e. prepare_workflow) to return prepared workflow as python dicts.

Advantage of this API is, that is saves few microseconds spent in compiling python dict in yaml and store on disk,
because it returns the python dict in memory.

Disadvantage of the approach,

It will allow the end users to direct consume internal data-structure and they may tend to rely on its structure. In future, we do not guarantee that the fields or structure of field will not change in this dict.

Environment tested:

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

Checklist:

@ScrapCodes ScrapCodes changed the title Add an API to return prepared workflow as python dicts. feat(sdk): Add an API to return prepared workflow as python dicts. Oct 20, 2021
@Tomcli
Copy link
Member

Tomcli commented Oct 20, 2021

thanks @ScrapCodes, can you add a simple example on how to use this new function? You can just extend a new section in the kfp-user-guide over here https://github.com/kubeflow/kfp-tekton/tree/master/guides/kfp-user-guide

@Tomcli
Copy link
Member

Tomcli commented Oct 22, 2021

FYI @Udiknedormin we added a new function in the compiler class to get the pipelineruns and the related loop CRs. Let us know if you think it needs more improvement.

@Tomcli
Copy link
Member

Tomcli commented Oct 22, 2021

/lgtm
/approve

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ScrapCodes, Tomcli

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

@google-oss-robot google-oss-robot merged commit 1eea716 into kubeflow:master Oct 22, 2021
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.

Create new compiler helper method to return workflow dictionary only
3 participants