Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968)
spored registered every instance carrying spawn:job-array-id, which every spawn launch --count/--mpi member carries. Nothing reads the registry for those arrays, and registration failed on all of them (no DynamoDB grant on the instance role; the table exists only where spawn burst ran). Now only a local node or an instance tagged spawn:burst=true by spawn burst registers. Peer discovery is unchanged.
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
#1003) * Make unit tests hermetic: no real AWS/DNS calls from make check (#968) TestNewAgent_StillActivates called the real NewAgent, which built a real DNS client, DynamoDB registry and EC2 tag writer from ambient credentials: every `make check` with a profile set did a real Route53 UPSERT via the DNS API, an EC2 CreateTags and a DynamoDB PutItem, and passed either way. - pkg/agent: newDNSClient/newPeerRegistry/newTagPutter seams (newPeerRegistry named as in #920); the activation test now asserts the leased UPSERT, the dns-status tag and the registry PutItem through httptest fakes. An fsxMounter seam keeps the FSx gating test off DescribeFileSystems. - Other offenders found by running every module under the new gate: provider and config public-IP lookups (ipify/ifconfig.me/icanhazip), taskpool job scripts' `aws s3 cp` (stub aws on PATH), ttl-reaper's init-time STS GetCallerIdentity (moved to main), a dashboard-api handler test's DynamoDB GetItem (loadAWSConfig seam), dns-updater handler tests' registry Scan. - Gate: internal/hermetic + test/hermetic, a `go test -exec` wrapper that strips AWS_* and sets fake creds, points AWS_ENDPOINT_URL and HTTP(S)_PROXY at a loopback recorder, and fails the package naming every request. The proxy is what catches the DNS client, which is not an SDK client. Wired into make check, CI (test, race, API surface) and scripts/nested-modules.sh; pkg/agent also installs it via TestMain. TestGateIsWired checks the wiring. (#968) * Consolidate CHANGELOG groups after rebase * Make the activation test's member a burst member now that only hybrid members register (#904, #968)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
…ent.Launch, and TestBurstMembersAreTaggedBurst covers the same assertion (#905)
scttfrdmn
added a commit
that referenced
this pull request
Oct 15, 2026
* Give spawn burst instances credentials, tags and a TTL (#905) spawn burst launched its members with no IAM instance profile, five hand-written tags, no TTL and unencoded user-data. RunInstances rejected the user-data, so every burst failed. Had it not, the members would have had no credentials for spored, no spawn:managed tag (so the TTL reaper, spawn list and the spored role's terminate grant could not reach them), no deadline, and the same job-array index on every member. Burst now resolves the instance profile the way spawn launch does with no --iam-* flags (SetupSporedIAMRole, or --instance-profile to skip it). It launches each member through pkg/aws Client.Launch, so buildTags writes the same tags a spawn launch job-array member gets, with a per-member index and a TTL (--ttl, default 8h; must parse as a Go duration so the deadline is computed). spawn:burst=true is added as a burst-only custom tag, never by buildTags (#904). --job-array-name defaults to the ID so the printed spawn array status hint finds the members. Both spored policies now grant PutItem/UpdateItem/DeleteItem/Query on spawn-hybrid-registry in the caller's own account, which is what the in-instance registry client calls. Without that, no job-array member could register. Fixes #917. * Drop #920's burst tag test: launchBurstInstances now goes through Client.Launch, and TestBurstMembersAreTaggedBurst covers the same assertion (#905)
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…ry (#918) The hybrid registry is written by local nodes and burst members alike, but only LocalProvider read it. EC2Provider.DiscoverPeers looked at tags only, so a burst instance saw its EC2 siblings and never the local nodes of its job array: discovery worked one way. A burst member (spawn:burst=true, parsed into Config.Burst exactly as #920 does) now also queries the registry and merges its entries with the tag peers, one entry per instance, the tag entry winning a collision since it carries the spore.host DNS name. A registry read failure keeps the tag peers and logs a warning. Ordinary members stay tag-only and never query the table. The registry query and its parsing move into pkg/provider/hybrid_registry.go, shared with the local provider (which also gains pagination). The table name is pinned to registry.TableName by a test, and the spored IAM grant gate now discovers the DynamoDB calls this reader makes as well as PeerRegistry's. Fixes #918.
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…ry (#918) The hybrid registry is written by local nodes and burst members alike, but only LocalProvider read it. EC2Provider.DiscoverPeers looked at tags only, so a burst instance saw its EC2 siblings and never the local nodes of its job array: discovery worked one way. A burst member (spawn:burst=true, parsed into Config.Burst exactly as #920 does) now also queries the registry and merges its entries with the tag peers, one entry per instance, the tag entry winning a collision since it carries the spore.host DNS name. A registry read failure keeps the tag peers and logs a warning. Ordinary members stay tag-only and never query the table. The registry query and its parsing move into pkg/provider/hybrid_registry.go, shared with the local provider (which also gains pagination). The table name is pinned to registry.TableName by a test, and the spored IAM grant gate now discovers the DynamoDB calls this reader makes as well as PeerRegistry's. Fixes #918.
scttfrdmn
added a commit
that referenced
this pull request
Oct 17, 2026
…ry (#918) (#934) The hybrid registry is written by local nodes and burst members alike, but only LocalProvider read it. EC2Provider.DiscoverPeers looked at tags only, so a burst instance saw its EC2 siblings and never the local nodes of its job array: discovery worked one way. A burst member (spawn:burst=true, parsed into Config.Burst exactly as #920 does) now also queries the registry and merges its entries with the tag peers, one entry per instance, the tag entry winning a collision since it carries the spore.host DNS name. A registry read failure keeps the tag peers and logs a warning. Ordinary members stay tag-only and never query the table. The registry query and its parsing move into pkg/provider/hybrid_registry.go, shared with the local provider (which also gains pagination). The table name is pinned to registry.TableName by a test, and the spored IAM grant gate now discovers the DynamoDB calls this reader makes as well as PeerRegistry's. Fixes #918.
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.
Problem
spored set up the hybrid registry (
registry.NewPeerRegistry,Register,StartHeartbeat, andDeregisteron cleanup) for any instance withspawn:job-array-id.buildJobArrayMemberConfigputs that tag on everyspawn launch --countmember, MPI or not. Nothing reads the registry for those arrays:EC2Provider.DiscoverPeersuses tags, and MPI peers come from the cohort Assembler. Registration also failed on every one of them, becausespored-instance-rolehas no DynamoDB grant and the table only exists wherespawn bursthas run. The result was a warning on every boot, plus heartbeat noise. Once #902 gives the client a region, those failures become AccessDenied or ResourceNotFound instead ofMissing Region.What identifies a hybrid member
LocalProvider.DiscoverPeersis the only production reader of the registry, so a local node has to register for the other local nodes to find it.spawn:burst=true. Onlyspawn burstwrites this tag (cmd/burst.go). It is also the only path that creates the table (registry.EnsureTable), and it setsspawn:job-array-idtoo. Burst members have to register so the local nodes can see them.Nothing else in the repo sets
spawn:burst.pkg/aws.buildTags(used byspawn launch) never does.Fix
provider.Config.Burstis a new field, parsed fromspawn:burst(viatagprefix.Tag("burst")) inloadConfigFromEC2Tags.joinsHybridRegistry(identity, config)in pkg/agent is true only for a job-array member that is eitherProvider == "local"orConfig.Burst. It gates the registry block innewAgent. Ordinary members logHybrid registry skipped: …instead of a failure.prov.DiscoverPeersstill runs for every job-array member. It is now its own block right after the registry one.Deregisterwas already gated ona.registry != nil, so it follows the new gate automatically.newPeerRegistryis a package var so tests can watch whether activation reaches it without touching DynamoDB.This does not overlap #902's region change (pkg/registry, pkg/provider/local.go,
Identity.AWSRegion). In agent.go only the registry/discovery block changes. The CHANGELOG### Fixedentry under[Unreleased]will likely need a trivial conflict resolution with #902.Tests
pkg/agent/hybrid_registry_test.goTestJoinsHybridRegistrytests the predicate directly (rule 2): an ordinary EC2 member is out, a burst member is in, a local node is in, no array means out, and nil inputs are out.TestNewAgent_RegistersOnlyHybridMembersWithTheRegistrygoes through the daemon'sNewAgent. The registry is built for burst and local members and not for an ordinary member.DiscoverPeersstill runs for all three.pkg/provider/burst_tag_test.go:spawn:burst=truesetsConfig.Burst;falseor a missing tag doesn't (run against Substrate).cmd/burst_tags_test.go: every instancelaunchBurstInstanceslaunches carries exactly the key spored reads (tagprefix.Tag("burst")) set totrue, plus the job-array id (run against Substrate).pkg/aws/tags_test.goTestBuildTags_JobArrayMemberIsNotTaggedBurst: aspawn launchjob-array member getsspawn:job-array-idbut neverspawn:burst.Each test was watched failing against a revert that compiles, with
go vetclean on each reverted tree:true || …config.JobArrayID != ""false && …TestLoadConfigFromEC2Tags_Burstspawn:burst-xTestLaunchBurstInstances_TagsMembersAsBurstbuildTagsemitsspawn:burstfor arraysTestBuildTags_JobArrayMemberIsNotTaggedBurstmake checkpasses exceptTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker, which needs a Docker daemon that wasn't available locally. All 9 nested modules pass, and so does the public-surface snapshot (no exported change in a public package). No AWS resources were created.Related, filed separately
spawn:managed, TTL, or job-array-index tags, so the reaper,spawn listandspawn array statuscan't see them.Fixes #904