Skip to content

breaking: change Airflow model_config order; make instance_type optional in model_config and Model.prepare_container_def #1558

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
wants to merge 1 commit into from

Conversation

laurenyu
Copy link
Contributor

@laurenyu laurenyu commented Jun 9, 2020

Issue #, if available:

Description of changes:
This is motivated by the Airflow model_config method unnecessarily requiring instance_type even though the parameter is unused. The reason prepare_container_def might use instance_type is because for Framework models, the instance type is used to pick "cpu" or "gpu" for the image tag if the tag is not provided. However, the base class's function need not require the argument.

Due to the maze of inheritance, I chose not to remove the arg entirely. This is because the various _create_sagemaker_model() calls would need to be modified (and perhaps re-implemented in specific subclasses) so that self.image is populated before calling self.prepare_container_def.

The other improvement that can be saved for a separate PR is to make instance_type optional in each framework's implementation of prepare_container_def if self.image is not None.

Testing done:
unit tests

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

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to any/all clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

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)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

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

…prepare_container_def in Model/FrameworkModel
@laurenyu laurenyu changed the title breaking: make instance_type optional and change parameter order for prepare_container_def in Model/FrameworkModel breaking: make instance_type optional in prepare_container_def for Model/FrameworkModel and change Airflow model_config order Jun 9, 2020
@laurenyu laurenyu changed the title breaking: make instance_type optional in prepare_container_def for Model/FrameworkModel and change Airflow model_config order breaking: change Airflow model_config order; make instance_type optional in Model.prepare_container_def Jun 9, 2020
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 8729c8a
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@laurenyu laurenyu changed the title breaking: change Airflow model_config order; make instance_type optional in Model.prepare_container_def breaking: change Airflow model_config order; make instance_type optional in model_config and Model.prepare_container_def Jun 9, 2020
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 8729c8a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-zwei-pr
  • Commit ID: 8729c8a
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 8729c8a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@laurenyu
Copy link
Contributor Author

closing now, and will redo after #1567

@laurenyu laurenyu closed this Jun 10, 2020
@laurenyu laurenyu deleted the model-args branch June 10, 2020 16:55
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