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/DSL: Fix bug when using PipelineParam in pvc of PipelineVolume #2018

Merged
merged 1 commit into from Sep 4, 2019

Conversation

elikatsis
Copy link
Member

@elikatsis elikatsis commented Sep 2, 2019

#1402 introduced the following bug:

If no name is provided to PipelineVolume constructor, a custom name is generated. It relies on json.dumps() of the struct after getting converted to dict.
When pvc is provided and name is not, the following error is raised:

TypeError: Object of type PipelineParam is not JSON serializable

This PR fixes it and extends tests to catch it.


This change is Reviewable

If no `name` is provided to PipelineVolume constructor, a custom name is
generated. It relies on `json.dumps()` of the struct after getting
converted to dict.
When `pvc` is provided and `name` is not, the following error is raised:
  TypeError: Object of type PipelineParam is not JSON serializable

This commit fixes it and extends tests to catch it.
# Testing json.dumps() when pvc is a PipelineParam to avoid
# `TypeError: Object of type PipelineParam is not JSON serializable`
param = PipelineParam(name="foo")
vol3 = PipelineVolume(pvc=param)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this line just verify that the code does not crash?

Copy link
Member Author

@elikatsis elikatsis Sep 4, 2019

Choose a reason for hiding this comment

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

Yes, I thought it is not necessary to test the result as well (since naming is already tested in the previous lines).

Is it sufficient? Do you think we should test it in a different way?

@Ark-kun
Copy link
Contributor

Ark-kun commented Sep 4, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

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 df4bc23 into kubeflow:master Sep 4, 2019
@elikatsis elikatsis deleted the fix-pipelinevolume-pvc-param branch March 9, 2020 14:47
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
* Update pull request template

Signed-off-by: Dan Sun <dsun20@bloomberg.net>

* Publish v0.8.0 release

Signed-off-by: Dan Sun <dsun20@bloomberg.net>

* Add step to describe pods after e2e test failure

Signed-off-by: Dan Sun <dsun20@bloomberg.net>

* Set default install mode to Serverless

Signed-off-by: Dan Sun <dsun20@bloomberg.net>
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.

None yet

3 participants