Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport CRAYSAT-1917: Fix jinja2 rendering of boot_sets data in sat bootprep #285

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

annapoorna-s-alt
Copy link
Contributor

Summary and Scope

Backport sat-container image to 3.32.10

Issues and Related PRs

List and characterize relationship to Jira/Github issues and other pull requests. Be sure to list dependencies.

Testing

See the linked PR.

Risks and Mitigations

See the linked PR

Pull Request Checklist

  • Version number(s) incremented, if applicable
  • Copyrights updated
  • License file intact
  • Target branch correct
  • CHANGELOG.md updated
  • Testing is appropriate and complete, if applicable
  • HPC Product Announcement prepared, if applicable

Make the following fixes:

- Remove the `boot_set` property from `BaseInputItem`. It is not appropriate
  there, and it is redundant with `boot_sets` property that already exists in
  the `InputSessionTemplate`
- Modify the `jinja_rendered` decorator to recursively render more complex
  objects like lists and dictionaries. I think this is safe, but we should
  consider any edge cases more carefully.
- Remove the now unnecessary code that does a one-off Jinja2 rendering of
  `rootfs_provider_passthrough` in the `boot_sets`.

Could still use unit test enhancements that test this new ability to render
fields in the boot_sets.

Test Description:
Tested on a simple bootprep input file that used a variable in the
`rootfs_provider_passthrough` field of a boot set in a BOS session template.

(cherry picked from commit 71ef427)
Add unit tests for usage of the `jinja_rendered` decorator on properties
of the `BaseInputItem`.

Modify these unit tests to simplify them slightly and to ensure that the
`SomeTestItem` class calls the `BaseInputItem` constructor, so that it
sets the `jinja_env` instance attribute, which is used by the
`jinja_rendered` decorator.

Test Description:
Unit tests pass.

(cherry picked from commit 6e42a20)
Update the unit tests of the InputSessionTemplate class to include tests
that check for proper Jinja2 template rendering of the boot_sets field.

(cherry picked from commit 8ff2874)
@annapoorna-s-alt annapoorna-s-alt merged commit c3c263b into release/3.32 Nov 13, 2024
3 checks passed
@annapoorna-s-alt annapoorna-s-alt deleted the backport-release-3.32 branch November 13, 2024 05:35
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.

2 participants