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: emit HyperparameterTuner tags to model and endpoint#803
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -54,6 +54,10 @@ | ||
| {'ModelName': 'model-2'}] | ||
| } | ||
| LIST_TAGS_RESULT = { | ||
| 'Tags': [{'Key': 'TagtestKey', 'Value': 'TagtestValue'}] | ||
| } | ||
| @pytest.fixture() | ||
| def sagemaker_session(): | ||
| @@ -66,6 +70,7 @@ def sagemaker_session(): | ||
| session.sagemaker_client.describe_training_job = Mock(return_value=describe) | ||
| session.sagemaker_client.describe_endpoint = Mock(return_value=ENDPOINT_DESC) | ||
| session.sagemaker_client.describe_endpoint_config = Mock(return_value=ENDPOINT_CONFIG_DESC) | ||
| session.sagemaker_client.list_tags = Mock(return_value=LIST_TAGS_RESULT) | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, there is no test that the tags actually get added to the estimator. adding an assert in test_attach would cover this. since we are testing parent class behavior, we don't need to add this for every framework, but it would be nice to test it in one of them. | ||
| session.wait_for_compilation_job = Mock(return_value=describe_compilation) | ||
| session.default_bucket = Mock(name='default_bucket', return_value=BUCKET_NAME) | ||
| session.expand_role = Mock(name="expand_role", return_value=ROLE) | ||
| @@ -346,6 +351,7 @@ def test_attach(sagemaker_session, mxnet_version): | ||
| 'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
| 'TrainingJobName': 'neo', | ||
| 'TrainingJobStatus': 'Completed', | ||
| 'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
| 'OutputDataConfig': { | ||
| 'KmsKeyId': '', | ||
| 'S3OutputPath': 's3://place/output/neo' | ||
| @@ -369,6 +375,7 @@ def test_attach(sagemaker_session, mxnet_version): | ||
| assert estimator.hyperparameters()['training_steps'] == '100' | ||
| assert estimator.source_dir == 's3://some/sourcedir.tar.gz' | ||
| assert estimator.entry_point == 'iris-dnn-classifier.py' | ||
| assert estimator.tags == LIST_TAGS_RESULT['Tags'] | ||
| def test_attach_old_container(sagemaker_session): | ||
| @@ -392,6 +399,7 @@ def test_attach_old_container(sagemaker_session): | ||
| 'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
| 'TrainingJobName': 'neo', | ||
| 'TrainingJobStatus': 'Completed', | ||
| 'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
| 'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
| 'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
| sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', | ||
| @@ -434,6 +442,7 @@ def test_attach_wrong_framework(sagemaker_session): | ||
| 'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
| 'TrainingJobName': 'neo', | ||
| 'TrainingJobStatus': 'Completed', | ||
| 'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
| 'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
| 'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
| sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', return_value=rjd) | ||
| @@ -465,6 +474,7 @@ def test_attach_custom_image(sagemaker_session): | ||
| 'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
| 'TrainingJobName': 'neo', | ||
| 'TrainingJobStatus': 'Completed', | ||
| 'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
| 'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
| 'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
| sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mock call is set up here, but there's no test that shows estimator uses the result of the call. adding an assert for this to
test_attach_frameworkwould cover this.