-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Set BuildKit's ExportedProduct variable to show useful errors in the future #37439
Conversation
full diff: moby/buildkit@9acf51e...c3846bd |
github.com/containerd/containerd 08f7ee9828af1783dc98cc5cc1739e915697c667 | ||
github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788 | ||
github.com/containerd/containerd b41633746ed4833f52c3c071e8edcfa2713e5677 | ||
github.com/containerd/typeurl a93fcdb778cd272c6e9b3028b2f42d813e785d40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double-checked, and these all match what's already in moby/vendor.conf
f30077a
to
0e57b2d
Compare
Codecov Report
@@ Coverage Diff @@
## master #37439 +/- ##
=========================================
Coverage ? 34.95%
=========================================
Files ? 610
Lines ? 44878
Branches ? 0
=========================================
Hits ? 15685
Misses ? 27073
Partials ? 2120 |
0e57b2d
to
1aa26e2
Compare
@@ -14,4 +14,5 @@ const ( | |||
RuncCommitID = "library-import" | |||
InitCommitID = "library-import" | |||
PlatformName = "" | |||
ProductName = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to have a default value? (moby
? moby-engine
? dockerd
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to keep it empty, because there are no "moby releases". Docker will set this.
cmd/dockerd/docker.go
Outdated
@@ -42,6 +43,10 @@ func newDaemonCommand() *cobra.Command { | |||
return cmd | |||
} | |||
|
|||
func init() { | |||
apicaps.ExportedProduct = dockerversion.ProductName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if dockerversion.ProductName != ""
1aa26e2
to
5080d67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nits and question, but LGTM otherwise; let me know if you want to address them in this PR, or want to do so as a follow up
hack/make/.go-autogen
Outdated
@@ -21,6 +21,7 @@ const ( | |||
IAmStatic string = "${IAMSTATIC:-true}" | |||
ContainerdCommitID string = "${CONTAINERD_COMMIT}" | |||
PlatformName string = "${PLATFORM}" | |||
ProductName string = "$PRODUCT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${PRODUCT}"
?
builder/builder-next/controller.go
Outdated
Frontends: frontends, | ||
CacheKeyStorage: cacheStorage, | ||
ResolveCacheImporterFunc: registryremotecache.ResolveCacheImporterFunc(opt.SessionManager), | ||
// ResolveCacheExporterFunc: ce, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why's this commented out? Does this need a TODO?
@@ -83,7 +83,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, ref cache.ImmutableR | |||
if ref != nil { | |||
layersDone := oneOffProgress(ctx, "exporting layers") | |||
|
|||
if err := ref.Finalize(ctx); err != nil { | |||
if err := ref.Finalize(ctx, true); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a super-fan of this boolean argument, but 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's in buildkit. Feel free to change it there, but I don't think it's a blocker for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I saw it was implemented there :-)
Signed-off-by: Tibor Vass <tibor@docker.com>
This introduces a PRODUCT environment variable that is used to set a constant at dockerversion.ProductName. That is then used to set BuildKit's ExportedProduct variable in order to show useful error messages to users when a certain version of the product doesn't support a BuildKit feature. Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
5080d67
to
8159922
Compare
@thaJeztah addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
unrelated CI failures |
This introduces a PRODUCT environment variable that is used to set a constant
at dockerversion.ProductName.
That is then used to set BuildKit's ExportedProduct variable in order to show
useful error messages to users when a certain version of the product doesn't
support a BuildKit feature.
Vendors buildkit to c3846bd8c419d280053e4a9ba4506577665ab94d