Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: pipeline upsert failed to pass parallelism_config to update#4066
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -26,7 +26,6 @@ | ||
| from sagemaker.workflow.execution_variables import ExecutionVariables | ||
| from sagemaker.workflow.parameters import ParameterString | ||
| from sagemaker.workflow.pipeline import Pipeline, PipelineGraph | ||
| from sagemaker.workflow.parallelism_config import ParallelismConfiguration | ||
| from sagemaker.workflow.pipeline_experiment_config import ( | ||
| PipelineExperimentConfig, | ||
| PipelineExperimentConfigProperties, | ||
| @@ -126,10 +125,12 @@ def test_pipeline_create_with_parallelism_config(sagemaker_session_mock, role_ar | ||
| name="MyPipeline", | ||
| parameters=[], | ||
| steps=[], | ||
| pipeline_experiment_config=ParallelismConfiguration(max_parallel_execution_steps=10), | ||
| sagemaker_session=sagemaker_session_mock, | ||
| ) | ||
| pipeline.create(role_arn=role_arn) | ||
| pipeline.create( | ||
| role_arn=role_arn, | ||
| parallelism_config=dict(MaxParallelExecutionSteps=10), | ||
| ) | ||
| assert sagemaker_session_mock.sagemaker_client.create_pipeline.called_with( | ||
| PipelineName="MyPipeline", | ||
| PipelineDefinition=pipeline.definition(), | ||
| @@ -138,6 +139,42 @@ def test_pipeline_create_with_parallelism_config(sagemaker_session_mock, role_ar | ||
| ) | ||
| def test_pipeline_create_and_start_with_parallelism_config(sagemaker_session_mock, role_arn): | ||
| pipeline = Pipeline( | ||
| name="MyPipeline", | ||
| parameters=[], | ||
| steps=[], | ||
| sagemaker_session=sagemaker_session_mock, | ||
| ) | ||
| pipeline.create( | ||
| role_arn=role_arn, | ||
| parallelism_config=dict(MaxParallelExecutionSteps=10), | ||
| ) | ||
| assert sagemaker_session_mock.sagemaker_client.create_pipeline.called_with( | ||
| PipelineName="MyPipeline", | ||
| PipelineDefinition=pipeline.definition(), | ||
| RoleArn=role_arn, | ||
| ParallelismConfiguration={"MaxParallelExecutionSteps": 10}, | ||
| ) | ||
| sagemaker_session_mock.sagemaker_client.start_pipeline_execution.return_value = dict( | ||
| PipelineExecutionArn="pipeline-execution-arn" | ||
| ) | ||
| # No ParallelismConfiguration specified | ||
| pipeline.start() | ||
| assert sagemaker_session_mock.sagemaker_client.start_pipeline_execution.call_args[1] == { | ||
| "PipelineName": "MyPipeline" | ||
| } | ||
| # Specify ParallelismConfiguration to another value which will be honored in backend | ||
| pipeline.start(parallelism_config=dict(MaxParallelExecutionSteps=20)) | ||
| assert sagemaker_session_mock.sagemaker_client.start_pipeline_execution.called_with( | ||
| PipelineName="MyPipeline", | ||
| ParallelismConfiguration={"MaxParallelExecutionSteps": 20}, | ||
| ) | ||
| @patch("sagemaker.s3.S3Uploader.upload_string_as_file_body") | ||
| def test_large_pipeline_create(sagemaker_session_mock, role_arn): | ||
| sagemaker_session_mock.sagemaker_config = {} | ||
| @@ -200,10 +237,12 @@ def test_pipeline_update_with_parallelism_config(sagemaker_session_mock, role_ar | ||
| name="MyPipeline", | ||
| parameters=[], | ||
| steps=[], | ||
| pipeline_experiment_config=ParallelismConfiguration(max_parallel_execution_steps=10), | ||
qidewenwhen marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| sagemaker_session=sagemaker_session_mock, | ||
| ) | ||
| pipeline.create(role_arn=role_arn) | ||
| pipeline.create( | ||
| role_arn=role_arn, | ||
| parallelism_config=dict(MaxParallelExecutionSteps=10), | ||
| ) | ||
| assert sagemaker_session_mock.sagemaker_client.update_pipeline.called_with( | ||
| PipelineName="MyPipeline", | ||
| PipelineDefinition=pipeline.definition(), | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.