Skip to content

perf(onboard): cache and prefetch sandbox base image resolution #4680

Description

@ahunnargikar-nvidia

Problem

nemoclaw onboard resolves and pins the sandbox base image before sandbox creation so the staged Dockerfile builds from the exact base image NemoClaw just fetched. That protects users from stale floating :latest behavior, but it can also add avoidable registry and Docker work on repeat onboard/rebuild flows where the same base image is already present and already resolved locally.

For warm systems, base image resolution should be fast and mostly local. Repeated onboard runs should not pay unnecessary remote pull/digest checks unless the requested base image, NemoClaw source version, platform/ABI requirement, or operator override has changed.

This is separate from cold-cache install UX. #3990 tracks fresh WSL2 installs where large downloads are unavoidable but should show progress and overlap where safe. This issue focuses on warm-cache behavior and base-image resolution policy.

Scope

Cache and prefetch sandbox base image resolution where it is safe to do so, while preserving digest pinning and avoiding stale-base regressions.

Candidate areas:

  • Cache the resolved sandbox base image ref/digest in NemoClaw state with enough key material to know when it is still valid.
  • Key the cache by architecture/platform, base image name/tag or explicit override, NemoClaw source/release identity, and whether OpenShell sandbox ABI compatibility required a local fallback image.
  • Prefer local Docker metadata (docker image inspect / RepoDigests) for warm-cache validation before attempting remote pulls.
  • Respect explicit overrides such as NEMOCLAW_SANDBOX_BASE_IMAGE_REF.
  • Provide a force-refresh path for --fresh, an env var, or another explicit operator control if needed.
  • Optionally prefetch/resolve the likely base image earlier once agent/platform requirements are known, but only under clear cancellation/failure handling.
  • Preserve clear offline behavior when a cached base image is usable and clear diagnostics when it is not.

Expected Behavior

On a warm system with the same NemoClaw version and sandbox base already available, repeat onboard/rebuild should reuse the cached local base-image resolution quickly.

If the cache is stale, unsafe, missing, or incompatible with the current platform/ABI requirement, NemoClaw should fall back to the current safe pull-and-resolve behavior.

Operators should be able to force a refresh when they need to verify or update the base image.

Related Work

This issue should coordinate with #4052 but not duplicate it. #4052 is about deterministic release-associated base refs. This issue is about avoiding repeat remote resolution/pull work when the selected base ref is already known and locally available.

Acceptance Criteria

  • Warm repeat onboard/rebuild can reuse a locally cached resolved sandbox base image ref/digest when the cache key still matches the current run.
  • Cache validation includes platform/architecture and OpenShell sandbox ABI compatibility requirements.
  • Explicit base image overrides are respected and do not get replaced by stale cached defaults.
  • A force-refresh path bypasses the cache and performs the current safe pull-and-resolve flow.
  • Offline warm-cache behavior is clear: usable cached bases work, unusable/missing cached bases fail with actionable guidance.
  • Trace output or logs distinguish cache hit, local validation, remote pull/resolve, and local fallback build paths.
  • Tests cover cache hit, cache miss, override, force refresh, stale key, ABI-required fallback, offline usable cache, and offline missing cache.
  • perf: investigate and reduce networking latency during onboard and validation #2001 or perf(onboard): define onboard performance budget and CI regression signal #3776 is updated with implementation notes or trace evidence if this materially changes onboard timing.

Non-goals

Activity

  1. added
    area: cli
    area: packaging
    enhancement
    platform: container
    area: performance
    and removed
    area: packaging
    on Jun 3, 2026
  2. removed
    enhancement
    on Jun 8, 2026
  3. cv commented on Jul 3, 2026

    @cv
    Collaborator

    Acceptance evidence for the warm base-image resolution work is recorded on #3776: #3776 (comment)

    That note distinguishes deterministic no-pull/cache-path evidence from wall-clock benchmarking and links this work to replacement PR #6254. Current targeted lifecycle evidence is being tracked on the PR; hosted-runner timings will be reported as regression evidence rather than an isolated warm/cold A/B claim.

  4. cv commented on Jul 4, 2026

    @cv
    Collaborator

    Final acceptance evidence: #3776 (comment) records the exact-final-head hosted run and timings. Both Hermes rebuild scenarios passed on PR #6254 head 6f19fa26a; the note explicitly treats those times as regression evidence rather than a controlled warm/cold A/B measurement.

  5. added a commit that references this issue on Jul 4, 2026
    8bfc315
  6. added a commit that references this issue on Jul 12, 2026
    5b782cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: cliarea: performanceplatform: container

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions