Skip to content

Process Guide

Foundry Variables

Foundry Variables are provided by the Foundry platform and are intended to enhance the flexibility and adaptability of your workflows. These variables (e.g. FOUNDRY_RUN_ID, FOUNDRY_PIPELINE_VERSION, etc.) can be used in your process scripts or configuration files.

Variable Description
{{FOUNDRY_PIPELINE_ID}} The identifier assigned to each pipeline.
{{FOUNDRY_PIPELINE_URL}} The URL assigned to each pipeline.
{{FOUNDRY_PIPELINE_VERSION}} The version assigned to each pipeline.
{{FOUNDRY_RUN_NAME}} The name of the executed run.
{{FOUNDRY_RUN_ID}} The unique identifier assigned to each run.
{{FOUNDRY_RUN_URL}} The URL that links to the detailed information and logs for the current run.
{{FOUNDRY_WEB_REPORT_DIR}} The URL where run reports are located.
{{FOUNDRY_WEB_RUN_DIR}} The URL where run logs are located.
{{FOUNDRY_PUBLISH_DIR}} The directory path where all reported files are located.
{{FOUNDRY_LAB}} The lab associated with the Foundry account under which the current run is running.
{{FOUNDRY_USERNAME}} The username associated with the Foundry account under which the current run is running.
{{FOUNDRY_EMAIL}} The email address associated with the Foundry account under which the run is running.

Usage: When scripting within the Foundry platform, you can directly reference these variables by enclosing them in double curly braces. For example:

echo "Current Run ID: {{FOUNDRY_RUN_ID}}"

Header Script

This section, found within the Advanced Options menu, allows you to add additional scripts or comments before the beginning of the process block. This allows you to re-call the same function several times in the Script section.

Header Script

Autofill Feature for Process

To automate the filling of executor properties in Via Foundry, you can utilize the autofill feature. There are two types of autofill options available: hostname-independent autofill and hostname-dependent autofill.

Hostname-Independent Autofill:

To define executor properties that will be automatically filled regardless of the hostname, you can use the following syntax:

//* autofill
<executor properties>
//* autofill

Hostname-Dependent Autofill:

If you need to overwrite the default executor properties based on specific hostnames, you can use hostname-dependent executor properties. Here's the syntax:

//* autofill
<executor properties>
if ($HOSTNAME == "umassrc.org"){
<hostname dependent executor properties>
}
//* autofill

In this example, the <executor properties> section will be filled for all hostnames. However, if the hostname is "umassrc.org", the <hostname dependent executor properties> section will be additionally filled.

The $HOSTNAME variable in Via Foundry represents the selected hostname in the run environment. By using this variable, you can apply specific executor properties based on the hostname.

Executor Properties:

There are five types of executor properties available to autofill Executor Settings for All Processes: $TIME, $CPU, $MEMORY, $QUEUE, $EXEC_OPTIONS which respectively define the Time, CPU, Memory, Queue/Partition and Other Options fields in the executor settings. See the example below:

//* autofill
$TIME = 1000
if ($HOSTNAME == "your-host.org"){
    $TIME = 3000
    $CPU  = 4
    $MEMORY = 100
    $QUEUE = "long"
    $EXEC_OPTIONS = '-E "file /home/via"'
}
//* autofill

Platform Tag:

To isolate platform-dependent parameters in Via Foundry, you can use the platform tag. This allows you to exclude platform-specific parameters from the exported process, and when the process is imported, existing platform-dependent parameters will not be overwritten. Here's an example of how to use the platform tag:

//* autofill
$MEMORY = 32
$CPU  = 1
    //* platform
    if ($HOSTNAME == "umassrc.org"){
        $TIME = 3000
        $CPU  = 4
        $MEMORY = 100
        $QUEUE = "long"
        $EXEC_OPTIONS = '-E "file /home/via"'
    }
    //* platform
//* autofill