REST API cofiguration
The appsettings.json
file is the main configuration file for the HEAppE Middleware. It contains the configuration for the database, logging, and other services. The file is located in the app directory of the HEAppE Middleware.
The file is in JSON format and contains the following configuration blocks:
ConnectionStrings
This configuration block contains the connection strings for the database and logging services.
The connection strings are used to connect to the database and logging services. The connection strings are stored in the appsettings.json
file and are used by the HEAppE Middleware to connect to the database and logging services.
Following connection string can be used, but <mssql_password>
needs to be replaced the with the password. Password must meet the password policy of the Microsoft SQL Server.
"ConnectionStrings": {
"MiddlewareContext": "Server=mssql;Database=heappe;User=SA;Password=<mssql_password>;TrustServerCertificate=true;",
"Logging": ""
}
BackGroundThreadSettings
- This configuration block allows time-interval definition (in seconds), where each background thread is activated.
GetAllJobsInformationCheck - Update job status from batch schedulers
CloseConnectionToFinishedJobsCheck - Close tunnel connection for finished jobs
ClusterAccountRotationJobCheck - Check if Middleware is able to submit job (ClusterAccountRotation = true)
FileTransferKeyRemovalCheck - Removal FileTransfer temporary added keys
"BackGroundThreadSettings": {
"GetAllJobsInformationCheck": 30,
"CloseConnectionToFinishedJobsCheck": 30,
"ClusterAccountRotationJobCheck": 30,
"FileTransferKeyRemovalCheck": 10800
}
BusinessLogicSettings
- This setting block allows the HEAppE business logic configurations.
ClusterAccountRotation - Rotation of cluster service accounts
GeneratedFileTransferKeyLimitPerJob - Maximal active FileTransfer temporary keys per job
ValidityOfTemporaryTransferKeysInHours - Validity of FileTransfer temporary keys
SessionExpirationInSeconds - User session expiration
HTTPRequestConnectionTimeoutInSeconds - HTTP requests timeout
"BusinessLogicSettings": {
"ClusterAccountRotation": false,
"GeneratedFileTransferKeyLimitPerJob": 5,
"ValidityOfTemporaryTransferKeysInHours": 24,
"SessionExpirationInSeconds": 900,
"HTTPRequestConnectionTimeoutInSeconds": 10
}
CertificateGeneratorSettings
These configurations allow the setup of encryption ciphers (file transfer temporary key). You can define path, in which keys will be generated and stored, keys prefix and type. You can choose type from several options:
RSA 3072
RSA 4096
ECDSA 256
ECDSA 521
"CertificateGeneratorSettings": {
"GeneratedKeysDirectory": "/opt/heappe/keys/",
"GeneratedKeyPrefix": "key",
"CipherSettings": {
"TypeName": "RSA",
"Size": 4096
}
}
HPCConnectionFrameworkSettings
The following two blocks present the configuration of the HEAppE HPC connection framework (for HPC as well as Local Cluster).
"HPCConnectionFrameworkSettings": {
"GenericCommandKeyParameter": "#HEAPPE_PARAM",
"JobArrayDbDelimiter": "<JOB_ARRAY_ITERATION>",
"TunnelSettings": {
"LocalhostName": "127.0.0.1",
"MinLocalPort": 4000,
"MaxLocalPort": 4500
},
"CommandScriptsPathSettings": {
"AddFiletransferKeyCmdPath": "~/.key_scripts/add_key.sh",
"RemoveFiletransferKeyCmdPath": "~/.key_scripts/remove_key.sh",
"CreateJobDirectoryCmdPath": "~/.key_scripts/create_job_directory.sh",
"ExecuteCmdPath": "~/.key_scripts/run_command.sh",
"ExecuteBackgroundCmdPath": "~/.key_scripts/run_background_command.sh",
"CopyDataFromTempCmdPath": "~/.key_scripts/copy_data_from_temp.sh",
"CopyDataToTempCmdPath": "~/.key_scripts/copy_data_to_temp.sh"
},
"ClustersConnectionPoolSettings":{
"ConnectionPoolCleaningInterval": 60,
"ConnectionPoolMaxUnusedInterval": 1800
},
"ScriptsSettings": {
"ClusterScriptsRepository": "https://github.com/It4innovations/HEAppE-scripts.git",
"KeyScriptsDirectoryInRepository": "HEAppE-scripts/HPC/.key_scripts/",
"SubExecutionsPath": "HEAppE/Executions",
"SubScriptsPath": "HEAppE/Scripts",
"ScriptsBasePath": "~/.key_scripts",
"CommandScriptsPathSettings": {
"AddFiletransferKeyCmdScriptName": "add_key.sh",
"RemoveFiletransferKeyCmdScriptName": "remove_key.sh",
"CreateJobDirectoryCmdScriptName": "create_job_directory.sh",
"ExecuteCmdScriptName": "run_command.sh",
"CopyDataFromTempCmdScriptName": "copy_data_from_temp.sh",
"CopyDataToTempCmdScriptName": "copy_data_to_temp.sh"
},
"LinuxLocalCommandScriptPathSettings": {
"ScriptsBasePath": "~/.local_hpc_scripts",
"PrepareJobDirCmdScriptName": "prepare_job_dir.sh",
"RunLocalCmdScriptName": "run_local.sh",
"GetJobInfoCmdScriptName": "get_job_info.sh",
"CountJobsCmdScriptName": "count_jobs.sh",
"CancelJobCmdScriptName": "cancel_job.sh"
}
}
}
ExternalAuthenticationSettings
This configuration block allows the setup of external authentication services. You can define the URL of the external authentication service, the URL of the external authentication service’s token endpoint, and the client ID and client secret of the external authentication service.
"ExternalAuthenticationSettings": {
"BaseUrl": "",
"Protocol": "openid-connect",
"RealmName": "",
"ClientId": "",
"SecretId": "",
"ConnectionTimeout": 15,
"AllowedClientIds": [],
"RoleMapping": {
"prj_list": "Maintainer",
"prj_read": "Reporter",
"prj_write": "Submitter"
},
"Projects":
[
{
"UUID": "",
"Name": "",
"HEAppEGroupName": "OpenIDGroup"
}
],
"HEAppEUserPrefix": "Open-Id_",
"LexisAuthenticationConfiguration":
{
"BaseAddress": "",
"EndpointPrefix": "userorg",
"ExtendedUserInfoEndpoint": "/api/UserInfo/Extended",
"HEAppEGroupNamePrefix": "Lexis_",
"HEAppEUserPrefix": "Lexis_<USERNAME>",
"RoleMapping":
{
"Submitter": "heappe_exec"
}
}
},
"OpenStackSettings": {
"IdentityPort": 5000,
"ConnectionTimeout": 15,
"OpenStackVersion": 3,
"OpenStackSessionExpiration": 1800
}