Skip to content

Add search for training job and fix slow tests #71

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
merged 4 commits into from
Apr 10, 2020
Merged

Add search for training job and fix slow tests #71

merged 4 commits into from
Apr 10, 2020

Conversation

l2yao
Copy link
Contributor

@l2yao l2yao commented Apr 9, 2020

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@l2yao l2yao requested a review from a team as a code owner April 9, 2020 22:54
Copy link
Member

@danabens danabens left a comment

Choose a reason for hiding this comment

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

nit: seems there are two types of changes (search objs and tests) in this pr which could be separated into multiple crs

Comment on lines -374 to -377
creation_time = None
created_by = None
last_modified_time = None
last_modified_by = None
Copy link
Member

Choose a reason for hiding this comment

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

these are in the response see DescribeExperiment.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I removed those since those will be covered by **kwargs

Comment on lines +299 to +313
training_job_name = None
training_job_arn = None
tuning_job_arn = None
labeling_job_arn = None
autoML_job_arn = None
model_artifacts = None
training_job_status = None
hyper_parameters = None
algorithm_specification = None
input_data_config = None
output_data_config = None
resource_config = None
debug_hook_config = None
experiment_config = None
debug_rule_config = None
Copy link
Member

Choose a reason for hiding this comment

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

how did you construct this list of fields? what about some other fields like SecondaryStatus and FailureReason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the ones I think are most useful, but others should be covered by **kwargs

Copy link
Member

Choose a reason for hiding this comment

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

seems incomplete tho, we will get back all the fields in search regardless of what is in kwargs. i guess we can follow up later and add the remaining fields.

@@ -20,12 +20,12 @@

@pytest.mark.slow
def test_track_from_processing_job(sagemaker_boto_client, processing_job_name):

processing_job_name = "smexperiments-integ-549de818-b4bd-42d0-8ce7-1cb4cb3573d9"
Copy link
Member

Choose a reason for hiding this comment

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

meant to have this hard coded job name here?

Copy link
Contributor Author

@l2yao l2yao Apr 10, 2020

Choose a reason for hiding this comment

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

good point, I removed this and also training_job_name which I dont think is needed.

@@ -1,4 +1,4 @@
# Copyright 019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

this should be done automatically, i created an issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree

for s in TrainingJob.search(
search_expression=search_expression, max_results=10, sagemaker_boto_client=sagemaker_boto_client
):
training_job_names_searched.append(s.training_job_name)
Copy link
Member

Choose a reason for hiding this comment

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

indented too far

Copy link
Contributor Author

@l2yao l2yao Apr 10, 2020

Choose a reason for hiding this comment

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

sure, just black-formatted it

training_job_names_searched.append(s.training_job_name)

assert len(training_job_names_searched) == 1
assert training_job_names_searched # sanity test
Copy link
Member

Choose a reason for hiding this comment

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

can we have a stronger assertion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing

@l2yao
Copy link
Contributor Author

l2yao commented Apr 10, 2020

nit: seems there are two types of changes (search objs and tests) in this pr which could be separated into multiple crs

I agree, sorry, just started fixing slow test since its blocking my search integ tests.

@l2yao l2yao merged commit 85375a9 into aws:master Apr 10, 2020
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.

2 participants