Skip to content

Commit f8601bb

Browse files
committed
Remove image arg. Move CodeBuild compute type choices to arg parse
1 parent 2f6573c commit f8601bb

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

sagemaker_studio_image_build/cli.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ def validate_args(args, extra_args):
2525
f"The value of the -f/file argument [{file_value}] is outside the working directory [{os.getcwd()}]"
2626
)
2727

28-
# Validate arg compute_type
29-
if args.compute_type:
30-
if not args.compute_type in ['BUILD_GENERAL1_SMALL', 'BUILD_GENERAL1_MEDIUM',
31-
'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_LARGE', 'BUILD_GENERAL1_2XLARGE']:
32-
raise ValueError(
33-
f'Error parsing reference: "{args.repository}" is not a valid repository/tag'
34-
)
35-
3628

3729
def get_role(args):
3830
if args.role:
@@ -78,13 +70,11 @@ def main():
7870
"--repository",
7971
help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)",
8072
)
81-
build_parser.add_argument(
82-
"--image",
83-
help="The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)",
84-
)
8573
build_parser.add_argument(
8674
"--compute-type",
87-
help="The code build compute type (default: BUILD_GENERAL1_SMALL)",
75+
help="The CodeBuild compute type (default: BUILD_GENERAL1_SMALL)",
76+
choices=["BUILD_GENERAL1_SMALL", "BUILD_GENERAL1_MEDIUM",
77+
"BUILD_GENERAL1_LARGE", "BUILD_GENERAL1_2XLARGE"]
8878
default="BUILD_GENERAL1_SMALL"
8979
)
9080
build_parser.add_argument(

sagemaker_studio_image_build/codebuild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, s3_location, role, repository=None, compute_type=None):
1818
self.session = boto3.session.Session()
1919
self.domain_id, self.user_profile_name = self._get_studio_metadata()
2020
self.repo_name = None
21-
self.compute_type = compute_type or 'BUILD_GENERAL1_SMALL'
21+
self.compute_type = compute_type or "BUILD_GENERAL1_SMALL"
2222

2323
if repository:
2424
self.repo_name, self.tag = repository.split(":", maxsplit=1)

0 commit comments

Comments
 (0)