Skip to content

chore(#1611): remove the Docker executors, spawn_control and ReplayCfg.RandomSeed - #1668

Merged
scttfrdmn merged 4 commits into
mainfrom
chore/v0132-remove-executors
Nov 24, 2026
Merged

scttfrdmn merged 4 commits into
mainfrom
chore/v0132-remove-executors

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1611

Removes the features that contradict the scope rule ("models API observations, not workload internals") or do nothing, and ships the two seeds that replace what they provided.

  • Lambda: the Docker RIE executor (lambda_exec.go), its "recorded" replay cache, the warm pool and evictWarmContainer are gone. Invoke answers a seeded error, then a seeded result, then the stub. The new POST/DELETE /v1/lambda/invoke-result ({"functionName"|"*","payload"}) returns the payload verbatim with no X-Amz-Function-Error. It resolves exact name before *, and invoke-error still wins. It is in the recorded control-plane group. ESM pollers and LambdaPlugin.ResetForRun stay, and the deployment package is still stored for CodeSize/CodeSha256.
  • RDS: the Postgres container executor (rds_exec.go) is gone. The stub endpoint and available status are unchanged. RDSPlugin.ResetForRun and its replay-snapshot methods are removed, so "rds" drops out of the ResettablePlugin list test.
  • S3: spawn_control.go and /v1/spawn/task-completion are replaced by the generic POST/DELETE /v1/s3/seeded-objects.
    • The body is {"bucket"|"*","key","body","bodyBase64","contentType","availableAt"}. A JSON-string body is served as text, any other JSON value as compact JSON, and bodyBase64 as bytes.
    • Seeds live in s3-ctrl under seeded-object:<bucket>/<key> and resolve exact bucket first, then *.
    • A seed is used only when no real object exists and no versionId is named. It goes through the normal GET/HEAD path, so Range and preconditions apply.
    • A seed is 404 NoSuchKey until availableAt on the simulated clock. Last-Modified is availableAt, or the seed time when there is none.
    • DELETE takes ?bucket=&key=. A key alone clears the * seed, and neither clears everything.
    • An unseeded tasks/<id>/completion.json is now a real 404.
  • Replay: ReplayCfg.RandomSeed and ReplayConfig.RandomSeed go together, since ToReplayConfig is a struct conversion. So do ReplayEngine.rng, RandFloat64 and RandInt64, and the math/rand/v2 import.
  • Config: Config.Lambda/LambdaCfg and Config.RDS/RDSCfg are removed, along with their defaults and validation. LoadConfig checks v.IsSet for lambda.docker_enabled, lambda.replay_mode, lambda.warm_pool_ttl, rds.engine and replay.random_seed, whether set in the file or as SUBSTRATE_*. Each one set appends a message to the new Config.Warnings, and the CLI logs those at startup (logConfigWarnings).
  • Gates: the nondeterminism allowlist drops lambda_exec.go:*, rds_exec.go:* and replay.go:import.
  • Docs:
    • services.md: the Lambda section's two Docker subsections are replaced by "Invoke answers a seed or a stub", and S3's "Task-completion records" by "Seeded objects". Rows and links are updated.
    • testing-guide.md: RandomSeed and random_seed are removed.
    • contributing.md: the ResettablePlugin bullets lose the RDS container case, and the seed example points at lambda_control.go and s3_seeded_objects.go.
    • substrate.yaml.example is updated.

The routed-operation catalog is unchanged (no AWS operation added or removed). The two new routes are control-plane only. Diff: +1,604 / −3,120.

Error text: the new 400s are control-plane JSON errors, not AWSErrors. The S3 404s are the existing NoSuchKey/NoSuchBucket responses.

Compatibility

See the CHANGELOG ### Compatibility list. It covers the removed exported API, the removed config keys and env vars (which now warn), and the removed /v1/spawn/task-completion route, which replays as 404 from old recorded streams. spore.host must now seed each completion record through /v1/s3/seeded-objects; the CHANGELOG has an example body.

Gates run locally

make lint test e2e, SUBSTRATE_IAC=1 make iac-e2e (after iac-e2e-setup), docs-reference-check, docs-headings-check, docs-versions, docs-counts-check, operation-catalog-check, operation-docs-check, cfn-schema-check, authz-reference-check, the discarded-* checks, wire-bookkeeping-check and nondeterminism-check (with self-test). Also make python-test (84 passed against a fresh binary), python-lint, and the VitePress build.

Smoke test against the built binary:

  • a config with lambda.docker_enabled: true starts and logs the warning;
  • a seeded invoke-result returns {"answer":42} with no error header, and a later invoke-error wins with X-Amz-Function-Error: Handled;
  • an unseeded tasks/x/completion.json is 404;
  • a seeded object is 404 before availableAt and 200 after, and Range answers 206.

Review fixes (second commit)

  • S3: a write or delete of a key an available seed answers supersedes the seed. PutObject, CopyObject, CompleteMultipartUpload, DeleteObject and DeleteObjects all do, through a per-bucket tombstone in s3-ctrl. So a deleted seeded object stays deleted in unversioned buckets, and in versioned buckets after the marker or the written version is removed. A delete before availableAt deletes nothing. Posting or clearing the seed clears its tombstones.
  • S3: CopyObject and UploadPartCopy read a seeded source. The operations that treat a seeded key as absent are listed in services.md.
  • S3: date preconditions compare Last-Modified in whole seconds, so an echoed header gets 304 / 200 (pre-existing).
  • Control plane: recordControlPlaneWrites holds the simulated clock across the handler and the event timestamp, the way handleAWSRequest does. seededAt now replays identically, which is tested on a running clock against the replay sandbox's state.
  • Lambda: seeds resolve in the order exact error, exact result, * error, * result. functionName accepts a qualified name or a full or partial ARN in invoke-error and invoke-result POST and DELETE.
  • CLI: loadConfig prints config warnings to stderr at every log level. It covers every LoadConfig call, including the SIGHUP reload and validate-plan.

Rebased onto #1667. Gates re-run: make lint test e2e, SUBSTRATE_IAC=1 make iac-e2e, the drift checks, python-test, python-lint and the VitePress build.

No follow-up issues filed.

@scttfrdmn scttfrdmn added this to the v0.132.0 milestone Nov 24, 2026
@scttfrdmn scttfrdmn added type: chore Build, tooling, dependency updates area: lambda labels Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.32710% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
emulator/s3_seeded_objects.go 94.04% 10 Missing ⚠️
cmd/substrate/main.go 87.50% 2 Missing ⚠️
emulator/lambda_control.go 96.82% 2 Missing ⚠️
emulator/s3_plugin.go 95.45% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…g.RandomSeed

Substrate models API observations, not workload internals, so the opt-in
Docker Lambda RIE and RDS Postgres executors go, with their config keys,
replay cache, warm-pool eviction and export_test accessors. The inert
ReplayCfg/ReplayConfig.RandomSeed goes with ReplayEngine.RandFloat64 and
RandInt64.

Two seeds replace what the removals took away:
- POST/DELETE /v1/lambda/invoke-result seeds a successful Invoke payload,
  resolved after invoke-error and before the stub.
- POST/DELETE /v1/s3/seeded-objects seeds the object a GET/HEAD of an
  unwritten key observes, gated on availableAt, replacing the
  spore.host-specific /v1/spawn/task-completion route.

LoadConfig reports each removed key still set in Config.Warnings, which
the CLI logs at startup.

Fixes #1611
- S3: a PutObject, CopyObject, CompleteMultipartUpload, DeleteObject or
  DeleteObjects of a key an available seed answers supersedes the seed
  with a per-bucket tombstone, so a deleted seeded object stays deleted in
  unversioned and versioned buckets. Posting or clearing the seed clears
  its tombstones.
- S3: CopyObject and UploadPartCopy read a seeded source; the operations
  that treat a seeded key as absent are documented.
- S3: date preconditions compare Last-Modified in whole seconds, so an
  echoed header answers 304/200 correctly.
- Control plane: recordControlPlaneWrites holds the simulated clock across
  the handler and the event timestamp, so seededAt replays identically.
- Lambda: seeds resolve exact error, exact result, * error, * result, and
  invoke-error/invoke-result normalise a qualified name or ARN.
- CLI: config warnings print to stderr at every log level, including after
  SIGHUP reload and on validate-plan.
@scttfrdmn
scttfrdmn force-pushed the chore/v0132-remove-executors branch from 66cfabe to 935523a Compare November 24, 2026 02:48
…-name forms

- S3: a tombstone is keyed by bucket, the superseded seed's scope and key,
  and records that seed's SeededAt; it suppresses only a matching seed of
  its own scope, and posting or clearing a seed clears only its own
  scope's tombstones. A bucket's own seed, when present, still decides the
  key alone.
- S3: a copy from a missing source bucket is NoSuchBucket before any seed
  is consulted.
- Lambda: only a full ARN or a <12-digit account>:function:<name> partial
  ARN is read for its function segment, so a function named "function"
  keeps its name; invoke-error's response names the bare function.
Tombstone read and clear failures, copy-source record and seed read
failures, supersede failures on CopyObject and a versioned DeleteObject,
and invoke-error seed read, write and delete failures.
@scttfrdmn
scttfrdmn merged commit 22653bd into main Nov 24, 2026
20 checks passed
@scttfrdmn
scttfrdmn deleted the chore/v0132-remove-executors branch November 24, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: lambda type: chore Build, tooling, dependency updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove scope-contradicting and dead features: Docker Lambda and RDS executors, spawn_control, ReplayCfg.RandomSeed

1 participant