Skip to content

Commit 90823b1

Browse files
authoredMar 3, 2025··
Allow @latest for spack.specs[0] (#45)
* Add 1-0-7.json * Allow `@latest` as a ref * Update CHANGELOG
1 parent 46509ca commit 90823b1

File tree

2 files changed

+178
-0
lines changed

2 files changed

+178
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/spack/environment/deployment/1-0-7.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"title": "Restricted spack environment file schema for ACCESS-NRI continuous deployment",
5+
"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.",
6+
"type": "object",
7+
"additionalProperties": false,
8+
"properties": {
9+
"spack": {
10+
"type": "object",
11+
"default": {},
12+
"additionalProperties": true,
13+
"properties": {
14+
"packages": {
15+
"type": "object",
16+
"default": {},
17+
"additionalProperties": true,
18+
"properties": {
19+
"gcc-runtime": {
20+
"type": "object",
21+
"default": {},
22+
"additionalProperties": true,
23+
"properties": {
24+
"require": {
25+
"type": "array",
26+
"minItems": 1,
27+
"additionalItems": true,
28+
"items": {
29+
"oneOf": [
30+
{
31+
"type": "object"
32+
},
33+
{
34+
"type": "string"
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
41+
},
42+
"patternProperties": {
43+
"(?!^(all|gcc-runtime)$)(^\\w[\\w-]*)": {
44+
"type": "object",
45+
"default": {},
46+
"additionalProperties": true,
47+
"properties": {
48+
"require": {
49+
"type": "array",
50+
"minItems": 1,
51+
"additionalItems": true,
52+
"items": [
53+
{
54+
"type": "string",
55+
"pattern": "^@[A-Za-z0-9.\\-_=\/]+$"
56+
},
57+
{
58+
"oneOf": [
59+
{
60+
"type": "object"
61+
},
62+
{
63+
"type": "string"
64+
}
65+
]
66+
}
67+
]
68+
}
69+
}
70+
}
71+
}
72+
},
73+
"specs": {
74+
"type": "array",
75+
"default": [],
76+
"minItems": 1,
77+
"items": {
78+
"type": "string",
79+
"pattern": "^.+@git\\.[^= ]+.*$|\\$ROOT_SPEC|^.+@latest"
80+
}
81+
},
82+
"definitions": {
83+
"type": "array",
84+
"default": [],
85+
"items": {
86+
"type": "object",
87+
"properties": {
88+
"when": {
89+
"type": "string"
90+
},
91+
"ROOT_PACKAGE": {
92+
"type": "array",
93+
"minItems": 1,
94+
"maxItems": 1,
95+
"items": {
96+
"type": "string"
97+
}
98+
},
99+
"ROOT_SPEC": {
100+
"type": "array",
101+
"items": {
102+
"type":"object",
103+
"properties": {
104+
"matrix": {
105+
"type": "array",
106+
"items": {
107+
"type": "array",
108+
"items": {
109+
"type": "string"
110+
}
111+
}
112+
},
113+
"exclude": {
114+
"type": "array",
115+
"items": {
116+
"type": "string"
117+
}
118+
}
119+
}
120+
}
121+
}
122+
}
123+
}
124+
}
125+
}
126+
}
127+
},
128+
"if": {
129+
"properties": {
130+
"spack": {
131+
"type": "object",
132+
"properties": {
133+
"specs": {
134+
"type": "array",
135+
"contains": {
136+
"const": "$ROOT_SPEC"
137+
}
138+
}
139+
}
140+
}
141+
}
142+
},
143+
"then": {
144+
"properties": {
145+
"spack": {
146+
"type": "object",
147+
"properties": {
148+
"definitions": {
149+
"allOf": [
150+
{
151+
"type": "array",
152+
"contains": {
153+
"type": "object",
154+
"required": ["ROOT_SPEC"]
155+
}
156+
},
157+
{
158+
"type": "array",
159+
"contains": {
160+
"type": "object",
161+
"required": ["ROOT_PACKAGE"]
162+
}
163+
}
164+
]
165+
}
166+
}
167+
}
168+
}
169+
}
170+
}

‎au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# `spack.yaml` Schema Changelog
22

3+
## 1-0-7
4+
5+
* 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.
6+
7+
This has full interoperability with the earlier schema/data.
8+
39
## 1-0-6
410

511
* Added special case for `spack.packages.gcc-runtime.require[0]` - it does not have to be a `@VERSION` as it dynamically creates it's version. That way, we can still put compiler constraints on the package without having to specify a version as the first element. For example:
@@ -12,6 +18,8 @@ spack:
1218
- '%gcc@8.5.0' # Note, not a '@VERSION'
1319
```
1420
21+
This has full interoperability with the earlier schema/data.
22+
1523
## 1-0-5
1624
1725
* Updated `spack.specs` to allow > 1 specs allowed. The first spec is still used as a basis for deployment information.

0 commit comments

Comments
 (0)
Please sign in to comment.