Description of configuration items and some repairs of broken formats

master
Martin Polanka 7 years ago
parent 5090238a7d
commit 78c54161ca

@ -4,6 +4,15 @@ In ReCodEx there are two configurations of exercise High Level Configuration (Hi
HiLC is divided in several parts which takes care of different things. There are ExerciseConfig, Pipelines, Limits and RuntimeConfig. From these components configuration of exercise is composed and on every submit new LoLC is compiled from it.
## Variables and Ports
In whole exercise configuration and appropriate structures variables and ports are used. All have to have a type. It was decided that there will be four types which should be sufficient for every possible usage. List of them follows:
* string - ...
* string[] - array of strings
* file - ...
* file[] - array of files
## ExerciseConfig
Represents basic exercise configuration which connects all things together. For some reasons there two formats of this configuration, one which is saved in the database and the other one which is sent back to web application. Both formats are described bellow.
@ -14,16 +23,16 @@ Returned as JSON.
Mandatory items are bold, optional italic, description of items follows:
* **${implicit list of environments}** - ...
* **name** - ...
* **tests** - ...
* **name** - ...
* **pipelines** - ...
* **name** - ...
* _variables_ - ...
* **name** - ...
* **type** - ...
* **value** - ...
* **${list of environments}** - root element is list of environments
* **name** - identifier of the environment from database
* **tests** - list of tests
* **name** - name of the test which serves as unique identifier
* **pipelines** - list of pipelines contained in test
* **name** - identifier of pipeline database entity
* _variables_ - list of variables for this pipeline
* **name** - unique identifier of variable
* **type** - one of the supported types
* **value** - either single scalar value or array is variable is of array type
Example:
@ -139,27 +148,29 @@ Example:
### Backend Format
Whole configuration consists of tests which should have defined pipelines from which they are composed. There are default pipelines and also special pipelines for runtime environments. If definition of some environment pipeline is missing they are taken from default pipelines of appropriate test.
Stored in yaml.
Mandatory items are bold, optional italic, description of items follows:
* **environments** - ...
* **tests** - ...
* **${test identification}** - ...
* **pipelines** - ...
* **name** - ...
* **variables** - ...
* **${variable identification}** - ...
* **type** - ...
* **value** - ...
* **environments** - ...
* **${environment identification}** - ...
* **pipelines** - ...
* **name** - ...
* **variables** - ...
* **${variable identification}** - ...
* **type** - ...
* **value** - ...
* **environments** - list of environments identifiers which belong to exercise
* **tests** - map of tests indexed by test unique identifier
* **${test identification}** - test unique identifier
* **pipelines** - list of default pipelines for this test
* **name** - identifier of pipeline from database entity
* **variables** - list of variables
* **name** - unique identifier of the variable
* **type** - one of the supported variable types
* **value** - either single scalar value or array is variable is of array type
* **environments** - map of environments which redefines default pipelines from this test
* **${environment identification}** - unique environment identifier from database
* **pipelines** - list of redefined pipelines
* **name** - name of the pipeline to which following variables belongs to
* **variables** - list of variables
* **name** - unique identifier of the variable
* **type** - one of the supported variable types
* **value** - either single scalar value or array is variable is of array type
Example:
@ -172,7 +183,7 @@ tests:
pipelines:
- name: pipeline1
variables:
varA:
- name: varA
type: string
value: valA
environments:
@ -180,7 +191,7 @@ tests:
pipelines:
- name: pipelineJava
variables:
varJava:
- name: varJava
type: string
value: valJava
cpp11: []
@ -188,7 +199,7 @@ tests:
pipelines:
- name: pipeline2
variables:
varB:
- name: varB
type: file
value: valB
environments:
@ -196,7 +207,7 @@ tests:
pipelines:
- name: pipeline2
variables:
varCpp:
- name: varCpp
type: file
value: valCpp
```
@ -221,26 +232,33 @@ Important features:
Mandatory items are bold, optional italic, description of items follows:
* **variables** - ...
* ${implicit list of variables}
* **name** - ...
* **type** - ...
* **value** - ...
* **boxes** - ...
* ${implicit list of boxes}
* **name** - ...
* **portsIn** - ...
* ${name of the port}
* **type** - ...
* **value** - ...
* **portsOut** - ...
* **type** - ...
* **variables** - list of variables for this pipeline
* **name** - unique identifier of the variable
* **type** - one of the supported variable types
* **value** - either single scalar value or array is variable is of array type
* **boxes** - list of boxes which are defined in this pipeline
* **name** - unique identification of box
* **type** - one of the supported box types
* **portsIn** - map of input ports
* **${port identification}** - unique identification of port
* **type** - one of the supported port types
* **value** - reference to variable which has to be defined in pipeline variables table, also port has to match
* **portsOut** - map of output ports
* **${port identification}** - unique identifier of port
* **type** - one of the supported port types
* **value** - reference to variable which has to be defined in pipeline variables table, also port has to match
Example:
```
{
"variables":[],
"variables":[
{
"name":"source_file",
"type":"file",
"value":"source.cpp"
}
],
"boxes": [
{
"name":"source",
@ -286,12 +304,12 @@ Example:
Mandatory items are bold, optional italic, description of items follows:
* **${test identification}** - ...
* **${pipeline identification}** - ...
* **${box identification}** - ...
* _wall-time_ - ...
* _memory_ - ...
* _parallel_ - ...
* **${test identification}** - identifier of test
* **${pipeline identification}** - identifier of pipeline taken from database
* **${box identification}** - identifier of box within pipeline
* _wall-time_ - elapsed real-time in seconds, defined as float
* _memory_ - maximal memory usage in kilobytes
* _parallel_ - maximal number of threads/processes used
Example:
@ -315,7 +333,12 @@ test-id-2:
Mandatory items are bold, optional italic, description of items follows:
* ...
* **{list of environments}** - root element is list of exercise environment configurations
* **runtimeEnvironmentId** - identification of environment taken from database
* **variablesTable** - list of variables
* **name** - unique identification of variable
* **type** - one of the supported variable types
* **value** - either single scalar value or array is variable is of array type
Example:
@ -325,16 +348,15 @@ Example:
"runtimeEnvironmentId":"CRuntime",
"variablesTable":[
{
"varA":{
"name":"varA"
"type":"string",
"value":"valA"
}
},
{
"varB":{
"name":"varB"
"type":"file",
"value":"valB"
}
}
]
},
@ -342,17 +364,15 @@ Example:
"runtimeEnvironmentId":"JavaRuntime",
"variablesTable":[
{
"varA":{
"name":"varA"
"type":"file",
"value":"javaA"
}
},
{
"varB":{
"name":"varB"
"type":"string",
"value":"javaB"
}
}
]
}
]
@ -360,11 +380,23 @@ Example:
### Backend Format
In API environment configurations are stored differently from how they are returned to the web-app. For every runtime environment there is individual database entity which holds environment configuration. Therefore there is only need to store variables table.
Mandatory items are bold, optional italic, description of items follows:
* ...
* **variablesTable** - list of variables
* **name** - unique identification of variable
* **type** - one of the supported variable types
* **value** - either single scalar value or array is variable is of array type
Example:
```
variablesTable:
- name: varName
type: string
value: varValue
- name: source_file
type: file
value: source.cpp
```
Loading…
Cancel
Save