Skip to content

Commit 50fada4

Browse files
committed
Addition unit test fixups to remove cloudwtch metrics, add training_steps, fix Rule evaluator image, and instance count/type
1 parent 24f1b61 commit 50fada4

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

tests/integ/test_training_pipeline_estimators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def test_pca_estimator(sfn_client, sagemaker_session, sagemaker_role_arn, sfn_ro
115115
s3_output_path = 's3://{bucket_name}/{workflow_name}/models'.format(bucket_name=bucket_name, workflow_name=unique_name)
116116
expected_execution_info = {'executionArn': execution_arn,
117117
'stateMachineArn': state_machine_arn,
118+
'inputDetails': {'included': True},
118119
'name': job_name,
120+
'outputDetails': {'included': True},
119121
'status': status,
120122
'startDate': execution_info['startDate'],
121123
'stopDate': execution_info['stopDate'],

tests/unit/test_pipeline.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def sklearn_preprocessor():
6666
role=SAGEMAKER_EXECUTION_ROLE,
6767
instance_type="ml.c4.xlarge",
6868
source_dir=source_dir,
69+
sagemaker_session = sagemaker_session
6970
)
7071

7172
sklearn_preprocessor.debugger_hook_config = DebuggerHookConfig(
@@ -334,11 +335,10 @@ def test_inference_pipeline(sklearn_preprocessor, linear_learner_estimator):
334335
},
335336
'HyperParameters': {
336337
'sagemaker_container_log_level': '20',
337-
'sagemaker_enable_cloudwatch_metrics': 'false',
338338
'sagemaker_job_name': '"preprocessor-linear_learner"',
339339
'sagemaker_program': '"sklearn_abalone_featurizer.py"',
340340
'sagemaker_region': '"us-east-1"',
341-
'sagemaker_submit_directory': '"s3://sagemaker/source"'
341+
'sagemaker_submit_directory': '"s3://sagemaker/source"',
342342
},
343343
'InputDataConfig': [{
344344
'ChannelName': 'train',
@@ -371,7 +371,6 @@ def test_inference_pipeline(sklearn_preprocessor, linear_learner_estimator):
371371
'PrimaryContainer': {
372372
'Environment': {
373373
'SAGEMAKER_CONTAINER_LOG_LEVEL': '20',
374-
'SAGEMAKER_ENABLE_CLOUDWATCH_METRICS': 'false',
375374
'SAGEMAKER_PROGRAM': 'sklearn_abalone_featurizer.py',
376375
'SAGEMAKER_REGION': 'us-east-1',
377376
'SAGEMAKER_SUBMIT_DIRECTORY': 's3://sagemaker/source'
@@ -435,7 +434,6 @@ def test_inference_pipeline(sklearn_preprocessor, linear_learner_estimator):
435434
{
436435
'Environment': {
437436
'SAGEMAKER_CONTAINER_LOG_LEVEL': '20',
438-
'SAGEMAKER_ENABLE_CLOUDWATCH_METRICS': 'false',
439437
'SAGEMAKER_PROGRAM': 'sklearn_abalone_featurizer.py',
440438
'SAGEMAKER_REGION': 'us-east-1',
441439
'SAGEMAKER_SUBMIT_DIRECTORY': 's3://sagemaker/source'

tests/unit/test_sagemaker_steps.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def pca_estimator_with_falsy_debug_hook():
119119
pca = sagemaker.estimator.Estimator(
120120
PCA_IMAGE,
121121
role=EXECUTION_ROLE,
122-
train_instance_count=1,
123-
train_instance_type='ml.c4.xlarge',
122+
instance_count=1,
123+
instance_type='ml.c4.xlarge',
124124
output_path=s3_output_location,
125125
debugger_hook_config = False
126126
)
@@ -298,7 +298,7 @@ def test_training_step_creation_with_debug_hook(pca_estimator_with_debug_hook):
298298
'DebugRuleConfigurations': [
299299
{
300300
'RuleConfigurationName': 'Confusion',
301-
'RuleEvaluatorImage': '199566480951.dkr.ecr.us-east-1.amazonaws.com/sagemaker-debugger-rules:latest',
301+
'RuleEvaluatorImage': '503895931360.dkr.ecr.us-east-1.amazonaws.com/sagemaker-debugger-rules:latest',
302302
'RuleParameters': {
303303
'rule_to_invoke': 'Confusion',
304304
'category_no': '15',
@@ -449,13 +449,14 @@ def test_training_step_creation_with_framework(tensorflow_estimator):
449449
},
450450
'RoleArn': EXECUTION_ROLE,
451451
'HyperParameters': {
452-
'model_dir': '"s3://sagemaker/models/tensorflow-job/model"',
452+
'checkpoint_path': '"s3://sagemaker/models/sagemaker-tensorflow/checkpoints"',
453+
'evaluation_steps': '100',
453454
'sagemaker_container_log_level': '20',
454-
'sagemaker_enable_cloudwatch_metrics': 'false',
455455
'sagemaker_job_name': '"tensorflow-job"',
456456
'sagemaker_program': '"tf_train.py"',
457457
'sagemaker_region': '"us-east-1"',
458-
'sagemaker_submit_directory': '"s3://sagemaker/source"'
458+
'sagemaker_submit_directory': '"s3://sagemaker/source"',
459+
'training_steps': '1000',
459460
},
460461
'TrainingJobName': 'tensorflow-job',
461462
'Tags': DEFAULT_TAGS_LIST
@@ -557,7 +558,6 @@ def test_get_expected_model_with_framework_estimator(tensorflow_estimator):
557558
'Environment': {
558559
'SAGEMAKER_PROGRAM': 'tf_train.py',
559560
'SAGEMAKER_SUBMIT_DIRECTORY': 's3://sagemaker/tensorflow-job/source/sourcedir.tar.gz',
560-
'SAGEMAKER_ENABLE_CLOUDWATCH_METRICS': 'false',
561561
'SAGEMAKER_CONTAINER_LOG_LEVEL': '20',
562562
'SAGEMAKER_REGION': 'us-east-1',
563563
},

0 commit comments

Comments
 (0)