Repository navigation
Conversation
…tatus (#933) spored discovered a job-array member's peers once, at boot, and only logged the count. Nothing stored the list, wrote it anywhere, showed it in spored status, or looked again, so a burst member's workload had no way to learn the local nodes #918 made discovery find, and the boot-time count was a lower bound because most siblings had not registered yet. For a hybrid member (spawn:burst on EC2, or a local-provider node) spored now writes the merged list to /etc/spawn/job-array-peers.json, the file and format spawn launch --mpi already uses (pkg/mpicohort), and rewrites it every minute from its own goroutine, off the lifecycle loop (#65). The path and the encoder now live in pkg/provider (JobArrayPeersFile, MarshalPeers, WritePeersFile, ReadPeersFile) and mpicohort uses them, so the two writers cannot drift. Writes are atomic (temp file + rename, 0644). A failed discovery keeps the previous file. spored never writes the file for any other member. For --mpi the file's arrival is the user-data's release signal, ordered after the cluster SSH key push (#684), so a spored write could release a node early. spored status (table and -o json) gains a peers section for job-array members: the list, the file, when it was last rewritten, and whether a spored-maintained list is stale (three missed refreshes). spawn burst's help says where the list is. Tests: write, refresh (join and leave), keep-on-failure, hybrid-only (MPI and ordinary members never write, also through the loop), boot write through the real NewAgent with every credential source removed, and status read, stale and missing-file handling plus the buildStatusReport wiring. Each was watched failing against a compiling revert. Fixes #933 (#933)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #933
Stacked on #966 (fix/939), which is on #940, #934 and #926. Review after those; the diff here is only this branch.
Contract chosen
Option (a) from the issue. The burst help's claim that instances "coordinate with local instances" is now backed by a file a workload can read.
/etc/spawn/job-array-peers.json. This is the file and formatspawn launch --mpialready uses: the cohort Assembler pushes it, and the MPI user-data builds its hostfile from it withjq. The format is a JSON array of{index, instance_id, ip, dns, provider}. The path and encoder now live inpkg/provider(JobArrayPeersFile,MarshalPeers,WritePeersFile,ReadPeersFile), andpkg/mpicohortuses them, so the two writers cannot drift. The existing byte-compat test still passes.spawn:burst=trueon EC2, or a local-provider node in a job array.--mpi. There the file's arrival is the user-data's release signal, and the Assembler deliberately writes it after the cluster SSH key (--mpi has never worked: BinariesBucket is never set, so cloud-init dies on 's3:///' and mpirun is never installed #684). A spored write could release a node before it has the key.spawn launch --countmembers. They are not in the hybrid registry (spored registers every job-array member with the hybrid registry, which only hybrid/burst arrays use #904), and their boot-time discovery stays diagnostic, as before.agent.PeerRefreshInterval, two registry heartbeats). This runs in its own goroutine, off the lifecycle loop (CRITICAL: spored monitor loop never runs after startup — TTL/idle/on-complete/pre-stop all silently dead #65). The write is atomic (temp file + rename) with mode 0644. A failed discovery keeps the previous file. The file's mtime is when the list was last confirmed.spored status: job-array members get a peers section in the table and in-o json(peers). It shows the list, the file, the time since the last rewrite, the refresh interval, andstalewhen a spored-maintained list has missed three refreshes. A missing file is reported as "not written yet" or "no peers file", never as zero peers.Tests (no AWS)
pkg/agent:TestHybridMemberWritesItsPeersFileTestPeersFileFollowsMembership: a later joiner appears, a leaver drops outTestPeersFileKeepsTheLastListWhenDiscoveryFailsTestOnlyHybridMembersMaintainThePeersFile: burst and local write; MPI/ordinary and non-array members never write, checked through the running loop tooTestBootWritesTheHybridPeersFile: the realNewAgent, with every AWS credential source and IMDS removed so its registry registration cannot reach AWSpkg/provider: round trip, atomic replace, empty list is[].cmd/spored: the peers section in the table and JSON, stale flagging (and no staleness for an Assembler-written file), missing file, andbuildStatusReportwiring (burst member has it, non-array instance does not).Each was watched failing against a compiling revert:
make check: all packages pass except the known Docker-onlyTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker.make check-nested: all 9 nested modules clean.-raceis clean on agent, spored, provider and mpicohort. Public surface unchanged (pkg/provideris not in it).docs-gen/burst.mdis regenerated for the help change.Caveats
expires_atpasses. That is the registry's existing TTL (1h, refreshed by the 30s heartbeat), and this PR does not change it. EC2 siblings drop out as soon as they leave pending/running./etc/spawn(not root) logs the failure once, andspored statusreports the error or staleness. There is no alternate path.TestNewAgent_StillActivatesinpkg/agentregisters a real spore.host DNS record with ambient credentials on every localmake check.