Commit c8d4eda4 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[schema][experiment] Refactored for v2 version

This moves out common definitions in a separate file. This
patch also updates the execution schema to reflect that.
parent c39d03e4
......@@ -46,7 +46,7 @@
"type": "object",
"properties": {
"database": {
"$ref": "../experiment/1.json#/definitions/versioned_database"
"$ref": "../experiment/common.json#/definitions/versioned_database"
},
"protocol": { "$ref": "../database/1.json#/definitions/protocol_name" },
"set": { "$ref": "../database/1.json#/definitions/identifier" },
......@@ -129,9 +129,9 @@
"inputs": { "$ref": "#/definitions/input_map" },
"channel": { "$ref": "../database/1.json#/definitions/identifier" },
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "../experiment/1.json#/definitions/parameter_set" },
"queue": { "$ref": "../experiment/1.json#/definitions/queue" },
"environment": { "$ref": "../experiment/1.json#/definitions/environment" },
"parameters": { "$ref": "../experiment/common.json#/definitions/parameter_set" },
"queue": { "$ref": "../experiment/common.json#/definitions/queue" },
"environment": { "$ref": "../experiment/common.json#/definitions/environment" },
"range": { "$ref": "#/definitions/range" },
"schema_version": { "$ref": "../common/1.json#/definitions/version" }
},
......@@ -163,7 +163,7 @@
{
"properties": {
"outputs": { "$ref": "#/definitions/output_map" },
"nb_slots": { "$ref": "../experiment/1.json#/definitions/slots" }
"nb_slots": { "$ref": "../experiment/common.json#/definitions/slots" }
},
"required": [
"outputs",
......
......@@ -10,47 +10,19 @@
"description": { "$ref": "../common/1.json#/definitions/description" },
"datasets": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/dataset" }
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
"$ref": "common.json#/definitions/datasets"
},
"blocks": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/block" }
},
"uniqueItems": true,
"additionalProperties": false
"$ref": "common.json#/definitions/blocks"
},
"analyzers": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/analyzer" }
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
"$ref": "common.json#/definitions/analyzers"
},
"globals": {
"type": "object",
"properties": {
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" }
},
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*/[a-zA-Z_][a-zA-Z0-9_-]*/[0-9]+$": {
"$ref": "#/definitions/parameter_set"
}
},
"uniqueItems": true,
"additionalProperties": false
"$ref": "common.json#/definitions/globals"
},
"schema_version": { "$ref": "../common/1.json#/definitions/version" }
......@@ -64,113 +36,6 @@
"globals"
],
"additionalProperties": false,
"definitions": {
"queue": {
"type": "string"
},
"environment": {
"type": "object",
"properties": {
"name": { "type": "string" },
"version": { "type": "string" }
},
"required": [
"name",
"version"
],
"additionalProperties": false
},
"slots": {
"type": "integer",
"minimum": 1,
"exclusiveMinimum": false
},
"versioned_database": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*/[0-9]+$"
},
"dataset": {
"type": "object",
"properties": {
"set": { "$ref": "../database/1.json#/definitions/identifier" },
"protocol": { "$ref": "../database/1.json#/definitions/protocol_name" },
"database": { "$ref": "#/definitions/versioned_database" }
},
"required": [
"set",
"protocol",
"database"
],
"additionalProperties": false
},
"connection_map": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
"$ref": "../toolchain/common.json#/definitions/identifier"
}
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
},
"block": {
"type": "object",
"properties": {
"inputs": { "$ref": "#/definitions/connection_map" },
"outputs": { "$ref": "#/definitions/connection_map" },
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "#/definitions/parameter_set" },
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" },
"nb_slots": { "$ref": "#/definitions/slots" }
},
"required": [
"inputs",
"outputs",
"algorithm"
],
"additionalProperties": false
},
"analyzer": {
"type": "object",
"properties": {
"inputs": { "$ref": "#/definitions/connection_map" },
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "#/definitions/parameter_set" },
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" },
"nb_slots": { "$ref": "#/definitions/slots" }
},
"required": [
"inputs",
"algorithm"
],
"additionalProperties": false
},
"parameter_set": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"$ref": "../common/1.json#/definitions/value"
}
},
"minProperties": 0,
"uniqueItems": true,
"additionalProperties": false
}
}
"additionalProperties": false
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Experiment v2 descriptor",
"description": "This schema defines the properties of a v2 experiment",
"type": "object",
"properties": {
"description": { "$ref": "../common/1.json#/definitions/description" },
"datasets": {
"$ref": "common.json#/definitions/datasets"
},
"blocks": {
"$ref": "common.json#/definitions/blocks"
},
"loops": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/loop" }
},
"uniqueItems": true,
"additionalProperties": false
},
"analyzers": {
"$ref": "common.json#/definitions/analyzers"
},
"globals": {
"$ref": "common.json#/definitions/globals"
},
"schema_version": { "$ref": "../common/1.json#/definitions/version" }
},
"required": [
"datasets",
"blocks",
"analyzers",
"globals"
],
"additionalProperties": false,
"definitions": {
"loop": {
"type": "object",
"properties": {
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "common.json#/definitions/parameter_set" },
"inputs": { "$ref": "common.json#/definitions/connection_map" },
"queue": { "$ref": "common.json#/definitions/queue" },
"environment": { "$ref": "common.json#/definitions/environment" },
"nb_slots": { "$ref": "common.json#/definitions/slots" }
}
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Experiment common components descriptor",
"description": "This schema defines the components components used in of the Experiment",
"definitions": {
"datasets": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/dataset" }
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
},
"blocks": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/block" }
},
"uniqueItems": true,
"additionalProperties": false
},
"analyzers": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": { "$ref": "#/definitions/analyzer" }
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
},
"globals": {
"type": "object",
"properties": {
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" }
},
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*/[a-zA-Z_][a-zA-Z0-9_-]*/[0-9]+$": {
"$ref": "#/definitions/parameter_set"
}
},
"uniqueItems": true,
"additionalProperties": false
},
"queue": {
"type": "string"
},
"environment": {
"type": "object",
"properties": {
"name": { "type": "string" },
"version": { "type": "string" }
},
"required": [
"name",
"version"
],
"additionalProperties": false
},
"slots": {
"type": "integer",
"minimum": 1,
"exclusiveMinimum": false
},
"versioned_database": {
"type": "string",
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*/[0-9]+$"
},
"dataset": {
"type": "object",
"properties": {
"set": { "$ref": "../database/1.json#/definitions/identifier" },
"protocol": { "$ref": "../database/1.json#/definitions/protocol_name" },
"database": { "$ref": "#/definitions/versioned_database" }
},
"required": [
"set",
"protocol",
"database"
],
"additionalProperties": false
},
"connection_map": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
"$ref": "../toolchain/common.json#/definitions/identifier"
}
},
"minProperties": 1,
"uniqueItems": true,
"additionalProperties": false
},
"block": {
"type": "object",
"properties": {
"inputs": { "$ref": "#/definitions/connection_map" },
"outputs": { "$ref": "#/definitions/connection_map" },
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "#/definitions/parameter_set" },
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" },
"nb_slots": { "$ref": "#/definitions/slots" }
},
"required": [
"inputs",
"outputs",
"algorithm"
],
"additionalProperties": false
},
"analyzer": {
"type": "object",
"properties": {
"inputs": { "$ref": "#/definitions/connection_map" },
"algorithm": { "$ref": "../common/1.json#/definitions/reference" },
"parameters": { "$ref": "#/definitions/parameter_set" },
"queue": { "$ref": "#/definitions/queue" },
"environment": { "$ref": "#/definitions/environment" },
"nb_slots": { "$ref": "#/definitions/slots" }
},
"required": [
"inputs",
"algorithm"
],
"additionalProperties": false
},
"parameter_set": {
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"$ref": "../common/1.json#/definitions/value"
}
},
"minProperties": 0,
"uniqueItems": true,
"additionalProperties": false
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment