Skip to content

vendor buildkit 6861f17f15364de0fe1fd1e6e8da07598a485123#41601

Merged
tiborvass merged 7 commits intomoby:masterfrom
tiborvass:bk_vendor
Nov 17, 2020
Merged

vendor buildkit 6861f17f15364de0fe1fd1e6e8da07598a485123#41601
tiborvass merged 7 commits intomoby:masterfrom
tiborvass:bk_vendor

Conversation

@tiborvass
Copy link
Copy Markdown
Contributor

Signed-off-by: Tibor Vass [email protected]

@thaJeztah
Copy link
Copy Markdown
Member

Failures look related;

2020-10-28T17:53:45.190Z] === Errors
[2020-10-28T17:53:45.190Z] builder/dockerfile/dispatchers_test.go:142:37: unknown field 'KeyValuePairOptional' in struct literal of type instructions.ArgCommand
[2020-10-28T17:53:45.190Z] builder/dockerfile/dispatchers_test.go:398:34: unknown field 'KeyValuePairOptional' in struct literal of type instructions.ArgCommand

Comment thread vendor.conf Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is downgrading to an older version; could you update the version in buildkit instead?

@thaJeztah
Copy link
Copy Markdown
Member

I know containerd doesn't have a stable Go API (yet); still trying to see what chances we have to stay on release branches / released versions, so that we can have bug- and security fixes backported upstream, and to make our dependency graph more go modules friendly; I think the relevant commits we need for buildkit are containerd/containerd#4445; how realistic would it be to get that backported to the v1.4 branch?

@tiborvass tiborvass marked this pull request as draft October 29, 2020 01:02
@tiborvass
Copy link
Copy Markdown
Contributor Author

Sorry this is not ready, I need to fix things still.

@AkihiroSuda
Copy link
Copy Markdown
Member

https://github.com/containerd/stargz-snapshotter (new dependency; Apache2 License, so should be ok)

@ktock Could we reorganize the package structure not to require this dependency? (Not a blocker for merging this PR)

@thaJeztah
Copy link
Copy Markdown
Member

@ktock Could we reorganize the package structure not to require this dependency? (Not a blocker for merging this PR)

👍 yes, if we don't need it in this code, that would be better of course!

@thaJeztah
Copy link
Copy Markdown
Member

thaJeztah commented Oct 30, 2020

Some upstream buildit PRs were opened;

@tiborvass tiborvass force-pushed the bk_vendor branch 4 times, most recently from 1a08597 to cd50e5b Compare November 13, 2020 05:43
@tiborvass tiborvass changed the title vendor buildkit 212a0b14394dd09e9ec5e112469c526a14a93b2a vendor buildkit ce283f39b5651c84ec237eb16d509ffa64c515b9 Nov 13, 2020
@tiborvass tiborvass marked this pull request as ready for review November 13, 2020 05:43
@tiborvass
Copy link
Copy Markdown
Contributor Author

@thaJeztah @tonistiigi updated. I will open a separate PR for sync-ing vendoring hashes.

@tiborvass tiborvass force-pushed the bk_vendor branch 2 times, most recently from 945d99b to b12df87 Compare November 13, 2020 06:37
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah Nov 13, 2020

Choose a reason for hiding this comment

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

