Skip to content

Commit

Permalink
Merge pull request #22 from RENCI/isHurricane
Browse files Browse the repository at this point in the history
correcting staging command line
  • Loading branch information
PhillipsOwen authored Sep 13, 2022
2 parents c297be5 + b9b686a commit 0fca705
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions supervisor/src/job_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def get_base_command_line(self, run: dict, job_type: JobType) -> (list, bool):

# is this a staging job array
if job_type == JobType.staging:
command_line_params = ['--inputURL', run['downloadurl'], '--isHurricane', run['isHurricane'], '--outputDir']
command_line_params = ['--inputURL', run['downloadurl'], '--isHurricane', run['stormname'], '--outputDir']
extend_output_path = True

# is this a hazus job array
Expand All @@ -291,7 +291,6 @@ def get_base_command_line(self, run: dict, job_type: JobType) -> (list, bool):
elif job_type == JobType.final_staging:
command_line_params = ['--inputDir', self.k8s_config[job_type]['DATA_MOUNT_PATH'] + '/' + str(run['id']) + self.k8s_config[job_type]['SUB_PATH'],
'--outputDir', self.k8s_config[job_type]['DATA_MOUNT_PATH'] + self.k8s_config[job_type]['SUB_PATH'],
'--isHurricane', run['isHurricane'],
'--tarMeta', str(run['id'])]

# is this an obs mod ast job
Expand Down Expand Up @@ -545,10 +544,8 @@ def check_input_params(self, run_info: dict) -> (str, str, bool):
run_info['downloadurl'] = run_info['post.opendap.renci_tds-k8.downloadurl'].replace('http://apsviz-thredds', 'https://apsviz-thredds')

# check to see if this is a hurricane
if 'stormname' in run_info:
run_info['isHurricane'] = 'True'
else:
run_info['isHurricane'] = 'False'
if 'stormname' not in run_info:
run_info['stormname'] = 'None'

# loop through the params and return the ones that are missing
return f"{', '.join([run_param for run_param in self.required_run_params if run_param not in run_info])}", instance_name, debug_mode
Expand Down Expand Up @@ -601,7 +598,7 @@ def get_incomplete_runs(self):
continue

# add the new run to the list
self.run_list.append({'id': run_id, 'isHurricane': run['run_data']['isHurricane'], 'debug': debug_mode, 'fake-jobs': self.fake_job, 'job-type': job_type, 'status': JobStatus.new, 'status_prov': f'{job_prov} run accepted', 'downloadurl': run['run_data']['downloadurl'], 'gridname': run['run_data']['adcirc.gridname'], 'instance_name': run['run_data']['instancename']})
self.run_list.append({'id': run_id, 'stormname': run['run_data']['stormname'], 'debug': debug_mode, 'fake-jobs': self.fake_job, 'job-type': job_type, 'status': JobStatus.new, 'status_prov': f'{job_prov} run accepted', 'downloadurl': run['run_data']['downloadurl'], 'gridname': run['run_data']['adcirc.gridname'], 'instance_name': run['run_data']['instancename']})

# update the run status in the DB
self.pg_db.update_job_status(run_id, f"{job_prov} run accepted")
Expand Down

0 comments on commit 0fca705

Please sign in to comment.