Skip to content

fix(vm): give jobs the environment of the image - #9

Merged
ephraimduncan merged 1 commit into
mainfrom
fix/vm-image-env
Nov 6, 2026
Merged

ephraimduncan merged 1 commit into
mainfrom
fix/vm-image-env

Conversation

@ephraimduncan

Copy link
Copy Markdown
Contributor

In VM mode, jobs did not get the environment of the image config. Docker gives the ENV of an image to the first process of a container, but a Firecracker VM boots from an ext4 copy of the image files only. Thus a VM had no RUNNER_TOOL_CACHE or ImageOS, and actions/setup-node, setup-python, and setup-go did not find the tool cache in /opt/hostedtoolcache. They downloaded each tool again and copied it into _work/_tool. On the telemetry.dev jobs, setup-node logged Attempting to download 24... and took 2 to 3 minutes.

The root disk now holds the image environment in /etc/runplane/environ, with a NUL byte after each entry. runplane-init sets these variables after it mounts the root, before it starts dockerd and the runner. Thus a job in a VM gets the same environment as a job in container mode.

The name of a root disk contains the hash of runplane-init. Thus, after the update, each VM server makes its root disks again one time.

In VM mode, jobs did not get the ENV of the image config. Thus a VM had
no RUNNER_TOOL_CACHE or ImageOS, and actions/setup-node, setup-python,
and setup-go downloaded the tools that the image has in
/opt/hostedtoolcache. On a nested VM, setup-node took 2 to 3 minutes for
each job.

The root disk now holds the image environment in /etc/runplane/environ.
runplane-init sets it after it mounts the root, as Docker does in
container mode.
@ephraimduncan
ephraimduncan merged commit 1b78e39 into main Nov 6, 2026
1 of 4 checks passed
ephraimduncan added a commit that referenced this pull request Nov 6, 2026
Merge 79d3da7, 1b78e39, and d27d5da of main. The features keep the
behavior of main. Each feature uses the packages of the refactor.

CI on the runplane runners (#7): the jobs use the runplane label, and the
image builds use QEMU. images.yml keeps the matrices of images.go and its
comment about the build context.

Image environment in VM mode (#9): internal/sandbox/guest owns
ImageEnvFile and its form. EncodeImageEnv writes the file in the root
disk, and runplane-init reads it with DecodeImageEnv. Thus the NUL
format has one place.

Pull requests that move jobs to runplane (#8):
- ghrest.Call has a JSON Body. ghrest.PullPermissions is part of
  AppPermissions, thus the manifest, the connect form, and the
  permission check use one list.
- github does not import huma. OpenPullRequest returns
  store.ErrNotFound, ghrest.ErrNoPullPermissions, or field.Problems, and
  the API changes them into 404, 403, and 422. Setup and the permission
  check read the installation through one function.
- The audit action github.pull_request.create is in the audit enum. Its
  detail has the repository, and the web has a text for it.
- The API gives permissions_url on the app. The web does not make the
  URL. The pull request description links to pages.Jobs.
- The label of the request has no pattern. The check against the
  enabled pools gives the 422 at body.label.
- The web finds the repositories with publicReposRun, the rule of the
  job access switch. Before, the web had a second rule that ignored dev
  mode and the modes of the servers.
- The route files only give params. The settings page and the first job
  step have the form. FormAlert moved to components/app, because the
  github pages must not import the setup pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant