Skip to content

perf(ci): find why the DevContainer Image job takes up to 25 minutes #1951

Closed

Description

@dan-petty

Friction

The DevContainer Image job takes up to 25 minutes. It runs on every pull request into main, so every release pull request waits for it. The same build runs again in release.yml after the merge.

Evidence

Run Job total Build and Push DevContainer Image by Digest Start the DevContainer Image as Its Remote User
39950016520 (#1947, head fe70a13) 25.3 min 22.8 min 1.8 min
39900430339 (workflow_dispatch on the #1950 branch) 17.3 min 14.9 min 1.8 min

The build step (.github/actions/devcontainer-image) takes about 90% of the job. Its time changes by 8 minutes between two runs of almost the same tree.

What to find

Measure where the build step spends its time, before you change anything. Candidates to check:

  • --platform linux/amd64,linux/arm64 on an amd64 runner builds linux/arm64 under QEMU emulation. GitHub has native arm64 runners (ubuntu-24.04-arm).
  • --cache-from type=registry,ref=ghcr.io/<org>/<image>/devcontainer:buildcache: only the release writes this cache. Find out how many layers hit the cache on a pull request.
  • The Dev Container Features install in each build, for each platform.
  • --sbom=true and --provenance=mode=max add time to the export.
  • The push by digest to the localhost:5000 registry service, and the 8-minute difference between the two runs.

Proposed remedy

Report the time of each part from the BuildKit output of one run (for example docker buildx history or the step timestamps in the log). Then propose the change that removes the largest part, with the time it saves. Name the open tool or GitHub feature that covers it.

regression of #1949, shipped in v0.2.39

Activity

  1. added
    source/agent
    type/infra
    on Oct 23, 2026
  2. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/infra. The candidate focuses on CI performance and infrastructure improvements.
    • Priority: P2-Medium. It impacts CI time but does not block releases or break functionality.
    • Value: Medium. Improving CI speed helps all contributors and release cycles.
    • Effort: High. The task requires detailed profiling, analysis, and potential changes to build steps.
  3. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Timing before and after v0.2.39

    The 25 minutes is new in v0.2.39. Times of the DevContainer jobs, from the Actions API:

    Release PR check into main (DevContainer Image) Release build on main
    v0.2.24 to v0.2.29 1.0 to 3.2 min not read
    v0.2.34 (#1566) 3.5 min not read
    v0.2.35 (#1581) 3.6 min failed at setup
    v0.2.36 (#1615) 3.2 min 8.7 min
    v0.2.37 (#1720) 3.3 min 11.3 min
    v0.2.38 (#1799) 1.7 min 8.8 min and 6.3 min
    v0.2.39 (#1947) 25.3 min (build step 22.8 min) running

    What changed in v0.2.39 (#1895, #1901)

    • Up to v0.2.38 the PR check used devcontainers/ci v0.3 for one platform, with cacheFrom the published :latest image, and pushed a PR tag to GHCR.
    • Since v0.2.39 the PR check runs .github/actions/devcontainer-image: the Dev Containers CLI builds linux/amd64 and linux/arm64, the arm64 platform under QEMU on an amd64 runner, with the Dev Container Features, --sbom=true and --provenance=mode=max. Its --cache-from is the buildcache ref that only the release writes. Then the smoke test pulls and starts both platforms.
    • Up to v0.2.38 the release build used docker/build-push-action for both platforms, with no Dev Container Features (fix(devcontainer): the published image applies the devcontainer features again, so remoteUser vscode exists #1901 put them back), in 6 to 11 minutes.

    So the first places to measure are the arm64 build under QEMU and the cache hits on a PR.

  4. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Fixed by #1952: the devcontainer image builds for linux/amd64 only, with no QEMU, as it did up to v0.2.34. The PR's DevContainer check took 4.8 minutes, down from about 25. The release no longer publishes a linux/arm64 devcontainer image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/infra

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions