Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve buildkit node creation #10843

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

silvin-lubecki
Copy link
Contributor

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

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 <silvin.lubecki@docker.com>
@codecov
Copy link

codecov bot commented Jul 24, 2023

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.

@glours glours requested a review from milas July 24, 2023 16:01
Copy link
Contributor

@milas milas left a comment

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 on lines +78 to +81
builderName := options.Builder
if builderName == "" {
builderName = os.Getenv("BUILDX_BUILDER")
}
Copy link
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
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants