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

[Backport] Fixes for pipeline extension request handling (#10031) #10046

Merged
merged 1 commit into from
May 10, 2024

Conversation

kevyang
Copy link
Contributor

@kevyang kevyang commented May 10, 2024

Fixes the way that we handle bad input specs and empty requirements files. Before, an empty requirements file would cause the pipeline creation to fail because it was defaulting to the home directory of the container, since the requirements file was an empty string and not None. Now, it correctly defaults to no requirements file. Bad input specs before would throw 500 responses, which is incorrect given it is due to user error.

INT-1261


Fixes the way that we handle bad input specs and empty requirements
files. Before, an empty requirements file would cause the pipeline
creation to fail because it was defaulting to the home directory of the
container, since the requirements file was an empty string and not
`None`. Now, it correctly defaults to no requirements file. Bad input
specs before would throw 500 responses, which is incorrect given it is
due to user error.

[INT-1261](https://pachyderm.atlassian.net/browse/INT-1266)

[INT-1261]:
https://pachyderm.atlassian.net/browse/INT-1261?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Kevin Yang <kevin.yang@hpe.com>
@kevyang kevyang requested review from a team and bbonenfant and removed request for a team May 10, 2024 13:59
Copy link
Contributor

@bbonenfant bbonenfant left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -81,6 +81,8 @@ def from_notebook(cls, notebook_path: Union[str, Path]) -> "PpsConfig":
if input_spec_str is None:
raise ValueError("field input_spec not set")
input_spec_dict = yaml.safe_load(input_spec_str)
if input_spec_dict is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

I just did a little testing and it looks like yaml.safe_load only returns None if the input string is empty or only whitespace. Were you able to get find any other ways to result in None? If not maybe the error message should say that the value is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You may be right here, I found this when I accidentally submitted a pipeline request without the input spec. Since this is a backport, I can update this message in a future PR.

@kevyang kevyang merged commit 0b79830 into 2.10.x May 10, 2024
12 checks passed
@kevyang kevyang deleted the kevyang/backport branch June 6, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants