Environment variables

December 9, 2025 · View on GitHub

The environment variables are passed to containers or added to the environment variable through profile or configuration files.

Note:

Environment variables starting with a Swarm component name (for example, SN_, SL_) are meant for those particular components. Environment variables starting without a Swarm component name are meant for all Swarm components.

The following environment variables are available to set and modify:

Environment variable nameDescription
SWARM_LOOPBACKUsed to bypass Swarm Learning to help you quickly develop, integrate, and test your model code with Swarm Learning package.If SWARM_LOOPBACK is set to 'True', then all Swarm functionality will be bypassed, except parameter validation.
This can help you to verify and test integration of the model code with Swarm without spawning any Swarm Learning containers.
LOGS_DIRSets the directory for Swarm components log, it is set usually by Docker file.
USR_DIRSets the directory for Swarm components, it is set usually by Docker file.
SN_ETH_PORT_EXTSets an Ethernet port for Swarm Network node.
SN_I_AM_SENTINELSets a Swarm Network node to become the Sentinel node, only when it is set to true.
Default value: False
SN_START_MININGStarts mining on non-sentinel nodes. (Optional)
Default value: False
SL_MAKE_ME_ADMINDetermines whether an SL node can participate in leader election or not. (Optional)
Default value: True
If SL_MAKE_ME_ADMIN is set to ‘False’, the corresponding SL node will not participate in leader election. If user doesn’t want to make a slow node (with less compute power, network band width etc) as a leader, then this can be set to ‘False’.
SL_LEADER_FAILURE_BASE_TIMEOUTSets the minimum timeout value (in seconds). If Swarm merging does not happen within this timeout, a new SL leader node is selected. The swarm training continues to run, regardless of SL leader node failures. This timeout will kickin after min_peers nodes have completed their local training.
Default value: 600 seconds.
This variable may need tunning depending on the ML application complexity.
SL_WAIT_FOR_FULL_QUORUM_SECONDSSets the maximum time for an SL leader node to wait for full quorum after minPeers are ready for merge. This parameter lets you to maximize the number of peers participating in the merge process.
Default value: 30 secs
SL_RAM_INTENSIVEOptimizes the usage of RAM in the SL leader node for coordinate and geometric median merge methods. Unlike mean merge method, coordinate and geometric median merge methods involve memory intensive operations. If SL Leader node has limited hardware (RAM) configuration, then merging the intermediate model parameters using the median methods can result in memory issues. For such scenarios, user can set up the SL_RAM_INTENSIVE flag to 'False' for merging the model parameters layer by layer. This 'False' option is based on I/O operations and is time consuming, hence the default option is set to 'True'.
User can pass this parameter in slenvvars option within SWOP profile. This option can be different for each SL node depending on its hardware capacity. Example: 'slenvvars : [SL_RAM_INTENSIVE : False]'
Default value: True
SL_MODEL_PARAMS_COMPRESSION_THRESHOLD_MBAdaptive compression threshold for model parameters (in MB). Model parameter files smaller than this threshold will be compressed to reduce network transfer time. Larger files skip compression to avoid disk I/O contention and CPU blocking.
Default Value: 250 (MB).
SWCI_RUN_TASK_MAX_WAIT_TIMESpecifies a maximum timeout value for the completion of a Run task (RUN_SWARM).
This value must be set in minutes, and the default is 120 mins (2 hours).
SWCI_GENERIC_TASK_MAX_WAIT_TIMESpecifies a maximum timeout value for the completion of tasks other than RUN_SWARM type task.
This value must be set in minutes, and the default is 120 mins (2 hours).
SWCI_MODEEnables SWCIs web interface instead of command line interface. Allowed values are CLI and WEB.
Default value: CLI
SWCI_STARTUP_SCRIPTThis is a default start script of SWCI.
SWCI_WEB_PORTDefault port on which SWCI-WEB starts server.
SWOP_PROFILEIndicates default profile for SWOP.
SWOP_KEEP_CONTAINERSBy default, SL and ML containers spawned by SWOP are removed. This option can be enabled to retain the stopped containers for debugging.
Default value: False
SWARM_ID_CACERTIndicates user CA certificates file.
SWARM_ID_CAPATHIndicates user CA certificates directory.
SWARM_ID_CERTIndicates user certificates file.
SWARM_ID_KEYIndicates user SSH key file.
SWARM_SPIFFE_WORKLOAD_API_SOCKET_PATHUsed for acquiring a SPIFFE identity. It points to the UNIX domain socket on which the SPIFFE agent is serving the SPIFFE workload API. For more information, https://spiffe.io/