-
Notifications
You must be signed in to change notification settings - Fork 26
Add compute type argument #8
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
Conversation
sagemaker_studio_image_build/cli.py
Outdated
| build_parser.add_argument( | ||
| "--image", | ||
| help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)", | ||
| ) |
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.
This looks identical to the --repository parameter. What is the use for this?
| build_parser.add_argument( | |
| "--image", | |
| help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)", | |
| ) |
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.
I was also going to add support for targeting a different CodeBuild image in addition to compute type. But decided to keep this PR just to compute type - so I will remove this option.
sagemaker_studio_image_build/cli.py
Outdated
| ) | ||
| build_parser.add_argument( | ||
| "--compute-type", | ||
| help="The code build compute type (default: BUILD_GENERAL1_SMALL)", |
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.
nitpick: s/code build/CodeBuild
| help="The code build compute type (default: BUILD_GENERAL1_SMALL)", | |
| help="The CodeBuild compute type (default: BUILD_GENERAL1_SMALL)", |
sagemaker_studio_image_build/cli.py
Outdated
| if not args.compute_type in ['BUILD_GENERAL1_SMALL', 'BUILD_GENERAL1_MEDIUM', | ||
| 'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_2XLARGE']: | ||
| raise ValueError( | ||
| f'Error parsing reference: "{args.repository}" is not a valid repository/tag' | ||
| ) | ||
|
|
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.
This can be simplified by using the choices functionality in argparse. For e.g.,
parser.add_argument('compute-type', choices=['BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_2XLARGE', '...'], default='BUILD_GENERAL1_SMALL')
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.
Fixed in update.
Issue #, if available: #5
Description of changes:
Add
--compute-typeargument to allow specifying the compute type down to the AWS CodeBuild job.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.