Skip to content

Conversation

@brightsparc
Copy link
Contributor

@brightsparc brightsparc commented Mar 5, 2021

Issue #, if available: #5

Description of changes:

Add --compute-type argument to allow specifying the compute type down to the AWS CodeBuild job.

Compute type computeType value Memory vCPUs Disk space Environment type
build.general1.small BUILD_GENERAL1_SMALL 3 GB 2 64 GB LINUX_CONTAINER
build.general1.medium BUILD_GENERAL1_MEDIUM 7 GB 4 128 GB LINUX_CONTAINER
build.general1.large BUILD_GENERAL1_LARGE 15 GB 8 128 GB LINUX_CONTAINER
build.general1.large BUILD_GENERAL1_LARGE 255 GB 32 50 GB LINUX_GPU_CONTAINER
build.general1.large BUILD_GENERAL1_LARGE 16 GB 8 50 GB ARM_CONTAINER
build.general1.2xlarge BUILD_GENERAL1_2XLARGE 145 GB 72 824 GB (SSD) LINUX_CONTAINER

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines 81 to 84
build_parser.add_argument(
"--image",
help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)",
)
Copy link
Contributor

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?

Suggested change
build_parser.add_argument(
"--image",
help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)",
)

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 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.

)
build_parser.add_argument(
"--compute-type",
help="The code build compute type (default: BUILD_GENERAL1_SMALL)",
Copy link
Contributor

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

Suggested change
help="The code build compute type (default: BUILD_GENERAL1_SMALL)",
help="The CodeBuild compute type (default: BUILD_GENERAL1_SMALL)",

Comment on lines 30 to 35
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'
)

Copy link
Contributor

@jaipreet-s jaipreet-s Mar 16, 2021

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')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in update.

@jaipreet-s jaipreet-s merged commit d02e979 into aws-samples:master Mar 18, 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.

2 participants