Repository navigation
feat(computers): the clock app and its follower put a computer on its gateway's clock (FD-5476) - #645
Closed
williamloo-scale wants to merge 1 commit into
Closed
williamloo-scale wants to merge 1 commit into
williamloo-scale wants to merge 1 commit into
Conversation
… gateway's clock (FD-5476) A Linux X11 computer env composes the `clock` app (`apps = ["clock"]`) to follow its multi env's gateway clock. Its install builds agent-env's libfaketime at compose, preloads it into every process, and adds the clock follower, root's loop that keeps it running, and the follower's own user, agentenv-clock, whose uid clock.conf names as the clock page's owner. The follower long-polls the gateway's /clock/watch with the version it last showed, which acknowledges it, and writes the page for each new version from the local time the gateway's sent stamp corresponds to (the offset from the watch's four stamps, as NTP estimates it). It records what it showed in a status file any user can read, and retries a failed round with backoff. The session user can't write the page, read the follower's config, or stop either process. The app's clock/v1 sync_time only reports what the follower showed for a config id, since its server runs as the session user; core configures and starts the follower as root (next change). Its recipe files are per-file symlinks to computers/clock, which a wheel packs as their content. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Closing: superseded by #649, which puts ubuntu-24.04 computers on the gateway's clock from the base image, with core configuring the follower at deploy and after a reset. FD-5477's remaining arm-time work ( |
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.
What and why
Adds the
clockcomputer app (FD-5476). A computer env withapps = ["clock"]runs on its multi env gateway's clock: every process uses agent-env's libfaketime and the TLS shim, and a clock follower keeps the clock page in step with the gateway.computers/envs/clock) builds the library and shim at compose fromcomputers/clock, preloads them through/etc/ld.so.preload, and installs the follower. Itsclock/v1sync_timeonly reports what the follower last showed for a config id. That is also what makes the gateway count the computer as a follower.computers/clock/clock-follower, stdlib Python) runs as its own user,agentenv-clock, under a root loop (follow) that restarts it. It long-polls the gateway's/clock/watch, writes the clock page on each new version, anchors the page from the watch's four stamps the way NTP estimates an offset, and records its status.docker execstarts processes with umask 0000.recipe/holds per-file symlinks intocomputers/clock. These are the repo's first symlinks; a built wheel includes them as regular files, and hatchling skips a symlinked directory.Core writes the follower's config and starts it, as root, in the next PR. Nothing here goes through the driver.
How it was tested
tst/unit/env/envs/test_computer_clock.pycover the follower's offset, versions, config change, failures, missing config and umask, and the app'ssync_time.uv build --wheel: all 10 recipe files are in the wheel.Notes
clockapp, what the follower does, and the security model. The limits are agent-env's own servers on universe time, TLS stacks the shim doesn't reach, Chromium's time zone, and live sites at other dates.Stack: this → sync → e2e → reset.
🤖 Generated with Claude Code