Repository navigation
The cache servers on every runner host, turbow rewritten, and the cache host as a template answer - #72
Open
davidjalbers wants to merge 22 commits into
Conversation
…s env (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…LX_TURBO_CACHE_HOST (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st, and probes it with the token (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… host, and probes it with the token (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…born app repo that reaches it (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ner host (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gone (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s/plx-226-the-cache-servers-on-every-runner-host Co-Authored-By: Claude Opus 5.5 <[email protected]>
…PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urbo marker (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…at -v prints no key or token (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eaches the server (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…te cache and says so (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and says so (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and GITHUB_ACTIONS=false for no job (PLX-226) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s/plx-226-the-cache-servers-on-every-runner-host Co-Authored-By: Claude Opus 5.5 <[email protected]>
…says otherwise (PLX-226) On the forge the tests inherit GITHUB_ACTIONS=true, which made every newborn's build a trusted verb of a job: without a trusted server it reads no local cache, and the tests of a build's cache hits failed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
The two Turbo cache servers move from a step of every job onto the runner hosts, as the role
plexus.ci.turbo_cache.turbowis rewritten to find its server by verb, job, environment and the new answerturbo_cache_host.The step
turbo-cacheand its place in_check.ymlleave.What changes
plexus.ci.turbo_cacherunsci-turbo-cache@shared(8585,<owner>-ci-turbo) andci-turbo-cache@trusted(8586,<owner>-ci-turbo-trusted), instances of one template unit.By default they listen on loopback only, with tokens the host generates once and keeps.
With
turbo_cache_overlay: truethey listen on 0.0.0.0 with the fixed tokensCI_TURBO_SHARED_TOKENandCI_TURBO_TRUSTED_TOKENfrom the run's environment, and a firewall fragment admits 8585 and 8586 onturbo_cache_overlay_interface(defaultwt0) only.The buckets' keys come from
CI_TURBO_S3_ENDPOINT,CI_TURBO_S3_REGION,CI_TURBO_{SHARED,TRUSTED}_{ACCESS,SECRET}_KEY, and are written to root-only files that systemd reads before it starts the server.What a slot is handed is
/etc/ci-turbo-cache/slot.env(PLX_TURBO_SHARED,PLX_TURBO_SHARED_TOKEN,PLX_TURBO_TRUSTED,PLX_TURBO_TRUSTED_TOKEN), and the same as the factsturbo_cache_{shared,trusted}_{url,token}.No slot is handed anything yet: that is for the follow-up.
repo-turboasksturbo_cache_host(a host name or IPv4 address, or empty) and renders it asPLX_TURBO_CACHE_HOSTin[env]ofmise.toml.turbow:checkandtestuse the shared server.build,e2eandpublishuse the trusted server in a job of the forge (GITHUB_ACTIONS=true), withTURBO_CACHE=remote:rwand so no local cache, and the shared server outside a job.The server comes from
PLX_TURBO_SHARED/PLX_TURBO_TRUSTED, then fromhttp://$PLX_TURBO_CACHE_HOST:8585/8586.The tokens come from
PLX_TURBO_SHARED_TOKEN/PLX_TURBO_TRUSTED_TOKEN.turbow says in one line when it runs without a remote cache: no server named, no shared token, no
nodeonPATHto ask the server with, a server that does not answer within two seconds or answers other than 200 or 401, or a server that refuses the token.A job with a trusted server and no trusted token fails in one line.
Every remote-cache variable of the caller's shell is unset before Turbo runs, and
TURBO_TEAMIDis handed over empty, so a linked repo's team id (.turbo/config.json) never reaches a server..github/actions/turbo-cache, its step in_check.yml, its tests and the composite-action runner of the newborns are deleted.Decisions the issue left open
plexus.ci.turbo_cache, not tasks ofactions_runners.That way they can be tested without Docker or the CI App, and a cache host needs no slots.
The playbook mounts it after
actions_runnersand before the firewall play.DynamicUser=yesas a user of its own,User=ci-turbo-cache-%i, so the shared server, which development machines reach, cannot read the trusted one's environment.-vwhatever its label, and an instance holds its keys and token.Every task whose item or content holds a secret has
no_log.Restart=always,RestartSec=2s,StartLimitIntervalSec=0, and noLogsDirectory=: with one, the server would also write an unrotated log file.[a-z0-9], written once withforce: false.A fixed token, set on the cache host, replaces the file on every run.
/v8/artifacts/statuswith the token (2 s timeout): 200 means the server is used, 401 means it "refuses the token", and anything else means "nothing answers".turbo_cache_hostis validated by character class ([a-z0-9.-]), since the template engine has no regex.A URL, a port, upper case and spaces are refused.
TURBO_CACHE=remote:rwand no API, so it never reads a local cache that a shared run may have filled._check.ymlkeeps its inputsvaultandop-service-account-token.The deleted step was what used them; whether they go is the follow-up's call, since callers pass them.
Left as they are, outside this change
newborns/pipeline.test.tsstill says the caches are "the cache servers the step turbo-cache starts".tests/runner-image-commands.shstill names "the composite actions under .github/actions" and lists whatturbo-cache.shused._e2e.ymland_publish-deploy.ymlstill use the deleted step ($/.github/actions/turbo-cache), as do the tests of them inpackages/lib/src/pipeline.test.ts.Those workflows are replaced in the follow-up.
Verified at ab2fac3
GITHUB_ACTIONS=true, so a newborn'sbuildwas a trusted verb of a job: with no trusted server named, turbow gives it no local cache, and twoapp-nextjsnewborn tests of a build's cache hits failed there (seen in the run's log and reproduced locally).The newborn harness now drops the inherited
GITHUB_ACTIONS: a newborn's verbs run outside a job unless a test passesGITHUB_ACTIONS=trueitself, as the cache and pipeline newborns do.TURBO_FORCE=true mise run testpasses: 7 of 7 tasks (at 7a8b0cb, before this test-only change).GITHUB_ACTIONS=true CI=true, withCI=truealone, and with neither: 102 of 102 each.newborns/turbo-cache.test.tsruns the role at-vvvin default and overlay mode, on a first run and on runs that restart the servers, and the output holds no bucket key and no token, fixed or generated.Turbo 2.11.13 sends a linked repo's team id when run alone, and never through turbow.
packages/lib/src/repoTurboCache.test.tskills these mutations: a probe timeout of 20 s or none, a 500 taken for a server to use, and a non-emptyGITHUB_ACTIONStaken for a job.Lines
+1164 / −1259 against
plain-pipeline(882c036).The additions that stay are the role (260 lines, about half of them its header and comments), the rewritten tests of turbow and of the newborn (the role runs in a systemd container on two networks, and a newborn reaches it), and the question with its rendering.
The action, its shell script, its tests and the composite runner (783 lines) are gone.
🤖 Generated with Claude Code