Usage of affinityGroup Tag
Steps are bound to an affinity group through its
configuration section, using the
To specify an affinity group for an individual step:
You can specify any string as the name of the affinity group, but you must use the same string for all
affinityGroup tags in the steps you wish to bind together in the group.
Alternatively, if all steps in the pipeline are to be in the same affinity group,
affinityGroup may be specified in the Pipelines configuration section:
The following simplified pipeline creates two steps bound to the same
ag_step_1 creates a text file in the build node where it executes, using the shared_workspace variable to ensure that the file will be available to both steps. The subsequent step,
ag_step_2 tries to read the file.
ag_step_2 into the same affinity group, the file that
ag_step_1 created in the build node's file system is available to
ag_step_2 because it is guaranteed to be running in the same node. Without being bound to an affinity group,
ag_step_2 may fail because it might execute in a node where the file does not exist.
When this pipeline is loaded in the JFrog Platform, the interactive diagram shown in the Pipeline History indicates that these steps are bound into the same affinity group:
When the pipeline is run, the Pipeline Run Logs show that
ag_step_2 was able to successfully find the file in the node's filesystem that was created by