Can you combine the "use buildkit dockerignore" with the vendor commit? (edit: so that it's clear these files moved?)
Also should add a "deprecated.go" that deprecated it, but aliases it to to the new location (to help the transition); there's quite some consumers of it; https://grep.app/search?current=2&q=github.com/docker/docker/builder/dockerignore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not pkg/ but fine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it make a difference? afaik the pkg/ prefix was a convention, but now discouraged and deprecated

@thaJeztah
Copy link
Copy Markdown
Member

This failure looks related;

=== RUN   TestDockerSuite/TestBuildContChar
    --- FAIL: TestDockerSuite/TestBuildContChar (2.41s)
        docker_cli_build_test.go:5627: assertion failed: expression is false: strings.Contains(result.Combined(), "Step 2/2 : RUN echo hi \\\n")

I suspect my changes in moby/buildkit#1559 broke that test. Looks like it was added in eaf0b57 (#27873), but AFAICS that was testing a bare (non-escaped) \ at the end of the line; #27545

Tibor Vass added 3 commits November 14, 2020 03:57
Tibor Vass added 3 commits November 14, 2020 03:57
This old test is failing after an edge-case change in dockerfile
parsing considered a bugfix: moby/buildkit#1559

Instead of fixing the test, I suggest removing it as there are already
tests for it in BuildKit.

Signed-off-by: Tibor Vass <[email protected]>
@tiborvass
Copy link
Copy Markdown
Contributor Author

@thaJeztah @tonistiigi it's updated and the s390x failure seems unrelated. --cache-from works for both inline cache local, inline-cache remote, and with remote cache exported with mode=max.

@thaJeztah
Copy link
Copy Markdown
Member

thaJeztah commented Nov 14, 2020 via email

@tiborvass tiborvass changed the title vendor buildkit ce283f39b5651c84ec237eb16d509ffa64c515b9 vendor buildkit 6861f17f15364de0fe1fd1e6e8da07598a485123 Nov 14, 2020
@tonistiigi
Copy link
Copy Markdown
Member

Building buildkit:master with this PR:

root@81f0e16cc830:/tmp/buildkit# docker build .
[+] Building 7.0s (15/30)
 => [internal] load build definition from Dockerfile                                                                                                    0.0s
 => => transferring dockerfile: 13.03kB                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => => transferring context: 56B                                                                                                                        0.0s
 => resolve image config for docker.io/docker/dockerfile:1.1-experimental                                                                               1.9s
 => docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44                 0.8s
 => => resolve docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44                     0.0s
 => => sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44 1.69kB / 1.69kB                                                          0.0s
 => => sha256:8c69d118cfcd040a222bea7f7d57c6156faa938cb61b47657cd65343babc3664 521B / 521B                                                              0.0s
 => => sha256:08fb2b2ca3d58e19d791e73dea16126df37608115532e748d63525688df457a5 897B / 897B                                                              0.0s
 => => sha256:61261561661960014533790f5d6c42f5b88362db7e005f35248c20f075900a61 8.88MB / 8.88MB                                                          0.5s
 => => extracting sha256:61261561661960014533790f5d6c42f5b88362db7e005f35248c20f075900a61                                                               0.2s
 => [internal] load metadata for docker.io/library/alpine:3.12                                                                                          1.3s
 => [internal] load metadata for docker.io/tonistiigi/xx:golang@sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18eb11d0c0a537                 1.5s
 => [internal] load metadata for docker.io/library/golang:1.13-buster                                                                                   1.5s
 => CANCELED [internal] load build context                                                                                                              1.0s
 => => transferring context: 38.34MB                                                                                                                    1.0s
 => [alpine 1/1] FROM docker.io/library/alpine:3.12@sha256:c0e9560cda118f9ec63ddefb4a173a2b2a0347082d7dff7dc14272e7841a5b5a                             1.6s
 => [gobuild-minimal 1/3] FROM docker.io/library/golang:1.13-buster@sha256:66a3f6817c129f48c9cc9b96816a1c0b6dcb399393196e3581d9367b55ab29f2             1.6s
 => CANCELED FROM docker.io/tonistiigi/binfmt:buildkit                                                                                                  1.0s
 => => resolve docker.io/tonistiigi/binfmt:buildkit                                                                                                     1.6s
 => => sha256:c43f2553830c3fe4846f88e6ea796237c83ebda9198896312bb1154795965696 7.78MB / 7.78MB                                                          0.6s
 => => sha256:9846723457345f5bc7247fd9681b51868c5b635ea77036d282ab774d2fbc0893 2.63MB / 2.63MB                                                          0.5s
 => => sha256:9da471824dab89882c995081b262df183c0d4522d4cef3656c28e54883c04df1 2.00kB / 2.00kB                                                          0.0s
 => => sha256:eee96be38e5e33c36b4c70128eeb781adc144ea342dc0dabc61ea3234416ec41 739B / 739B                                                              0.0s
 => => sha256:ceae2fe9603c9985f8874fda667cbea184ce0837ba156ad53873668ad5c9e81e 6.06kB / 6.06kB                                                          0.0s
 => => extracting sha256:c43f2553830c3fe4846f88e6ea796237c83ebda9198896312bb1154795965696                                                               0.4s
 => [xgo 1/1] FROM docker.io/tonistiigi/xx:golang@sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18eb11d0c0a537                               0.3s
 => => resolve docker.io/tonistiigi/xx:golang@sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18eb11d0c0a537                                   0.0s
 => => sha256:6f7d999551dd471b58f70716754290495690efa8421e0a1fcf18eb11d0c0a537 3.29kB / 3.29kB                                                          0.0s
 => => sha256:3265075f008d7c003eea3e5c4da277cd5049c0aa31d39d1ec35272168f8bf9dd 523B / 523B                                                              0.0s
 => => sha256:ebffcbb79133382ea62829f690a0273304a3f4d83cd4876b58af645356512348 466B / 466B                                                              0.0s
 => => sha256:a104d17248520be6cb06ad88875c391c27c5e9e2a7f474d8ad6222d6bbe02445 616B / 616B                                                              0.1s
 => => extracting sha256:a104d17248520be6cb06ad88875c391c27c5e9e2a7f474d8ad6222d6bbe02445                                                               0.0s
 => ERROR [git 1/1] RUN apk add --no-cache git xz                                                                                                       0.7s
 => [gobuild-minimal 2/3] COPY --from=xgo / /                                                                                                           0.1s
 => ERROR [gobuild-minimal 3/3] RUN apt-get update && apt-get install --no-install-recommends -y libseccomp-dev file                                    0.5s
------
 > [git 1/1] RUN apk add --no-cache git xz:
#9 0.707 container_linux.go:370: starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory
------
------
 > [gobuild-minimal 3/3] RUN apt-get update && apt-get install --no-install-recommends -y libseccomp-dev file:
#16 0.437 container_linux.go:370: starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory
------
executor failed running [/bin/sh -c apt-get update && apt-get install --no-install-recommends -y libseccomp-dev file]: exit code: 1

From output you can see apt-get update runs without the base image being pulled.

@tonistiigi
Copy link
Copy Markdown
Member

tonistiigi commented Nov 16, 2020

diff --git a/builder/builder-next/adapters/containerimage/pull.go b/builder/builder-next/adapters/containerimage/pull.go
index d0891cb598..62977675bd 100644
--- a/builder/builder-next/adapters/containerimage/pull.go
+++ b/builder/builder-next/adapters/containerimage/pull.go
@@ -93,7 +93,11 @@ func (is *Source) resolveRemote(ctx context.Context, ref string, platform *ocisp
 		dgst digest.Digest
 		dt   []byte
 	}
-	res, err := is.g.Do(ctx, ref, func(ctx context.Context) (interface{}, error) {
+	p := platforms.DefaultSpec()
+	if platform != nil {
+		p = *platform
+	}
+	res, err := is.g.Do(ctx, "getconfig::"+ref+"::"+platforms.Format(p), func(ctx context.Context) (interface{}, error) {
 		res := resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g)
 		dgst, dt, err := imageutil.Config(ctx, ref, res, is.ContentStore, nil, platform)
 		if err != nil {
@@ -247,7 +251,7 @@ func (p *puller) resolveLocal() {
 }
 
 func (p *puller) resolve(ctx context.Context, g session.Group) error {
-	_, err := p.is.g.Do(ctx, "", func(ctx context.Context) (_ interface{}, err error) {
+	_, err := p.is.g.Do(ctx, "resolve::"+p.ref+"::"+platforms.Format(p.platform), func(ctx context.Context) (_ interface{}, err error) {
 		resolveProgressDone := oneOffProgress(ctx, "resolve "+p.src.Reference.String())
 		defer func() {
 			resolveProgressDone(err)

@tiborvass
Copy link
Copy Markdown
Contributor Author

@tonistiigi updated

@tiborvass
Copy link
Copy Markdown
Contributor Author

I don't see how TestInspect failure would be related to this PR. Probably a flakey test.

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

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

Is there a summary of changes in this bump?


}

func (s *DockerSuite) TestBuildContChar(c *testing.T) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like that we are removing the test.
Even if it is tested in buildkit, this is more of an end-to-end test, and we make sure it doesn't break regardless of builder.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cpuguy83 who writes a \ as the last character of a Dockerfile? I am of the opinion that it's such an edge case that I'm prioritizing removing legacy tests that are useless. But if you feel strongly about this I can fix the test.

Comment thread builder/builder-next/adapters/containerimage/pull.go Outdated
Comment thread builder/builder-next/adapters/containerimage/pull.go Outdated
Comment thread builder/builder-next/adapters/containerimage/pull.go Outdated
Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

5 participants