First thing this morning I fixed both bugs.
I had to pass in cli_args to the promote_agent_to_workflow function and add these lines:
for opt_input in agent_config.get('optional_inputs', []):
if cli_args.get(opt_input) is not None:
# Add to workflow inputs
temp_workflow['inputs'].append(opt_input)
# Add to steps params
temp_workflow['steps'][0]['params'][opt_input] = f"${opt_input}"
In the config handling I had to move the above function call until after we calculated the command line arguments and also remove entries from the cli_args that didn't actually appear on the command line.
cli_args = {k: v for k, v in vars(args).items() if v is not None}
This is the flow of the data through my system, you can see how the command line becomes the cli_args then to the step parameters being passed to the the function, and the output of the function from the input. You can see how the ENV_ values are replaced by the actual real values from the environmental variables.
No comments:
Post a Comment