Skip to content

fix(sandbox): a VM logs in to the image store's registry before pulling an image by its digest - #746

Merged
earakely-scale merged 2 commits into
mainfrom
edgararakelyan/vm-pulls-by-digest-log-in
Nov 17, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
edgararakelyan/vm-pulls-by-digest-log-in

Conversation

@earakely-scale

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

Copy link
Copy Markdown
Collaborator

Part of FD-6064.

Why

agent-env bundle register builds each image a bundle builds, pushes it to the configured image store, and records it by digest with its build context beside it. On a VM sandbox, load_docker_images pulls such an image by digest (pull_published), but that path never logged in to the registry. Only the pull by name (pull_images) did.

With a private image store such as ECR, every pull by digest failed, and the VM rebuilt the image from its build context on every deploy, without saying so. FD-5969's run on modal_vm hit this for both of the bundle's images:

Couldn't pull 084828598639.dkr.ecr.us-west-2.amazonaws.com/agentenv-e2e-m8/fd5969-items-env_image:src-…@sha256:c617ea6e… on sb-01M7KV3PF…, so it's built from its build context: … authorization failed: no basic auth credentials

FD-4709's bundles reference images in the delivery ECR by digest, which is the same path.

What changes

  • pull_published first logs in to each registry the image store holds credentials for, then pulls by digest.
  • A registry the VM can't log in to falls back the way a failed pull by digest does: its images aren't pulled, and are built from their build contexts with a warning that names the failed login. pull_images (by name), which has nothing to fall back on, still raises.
  • The login loop moves out of pull_images into VmSandbox._log_in, which both pulls use: one login per registry, and none for a registry the store holds no credentials for. GHCR's published infra images are pulled as before.

Testing

  • New unit test: an image registered by digest in a registry the store holds is pulled by its digest after docker login to that registry, while a published image beside it logs in nowhere. It fails on main.
  • New unit test: when the registry's login fails (the store's credentials can't be minted), the image is built from its build context instead of failing the deploy, and the published image beside it is still pulled. vm_sandbox_test.py: 64 passed.
  • On modal_vm, with FD-5969's registered bundle (images in ECR, us-west-2):
    • Before (main): two Couldn't pull … no basic auth credentials warnings per deploy, and the items and shop images were built on the gateway VM.
    • This branch: no warnings. The gateway VM ran the items and shop containers from the ECR images it pulled, and built only the gateway, whose image is stored as a build context by design.
    • Deploy took 100 s, against 122 s before.
    • Every check of the FD-5969 run passed: triggers, clock jumps, the counterpart across sandboxes, and site routing. Teardown was clean.
    • One other run of this branch took 1,067 s to deploy, with every check passing and no pull warnings. The timed rerun put the deploy at 100 s, so that was a slow Modal host, not this change.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous login-failure issue is fixed.

Summary

VM sandboxes log in before pulling images by digest.

  • VM sandboxes log in before pulling private images by digest.

Reviews (6) · Last reviewed commit: "fix(sandbox): a registry a VM can't log ..." · Reviewed by Greptile

…ng an image by its digest

A bundle's image, registered by its digest in a private image store such as ECR, failed to pull on a VM sandbox
("no basic auth credentials") and was built from its build context on every deploy, since only the pull by name
logged in. The pull by digest now logs in to each registry the store holds credentials for first, as the pull by
name does; a registry it holds none for, GHCR's published images, is left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its images, as a failed pull by digest does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit b3d4255 into main Nov 17, 2026
36 of 37 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/vm-pulls-by-digest-log-in branch November 17, 2026 20:03
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