Architecture Decision Records
ADR 0078: Every rank of a multi-node deployment gets a read-only peers file
On this page
Date: 2026-11-19 · Status: Accepted
Context
The launch variables of a multi-node deployment give a rank only its own address and the leader's (NODE_ADDR, MASTER_ADDR, MASTER_PORT). That is enough for the vLLM and SGLang rendezvous, but many recipes need to know where every rank of the group is before they start: pico-dgx-ds4's fleet.conf needs each rank's host name, management address, and for every RDMA link the HCA name and RoCE address; Ascend HCCL rank tables and Mooncake configurations are similar. Without a list from the platform, a recipe has to build its own discovery round inside the container (broadcasting to each other, exchanging files on shared storage), which is slow and written anew by every recipe.
The server already has all of these facts when it places a group: which nodes the group has and their ranks, the address, bootstrap interface and rails the group's shared compute network resolved to on every node (netplan.Resolved), and the network inventory the agents report (the interface of each RDMA port and its RoCE address verified against the GID table, the accelerator card ports' addresses).
Decision
- One typed, versioned document that reuses existing vocabulary:
proto.PeersFile. At the top:version, the reader's ownnode_rank,nnodes,master_addr/master_port, the shared network'stype/link_layer, andranksin rank order; each rank hasnode_rank,node_uuid/node_name/hostname,node_addr,management(interface,ip, the management address the agent reports), the bootstrapinterface, and the compute network'shcas(each rail'sname,device/port,netdev,ip, as the network API describes rails). Field names are the launch variables in lower case and the network API's field names; no new names are invented. Every value that also exists as a launch variable equals that rank's launch variable on every rank (the reader's own row takes itsnode_addrfrom the rank'sNODE_ADDR; both come from the same function). Adding fields keepsversion; only a change of meaning raises it. The shape is documented in Deployment Launch Parameter Sources. - Built at placement, saved with the launch: before planning the ranks of a generation, the controller builds the list from that generation's nodes and the group network it already resolved (
planning.GroupPeers). It reaches the launch parameters through the topology, anddeploy.ResolveLaunchcombines it with the rank's own number and the rendezvous intoResolvedLaunch.Peers. The document is part of the desired state, saved with the instance like argv and env, and is not derived again on a re-push or reconnect, so a container always sees the facts of its generation's placement. The evaluation preview builds it the same way. - The path is a launch variable and an env of the same name:
${GPUWORKS_PEERS_FILE}is a platform fact like${GPUWORKS_NODE_RANK}(placement.VarPeersFile; a resolver cannot return it), expanded in a template's args, env, preparation script and in manual commands; the system-layer envGPUWORKS_PEERS_FILE, with the same value, lets a program the recipe starts find the file without being passed it. A launch without a peers file whose template fields reference it fails, as a single-node reference toMASTER_ADDRdoes. - The agent writes the file and mounts it read-only in the platform directory: the agent writes the document into the instance's own runtime mount directory (purpose
peers) and mounts it read-only at/gpuworks/peers.json; it is rewritten on every container start and deleted when the instance is reclaimed. Every runtime uses the same mount (docker, nerdctl, udocker, Kubernetes volumes; the host-process runtime maps container paths to host paths through its mount table), so every runtime that supports multi-node can use it. A failed write fails that start withPEERS_FILE_PREPARE_FAILED, before any container is created. /gpuworksbelongs to the platform, as one more claim in the one container path space: the files the platform provides (the peers file, the pre-start wrapper) are under/gpuworksin the container (proto.PlatformFileDir). It has no check of its own; it is one more entry in the path rule of ADR 0077 (proto.ContainerPathsOverlap): on template import it is checked together with the model mount, componentmount_paths, assetunpack_tos and dirmount_paths (CATALOG_MOUNT_PATH_CONFLICT), and at launch resolution no mount may overlap it (MOUNT_TARGET_RESERVED). A deployment restarted as stored keeps a mount it was created with, unless it would cover this launch's peers file. Platform files added later go in the same directory and cannot collide with a recipe's mounts.- Sent by capability, by the same rule as managed directories: only the agent can write the peers file, so a launch that uses it follows ADR 0077's agent capability rule (capability
launch.peers_file). A template uses it by referencing${GPUWORKS_PEERS_FILE}in a launch field (either spelling in launch fields, only the prefixed one in a hand-written manual command): an older agent's node is refused withagent_capability_missinginstead of failing at launch with an unresolved variable. A multi-node rank that does not reference it starts on an older agent as before, only without the file, variable and env, so no path names a file that is not there and a multi-node deployment is not kept off a node for a file it does not read; the list itself still names that rank. Planning decides it once (peersForAgent) for the controller and the evaluation preview alike. - No values the container probes itself: values that depend on the container's view of devices, such as the RoCE GID index, are not written; the recipe probes them inside the container.
Trade-offs
- One more JSON key in the desired state: the list can be derived from the node and network tables, but the derivation has to happen at the moment of placement; deriving it again after the node inventory or network changes would show one running container a list that disagrees with the other ranks'. Like argv and env it is a fact of this launch, so it is saved with
ResolvedLaunch, withproto.PeersFileas its only type. - A file rather than a set of env variables: the number of ranks and rails varies, and spreading them over env would need an invented numbering convention; one JSON document can be read by any language and is easy for a recipe to convert into its own format.
- Reusing the rail description: a rail's interface and address come from
netplan.Rails, the same reading of rails the network pages and NCCL injection use, instead of a second inventory parser. - One file per rank, differing only in
node_rank: the files could be identical, with ranks told apart byNODE_RANK, but with the reader's rank in the file a program reading it needs no extra argument.
Consequences
- Protocol:
ResolvedLaunch.peers(proto.PeersFile), agent capabilitylaunch.peers_file, failure codesPEERS_FILE_PREPARE_FAILEDandMOUNT_TARGET_RESERVED; launch variable${GPUWORKS_PEERS_FILE}(alias${PEERS_FILE}); platform directoryproto.PlatformFileDir. - No new database columns or tables; the document is saved in the instance's existing desired state.
- Single-node deployments, and ranks on agents that do not advertise the capability, have no peers file.
Was this page helpful?