Skip to content

Update schema to support multi-target spack.yaml#41

Merged
CodeGat merged 5 commits intomainfrom
model-deployment-template-15-multi-target-spack-yaml
Jan 21, 2025
Merged

Update schema to support multi-target spack.yaml#41
CodeGat merged 5 commits intomainfrom
model-deployment-template-15-multi-target-spack-yaml

Conversation

@CodeGat
Copy link
Copy Markdown
Member

@CodeGat CodeGat commented Jan 20, 2025

References ACCESS-NRI/model-deployment-template#15

To diff this schema, do diff -- au.org.access-nri/model/spack/environment/deployment/1-0-3.json au.org.access-nri/model/spack/environment/deployment/1-0-4.json since it is a new file.

Background

This PR updates the schema that contains ACCESS-NRI-flavoured restrictions on spack.yaml. The changes are as follows:

  • Update spack.specs[] to allow "$ROOT_SPEC" as a valid value
  • Update spack.definitions to require definitions for ROOT_PACKAGE/ROOT_SPEC only if spack.specs contains $ROOT_SPEC

Also had some other changes:

  • 1-0-3.json: Update $id to be correctly referencing itself
  • Updated CHANGELOG.md

Testing

Tested this schema against https://github.com/ACCESS-NRI/ACCESS-OM2/blob/multi-target-spack-yaml-format/spack.yaml, specifically:

  • When $ROOT_SPEC exists in spack.specs but ROOT_SPEC/ROOT_PACKAGE doesn't (expected failure)
  • When $ROOT_SPEC exists in spack.specs and ROOT_SPEC/ROOT_PACKAGE both exist (expected success)
  • When $ROOT_SPEC doesn't exist in spack.specs and ROOT_SPEC/ROOT_PACKAGE doesn't (expected success)
  • When $ROOT_SPEC doesn't exist in spack.specs but ROOT_SPEC/ROOT_PACKAGE both exist (expected success)

Can be tested via ajv --strict=true -s au.org.access-nri/model/spack/environment/deployment/1-0-4.json -d ../ACCESS-OM2/spack.yaml

@CodeGat CodeGat added the enhancement New feature or request label Jan 20, 2025
@CodeGat CodeGat self-assigned this Jan 20, 2025
jo-basevi
jo-basevi previously approved these changes Jan 20, 2025
Copy link
Copy Markdown
Collaborator

@jo-basevi jo-basevi left a comment

Choose a reason for hiding this comment

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

Looks good to me! Now have learnt how to do conditionals in a schema :)

@CodeGat CodeGat merged commit 060098e into main Jan 21, 2025
@CodeGat CodeGat deleted the model-deployment-template-15-multi-target-spack-yaml branch January 21, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done ✅

Development

Successfully merging this pull request may close these issues.

2 participants