Skip to content

Schema Versions as Entrypoint Inputs Over vars#310

Merged
CodeGat merged 2 commits intodev-v6from
239-schema-version-and-path-input
Aug 5, 2025
Merged

Schema Versions as Entrypoint Inputs Over vars#310
CodeGat merged 2 commits intodev-v6from
239-schema-version-and-path-input

Conversation

@CodeGat
Copy link
Copy Markdown
Member

@CodeGat CodeGat commented Aug 4, 2025

Closes #239

Background

vars are difficult to find, can't be versioned, and apply to the whole repository. In the linked issue, this was a reason to get rid of them.

Now, the versions for the various schema are instead passed in to the entrypoint workflow, giving provenance as to when they changed and PR/commit-level granularity.

The new inputs are:

  • spack-manifest-schema-path (Optional, defaults to au.org.access-nri/model/spack/environment/deployment): The path to the schema relative to ACCESS-NRI/schema. Useful for using different schema depending on the type of software deployed - for example, models vs general software deployment via spack
  • spack-manifest-schema-version (Required): The version for the schema (under spack-manifest-schema-path) that validates spack manifests.
  • config-versions-schema-version (Required): The version for the schema that validates the config/versions.json file.
  • config-packages-schema-version (Required): The version for the schema that validates the config/packages.json file.

Important

Because we are adding new, required inputs to the entrypoint workflows, this will be a MAJOR update.

The PR

  • Change schema vars to required inputs, add optional spack manifest schema path for potentially different schemas
  • Add required schema version inputs, and optional spack manifest schema paths to entrypoint workflows

Testing

Since we will be effectively retesting the same code, we will do the main test under the dev-v6 -> v6 PR.

@CodeGat CodeGat added type:enhancement Improvements to existing features priority:high version:MAJOR Requires an update to Model Deployment Repositories CI for:v6 Applies to v6 labels Aug 4, 2025
@CodeGat CodeGat self-assigned this Aug 4, 2025
@CodeGat CodeGat force-pushed the 239-schema-version-and-path-input branch from aa15a37 to a54f5d5 Compare August 4, 2025 23:37
@CodeGat CodeGat marked this pull request as ready for review August 4, 2025 23:43
@CodeGat CodeGat mentioned this pull request Aug 5, 2025
Copy link
Copy Markdown
Member

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CodeGat CodeGat merged commit a5ed4e0 into dev-v6 Aug 5, 2025
@CodeGat CodeGat deleted the 239-schema-version-and-path-input branch August 5, 2025 03:03
CodeGat added a commit that referenced this pull request Aug 11, 2025
* Injection of Modules over Checks (#295)

* Add projection injection module

* Add requirements for injection modules

* Add tests for injection projection module, and inputs/requirements

* Add prerelease injection module

* Add tests for prerelease injection module

* Run injection.projection and injection.prerelease modules

* deploy-1-setup: Remove projection checks

* Remove unneeded mergedeep requirement

* Add module inits to folders

* Add step for installing dependencies, update names for checkout steps

* Used cd module prefix rather than custom working-directory so we can find the manifest

* Added required input for prerelease modification, always print out updated manifest at end

* Add back EOT

* Update non-root-spec projections to namespaced `{name}/prX-Y/VERSION` format

* Updated tests for namespaced non-root-spec projections

* Update prerelease module argument from --root-spec-version to --version

* Pass in sys.argv to parse_args, add tests

* Refactor workflow to split generation of root spec and packages

* Rename projections script to modules

* Add inject_includes function

* For test inputs, comment what is expected

* Reordered functions

* Updated tests after code updates

* Apply suggestions from code review

Co-authored-by: Aidan Heerdegen <[email protected]>
Signed-off-by: Tommy Gatti <[email protected]>

* Add root_spec to includes set, but remove it later when alphabetically sorting the includelist since it always comes first

* Updated output of manifest

* Ran black

* Added getter module for accessing various parts of a spack manifest

* Update `[test_]modules.py` to use new getter module

* Update `[test_]prerelease.py` to use getter module, update deploy-2-start to remove --root-spec arg

* Ran black again

* Raise NotImplementedErrors, add comments for successful matches

* Remove comments of old code

* Apply suggestions from code review

Co-authored-by: Aidan Heerdegen <[email protected]>
Signed-off-by: Tommy Gatti <[email protected]>

* Add example to multi-target spec to test function

* Parameterized tests

* Fixes following more test cases

* Converted manifest with no packages to fixture

* Improved from_file classmethod tests

* Parameterized valid and mistakenly invalid tests

* Remove `root-spec` arg and instead get from manifest directly, update tests

* Add new prerelease script flag `--keep-root-spec-intact`, that doesn't remove version information

---------

Signed-off-by: Tommy Gatti <[email protected]>
Co-authored-by: Aidan Heerdegen <[email protected]>

* `vars` to File-Based Special Packages (#305)

* Validate MDR config/packages.json

* Pass info from MDR config/packages.json to module injection script

* Update variable name to `vars.CONFIG_PACKAGES_SCHEMA_VERSION`

* Change cwd relative to build-cd rather than model for scripts

* Add output of packages to be injected/added to provenance DB

* Update prerelease projection to `ROOT_SPEC/prX-Y/{name}/VERSION`

* Update tests for new prerelease injection logic

* Replace all internal refs with v6

* Dump quoted strings for prerelease projections, updated expected output

* Schema Versions as Entrypoint Inputs Over `vars` (#310)

* Change schema vars to required inputs, add optional spack manifest schema path for potentially different schemas

* Add required schema version inputs, and optional spack manifest schema paths to entrypoint workflows

* Get packages for provenance from an earlier step

* Update prerelease injection to the form `ROOT_SPEC/.dependencies/PRX-Y/VERSION-{hash:7}`

* Fixed up an unused variable

* Remove `.` from `dependencies directory

---------

Signed-off-by: Tommy Gatti <[email protected]>
Co-authored-by: Aidan Heerdegen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for:v6 Applies to v6 priority:high type:enhancement Improvements to existing features version:MAJOR Requires an update to Model Deployment Repositories CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants