resourceLabels
The resourceLabels directive attaches custom name-value pairs to task executions, for executors that support it. For example:
process hello {
resourceLabels region: 'some-region', user: 'some-username'
script:
"""
your_command --here
"""
}
Resource labels are attached to underlying resources such as cloud VMs, and are intended for operational purposes such as cost tracking. They are not recorded in lineage metadata.
When resourceLabels is specified multiple times in the config, only the last setting is used. Additionally, when resourceLabels is specified both in the config and the process definition, only the process definition is used.
As a best practice, define all resource labels in a single config setting:
process {
resourceLabels = [ region: 'some-region', user: 'some-username' ]
}
Use process selectors (withName: or withLabel:) to override resource labels for a specific process.
Resource labels are currently supported by the following executors:
The limits and the syntax of the corresponding executor should be taken into consideration when using resource labels.
Resource labels in Azure are added to auto-pools, rather than jobs, in order to facilitate cost analysis. A new pool will be created for each new set of resource labels. Therefore, it is recommended to also set azure.batch.deletePoolsOnCompletion = true when using process-specific resource labels.
See also: label (for shared process configuration), tag (for per-task identification)