From 613fb2075906fb5fa137dd2e3c876660a796632b Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 4 Dec 2025 15:48:38 +1100 Subject: [PATCH 1/5] Copy over 1-0-7 as 2-0-0 --- .../spack/environment/deployment/2-0-0.json | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 au.org.access-nri/model/spack/environment/deployment/2-0-0.json diff --git a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json new file mode 100644 index 0000000..f37f586 --- /dev/null +++ b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json @@ -0,0 +1,170 @@ +{ + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/spack/environment/deployment/1-0-7.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Restricted spack environment file schema for ACCESS-NRI continuous deployment", + "description": "This schema was adapted from https://github.com/ACCESS-NRI/spack/blob/releases/v0.21/lib/spack/spack/schema/env.py to specify a restricted form of spack.yaml to design generic deployment infrastructure.", + "type": "object", + "additionalProperties": false, + "properties": { + "spack": { + "type": "object", + "default": {}, + "additionalProperties": true, + "properties": { + "packages": { + "type": "object", + "default": {}, + "additionalProperties": true, + "properties": { + "gcc-runtime": { + "type": "object", + "default": {}, + "additionalProperties": true, + "properties": { + "require": { + "type": "array", + "minItems": 1, + "additionalItems": true, + "items": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + } + } + }, + "patternProperties": { + "(?!^(all|gcc-runtime)$)(^\\w[\\w-]*)": { + "type": "object", + "default": {}, + "additionalProperties": true, + "properties": { + "require": { + "type": "array", + "minItems": 1, + "additionalItems": true, + "items": [ + { + "type": "string", + "pattern": "^@[A-Za-z0-9.\\-_=\/]+$" + }, + { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + ] + } + } + } + } + }, + "specs": { + "type": "array", + "default": [], + "minItems": 1, + "items": { + "type": "string", + "pattern": "^.+@git\\.[^= ]+.*$|\\$ROOT_SPEC|^.+@latest" + } + }, + "definitions": { + "type": "array", + "default": [], + "items": { + "type": "object", + "properties": { + "when": { + "type": "string" + }, + "ROOT_PACKAGE": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "string" + } + }, + "ROOT_SPEC": { + "type": "array", + "items": { + "type":"object", + "properties": { + "matrix": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "if": { + "properties": { + "spack": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "contains": { + "const": "$ROOT_SPEC" + } + } + } + } + } + }, + "then": { + "properties": { + "spack": { + "type": "object", + "properties": { + "definitions": { + "allOf": [ + { + "type": "array", + "contains": { + "type": "object", + "required": ["ROOT_SPEC"] + } + }, + { + "type": "array", + "contains": { + "type": "object", + "required": ["ROOT_PACKAGE"] + } + } + ] + } + } + } + } + } + } From 1784be4c1fbe3d20811287c34a50e55a3237ba90 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 4 Dec 2025 15:54:39 +1100 Subject: [PATCH 2/5] Remove spack.specs requirements, add required _name, _version definitions --- .../spack/environment/deployment/2-0-0.json | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json index f37f586..fcf6ab4 100644 --- a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json +++ b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json @@ -75,18 +75,31 @@ "default": [], "minItems": 1, "items": { - "type": "string", - "pattern": "^.+@git\\.[^= ]+.*$|\\$ROOT_SPEC|^.+@latest" + "type": "string" } }, "definitions": { "type": "array", "default": [], + "required": ["_name", "_version"], "items": { "type": "object", "properties": { - "when": { - "type": "string" + "_name": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "string" + } + }, + "_version": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "string" + } }, "ROOT_PACKAGE": { "type": "array", From 5cbd403a270799b2b3f90b70d647a7695aec70e3 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 4 Dec 2025 15:55:07 +1100 Subject: [PATCH 3/5] Update changelog --- .../model/spack/environment/deployment/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md b/au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md index 9933074..f992f52 100644 --- a/au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md +++ b/au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md @@ -1,5 +1,10 @@ # `spack.yaml` Schema Changelog +## 2-0-0 + +* Require reserved definitions for `spack.definitions[]._name` and `spack.definitions[]._version` +* Relax requirements on `spack.specs` entirely + ## 1-0-7 * Allow the use of `@latest` in `spack.specs[0]`. This is allowed for Prereleases, but not for Releases. This keeps continuity with local builds which can't use not-yet-existing `@git.TAG`s like Prerelease builds can. From 6a6c361309e225610b43a0a07d6cb915e2b04776 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Fri, 5 Dec 2025 15:02:19 +1100 Subject: [PATCH 4/5] Update required condition on object rather than array --- au.org.access-nri/model/spack/environment/deployment/2-0-0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json index fcf6ab4..174bc51 100644 --- a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json +++ b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json @@ -81,9 +81,9 @@ "definitions": { "type": "array", "default": [], - "required": ["_name", "_version"], "items": { "type": "object", + "required": ["_name", "_version"], "properties": { "_name": { "type": "array", From 2acd9602ca7412566d4ba8eed699a37f044b1d56 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Fri, 5 Dec 2025 15:03:42 +1100 Subject: [PATCH 5/5] Update $id --- au.org.access-nri/model/spack/environment/deployment/2-0-0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json index 174bc51..609f0ce 100644 --- a/au.org.access-nri/model/spack/environment/deployment/2-0-0.json +++ b/au.org.access-nri/model/spack/environment/deployment/2-0-0.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/spack/environment/deployment/1-0-7.json", + "$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/spack/environment/deployment/2-0-0.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Restricted spack environment file schema for ACCESS-NRI continuous deployment", "description": "This schema was adapted from https://github.com/ACCESS-NRI/spack/blob/releases/v0.21/lib/spack/spack/schema/env.py to specify a restricted form of spack.yaml to design generic deployment infrastructure.",