Skip to content

Pipeline paramaters validation for Local mode #4016

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

Closed
patrick-239 opened this issue Jul 21, 2023 · 2 comments · Fixed by #4354
Closed

Pipeline paramaters validation for Local mode #4016

patrick-239 opened this issue Jul 21, 2023 · 2 comments · Fixed by #4354
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug

Comments

@patrick-239
Copy link

Describe the bug
In local mode it is possible to pass empty SM pipeline parameter (ParameterString type) when calling the StartPipelineExecution operation, but the same code will rise an exception when launched on cloud: "botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the StartPipelineExecution operation: [string "" is too short (length: 0, required minimum: 1)]". It is hard to develop a code locally when same methods have a different behavior in a cloud.

To reproduce
Launch SM pipeline with an empty parameter in a cloud. Repeat same with local mode.

Expected behavior
Both mode (local and cloud) raise an error or allow to use empty parameters.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version:
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans):
  • Framework version:
  • Python version:
  • CPU or GPU:
  • Custom Docker image (Y/N):

Additional context
Add any other context about the problem here.

@thbrooks22 thbrooks22 added the component: pipelines Relates to the SageMaker Pipeline Platform label Jul 24, 2023
@qidewenwhen
Copy link
Member

Hi @patrick-239, thanks for reaching out!

Could you share us the complete error log trace for further investigation.
Also, can you share us some code snippet on what your pipeline looks like if possible? Thanks!

Asking because the error was thrown from StartPipelineExecution. We have explicit validation logics behind CreatePipeline rather than StartPipelineExecution so we need to understand where the ValidationException is coming from.

@qidewenwhen
Copy link
Member

qidewenwhen commented Oct 27, 2023

We have the following validation for json get input in local mode to replicate the behavior in API but seems we miss one for the ParameterString

def _validate_json_get_function(

Next steps:
1. Check if the default string is empty and throw an error accordingly
2. Move such validation to an early stage when creating the ParameterString object, so that users can get notified as early as possible.
Tracked this quick fix in backlog with other issues

Update:
Reproduced the issue.
The error botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the StartPipelineExecution operation: [string "" is too short (length: 0, required minimum: 1)] is thrown by StartPipelineExecution API.

However, when defining the pipeline, the ParameterString's default value allows an empty string and it won't raise error if the parameter string value is not overridden when starting a pipeline execution.

Thus, to make local mode behavior consistent with the cloud, we should add the ParameterString's value validation in execution time (i.e. when starting an execution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug
Projects
None yet
3 participants