Skip to content

Improve buildkit node creation#10843

Merged
milas merged 2 commits into
docker:v2from
silvin-lubecki:improve-buildx-node-creation
Aug 3, 2023
Merged

Improve buildkit node creation#10843
milas merged 2 commits into
docker:v2from
silvin-lubecki:improve-buildx-node-creation

Conversation

@silvin-lubecki

@silvin-lubecki silvin-lubecki commented Jul 24, 2023

Copy link
Copy Markdown
Contributor

What I did
Move builder and nodes initialization code up, avoiding to recreate/load them for every service build.
Added support of BUILDX_BUILDER env var.

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

…oad them for every service build.

Signed-off-by: Silvin Lubecki <[email protected]>
@silvin-lubecki
silvin-lubecki force-pushed the improve-buildx-node-creation branch from 961d232 to 092cd69 Compare July 24, 2023 15:44
@codecov

codecov Bot commented Jul 24, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 86.95% and project coverage change: +1.63% 🎉

Comparison is base (8a1bf5d) 58.30% compared to head (092cd69) 59.94%.
Report is 1 commits behind head on v2.

❗ Current head 092cd69 differs from pull request most recent head e1171c6. Consider uploading reports for the commit e1171c6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10843      +/-   ##
==========================================
+ Coverage   58.30%   59.94%   +1.63%     
==========================================
  Files         119      118       -1     
  Lines       10331    10076     -255     
==========================================
+ Hits         6024     6040      +16     
+ Misses       3710     3441     -269     
+ Partials      597      595       -2     
Files Changed Coverage Δ
pkg/compose/build.go 75.29% <83.33%> (+0.29%) ⬆️
pkg/compose/build_buildkit.go 34.04% <100.00%> (-0.58%) ⬇️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@silvin-lubecki
silvin-lubecki requested a review from glours July 24, 2023 16:01
@glours
glours requested a review from milas July 24, 2023 16:01

@milas milas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Note to Compose team: we should make sure to mention that BUILDX_BUILDER is now supported for up --build as well in the release notes (see also my non-blocking review comment)

Comment thread pkg/compose/build.go
Comment on lines +78 to +81
builderName := options.Builder
if builderName == "" {
builderName = os.Getenv("BUILDX_BUILDER")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, so we already do a look up in cmd/build.go:

builderName := opts.builder
if builderName == "" {
builderName = os.Getenv("BUILDX_BUILDER")
}

But that won't apply for up --build (while this will).

@glours Do you think that --builder should become a global flag on Compose, and let the CLI/cmd part handle the env var lookup?

[I don't think we need to resolve this as part of this PR]

@milas
milas requested a review from ndeloof August 3, 2023 12:53
@milas
milas merged commit 7c42776 into docker:v2 Aug 3, 2023
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.

3 participants