Skip to content

feat(website): a website env's ready_timeout_s and shm_mb, for a site slow to boot - #590

Merged
earakely-scale merged 3 commits into
mainfrom
edgararakelyan/fd-4981-m833-website-env-a-boot-timeout-for
Nov 10, 2026
Merged

earakely-scale merged 3 commits into
mainfrom
edgararakelyan/fd-4981-m833-website-env-a-boot-timeout-for

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What

A website env can now say how long its site may take to be ready and how much shared memory its server needs: ready_timeout_s and shm_mb. They go in env.toml, in the stored env, and on agent-env env website put (--ready-timeout-s, --shm-mb). They apply wherever a website env deploys through the gateway, alone or as a multi env's website child.

This is M8.33 (FD-4981). It's for third-party site images such as WebArena's GitLab or shopping (M8.36 to M8.38), which can take minutes to boot and want more than Docker's 64 MiB of /dev/shm.

Today:

  • The gateway's health check of a site's server container runs every 10 s with start_period: 30s and 3 retries, so a server that answers nothing for about a minute is marked unhealthy.
  • The gateway depends_on that server being healthy, so docker compose up then fails the deploy, whatever the deploy's own readiness wait (300 s, or what the card declares) would have allowed.
  • Nothing sets the server's shm_size.

With the fields:

  • The health check's start_period is ready_timeout_s, rounded up to whole seconds. Its interval, timeout and retries are unchanged, so a silent server is still noticed about 30 s after its time, and a check that passes earlier marks it healthy at once.
  • The deploy waits the longer of the card's ready timeout and ready_timeout_s, plus the usual 30 s margin, and never less than today's 300 s. Every protocol card declares a timeout (300 s by default), so letting the card's always win would have made env.toml unable to extend the wait.
  • shm_mb is the server container's shm_size.
  • Without the fields, the compose file and the waits are exactly as before.

Decisions (FD-4981)

  1. a. The names are ready_timeout_s and shm_mb, as the protocol's @website(ready_timeout_s=) and the apps' @linux(shm_mb=) name them.
  2. a. Absent means today's behaviour. ready_timeout_s is any positive number of seconds, as @website accepts. shm_mb is 1 to 65536 MiB, sharing the apps' MAX_SHM_MB.
  3. a. start_period takes the timeout, and the rest of the health check is unchanged.
  4. a. Only env.toml declares them, with no protocol change. The wait takes the longer of the card's and the env's.

Both are checked at put, in the constructor, the env.toml check and the CLI, with the same messages.

Tests

  • Unit:
    • the fields are stored and refused out of range (including inf, true and 1.5);
    • env.toml accepts them and refuses bad values before any write;
    • a bundle export round-trips them;
    • the compose file's start_period and shm_size follow them, and are 30s and absent without them;
    • the wait is lengthened past the card's and the default's, but never shortened.
  • Integration: a new gateway_test.py test deploys a fixture site (tst/data/slow_boot_website) that answers nothing for 100 s, past the health check's minute, with ready_timeout_s = 160 and shm_mb = 1024. It reads the server's /dev/shm through the gateway: 1 GiB. The same site with no timeout fails the deploy at its server's health check, as today.
  • VM e2e, at 218901f:
    • amd64 local Docker (agent-environments-admin c8i.4xlarge), with the site's boot at 180 s then (018cc77 shortened it to 100 s for CI):
      • the new test passes both ways (2/2);
      • the existing website gateway tests pass (4/4): single website env, multi env with a website, website env v1, and the website trigger;
      • the unit tier passes (14272), apart from the 3 known VM-environment failures (no .git in the synced tree, no httpx in the system Python).
      • The gateway tier's fixture images build for amd64 only, so arm64 wasn't run.
    • modal_vm, on dev's stores (the writes OK'd), with an image built and saved on the VM and registered in dev as m833-slow-boot-site-server:
      • m833-slow-boot-site (answers nothing for 180 s, ready_timeout_s = 240) deploys in 219 s, and its server's /dev/shm reads 1073741824 bytes through the gateway;
      • m833-slow-boot-site-default, the same site without a timeout, fails after 72 s with slowboot-website-backend failed its health check;
      • both are closed.
    • Every VM is torn down.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds ready_timeout_s and shm_mb to website envs.

  • Website settings can extend startup time and enlarge server memory.

The previous and current commits have different merge bases with the target commit, so this review covered the full PR diff. No previous review threads were supplied. No new actionable issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["env.toml or CLI"] --> B["WebsiteEnv"]
  B --> C["Stored env"]
  C --> D["website_config"]
  D --> E["Compose start_period and shm_size"]
  D --> F["Website readiness wait"]
Loading

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

… slow to boot

A website env takes ready_timeout_s, how long its server may take from its container starting to ready, and shm_mb,
its server's /dev/shm in MiB, in env.toml, the stored env and agent-env env website put. The gateway's health check of
the server allows the timeout before it counts a failure (start_period), and the deploy waits it, or as long as the
site's card says if longer, so a third-party image that answers nothing for minutes deploys rather than failing after
about a minute. shm_mb sets the server container's shm_size. Without them, nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 9, 2026 20:57
…minute, to keep CI's shard short

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1-m833-website-env-a-boot-timeout-for

# Conflicts:
#	AGENTS.md
@earakely-scale
earakely-scale merged commit 24ea806 into main Nov 10, 2026
34 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-4981-m833-website-env-a-boot-timeout-for branch November 10, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant