generated from ACCESS-NRI/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update schema to support multi-target
spack.yaml
(#41)
* `1-0-3.json`: Update `$id` to be correctly referencing itself * `1-0-4.json`: Added the requirement for a `root_package` definition if `definitions` is defined * `1-0-4.json`: Updated constraint to be conditional on `spack.specs[0] == "$ROOT_SPEC"`, updated case * Update CHANGELOG * Added $schema key
- Loading branch information
Showing
3 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
au.org.access-nri/model/spack/environment/deployment/1-0-3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 142 additions & 0 deletions
142
au.org.access-nri/model/spack/environment/deployment/1-0-4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"$id": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/spack/environment/deployment/1-0-4.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, | ||
"patternProperties": { | ||
"(?!^all$)(^\\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, | ||
"maxItems": 1, | ||
"items": { | ||
"type": "string", | ||
"pattern": "^.+@git\\.[^ ]+.*$|\\$ROOT_SPEC" | ||
} | ||
}, | ||
"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": { | ||
"properties": { | ||
"specs": { | ||
"contains": { | ||
"const": "$ROOT_SPEC" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"spack": { | ||
"properties": { | ||
"definitions": { | ||
"allOf": [ | ||
{ | ||
"contains": { | ||
"type": "object", | ||
"required": ["ROOT_SPEC"] | ||
} | ||
}, | ||
{ | ||
"contains": { | ||
"type": "object", | ||
"required": ["ROOT_PACKAGE"] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
au.org.access-nri/model/spack/environment/deployment/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters