Skip to content

Conversation

@mwiebe
Copy link
Contributor

@mwiebe mwiebe commented Mar 18, 2025

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:

openjd run job.yaml --environment env.yaml

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 run command 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?

  • Does the change need to be threat modeled? For example, does it create or modify files/directories that must only be readable by the process owner?
    • If so, then please label this pull request with the "security" label. We'll work with you to analyze the threats.

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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 `openjd run job.yaml --environment env.yaml`.

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. This change fixes that to forward the parameters.

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.

Signed-off-by: Mark Wiebe <[email protected]>
@mwiebe mwiebe requested a review from a team as a code owner March 18, 2025 22:51
@sonarqubecloud
Copy link

@mwiebe mwiebe enabled auto-merge (rebase) March 18, 2025 23:53
@mwiebe mwiebe merged commit 65a15b4 into OpenJobDescription:mainline Mar 19, 2025
19 checks passed
@mwiebe mwiebe deleted the fix-env-with-param branch March 19, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants