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

Set BuildKit's ExportedProduct variable to show useful errors in the future #37439

Merged
merged 3 commits into from
Jul 17, 2018

Conversation

tiborvass
Copy link
Contributor

@tiborvass tiborvass commented Jul 11, 2018

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

@thaJeztah
Copy link
Member

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
Copy link
Member

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

@codecov
Copy link

codecov bot commented Jul 12, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@a5495f2). Click here to learn what that means.
The diff coverage is 33.33%.

@@            Coverage Diff            @@
##             master   #37439   +/-   ##
=========================================
  Coverage          ?   34.95%           
=========================================
  Files             ?      610           
  Lines             ?    44878           
  Branches          ?        0           
=========================================
  Hits              ?    15685           
  Misses            ?    27073           
  Partials          ?     2120

@tiborvass tiborvass changed the title vendor: buildkit to c3846bd8c419d280053e4a9ba4506577665ab94d Set BuildKit's ExportedProduct variable to show useful errors in the future Jul 12, 2018
@@ -14,4 +14,5 @@ const (
RuncCommitID = "library-import"
InitCommitID = "library-import"
PlatformName = ""
ProductName = ""
Copy link
Member

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?)

Copy link
Contributor Author

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.

@@ -42,6 +43,10 @@ func newDaemonCommand() *cobra.Command {
return cmd
}

func init() {
apicaps.ExportedProduct = dockerversion.ProductName
Copy link
Member

Choose a reason for hiding this comment

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

if dockerversion.ProductName != ""

Copy link
Member

@thaJeztah thaJeztah left a 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

@@ -21,6 +21,7 @@ const (
IAmStatic string = "${IAMSTATIC:-true}"
ContainerdCommitID string = "${CONTAINERD_COMMIT}"
PlatformName string = "${PLATFORM}"
ProductName string = "$PRODUCT"
Copy link
Member

Choose a reason for hiding this comment

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

"${PRODUCT}" ?

Frontends: frontends,
CacheKeyStorage: cacheStorage,
ResolveCacheImporterFunc: registryremotecache.ResolveCacheImporterFunc(opt.SessionManager),
// ResolveCacheExporterFunc: ce,
Copy link
Member

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 {
Copy link
Member

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 🤷‍♂️

Copy link
Contributor Author

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.

Copy link
Member

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 :-)

Tibor Vass added 3 commits July 16, 2018 21:41
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>
@tiborvass
Copy link
Contributor Author

@thaJeztah addressed.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@tiborvass
Copy link
Contributor Author

unrelated CI failures

@tiborvass tiborvass merged commit 9ebed53 into moby:master Jul 17, 2018
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

6 participants