Skip to content

Parallelize kind-build-images for faster kind-up#12069

Draft
caseydavenport wants to merge 3 commits intoprojectcalico:masterfrom
caseydavenport:caseydavenport/parallel-kind-build-images
Draft

Parallelize kind-build-images for faster kind-up#12069
caseydavenport wants to merge 3 commits intoprojectcalico:masterfrom
caseydavenport:caseydavenport/parallel-kind-build-images

Conversation

@caseydavenport
Copy link
Member

Summary

  • Build component images concurrently during kind-up and kind-reload by invoking
    kind-build-images with make -j$(nproc) instead of sequentially.
  • The stamp file targets in lib.Makefile are independent of each other, so they can
    safely run in parallel. The operator build depends on all image markers, so it
    correctly serializes after them.

Test plan

  • Run make kind-up from a clean state (no stamp files) and verify all images build
    and the cluster comes up healthy.
  • Run make kind-reload after a source change and verify only the changed image rebuilds.

@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Mar 11, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Mar 11, 2026
@caseydavenport caseydavenport force-pushed the caseydavenport/parallel-kind-build-images branch 3 times, most recently from 0a2f1f8 to ce113c0 Compare March 11, 2026 21:25
Build all component images concurrently by invoking kind-build-images
with make -j$(nproc). The stamp file targets are independent of each
other, so they can safely run in parallel. The operator build already
depends on all image markers, so it correctly serializes after them.

Apply the same treatment to kind-reload.
Replace the docker-save/kind-load-image-archive approach with a local
Docker registry (localhost:5001). Images are pushed to the registry
after building, and kind nodes pull from it directly.

This is faster than the tarball approach because docker push transfers
only changed layers, and avoids the overhead of creating and loading a
multi-GB archive. It also more closely mirrors how images are pulled in
a real cluster.

Changes:
- Add kind-img-registry target to start a local registry container
- Configure containerd on kind nodes to mirror localhost:5001 to the
  registry container
- Push images to registry in kind-build-images and build-operator.sh
- Update values.yaml and calicoctl.yaml to use localhost:5001 registry
- Switch operator pull policy from PullNever to PullAlways
- Add push_images.sh, used by deploy_resources.sh
Two changes:

1. build-operator.sh: Reuse existing operator clone across runs instead of
   deleting and re-cloning every time. On subsequent runs, just fetch+reset
   to latest. This preserves the Go build cache, downloaded helm binary,
   and Istio/Gateway API charts.

2. node/Makefile: Exclude build artifacts (*.ll, *.o, *.d, libbpf/) from
   the GPL source tarball and its find-based dependency list. The BPF
   compilation creates transient .ll files in felix/bpf-gpl/ that cause
   tar to fail when running in parallel (-j) because files appear and
   disappear mid-archive.
@caseydavenport caseydavenport force-pushed the caseydavenport/parallel-kind-build-images branch from ce113c0 to 640753b Compare March 12, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-pr-required Change is not yet documented release-note-required Change has user-facing impact (no matter how small)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants