REST API & Command Template

REST API

Each deployed HEAppE instance contains its own interactive Swagger REST API documentation with endpoint descriptions and parameter examples. You could try the live demo HEAppE instance.

Command Template

For security purposes, HEAppE enables the users to run only a pre-prepared set of so-called Command Templates. Each template defines a script or executable binary, that will be executed on a specific HPC cluster queue to which the template is assigned (any dependencies or third-party software it might require). There are generally two kinds of these templates:

  1. Static command template

    The command template contains the set of input parameters (parameters are exposed in the API) that will be passed to the executable script during the run-time. Thus, the users can execute pre-prepared command templates with the pre-defined set of input parameters. The actual value of each parameter (input from the user) can be different for each job submission. The following block presents the static command template configuration in the HEAppE Middleware part. In the HPC part, must exist the corresponding test script with one inputParam parameter located at ~/.key_scripts/test.sh.

    Example of static command template definition in seed.njson.
      "CommandTemplates":[
        {
          "Id": 1,
          "Name": "TestTemplate",
          "Description": "TestTemplate",
          "Code": "TestTemplate",
          "ExecutableFile": "~/.key_scripts/test.sh",
          "CommandParameters": "%%{inputParam}",
          "PreparationScript": null,
          "ClusterNodeTypeId": 2,
          "IsGeneric": false,
          "IsEnabled": true
        }
      ],
      "CommandTemplateParameters": [
        {
          "Id": 1,
          "Identifier": "inputParam",
          "Query": "",
          "Description": "inputParam",
          "CommandTemplateId": 1,
          "IsVisible": true
        }
      ]
    
  2. Generic command template

    The command template only exposed the “userScriptPath” parameter, rest of the parameters (defined with #HEAPPE_PARAM) are taken from the bash script of the command template at the run-time. To use the Generic command template user must know all the input parameters defined in the bash script (which had to be specified in the HEAppE API CreateJob method). The main goal of the generic command template is for the prototyping for creating new static command templates (which can be done by the users with access to the HPC centre). After debugging of generic command template, it could be transferred into a static one by corresponding methods defined in the management HEAppE API endpoint. The following block presents the generic command template configuration in the HEAppE Middleware part. In the HPC part, must exist the corresponding generic test script with two parameters (iterations, message) located at ~/.key_scripts/test_generic.sh.

    Example of generic command template definition in seed.njson.
      "CommandTemplates":[
        {
          "Id": 1,
          "Name": "GenericCommandTemplate",
          "Description": "Command template for generic job.",
          "Code": "GenericCommandTemplate",
          "ExecutableFile": "~/.key_scripts/generic.sh",
          "CommandParameters": "%%{userScriptPath} %%{userScriptParametres}",
          "PreparationScript": null,
          "ClusterNodeTypeId": 2,
          "IsGeneric": true,
          "IsEnabled": true
        }
      ],
      "CommandTemplateParameters": [
        {
          "Id": 1,
          "Identifier": "userScriptPath",
          "Query": "",
          "Description": "Path of the user script, to be executed via the generic job script",
          "CommandTemplateId": 1,
          "IsVisible": true
        },
        {
          "Id": 2,
          "Identifier": "userScriptParametres",
          "Query": "",
          "Description": "Generic parameters of the generic command template.",
          "CommandTemplateId": 1,
          "IsVisible": false
        }
      ]