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

Refactor Python SDK #568

Merged
merged 4 commits into from
Dec 20, 2018
Merged

Refactor Python SDK #568

merged 4 commits into from
Dec 20, 2018

Conversation

gaoning777
Copy link
Contributor

@gaoning777 gaoning777 commented Dec 19, 2018

Add some comments; refactor convert_k8s_obj_to_json; remove unnecessary imports; add license to dsl_bridge.

As the Python SDK codebase becomes larger, it requires some cleaning to make it more readable.


This change is Reviewable

@gaoning777
Copy link
Contributor Author

/test kubeflow-pipeline-sample-test

1 similar comment
@gaoning777
Copy link
Contributor Author

/test kubeflow-pipeline-sample-test

@@ -140,9 +145,9 @@ def _op_to_template(self, op):
template['nodeSelector'] = op.node_selector

if op.env_variables:
template['container']['env'] = list(map(self._convert_k8s_obj_to_dic, op.env_variables))
template['container']['env'] = list(map(K8sHelper.convert_k8s_obj_to_json, op.env_variables))
Copy link
Contributor

Choose a reason for hiding this comment

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

The output in not really JSON. It's a python dict.
P.S. The function (including the name comes from the K8s client library (ApiClient class))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the name as yang's docstring inside the function, which is a json serialized dictionary that has nested structure.


Args:
value_or_reference: value or reference to be resolved. It could be basic python types or PipelineParam
potential_references(dict{str->str}): a dictionary of parameter names to task names
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying this.
I think it can be made even more clear. Why are the references potentials? What kind parameter names are these?

P.S. The python dictionary type is:from typing import Mapping, potential_references: Mapping[str, str]. Is the type correct though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll sending some more refactoring PRs recently to make DSL more readable.
Will note this. Thanks for your feedback.

@Ark-kun
Copy link
Contributor

Ark-kun commented Dec 20, 2018

I have an ask: Can we make is so that the compiler is executable from source code clone without installing the package? It's probably a really small fix.
I want something like python3 kfp/dsl/compile/main.py --py ... to work.

@gaoning777
Copy link
Contributor Author

Interesting idea. It might be useful for DSL development work.
This is PR is simply some code refactoring. You might add an issue for this feature.

@Ark-kun
Copy link
Contributor

Ark-kun commented Dec 20, 2018

/lgtm

@gaoning777
Copy link
Contributor Author

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaoning777

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

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaoning777

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 85c6413 into kubeflow:master Dec 20, 2018
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
…beflow#568)

This reverts commit 4ebe571.

The list of service accounts only includes service accounts owned by the
project. So we ended up deleting bindings for service accounts owned by
other projects such as the service accounts.

related to: kubeflow#566
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
Add pipelineloop-controller, pipelineloop-webhook and
anysequencer to the toolchain pipelines
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.

3 participants