Skip to content

Commit

Permalink
fix config.inputs.proj not getting workflow_execution id
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Nov 25, 2024
1 parent 5e6e73e commit bc5a534
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions nmdc_automation/workflow_automation/sched.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def create_job_rec(self, job: SchedulerJob):

wf = job.workflow
base_id, iteration = self.get_activity_id(wf, job.informed_by)
activity_id = f"{base_id}.{iteration}"
inp_objects = []
inp = dict()
workflow_execution_id = f"{base_id}.{iteration}"
input_data_objects = []
inputs = dict()
optional_inputs = wf.optional_inputs
for k, v in job.workflow.inputs.items():
if v.startswith("do:"):
Expand All @@ -135,31 +135,31 @@ def create_job_rec(self, job: SchedulerJob):
if k in optional_inputs:
continue
raise ValueError(f"Unable to find {do_type} in {do_by_type}")
inp_objects.append(dobj.as_dict())
input_data_objects.append(dobj.as_dict())
v = dobj["url"]
# TODO: Make this smarter
elif v == "{was_informed_by}":
v = job.informed_by
elif v == "{activity_id}":
v = activity_id
elif v == "{workflow_execution_id}":
v = workflow_execution_id
elif v == "{predecessor_activity_id}":
v = job.trigger_act.id

inp[k] = v
inputs[k] = v

# Build the respoonse
job_config = {
"git_repo": wf.git_repo,
"release": wf.version,
"wdl": wf.wdl,
"activity_id": activity_id,
"activity_id": workflow_execution_id,
"activity_set": wf.collection,
"was_informed_by": job.informed_by,
"trigger_activity": job.trigger_id,
"iteration": iteration,
"input_prefix": wf.input_prefix,
"inputs": inp,
"input_data_objects": inp_objects,
"inputs": inputs,
"input_data_objects": input_data_objects,
}
if wf.workflow_execution:
job_config["activity"] = wf.workflow_execution
Expand Down

0 comments on commit bc5a534

Please sign in to comment.