Skip to content

Commit

Permalink
Added spec verification via jsonschema
Browse files Browse the repository at this point in the history
added checks for valid keys

branch updates

working on validation

added schema file

updates

fixed spec

fixed spec

added jsonschema to deps

updates

ran black on yamlspecification.py

specified newest jsonschema version

added manifest

added include_package_data to setup.py

reformatted json

experimental package_data

fixed path

fixed path

fixed path again

reverted newline

added check for empty strings

reworked exception logic

implemented reviewer suggestions, shifted exception logic, renamed redundant variables

renamed variable

removed unused import

added missing `self.verify_environment()` call

Co-Authored-By: Francesco Di Natale <frank.dinatale1988@gmail.com>

paths and git dependencies are now array types

Co-Authored-By: Francesco Di Natale <frank.dinatale1988@gmail.com>

removed redundant logic

swapped number type to integer

moved env schema validation to top, which avoids some types of ambiguous errors

removed test yaml

removed some additionalProperties restrictions

unknown commit

removed debug print
  • Loading branch information
ben-bay authored and FrankD412 committed Apr 21, 2020
1 parent 7022c43 commit 418d249
Show file tree
Hide file tree
Showing 6 changed files with 305 additions and 124 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include maestrowf/datastructures/schemas.json
116 changes: 116 additions & 0 deletions maestrowf/datastructures/schemas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"DESCRIPTION": {
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
"description": {"type": "string", "minLength": 1}
},
"required": [
"name",
"description"
]
},
"PARAM": {
"type": "object",
"properties": {
"values": {
"type": "array"
},
"label": {"type": "string", "minLength": 1}
},
"additionalProperties": false,
"required": [
"values",
"label"
]
},
"STUDY_STEP": {
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
"description": {"type": "string", "minLength": 1},
"run": {
"type": "object",
"properties": {
"cmd": {"type": "string", "minLength": 1},
"depends": {"type": "array", "uniqueItems": true},
"pre": {"type": "string", "minLength": 1},
"post": {"type": "string", "minLength": 1},
"restart": {"type": "string", "minLength": 1},
"nodes": {"type": "integer"},
"procs": {"type": "integer"},
"gpus": {"type": "integer"},
"cores per task": {"type": "integer"},
"walltime": {"type": "string", "minLength": 1},
"reservation": {"type": "string", "minLength": 1}
},
"additionalProperties": false,
"required": [
"cmd"
]
}
},
"additionalProperties": false,
"required": [
"name",
"description",
"run"
]
},
"ENV": {
"type": "object",
"properties": {
"variables": {"type": "object"},
"labels": {"type": "object"},
"sources": {"type": "object"},
"dependencies": {
"type": "object",
"properties": {
"paths": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
"path": {"type": "string", "minLength": 1}
},
"required": [
"name",
"path"
],
"additionalProperties": false
}
},
"git": {
"type": "array",
"items": {
"properties": {
"name": {"type": "string", "minLength": 1},
"path": {"type": "string", "minLength": 1},
"url": {"type": "string", "minLength": 1},
"tag": {"type": "string", "minLength": 1}
},
"required": [
"name",
"path",
"url"
]
}
},
"spack": {
"type": "object",
"properties": {
"name": {"type": "string", "minLength": 1},
"package_name": {"type": "string", "minLength": 1}
},
"required": [
"type",
"package_name"
]
}
}
}
},
"additionalProperties": false
}
}

0 comments on commit 418d249

Please sign in to comment.