Repository navigation
PLX-259: the deploy job's install step writes mise's system shims into its own temp directory - #95
Merged
davidjalbers merged 9 commits intoDec 3, 2026
Conversation
…ivery slot A test that runs the job deploy's steps up to its setup in a container of the environment image, as ci-runner-slot starts a delivery slot: the image's base, its mise at the Dockerfile's pin, plx-ci at the version its mise.toml pins installed and shimmed by the Dockerfile's own line into mise's system directory, the user runner, the host's network and no capability. It fails as the real job did: the image's plx-ci is the version the workflow names, mise rebuilds the system shims, which point at another mise than the action's, and sudo fails. The steps of the file now run on a machine: this one, as before, or the slot's container; a step's own environment is evaluated as its inputs are. Co-Authored-By: Claude Opus <noreply@anthropic.com>
…ts own temp directory On a runner host's slot the environment image carries plx-ci at the Plexus version, the one the job deploy names. `mise use -g` finds it installed in mise's system directory and so rebuilds the system shims; those point at the image's mise, not at the one jdx/mise-action downloaded, so mise must rewrite them, as root, through sudo, which fails in a slot's container without capabilities. MISE_SYSTEM_SHIMS_DIR on the step sends that rebuild into the job's temp directory, which nothing runs from: the step installs plx with no root and no writable system directory, and the later steps run the image's shims as before. On the forge's runners there is no system directory and the variable changes nothing. Co-Authored-By: Claude Opus <noreply@anthropic.com>
Co-Authored-By: Claude Opus <noreply@anthropic.com>
…n files The newborn's image now takes its instructions from the environment image's Dockerfile word for word and in their order (the base, every ENV, the apt-get install that brings sudo, the user runner and the sudoers line, the download of mise at its pin, the system config, the system install, USER and WORKDIR), and its system config is the image's own [settings] block and plx-ci line; a line it takes that the Dockerfile no longer has fails the test. The image is kept between runs, as the other newborns' are. The container is named for the run, lives thirty minutes at most, and a later run removes one whose run is gone. The action verifies the mise it downloaded in `before`, copied into the container, and downloads none. The header says what the case downloads and how long it takes. The image's Dockerfile names the reason sudo fails in a slot: ci-runner-slot starts its container with no capability. Co-Authored-By: Claude Opus <noreply@anthropic.com>
Co-Authored-By: Claude Opus <noreply@anthropic.com>
Co-Authored-By: Claude Opus <noreply@anthropic.com>
…d against the image's instructions The image is tagged by a hash of its generated Dockerfile and config, so two checkouts with different Dockerfiles cannot test each other's image, and the older tags of its name are removed where no container uses them. A RUN, COPY or ADD of the image's Dockerfile that the test neither takes nor leaves out by name fails it, and so does a ci-runner-slot that no longer starts a slot with --cap-drop ALL. The sweep of other runs' containers is gone: the Docker daemon is shared across pid namespaces, so a live run elsewhere could be taken for a dead one; the container's own thirty minutes and `after` remove it. Co-Authored-By: Claude Opus <noreply@anthropic.com>
Co-Authored-By: Claude Opus <noreply@anthropic.com>
It said mise never writes the system directory. A user's mise does, through sudo, when a `mise use` names a version installed there; in a slot that fails, and the job deploy has the shims written elsewhere. Co-Authored-By: Claude Opus <noreply@anthropic.com>
davidjalbers
deleted the
davidjalbers/plx-259-deploy-job-on-a-delivery-slot
branch
December 3, 2026 03:53
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.
PLX-259: the
deployjob ofon_pushfailed on adeliveryslot of a runner host at Plexus 0.135.0, in the stepmise use -g node@24 npm:@plexus-ms/cli@… npm:@plexus-ms/cli-ci@…, withfailed to rebuild system shimsandsudo requires a password but no TTY is available.Cause
Three facts meet, and only together.
plx-ciat the Plexus version, installed into mise's system directory (/usr/local/share/mise/installs) bymise install --system && mise reshim --system, as root.The
deployjob namesplx-ciat the same version, since a version stamps both.So
mise use -gfinds it "already installed" there, and counts a changed install path inside the system directory, which makes it rebuild the system shims (rebuild_shims_and_runtime_symlinks_for_changesinsrc/config/mod.rsof mise:system_changedis true when any of the named versions' install paths lies undersystem_installs_dir)./usr/local/bin/mise.The job runs the mise that
jdx/mise-actiondownloads to~/.local/share/mise/bin/mise.A shim counts as current only when it points at the running mise (
is_current_owned_mise_shim, andsystem_install::linksdrops only the links that already match), so every system shim has to be rewritten./usr/local/share/mise/shimsis root's, so mise hands the rewrite to its privileged helper throughsudo(system_install::needs_elevation,publish).A slot's container runs with
--cap-drop ALL(since PLX-228), so sudo cannot change user, and mise reports it as above.The job's log shows each: the action selected mise 2026.12.0 and put
~/.local/share/mise/binon the path;mise lslistednpm:@plexus-ms/cli-ci 0.135.0 (system); the step printednpm:@plexus-ms/cli-ci@0.135.0 already installed, then the error.The version of mise is not the cause.
The rebuild of system shims and the elevation through sudo are in mise 2026.11.8, the image's pin, as in 2026.12.0 (automatic elevation of system installs since
feat(install): automatically elevate system installs with sudo, jdx/mise#13384, 2026-09-19; the linefailed to rebuild system shimsis insrc/config/mod.rsat v2026.11.8, v2026.11.11 to v2026.11.16, v2026.12.0 and v2026.12.1).None of the release notes from v2026.11.8 to v2026.12.1 changes this; the nearest is v2026.11.12's "
mise reshim --systemno longer drops the shim for a system version that you also have in your own installs directory".Reproduced, in a container of
ghcr.io/plexus-ms/ci-runner:0.135.0as a delivery slot runs it (userrunner,--cap-drop ALL, no mounts), the step run from a temp directory~/.local/share/mise/bin/mise(as the job)/usr/local/bin/mise2026.11.8MISE_SYSTEM_DATA_DIRset to an absent directoryNo versions found for aqua:1password/cli, and plx-ci is downloaded againMISE_SYSTEM_SHIMS_DIRset to a directory of the job'splxandplx-ci0.135.0,op2.42.0 andgh2.106.0And
ci-runner:0.134.1with the step naming 0.134.1: with--cap-drop ALLthe same error; without it the image's passwordless sudo succeeds and the job's mise rewrites the image's system shims to point at itself.Why the suite did not meet it
newborns/deploy-job.test.tsran the steps on the host, with a system directory of the test's own that the test's user can write, and a stand-inplx-ciat9.9.9, a version the workflow never names.Neither the version match nor a root-owned system directory nor a sudo that fails was there.
newborns/pipeline.test.tscovers the jobrepoonly.The trial of PLX-244 in the runner image predates the slot's
--cap-drop ALLor ran without it; not verifiable from here, but without it sudo succeeds silently (above).Fix
The install step gets one variable:
MISE_SYSTEM_SHIMS_DIRis mise's documented variable for the system shims' directory (settingsystem_shims_dir, present at v2026.11.8 and v2026.12.x; docsdev-tools/system-installs.md).mise then writes the rebuilt system shims into the job's temp directory, which it can write and which nothing runs from; nothing elevates.
The step still uses the image's
plx-ciwhere it is the version named, and the later steps run through the image's shims as before.No job gets root, the image's system directory stays root's, a delivery slot mounts nothing new, and the step is still one command (§ 6.4, § 7.4).
On the forge's runners there is no system directory and the variable changes nothing.
Why here and not in the image: the image would need its system shims writable by the job's user (a writable system directory, against § 7.4) or the job would have to run the image's mise and not the action's, which the forge's runners do not have; and an image change reaches a host only when the host is replaced (§ 7.12).
MISE_SYSTEM_DATA_DIRwould work too, but warns in every deploy log and downloads plx-ci again.mise is not pinned for the job:
jdx/mise-actiontakes the newest release older than 24 h (inputversionunset); the image pins its own byMISE_VERSIONin the Dockerfile, which Renovate moves.The fix does not depend on which mise version either side has, as long as the job's mise still honours
MISE_SYSTEM_SHIMS_DIR: a setting of the young system-installs feature, which nothing but this newborn would notice disappearing (question below).What a consumer and a host must do
plx update);on_push.ymlchanges anyway with every version (§ 6.2).plx updateconflicts at the step'srun:line, since the hand-added lines sit next to the line whose version changes with every version (tried by the review with the engine's own merge call); the resolution is to take the template's side.Tests
newborns/deploy-job.test.tsgains a case that builds a slim image from the environment image's own files and runs the job's steps up to setup in a container of it asci-runner-slotstarts a delivery slot: host network,--cap-drop ALL, userrunner.ENV, theapt-get installthat brings sudo, curl and zstd, theuseraddofrunnerand its sudoers line (out of the instruction that also downloads the runner), theARGs and download of mise at its pin,COPY mise.toml /etc/mise/config.toml, theRUN mise install --system …line,USERandWORKDIR.A pattern that no longer matches fails the test.
[settings]block and itsplx-ciline.ci-mise-install, and the system config's other tools (op,gh,exo), none of which the step names;plx-cialone makes mise rebuild the system shims.RUN,COPYorADDof the Dockerfile that the test neither takes nor leaves out by name fails it, and so does aci-runner-slotwithout--cap-drop ALL, which the test types by hand.sleep 1800,--rm) and is removed inafter.beforealready downloaded, copied into the container, which the action verifies, fetching only its signed checksums, and does not download again. The image build downloads, cold, the base (Docker Hub, by digest), Debian's packages, mise at the image's pin (GitHub releases) and the image'splx-cifrom npm, as the image's own build does; registries the other newborns use as well. Warm it builds from Docker's cache, and node is the one download. Measured: about two minutes cold with the base present; 15 s, 73 s and 173 s in three warm runs, as fast as node's download.mise ERROR failed to rebuild system shimsandsudo requires a password but no TTY is available,Version: 2026.12.0, exactly the job's lines; run withnode newborns/scratch.ts node --test --test-name-pattern="delivery slot" newborns/deploy-job.test.ts, exit 1.With the image taken from the Dockerfile (1cd2b58), red again with the template's two lines removed in the working tree, same lines, exit 1.
packages/lib/src/pipeline.test.tspins the step'senv.mise run testexit 0, after mergingplain-pipeline-2.mise upgrade.Readings, for the maintainer
mise use(and perhapsmise upgrade, not tried) naming a version the image holds in its system directory, with a mise other than the image's.mise installdoes not (the review tried it), which is why the jobrepopassed in the same run.ansible/ci/roles/actions_runners/files/ci-runner/mise.toml, which said mise "never writes" its system directory, now says that only root can, and that a job'smise usenaming a version installed there makes mise rebuild the shims through sudo (after PLX-248: plx-ci setup without a token and without op on the forge's runners #93 was merged). The Dockerfile's header, which named no-new-privileges as the reason sudo fails in a slot, now namesci-runner-slot's--cap-drop ALL.jdx/mise-actiontakes the newest release at least a day old), the fix rests on a setting mise introduced a few months ago (system_shims_dir, beside the automatic elevation of September), and nothing would notice if a later mise dropped or renamed it, since mise ignores an unknown variable, except this newborn at the next cut.mise useon a container where sudo works (the image's sudoers line, without--cap-drop ALL) silently re-points the image's system shims at the job's mise, as root; on a slot that cannot happen.What the compendium owes
Nothing: no requirement changes, and the compendium's
maindoes not describe the install step (searched formise use, "installs plx" and "system directory").A branch of the compendium that describes the step would say that it keeps mise's rebuild of the image's shims inside the job.
🤖 Generated with Claude Code