@@ -39,6 +39,9 @@ def pull_job_definition(job_name: str, batch_client) -> dict:
3939 """Pull Batch job definition from AWS."""
4040 response = batch_client .describe_job_definitions (jobDefinitionName = job_name , status = "ACTIVE" )
4141
42+ if not response ["jobDefinitions" ]:
43+ raise ValueError (f"No job definitions found with name '{ job_name } ' and status 'ACTIVE'" )
44+
4245 latest_revision = max (jd ["revision" ] for jd in response ["jobDefinitions" ])
4346 job_data = next (jd for jd in response ["jobDefinitions" ] if jd ["revision" ] == latest_revision )
4447
@@ -107,17 +110,14 @@ def pull_file(json_path: Path, region: str) -> None:
107110 case "iam-job-role.json" :
108111 data = pull_iam_role ("kilian-codeclash-job-role" , boto3 .client ("iam" , region_name = region ))
109112 cleaned_data = clean_response_data (data , is_iam_role = True )
110- case "iam-ebs.json" :
111- data = pull_iam_role ("kilian-codeclash-ecs-role-for-ebs-volumes" , boto3 .client ("iam" , region_name = region ))
112- cleaned_data = clean_response_data (data , is_iam_role = True )
113113 case "environment.json" :
114114 data = pull_compute_environment ("codeclash-batch" , boto3 .client ("batch" , region_name = region ))
115115 cleaned_data = clean_response_data (data , is_iam_role = False )
116116 case "job_queue.json" :
117117 data = pull_job_queue ("codeclash-queue" , boto3 .client ("batch" , region_name = region ))
118118 cleaned_data = clean_response_data (data , is_iam_role = False )
119119 case "job_definition.json" :
120- data = pull_job_definition ("codeclash-ebs-20g " , boto3 .client ("batch" , region_name = region ))
120+ data = pull_job_definition ("codeclash-default-job " , boto3 .client ("batch" , region_name = region ))
121121 cleaned_data = clean_response_data (data , is_iam_role = False )
122122 case "launch_template.json" :
123123 data = pull_launch_template ("kilian-codeclash-launch-template" , boto3 .client ("ec2" , region_name = region ))
0 commit comments