@@ -25,6 +25,14 @@ 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+
2836
2937def get_role (args ):
3038 if args .role :
@@ -50,7 +58,7 @@ def build_image(args, extra_args):
5058 validate_args (args , extra_args )
5159
5260 builder .build_image (
53- args .repository , get_role (args ), args .bucket , extra_args , log = not args .no_logs
61+ args .repository , get_role (args ), args .bucket , args . compute_type , extra_args , log = not args .no_logs
5462 )
5563
5664
@@ -70,6 +78,15 @@ def main():
7078 "--repository" ,
7179 help = "The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)" ,
7280 )
81+ build_parser .add_argument (
82+ "--image" ,
83+ help = "The ECR repository:tag for the image (default: sagemaker-studio-${domain_id}:latest)" ,
84+ )
85+ build_parser .add_argument (
86+ "--compute-type" ,
87+ help = "The code build compute type (default: BUILD_GENERAL1_SMALL)" ,
88+ default = "BUILD_GENERAL1_SMALL"
89+ )
7390 build_parser .add_argument (
7491 "--role" ,
7592 help = f"The IAM role name for CodeBuild to use (default: the Studio execution role)." ,
0 commit comments