Preparing and Registering a Static Command Template with HEAppE

This manual describes a generic process for uploading, configuring, and registering an executable script as a command template in HEAppE. The procedure is suitable for any HPC job script you want to run via the HEAppE middleware and API.

1. Uploading Your Job Script

  1. Upload your executable job script (e.g., job_script.sh) to a shared project directory accessible by the HPC cluster, for example:

    /mnt/<hpc-storage>/<accounting_string>/your_project/job_script.sh
    

    Replace <accounting_string> with your project-specific accounting string.

  2. Ensure your script is executable by setting the appropriate permissions:

    chmod ug+x /mnt/<hpc-storage>/<accounting_string>/your_project/job_script.sh
    

3. Creating a Command Template

Command templates define executable scripts or binaries with input parameters and target HPC cluster properties.

You can create and manage command templates either via the Py4HEAppE CLI or a direct REST API call.

4.1 Using Py4HEAppE CLI

  1. Install the CLI:

pip install Py4HEAppE
  1. Initialize configuration:

py4heappe Conf Init

When prompted, provide your HEAppE instance URL and accounting string.

  1. Authenticate:

py4heappe Auth UserPass

Provide your credentials.

or

py4heappe Auth OpenId

Provide your credentials.

  1. (Optional) List existing command templates:

py4heappe CmdTemp List
  1. Create a new command template:

py4heappe CmdTemp Create \
    --name <template_name> \
    --desc <template_description> \
    --execscript /mnt/proj3/<accounting_string>/your_project/job_script.sh \
    --clusternodetypeid <cluster_node_type_id>
  • Obtain the <cluster_node_type_id> from cluster info:

    py4heappe Info ClusterInfo
    
  1. Add parameters for the command template (if your script expects them):

py4heappe CmdTemp CreateParameter \
    --cmdtemplateid <template_id> \
    --uniquename <parameter_name> \
    --desc "<parameter_description>"

3.2 Using REST API

Alternatively, create the command template via HTTP POST to the Management API:

curl -X 'POST' \
  'https://<your-heappe-instance>/heappe/Management/CommandTemplate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "SessionCode": "<sessionCode>",
    "Name": "<template_name>",
    "Description": "<template_description>",
    "ExtendedAllocationCommand": "",
    "ExecutableFile": "/mnt/<hpc-storage>/<accounting_string>/your_project/job_script.sh",
    "PreparationScript": null,
    "ClusterNodeTypeId": <cluster_node_type_id>,
    "ProjectId": <project_id>,
    "TemplateParameters": [
      {
        "Identifier": "<parameter_name>",
        "Query": "",
        "Description": "<parameter_description>"
      }
      // Add more parameters if needed
    ]
}'

Replace placeholders accordingly.

Important Notes

  • All placeholders like <accounting_string>, <sessionCode>, <cluster_node_type_id>, <project_id>, and parameter details must be replaced with values matching your environment.

  • The job script must exist at the specified path accessible for execution by the HPC cluster via HEAppE.