fix!: Running jobs with env templates does not support parameters #147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



What was the problem/requirement? (What/Why)
The Open Job Description specification https://github.com/OpenJobDescription/openjd-specifications/wiki/2023-09-Template-Schemas includes both job and environment templates. The openjd CLI lets you run a job in the context of one or more externally defined templates via:
Environment templates can define parameters just like jobs, but when they did this the CLI tool failed to run them. This was because the parameter values were not being processed and forwarded based on the full environment context, they were being regenerated later without the environments.
What was the solution? (How)
This change fixes the processing of environment and job templates to forward the preprocessed parameters
that include both job and environment.
What is the impact of this change?
The
openjd runcommand will work with environment templates such as the samples in https://github.com/aws-deadline/deadline-cloud-samples/tree/mainline/queue_environments#readme.How was this change tested?
Implemented a new test that uses an environment template accepting a parameter.
Was this change documented?
N/A
Is this a breaking change?
BREAKING CHANGE: The functions generate_jobs and job_from_template have
changed to accept the environments and return the job parameters
alongside the job. Constructing the LocalSession class now requires
job parameters.
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.