Skip to content

feat: Support Placeholders with ModelStep #175

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
Oct 28, 2021

Conversation

ca-nguyen
Copy link
Contributor

Description

Add support to define Model parameters dynamically using placeholders

Fixes #117

Why is the change necessary?

Currently, it is not possible to use placeholders for Sagemaker Model parameters. The properties cannot be defined dynamically, as they need to be defined in the Model which does not accept placeholders.
This change makes it possible to use placeholders for Model properties by using the parameters field that are passed down from the ModelStep.

Solution

Use the parameters field that is compatible with placeholders to define ModelStep properties.
Merge the parameters that were generated from the Model with the input parameters:

  • The input parameters will overwrite the parameters generated from the Model if the properties were defined in both
  • The input parameters should follow the schema described in CreateModel API doc

Testing

Added unit and integ tests


Pull Request Checklist

Please check all boxes (including N/A items)

Testing

  • Unit tests added
  • Integration test added
  • Manual testing - why was it necessary? could it be automated? - N/A

Documentation

  • docs: All relevant docs updated
  • docstrings: All public APIs documented

Title and description

  • Change type: Title is prefixed with change type: and follows conventional commits
  • References: Indicate issues fixed via: Fixes #xxx

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

@ca-nguyen ca-nguyen requested review from shivlaks and evscott October 25, 2021 17:25
shivlaks
shivlaks previously approved these changes Oct 27, 2021
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

some minor nits. consider addressing them before shipping.

if isinstance(model, FrameworkModel):
parameters = model_config(model=model, instance_type=instance_type, role=model.role, image_uri=model.image_uri)
model_parameters = model_config(model=model, instance_type=instance_type, role=model.role, image_uri=model.image_uri)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: didn't really have an objection to this parameter name since they do ultimately resolve to Parameters and you're calling the model_config method to assign it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was renamed to avoid confusion with the input parameters provided in the args

@ca-nguyen ca-nguyen requested a review from jormello October 27, 2021 18:56
@StepFunctions-Bot
Copy link
Contributor

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-sEHrOdk7acJc
  • Commit ID: 584cb94
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@ca-nguyen ca-nguyen merged commit 2091850 into aws:main Oct 28, 2021
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.

add placeholders support for all properties
4 participants