-
Notifications
You must be signed in to change notification settings - Fork 31
ATLAS schema collection
Lukas edited this page Feb 16, 2016
·
13 revisions
I'm just collecting some schemas and test instances here for this issue
https://github.com/cernanalysispreservation/analysis-preservation.cern.ch/issues/70
once this is done, we can delete this page
Description: This schema defines a Docker Environment
mandatory fields:
- environment-type
- image
optional fields:
- resources
- environment variables
- environment script
- image tag
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"additionalProperties": false,
"properties": {
"environment-schema": {
"id": "http://jsonschema.net/environment-schema",
"type": "string",
"enum":["docker-encapsulated"],
"default":"docker-encapsulated"
},
"image": {
"id": "http://jsonschema.net/image",
"type": "string"
},
"imagetag": {
"id": "http://jsonschema.net/imagetag",
"type": "string",
"default":"latest"
},
"resources": {
"id": "http://jsonschema.net/resources",
"type": "array",
"default":null
},
"envscript": {
"id": "http://jsonschema.net/envscript",
"type": "string",
"default":null
},
"envvars": {
"id": "http://jsonschema.net/envars",
"type": "object",
"default":null
}
},
"required": [
"environment-type",
"image"
]
}
{
"environment-type": "docker-encapsulated",
"image": "lukasheinrich/walkthrough_one",
}
{
"environment-type": "docker-encapsulated",
"image": "lukasheinrich/walkthrough_one",
"imagetag":"latest",
"resources":["CVMFS","GRIDProxy"],
"envscript":"/resources/setup.sh",
"envvars":{"ROOTSYS":"/usr/local"}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"additionalProperties": false,
"properties": {
"publisher-type": {
"id": "http://jsonschema.net/publisher-type",
"type": "string",
"enum": [
"process-attr-pub"
]
},
"outputmap": {
"id": "http://jsonschema.net/outputmap",
"type": "object"
}
},
"required": [
"publisher-type"
]
}
{
"publisher-type": "process-attr-pub"
}
{
"publisher-type": "process-attr-pub",
"outputmap": {
"output": "outList",
"another output": ["onePar", "anotherPar"]
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"additionalProperties": false,
"properties": {
"process-type": {
"id": "http://jsonschema.net/process-type",
"type": "string",
"enum": [
"string-interpolated-cmd"
]
},
"cmd": {
"id": "http://jsonschema.net/cmd",
"type": "string"
}
},
"required": [
"process-type",
"cmd"
]
}
{
"process-type":"string-interpolated-cmd",
"cmd":"./hello_world {someattr} {anotherattr}"
}
{
"process-type":"string-interpolated-cmd",
"cmd":"./hello_world"
}
This schema is a thin wrapper schema that holds a process, a publisher and a environment
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"additionalProperties": false,
"properties": {
"process": {
"id": "http://jsonschema.net/process",
"type": "object",
"oneOf": [{
"$ref": "/static/jsonschemas/atlas/strininterp-proc-schema.json#"
}]
},
"publisher": {
"id": "http://jsonschema.net/publisher",
"type": "object",
"oneOf": [{
"$ref": "/static/jsonschemas/atlas/fromattr-pub-schema.json#"
}]
},
"environment": {
"id": "http://jsonschema.net/environment",
"type": "object",
"oneOf": [{
"$ref": "/static/jsonschemas/atlas/docker-enc-schema.json#"
}]
}
},
"required": [
"process",
"publisher",
"environment"
]
}
this should now validate:
{
"process": {
"cmd": "./hello_world",
"process-type": "string-interpolated-cmd"
},
"publisher": {
"outputmap": {
"output": "outList",
"another output": ["onePar", "anotherPar"]
},
"publisher-type": "process-attr-pub"
},
"environment": {
"envvars": {
"ROOTSYS": "/usr/local"
},
"envscript": "/resources/setup.s",
"environment-type": "docker-encapsulated",
"imagetag": "latest",
"image": "lukasheinrich/walkthrough_one",
"resources": ["CVMFS", "GRIDProxy"]
}
}
and this also
{
"process": {
"cmd": "./hello_world",
"process-type": "string-interpolated-cmd"
},
"publisher": {
"publisher-type": "process-attr-pub"
},
"environment": {
"image": "lukasheinrich/walkthrough_one",
"environment-type": "docker-encapsulated"
}
}