update of references

master
Martin Polanka 7 years ago
parent c970c73c16
commit 5ab74810ae

@ -29,6 +29,10 @@ In whole exercise configuration and appropriate structures variables and ports a
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.
Important features:
* Variables table in exercise config can contain **references** to variables which should be given during submitting of solution. Variable is reference if it starts with the character **'$'**, variable cannot be used inside variable value (textual value "hello $world", where world should be reference, is not allowed). If for some reasons is needed to use variable value which starts with dollar sign it has to be escaped with backslash, so this "\$1 million" is actual value and not a reference.
### Frontend Format
Returned as JSON. There is one generated "environment" which is called "default" in here default pipelines for all tests can be found.
@ -225,13 +229,13 @@ Pipelines are sent to clients in JSON format and are stored in API in correspond
Important features:
* Every port either have to have defined reference to variable or it has to be blank. Actual value (for example string) is not allowed in port. If variable name is declared in port it has to exist in variables table.
* Connection between ports can be one-to-one or one-to-many from the perspective of output port. That means it is possible to have one output port which redirects variables to two or more input ports. Of course there has to be exception, it is allowed to have variable which is used only in input port, value of this variable has to be defined in pipeline variables table.
* Variables table in pipeline can contain references to external variables, these references can be directed to variables from environment configuration or exercise configuration. Variable is reference if it starts with the character '$', variable cannot be used inside variable value (textual value "hello $world", where world should be reference, is not allowed). If for some reasons is needed to use variable value which starts with dollar sign it has to be escaped with backslash, so this "\$1 million" is actual value and not a reference.
* Connection between ports can be **one-to-one** or **one-to-many** from the perspective of output port. That means it is possible to have one output port which redirects variables to two or more input ports. Of course there has to be exception, it is allowed to have variable which is used only in input port, value of this variable has to be defined in pipeline variables table.
* Variables table in pipeline can contain **references** to external variables, these references can be directed to variables from environment configuration or exercise configuration. Variable is reference if it starts with the character **'$'**, variable cannot be used inside variable value (textual value "hello $world", where world should be reference, is not allowed). If for some reasons is needed to use variable value which starts with dollar sign it has to be escaped with backslash, so this "\$1 million" is actual value and not a reference.
### Boxes
* DataInBox and DataOutBox are special boxes which are treated differently from the others. This means that their deletion or even some breaking changes may have unforseen consequences. They are used for importing and exporting files in/out from pipeline. For importing string or array of strings, variable references have to be used. Inputs or outputs from pipeline may have been connected to another pipeline or to supervisor/student inputs.
* Date boxes have to be unconditionally used for importing or exporting files from pipelines. Variable references are not usable here since these references are only substitutions. For example files uploaded by supervisor (inputs and outputs) have to have input boxes in order to be properly downloaded from fileserver during execution.
* Data boxes have to be unconditionally used for importing or exporting files from pipelines. Variable references are not usable here since these references are only substitutions. For example files uploaded by supervisor (inputs and outputs) have to have input boxes in order to be properly downloaded from fileserver during execution.
* Every (except data boxes) box is used only in BoxService for creation purposes and then through abstract Box interface which is of course using inheritance for providing general usage schema. Thanks to this, creation of new boxes is quite simple and straightforward.
### Configuration
@ -311,32 +315,32 @@ Example:
Mandatory items are bold, optional italic, description of items follows:
* **${test identification}** - identifier of test from database
* **${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
* _wall-time_ - elapsed real-time in seconds, defined as float
* _cpu-time_ - elapsed cpu-time in seconds, defined as float
* _memory_ - maximal memory usage in kilobytes
* _parallel_ - maximal number of threads/processes used
Example:
```
test-id-1:
pipeline-id-1:
box-id-1:
wall-time: 5
memory: 50
parallel: 500
wall-time: 5
cpu-time: 6.4
memory: 50
parallel: 500
test-id-2:
pipeline-id-2:
box-id-2:
wall-time: 6
memory: 60
wall-time: 6
memory: 60
```
## ExerciseEnvironmentConfig
Configuration for particular environments is stored here. This configuration can be seen in two formats the one which is returned to the web-app and the one in which configuration is stored. Environment configuration is stored in individual database entities, but it is desirable to return it as a whole for the whole exercise. Hence there appears to be two formats, both of them are described bellow.
Important features:
* Variable of type `file` or `file[]` in environment config can contain **wildcards**. These wildcards are then matched against files submitted in solution. For every wildcard/variable there has to be at least one file which match it.
### Frontend Format
Mandatory items are bold, optional italic, description of items follows:

Loading…
Cancel
Save