Repository navigation
feat(agent): join a pod group's coordination session - #826
galletas1712 wants to merge 22 commits into
Conversation
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Breaking Api Changes | PR #826 (ai-dynamo/snapshot, author galletas1712, base coordinator-nats, head schwinns/agent-group-member) changes no files under api/ that this PR introduces. Evidence: - The local checkout is detach… |
|
| Rbac Least Privilege | The check fails only if a kubebuilder RBAC marker or Helm RBAC manifest grants wildcard verbs or resources without a justification comment. I found no such grant in the checked-out PR head (6d43fd3, t… |
Full details: Breaking Api Changes
-
Explanation
PR
#826(ai-dynamo/snapshot, author galletas1712, base coordinator-nats, head schwinns/agent-group-member) changes no files under api/ that this PR introduces. Evidence: - The local checkout is detached at 6d43fd3. Its merge-base with main is 5f52a5e.git diff --stat main...HEAD -- api/is empty. - The PR branch merged coordinator-nats at 96ece98.git diff --stat 96ece98^2 HEAD -- api/is empty, and so is96ece98^1 HEAD -- api/. So the PR's own commits add no api/ change on top of coordinator-nats. - A two-dotgit diff main HEAD -- api/shows changes. Those come from main, which has api/ commits that coordinator-nats lacks. They are not PR changes. The96ece98^2 -> maindiff shows the same set. Against the check: - No existing exported field is removed, renamed, retyped, or has its json tag changed. No api/ hunk exists to inspect. - No new field is added, so the// +optionaland+kubebuilder:defaultrule is not triggered. - No XValidation immutability marker on PodSnapshotSpec or PodSnapshotContentSpec is changed. The PR body also states "Does this PR introduce an API change? NONE", which matches the diff evidence. Limit: the coordinator-nats tip is not present locally. The conclusion rests on the merge-base and merge-parent diffs above, which show no api/ change in the PR's commit range.
Full details: Rbac Least Privilege
-
Explanation
The check fails only if a kubebuilder RBAC marker or Helm RBAC manifest grants wildcard verbs or resources without a justification comment. I found no such grant in the checked-out PR head (6d43fd3, the provider-reported head of PR
#826). - Kubebuilder markers: every+kubebuilder:rbacmarker inoperator/internal/controller/(podsnapshot_reconciler.go, snapshotcontent_reconciler.go, snapshotjob_reconciler.go) names explicit verbs and explicit resources. A search for*in kubebuilder RBAC markers returned no matches. - Helm manifests:charts/snapshot/templates/role.yaml,rolebinding.yaml,operator-rbac.yamlandopenshift/rbac-privileged.yamlcontain no*character. - PR scope: the PR description covers the newagent/internal/grouppackage, executor barriers, the manifestpodGroupsection, ago.modreplace and a Dockerfile build context. It does not describe RBAC changes. The commits at the checked-out head touch onlyagent/internal/executorfiles (checkpoint.go, restore.go, group_test.go). Limitation: the base branchcoordinator-natsis not in the local clone, so I could not produce the full PR diff against its base. The RBAC-related result does not depend on that diff, because no wildcard grant exists anywhere in the checked-out RBAC markers or manifests. Any RBAC change in the unseen part of the diff would also need a wildcard to trigger this check, and none is present at head.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
f68f2da to
654220f
Compare
|
A heads-up for the rest of #614, from the
Separately, this PR is stacked on #762 at
So a rebase onto the current |
654220f to
8c1b613
Compare
|
A follow-up to my note on A restore Pod can now serve several attempts in turn, so its binding and its reports both name an attempt by UID:
One helper should publish every report, so no path can bypass these rules. Please test it against a real API server on Kubernetes 1.32 and the newest supported version, covering:
The two annotation constants land with #811. Nothing in this PR needs to change before that. |
8c1b613 to
fc147c3
Compare
The agent image now carries /usr/local/bin/snapshot-coordinator, which the agent's Pod will run in a container of its own, with its own command; there is no separate image. - agent/Dockerfile builds it in a coordinator-builder stage of its own, from the coordinator module and its own go.mod, with the api and coordinator modules copied side by side from their named build contexts, on go-base's toolchain image. go-base is unchanged. - The image's compliance steps cover the coordinator module's Go dependencies as they cover the agent's: that stage vendors them, the sources stage ships them at /legal/source/go/coordinator/vendor, and THIRD-PARTY.txt gains a section for them, which go-licenses.sh's new optional argument names "snapshot-coordinator". The agent's section and the operator's are unchanged. - AGENT_BUILD_FLAGS passes the coordinator build context, with the line #826 adds, so the two changes merge cleanly. - coordinator/.dockerignore keeps make build's bin/ out of that context. - The root Makefile's test-integration comment named the operator only; the coordinator's tests run there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Julien Mancuso <jmancuso@nvidia.com>
83725b4 to
8bfc1d1
Compare
|
A heads-up on the restore Pod contract, which changed so that one Pod template can serve every replica of a group (#325 has the details, and #614 lists the agent's part):
The shared parsing of the marker and the map lands in |
|
A heads-up on the restore Pod contract for group targets, which changed again (#325 has the details, and #614 lists the agent's part). The
The shared reader for the binding and the single-pair map lands in |
fc0c592 to
3add993
Compare
A member of a pod group runs its capture or restore as its part in the group's, as SNEP-324 describes. The new package agent/internal/group joins the attempt's session through the coordinator module's client, takes the member's rank from the session, exchanges the members' admissions, maps the other members' capture-time IPs to their current ones, passes the group's barriers, and fails or leaves the attempt. The executor takes an optional group member on a capture or restore request. A capture admits the group after its own checks and before anything changes the source, records the capture ID, the member, its rank and every member's Pod IP in the manifest, and passes net-freeze before the CRIU dump. A restore checks that its artifact is the member's own part of a group capture, admits the group with its new Pod IP and the capture it restores, and passes release once its processes are restored. A failed capture or restore fails the attempt for every member, with Refused before the admitted barrier and MemberFailed after. The timing summary of a group member's capture or restore reports the time spent in the group's admission and barriers as its own phase, mostly waiting for the other members, so it no longer lands in unaccounted. A Pod captured or restored on its own is unchanged. The agent module now depends on the coordinator module, so the agent image build gets it as a named build context, as it gets the api module. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
…ssion A capture admitted its group before it staged and checked the CUDA job file and configured the dump, and a restore admitted its group before it built the GPU context for PageBroker. These steps only read the source, the artifact or the placeholder, or write to the capture's own staging, yet they ran after the admitted barrier. A member that failed one of them, such as a multi-GPU capture without its job file, then failed the attempt with MemberFailed after every other member had started, instead of refusing it. A capture now admits its group right before it checkpoints the GPU state and dumps, and a restore right before it mounts into the placeholder, so every one of these checks fails the attempt with Refused and leaves every member as Snapshot found it. The capture records the group's section of the manifest once admitted, and the dump writes the manifest again with it. Tests run a member's capture and restore against a two-member session: a step before admission fails the attempt with Refused before the peer passes the admitted barrier, and a step after the commit fails it with MemberFailed. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A member counted as committed only once its own call to the admitted barrier returned. An arrival that the coordinator recorded stays recorded even when the call then fails, for example when its context ends or its connection drops, and the other members may then pass the barrier and start. Such a member then failed the attempt with Refused, although some of its peers had already changed their workloads. A member now counts as committed as soon as it calls the admitted barrier, so a failure after that call always fails the attempt with MemberFailed. A test stops a member's wait at the admitted barrier after its arrival, lets the peer pass the barrier, and checks that the member's failure reaches the peer as MemberFailed. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
On 2026-11-17 the implementation stack (#811 to #934 with #824, #973, #825, #826, #827 and #801) captured a two-Pod DeepSeek V4.1 Flash vLLM group on GB300 twice and restored it in place three times, with byte-identical greedy outputs. Each tensor-parallel worker imported 68 to 76 FABRIC handles exported by the other Pod. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
Match the SNEP to #826 and #827: - An agent fails the session with Refused until its member calls the admitted barrier, and with MemberFailed from then on. It gives a relay's failure the same reason, whatever reason the relay names. - From the deadline on, an agent fails nothing and waits for the session to end, so a clock ahead of the coordinator's never replaces DeadlineExceeded. - At restore, a member contributes its new Pod IP, the capture ID and whether it runs a relay, and no Pod or container identity. - A Pod IP that is not IPv4 refuses a capture. Figures 5 and 8 show the reason each agent uses. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
On 2026-11-17 the implementation stack (#811 to #934 with #824, #973, #825, #826, #827 and #801) captured a two-Pod DeepSeek V4.1 Flash vLLM group on GB300 twice and restored it in place three times, with byte-identical greedy outputs. Each tensor-parallel worker imported 68 to 76 FABRIC handles exported by the other Pod. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
| g.SetLimit(2) | ||
| for rank := range admissions { | ||
| g.Go(func() error { | ||
| value, err := m.agent.Get(gctx, admitKey(rank), wait) |
There was a problem hiding this comment.
Can each agent fetch all admission records from NATS in one batch? With 16 Pods, each agent makes 16 separate Get calls, for 256 calls total. A batch read would bring that down to 16 calls. We can keep one record per rank and the same admission checks.
There was a problem hiding this comment.
Agreed. The session client in #762 has only a per-key Get, so a batch needs a new read there, for example a prefix read of admit.* that returns once every rank's record is present. @julienmancuso, would you be open to adding one to the session store? Once it exists, this PR switches to it with the same per-rank records and checks. Each agent's admission reads then become one call, and the limit of two reads at once goes away.
| // Barrier returns once every member has arrived at the barrier name. | ||
| func (m *Member) Barrier(ctx context.Context, name string) error { | ||
| if name == Admitted { | ||
| m.committed.Store(true) |
There was a problem hiding this comment.
Can the coordinator classify a member failure using the order of events in NATS? If NATS records the failure before the last admitted arrival, report Refused. If it records the last arrival first, report MemberFailed, since a Pod may already have started. This can wait until after alpha unless a caller needs to act differently on the two results.
There was a problem hiding this comment.
Agreed, and the coordinator is the right place, since it sees the global order. Today each member decides from its own view: Refused until it calls admitted, and MemberFailed after. So a member that called the barrier and then failed reports MemberFailed even when no other member had arrived. As you suggest, we'll leave it for after alpha, and I've added it to the follow-ups in #984.
| // runs, with no CUDA process to checkpoint. | ||
| originalDump := dumpCheckpointFunc | ||
| t.Cleanup(func() { dumpCheckpointFunc = originalDump }) | ||
| dumpCheckpointFunc = func(context.Context, *criurpc.CriuOpts, *types.CRIUSettings, *types.CheckpointManifest, |
There was a problem hiding this comment.
Can we add a two-Pod end-to-end test for staggered CRIU dumps? Open a TCP connection between the Pods with keepalive enabled. Let both Pods pass net-freeze, then let A finish its real CRIU dump while B waits. Dump B, restore both Pods, and check that data flows both ways over the original connection without reconnecting. That would exercise the capture-side timeout risk in #577.
There was a problem hiding this comment.
Agreed, that is the right test for #577. It needs the pod group stack on main, because the e2e suite drives a group capture through a PodGroupSnapshot, so we'll add it in a follow-up once #934 merges. The plan: two CPU Pods with a TCP connection that has keepalive on. A dumps while B is held after net-freeze, then B dumps, both restore, and data flows both ways on the original connection without reconnecting. We'll run it with B's wait inside and beyond the keepalive budget. We expect the second case to fail today, because keepalive keeps running at capture and only restore turns it off. If it does, the fix is to turn keepalive off for kept connections at net-freeze as well, and record which ones had it.
There was a problem hiding this comment.
This test is now case 4 of #1297, which tracks the two-node pod group e2e suite. No pull request adds that suite yet, and the SNEP lists it among the alpha criteria.
| // processes, and keeps it dropped after the dump ends them. A repeated | ||
| // dump needs no second barrier: every member is already past those steps. | ||
| barrierStart := time.Now() | ||
| if err := g.Barrier(ctx, group.NetFreeze); err != nil { |
There was a problem hiding this comment.
The group has a deadline, and the CRIU dump call takes no context from the agent. If the deadline passes while CRIU is still writing the checkpoint, do we let it finish or stop it? What state should we leave the source Pod and its network in?
There was a problem hiding this comment.
We let CRIU finish, and 717e89b says why at the dump call. go-criu runs criu swrk with no context, and killing it partway could leave the source frozen in its cgroup or holding CRIU's parasite code, with the Pod's network still locked.
- After a successful dump, CRIU kills the source tree, because
LeaveRunningis false. It keeps its iptables lock in the Pod's network namespace, so peers see dropped packets rather than resets, as after any capture. - If the dump fails, CRIU resumes the tree and unlocks the network, and the agent then ends the source because the member has started.
- Past the deadline, the capture fails at the PageBroker commit, the first step after the dump that takes the context, and the coordinator ends the session as
DeadlineExceeded.
The one gap was the staged dump, which stayed on the node until PageBroker reaped it about two hours later. A pod group member now releases it (fd203dd), and TestGroupCheckpointThatDumpsPastTheDeadlineReleasesTheDump covers that.
| // first irreversible step, so the caller can record that the member | ||
| // started. An error fails the attempt: the barrier has passed, so with | ||
| // session.ReasonMemberFailed. Nil records nothing. | ||
| Committed func(context.Context) error |
There was a problem hiding this comment.
I had to trace three meanings of committed. The callback records that a member started. The local flag tracks whether its artifact was committed. The member flag is set just before the Admitted call. Would RecordMemberStarted for the callback and enteredAdmitted for the member flag make this easier to follow?
There was a problem hiding this comment.
Done in 8b93aa4. The callback is now RecordMemberStarted on both requests, and the member's flag is enteredAdmitted. I kept the local committed in checkpoint, since it is set only once PageBroker has committed the artifact. When #934 merges this again it needs the new name in controller.go, podsnapshotcontent.go and podgroup_restore_test.go.
| outcome.err = ctx.Err() | ||
| } | ||
| } | ||
| _ = peer.Fail(ctx) |
There was a problem hiding this comment.
The success case checks that the local restore waits at release and then returns successfully. runLatePeer calls Fail after it passes release, so the session can still end as MemberFailed. Is that intentional test cleanup? A comment by Fail would make that clear.
There was a problem hiding this comment.
It was cleanup, not intended, and it did end the session as MemberFailed after both members succeeded. In 2d0a9e5 the peer leaves once it passes its last barrier, and the test leaves for the member after its restore succeeds, as the real caller does. The success cases now check that the session closed with every member done. A peer that fails still calls Fail.
Document what the multi-node snapshot PRs add, so their code changes can land without docs changes: - The cuInterpose design gains FABRIC handles: they stay real at runtime, the shim records each export and import, and each importer imports the creator's new handle during restore. It also describes how the coordinator validates the Pods of a group as one topology, the relay rounds over the group's coordination session, and the coordinator's group arguments. MNNVL sharing moves from unsupported to needing the agent to run each Pod's coordinator in a group. - The architecture overview lists agent/internal/group. The text is the one reviewed in #824, #825, #826 and #827. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
| // No member's network freezes while another member still has a step | ||
| // that needs it. CRIU then drops the Pod's traffic once it freezes the | ||
| // processes, and keeps it dropped after the dump ends them. A repeated | ||
| // dump needs no second barrier: every member is already past those steps. |
There was a problem hiding this comment.
Should group retries stay disabled until we test a failed first dump with two Pods and an open TCP connection? The failed Pod can lose its network hold before retrying, after the other Pod has already dumped.
There was a problem hiding this comment.
Yes. In 6d43fd3 a group member ignores its retry budget, and a failed dump fails the attempt. A test gives a member a budget of three and a dump that always fails, and checks that it dumps once and never records its tree to repeat. It fails without the change.
No member repeated by default before this either, since checkpoint.defaultRetryLimit is 0. But #934 passes a PodSnapshot's budget on to its group members, so a group could have opted in. The SNEP now says members do not repeat (fd28542 on #325). We can lift this once a two-Pod test with an open TCP connection shows that a repeat keeps the members consistent.
| } | ||
| // A restore that only failed its cleanup has released its member. | ||
| if retErr != nil && !errors.As(retErr, new(*RestoreCleanupError)) { | ||
| failGroup(ctx, log, req.Group) |
There was a problem hiding this comment.
Can the agent report the failure to the group as soon as the operation fails? A CPU PageBroker abort can currently take up to 30 seconds before that call runs.
There was a problem hiding this comment.
Done in fdc28a9, on both capture and restore. The call that fails the attempt is now deferred after the cleanup, so it runs first, and the other members learn of the failure before the PageBroker abort, the unmounts and the GPU teardown. Two tests hold the first cleanup step until the peer has seen MemberFailed. The trade-off is that if the coordinator is unreachable, the up to 30 s of Fail now delays this member's own cleanup rather than its peers.
A reviewer had to trace three meanings of committed. The request callback records that the member started, the member's flag says it called the admitted barrier, and the capture's local flag says its artifact was committed. The callback on the capture and restore requests is now RecordMemberStarted, and recordMemberStarted calls it. The member's flag is now enteredAdmitted. The capture's local flag keeps its name, since it is set only once PageBroker has committed the artifact. The tests that check the record are renamed to match. Callers that set Committed on CheckpointRequest or RestoreRequest set RecordMemberStarted instead. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A test peer called Fail once its part was over, whether or not it had failed. After a peer that passed release or net-freeze, that ended the session as MemberFailed, although both members succeeded. Nothing checked the session's end, so the tests passed either way. A peer that passes its last barrier now leaves the attempt, as its agent would, and so does the member once its capture or restore succeeded. The peer's outcome is how its Leave returned, so the success cases now check that the session closed with every member done. A peer that fails, or that the attempt's end stopped, still calls Fail. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A reviewer asked what happens when a pod group's deadline passes while CRIU is still dumping. go-criu runs criu swrk with no context, so nothing stops the dump, and nothing should. CRIU freezes the cgroup, seizes every task and injects its parasite. Killing it partway would leave the tree in whichever of those states it had reached, with CRIU's network lock still in the Pod's network namespace. So CRIU finishes. A dump that succeeds kills the tree, as LeaveRunning is false, and keeps the network lock, as after any capture. One that fails resumes the tree and unlocks the network. Either way, the capture fails at the commit, the first step after the dump that takes the capture's context. The comment at the dump says this, and the troubleshooting entry for the commit step names the deadline as a cause. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A capture keeps a completed dump when its commit fails in a way that may clear, or cannot dial PageBroker. A pod group member whose dump outlasts the attempt's deadline lands there: its caller bounds the capture's context by the deadline, CRIU takes no context and finishes, and the commit then cannot dial. The staged dump stayed on the node until PageBroker reaped the transaction, two hours later by default. Nothing could publish that dump. The member's failure fails the attempt, which never runs again, and the member's artifact restores only with its group. A pod group member's failed capture now releases its staged dump. The abort runs on its own context, so it reaches PageBroker past the deadline. A capture of a Pod on its own keeps the dump as before. A test runs a member whose dump outlasts the deadline. Its capture fails at the commit, the dump is released, and the attempt ends as DeadlineExceeded. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A reviewer asked whether a member could report its failure to the group as soon as its capture or restore fails. Failing the attempt was deferred first, so it ran last, after the member's own cleanup. A PageBroker abort alone can take 30 seconds, and the other members waited at their next barrier for all of it. The deferred call that fails the attempt now comes after the cleanup, so it runs first. A capture sets up its PageBroker release before any step that can fail, so every failure still fails the attempt. A restore that fails only in its cleanup has passed the release barrier, and it still does not fail the attempt, since the cleanup's errors reach the result after the check. Nothing in the cleanup has to happen before the other members learn of the failure. The restore-failed marker is still written before the restore returns. Two tests hold the member's first cleanup step until the peer has seen the attempt end as MemberFailed, for a capture whose dump fails and for a restore whose staging mount fails. Both fail with the old order. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
A reviewer asked whether a pod group member should repeat a failed dump before a test covers it with two Pods and an open TCP connection. A member spent its capture's retry budget like any other capture. When a dump fails, CRIU unlocks the Pod's network and resumes its processes. A peer that has already dumped stays behind its own lock. While the member waits to repeat, keepalive or an application timeout could close a connection on its side only, and the restore would keep that connection on the peer's side. A member now ignores the retry budget, and a failed dump fails the attempt. The budget still applies to a capture outside a pod group. A test gives a member a budget of three and a dump that always fails, and checks that the member dumps once and never records its process tree to repeat. It fails without the change. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
The proposal let a member repeat its dump after the commit, and said its network stays frozen while it does. It does not: when a dump fails, CRIU unlocks the Pod's network and resumes its processes, while a peer that has already dumped stays behind its own lock. A connection could then close on one side only, and the restore would keep it on the other. A member now ignores its retry budget, and a failed dump fails the group (#826). Repeats wait for a test with two Pods and an open TCP connection. Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
| // dump fails the attempt. | ||
| retriesRemaining = 0 | ||
| barrierStart := time.Now() | ||
| if err := g.Barrier(ctx, group.NetFreeze); err != nil { |
There was a problem hiding this comment.
The net-freeze wait can return success after the member’s context has already ended. A loopback test hit this and the executor still called the CRIU dump function. Can we check the context just before starting the dump? A dump that already started can finish as before.
There was a problem hiding this comment.
Please add the regression case where NetFreeze has already recorded a successful release and the capture context expires before CRIU starts. Check that the agent never calls the dump hook. The existing test covers a dump that was already running when the deadline passed.
dfeigin-nv
left a comment
There was a problem hiding this comment.
Group member tests and failure reporting.
| asked = "commit" | ||
| response.Result = &pagebroker.Response_CommitComplete{CommitComplete: &pagebroker.CommitComplete{}} | ||
| default: | ||
| asked = "abort" |
There was a problem hiding this comment.
I sent PageBroker Capabilities in place of Abort, and all three cleanup tests still passed. Please make Abort an explicit case and have the fake fail the test on an unexpected request.
|
|
||
| // A session of the coordinator cannot show how many waits a member has at | ||
| // once, so this test counts them in a Store of its own. | ||
| func TestAdmissionWaitsTwoAtATimeUntilTheSessionEnds(t *testing.T) { |
There was a problem hiding this comment.
The fake answers each read after 10 ms and never ends the session. I’d name this test for the two checks it makes. It checks at most two admission reads in flight and the requested timeout.
| // Deferred after the release of the dump, so it runs first: the other | ||
| // members learn of the failure without waiting for the PageBroker | ||
| // abort, which alone can take pageBrokerAbortTimeout. | ||
| defer func() { |
There was a problem hiding this comment.
Capture and restore use the same deferred block to tell peers about an error or panic. I’d have both defer the same function directly, in the current order, so peers still hear about the failure before local cleanup.
What type of PR is this?
What this PR does / why we need it:
SNEP-324 runs the capture or restore of each Pod of a pod group as one member's part in the group's. Every member joins the attempt's coordination session, exchanges an admission with the others, and passes the group's barriers. #762 serves those sessions and ships the client. This PR is the agent's side of it: the group member, and the points in the capture and restore flows where a member synchronizes with the others.
The group member. The new package
agent/internal/groupjoins the attempt's session through #762'scoordinatorclient. The member's rank is the session's (Session.Rank).Admitpublishes the member's admission underadmit.<rank>in the snapshot namespace and returns once it has every member's. An admission carries the member's Pod IP now, at capture its Pod UID and captured container, and at restore the ID of the capture its artifact belongs to. Members that restore different captures refuse the attempt, and so does a member whose Pod IP is not IPv4, since restore is IPv4 only.Admitwaits for the others until the session's deadline plus the client's slack, so the coordinator's ownDeadlineExceededends a late attempt, and it keeps at most two waits open at once, within the coordinator's per-member watch budget.PeerIPsmaps every other member's IP at capture to its IP now, from the members' IPs that the restore's artifact recorded and the admissions. Nothing in this PR uses it yet. The TCP change on top of this PR does.Barrierwaits for every member at a barrier.Failends the attempt for every member, withRefused(session.ReasonRefused, shared with the coordinator) before the member calls theadmittedbarrier andMemberFailedonce it has, since its arrival may have been recorded even if the call fails. From the attempt's deadline on, by the member's clock,Faildoes not fail the attempt. It waits for the session to end, until the deadline plus the client's slack and one more second, so the coordinator'sDeadlineExceededstands even if the member's clock runs ahead.Leaverecords that the member is done and keeps the connection until the session ends.Capture. A capture request takes an optional group member.
admittedbarrier, after which the attempt commits.podGroup: a version, the capture UID (thePodGroupSnapshot's UID), the member's ID, and the member table, whose index is the rank, with each member's ID, Pod UID, containers and Pod IP.net-freezeafter CUDA's checkpoint and before the CRIU dump, so no member's network freezes while another member still needs it.Restore. A restore request takes an optional group member.
admitted.release, so no member is released before every member is reconstructed.resumebarrier beforerelease. It orders CUDA Checkpoint's resume phase, in which libraries reconnect, after every member has rebuilt its shared memory. The agent does not run that phase yet: nsrestore restores and unlocks CUDA on its own, as for a single Pod. So aresumebarrier here would pass right beforereleasewith nothing between them. It comes with the change that runs the resume phase.Recording that the member started. Capture and restore requests take an optional
RecordMemberStartedcallback. The executor calls it right after theadmittedbarrier and before the member's first irreversible step, so the caller can record that the member started: theStartedcondition at capture, andRestoreStartedat restore (#934 sets it). An error fails the attempt withMemberFailed, and leaves this member as Snapshot found it. A nilRecordMemberStartedrecords nothing.Timing. The timing summary of a member's capture or restore gets a
groupphase: the time spent at admission and at the group's barriers, mostly waiting for the other members. Without it, that wait showed asunaccounted, for example 12.6 s of a 15.8 s restore.A failed capture or restore fails the attempt for every member, also when the executor panics. A pod group member's checkpoint restores only with its group, so a restore on its own refuses it. A restore that only failed its cleanup has released its member, so it does not. Three steps are new, "admitting the pod group", "recording that the member started" and "waiting for the pod group's other members", each with a troubleshooting entry in #930 or #972.
A Pod captured or restored on its own takes none of this and behaves exactly as today.
Build. The agent module now depends on the
coordinatormodule, through areplacelike the one forapi. The agent image build gets it as a named build context,coordinator, next toapi. The operator module gets the samereplace, since it depends on the agent module.Which issue(s) this PR fixes:
Part of #614. Stacked on #762. Tracking issue: #324. Design: #325 (Group checkpoint, Group restore).
How was this tested?
coordinatorteststarts one in the test process with TLS, and each member joins through feat(coordinator): serve coordination sessions from embedded NATS #762's client.PeerIPsmaps the other members' capture-time IPs to their new ones, and refuses a capture with a different member count. All three leave.Refusedbefore theadmittedbarrier and withMemberFailedafter it.Refusedand the peer never passesadmitted. A dump failure, a mount failure after the commit, and a panic after the commit end it asMemberFailed.RecordMemberStartedruns between theadmittedbarrier and the first irreversible step at capture and at restore, and aRecordMemberStartedthat fails stops the member there and ends the attempt asMemberFailed. An IPv6 Pod IP is refused at capture and at restore, and a group member's checkpoint restored on its own is refused.net-freeze, and a peer that fails instead stops it at "waiting for the pod group's other members" withMemberFailedand no dump. At restore, the steps afterreleaserun only once a late peer arrives, and a peer that fails instead fails the member at that step with no restored process. Both tests fail if a barrier is removed or moved after the step it guards.DeadlineExceededfor every member.admittedwait timed out after its arrival fails the attempt asMemberFailed.Admitkeeps at most two waits open, each until the deadline plus the client's slack. The manifest'spodGroupsection round-trips through YAML with SNEP-324's keys.go build ./...in the agent and operator modules, in workspace mode and withGOWORK=off(the module mode the agent image builds in).go vetandgo testofinternal/executor,internal/group,internal/typesandinternal/controller. golangci-lint v2.14.0 on the agent module: 0 issues.go test -raceofinternal/executorandinternal/groupin a Linux container.go test -raceof the whole ofinternal/group,internal/executorandinternal/typesagain after the review fixes.hack/verify-troubleshooting-steps.shpasses once merged with main, which has the entries from docs(troubleshooting): document the pod group steps of capture and restore #930, and with those from docs(troubleshooting): document pod group start, step order and causes #972.admittedandnet-freezeat capture andadmittedandreleaseat restore, and left. Each barrier took under 2 ms. The images were built from that commit.grouptiming phase was added after the runs, to account for the wait they showed.admittedand set Started on their PodSnapshotContents in two group captures. Three group restores committed, setnvidia.com/RestoreStarted, wrote restore-complete with the PodGroupRestore's UID and released both members. The coordinator loggedSession closedfor every attempt. No attempt reached its deadline, so the deadline path ran only in the unit tests.make checkwas not run locally. CI's Validate repository job runs the fullmake check, and it passes.cuda-checkpoint-helperand the agent'snvidia-smiall loadedlibcuda.so.620.70.06fromcuda-compat-13-5. The build was an integration of feat(agent): wire the agent into pod-group captures and restores #934, feat(operator): add the PodGroupRestore controller #858, feat(agent): join a pod group's coordination session #826 (6d43fd3), feat(agent): keep TCP connections between restored group members #801 (809e3c4), feat(agent): serve the cuInterpose relay's session socket #827 (587df98) and feat(cuinterpose): relay a Pod's coordinator through the group session #825 (9543e5d). It used feat(operator): add the PodGroupRestore controller #858 from before its November 30 API change, which feat(agent): wire the agent into pod-group captures and restores #934 does not build against yet, three fix commits for feat(agent): wire the agent into pod-group captures and restores #934 (theRecordMemberStartedrename among them), and one test-only workaround, because the cluster's sharedpodsnapshotcontentsCRD is older and dropsspec.podGroup. The two-Pod DeepSeek V4.1 Flash set was captured as a pod group twice and restored five times, three of them onto two other nodes, and four greedy answers matched byte for byte every time. Each member's restore took 16.3 to 16.9 s. Every restore remapped both Pod IPs, held 34 kept connections per member, passed the NVLink fabric check, and ran its relay over the session socket. The agent ran onenvidia-smifabric query per node per restore, for all of the node's GPUs. Decode after restore was 191 to 234 tok/s against 230 before. A controlled follow-up confirmed the cause named above and narrowed it: with--no-numa-bind, decode speed depends on whether a Pod's two TP workers run on the same CPU socket, which a restore does not preserve (Preserve and remap per-worker CPU affinity and NUMA placement across restore #548). With each Pod's workers pinned to one socket, the source and three restores all ran at 230 to 231 tok/s, and their GPU kernel times matched within about 2%.Special notes for your reviewer:
group.Join, setsGroupandRecordMemberStartedon the request, and callsLeaveonce the capture or restore has succeeded. The same work makes the agent advertise thev1group protocol that feat(operator): add the PodGroupSnapshot controller #833's admission waits for, and record theStartedcondition throughRecordMemberStarted.Fail's reasons are the group reasons feat(operator): add the PodGroupSnapshot controller #833 aggregates:Refusedbefore the commit,MemberFailedafter.RestoreStartedcondition and noattemptkey inrestore-complete. Those come with the controllers.sockets-restored), and the cuInterpose relay's session socket (feat(agent): serve the cuInterpose relay's session socket #827).Does this PR introduce an API change?
Additional documentation, e.g. enhancement proposals, usage docs:
Checklist
git commit -s), per CONTRIBUTING.mdmake check testpasses locally (the touched packages' build, vet, tests, lint and the troubleshooting-steps check pass locally. CI's Validate repository job runs the fullmake check, and it passes.)🤖 Generated with Claude Code