Containers
Acquiring custom files

As discussed in the submission results document, during the submission execution, some feedback is produced and stored. Most of it is strictly defined, yet there is one dedicated stream designed to keep auxiliary files selected by the Content Manager.

For each scenario, a project configuration allows defining which directories should be kept after the submission execution of this scenario. This is defined in the root.scenarios.scenarioName.auxdata key of the configuration JSON file.

The auxdata configuration field is a key: value collection compatible with the following:

  • both key and value are of the type string,
  • the key is a string that is valid as a filename in Linux operating systems,
  • the value is an absolute path, or a relative path to some directory in the filesystem,
    • if a relative path is given, it is assumed to be relative to the $SE_PATH_WORKSPACE directory (usually /home/user/workspace).

After the submission execution of the scenario the following steps are performed:

  • a single compressed archive auxdata.tar.gz with all specified resources will be created,
    • the archive is of the gzip type,
  • for each key a directory of the same name is created in the auxdata.tar.gz archive,
  • for the value corresponding with the key, the content of the directory pointed by value is copied into the directory pointed by key in the auxdata.tar.gz archive,
  • if the directory pointed by value is missing, the whole key: value pair is omitted,
    • this is not considered an error,
    • an empty directory of the name key will not be created in the auxdata.tar.gz archive,
  • the copying process does not follow symbolic links in the copied directories,
    • this means that files and directories pointed by symbolic link will not be present in the auxdata.tar.gz archive.

Example

Now, let's summarize this by analyzing a simple example.

config.json file:

{
(...)
  "auxdata": {
    "custom_dir1": "d1",
    "custom_dir2": "d2",
    "custom_dir3": "/tmp/xyz"
  }
(...)
}

By this part of a configuration file it is expected that after submission execution of the scenario, there are three directories that should be preserved:

  • directory d1 in the $SE_PATH_WORKSPACE, so usually /home/user/workspace/d1,
  • directory d2 in the $SE_PATH_WORKSPACE, so usually /home/user/workspace/d2,
  • directory /tmp/xyz.

Based on this, a compressed archive auxdata.tar.gz with the content specified be auxdata configuration field will be created. Assuming all specified directories exist, the structure of the archive is as follows:

.
├── custom_dir1
│   ├── ...
│   └── ...
├── custom_dir2
│   ├── ...
│   └── ...
└── custom_dir3
    │ ...
    └── ...

For example the content of auxdata.tar.gz archive can look like this:

.
├── custom_dir1
│   ├── file.txt
│   └── .hidden_file
├── custom_dir2
│   ├── file.txt
│   └── subdirectory
│       ├── file.txt
│       └── .hidden_file
└── custom_dir3
    └── file.txt

Finally, the auxdata.tar.gz archive is stored along with other submission execution of the scenario results. It can be later downloaded by the GET /submissions/:id/:stream Containers API method call with stream=auxdata.