Skip to content

ci(swtbench): default cache-mode to off - #541

Merged
juanmichelini merged 2 commits into
mainfrom
swtbench-cache-mode-off
Mar 19, 2026
Merged

juanmichelini merged 2 commits into
mainfrom
swtbench-cache-mode-off

Conversation

@simonrosenberg

Copy link
Copy Markdown
Member

Summary

  • Adds cache-mode workflow input to the SWT-Bench image build workflow, defaulting to off
  • Passes it as OPENHANDS_BUILDKIT_CACHE_MODE env var to the build step

Why

BuildKit cache export has a 100% miss rate for benchmark image builds and adds ~22s overhead per image. With 433 SWT-Bench images, this wastes ~26 minutes on registry cache round-trips even when all images already exist and are skipped.

See #540 for the full analysis:

  • max mode: 35.5 img/h
  • off mode: 50.7 img/h (43% faster)

Test plan

  • Trigger a SWT-Bench image build and verify OPENHANDS_BUILDKIT_CACHE_MODE=off appears in logs
  • Confirm build throughput improvement vs previous runs

Closes #540

🤖 Generated with Claude Code

BuildKit cache export is useless for benchmark builds (100% miss rate)
and adds ~22s overhead per image. With 433 SWT-Bench images, this wastes
~26 minutes on registry round-trips even when all images are skipped.

Closes #540

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Acceptable - Pragmatic fix for a real performance problem. One minor code smell to clean up.

env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
OPENHANDS_BUILDKIT_CACHE_MODE: ${{ inputs.cache-mode || 'off' }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Nit: The || 'off' fallback is redundant. GitHub Actions inputs with default values are never empty - inputs.cache-mode will already be 'off' if not provided. This defensive programming adds noise without value.

Suggested change
OPENHANDS_BUILDKIT_CACHE_MODE: ${{ inputs.cache-mode || 'off' }}
OPENHANDS_BUILDKIT_CACHE_MODE: ${{ inputs.cache-mode }}

Why it matters (barely): Good code doesn't have unnecessary special cases. If the input system guarantees a default, trust it.

The input already has default: 'off', so the || fallback is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@juanmichelini juanmichelini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the analysis!

@juanmichelini
juanmichelini merged commit 1393afc into main Mar 19, 2026
2 checks passed
simonrosenberg pushed a commit that referenced this pull request Mar 19, 2026
Registry cache export is needed for the Dockerfile ARG reorder fix
(SDK PR #2522) to work. With the fix, base-image-minimal layers
become SDK-independent and reusable across SDK commits via
--cache-from. But --cache-from only works if a previous build
exported the layers with --cache-to.

The prior rationale for cache-mode=off (#540) was that registry cache
had a 100% miss rate. That was because OPENHANDS_BUILD_GIT_SHA busted
the base layers on every SDK change. With the ARG reorder fix, the
base layers will be cache-stable and registry export becomes useful.

Related: #542, #541, #531

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Use cache-mode=off for batch benchmark image builds

3 participants