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

Update docker/docker to master / v21.xx-dev (post libnetwork integration) #2150

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

thaJeztah
Copy link
Member

follow-up to #2149

full diff: https://github.com/docker/docker/compare/v20.10.7..8dbd90ec00da

This applies the same / similar local changes to buildkit as were made in
the branch that moby is currently vendoring:
244e8cd...cpuguy83:update_libnetwork_import

Unfortunately, this (again) requires a "replace" rule (probably until we tagged
a release with this change). Go mod refuses to pick a version from master, and
(without the replace rule), does weird, reverting docker to a very old version,
predating the sirupsen rename:

> [vendored 4/4] RUN --mount=target=/src,rw   --mount=target=/go/pkg/mod,type=cache   go mod tidy && go mod vendor &&   mkdir /out && cp -r go.mod go.sum vendor /out:
#10 0.500 go: finding github.com/docker/docker 8dbd90ec00daa26dc45d7da2431c965dec99e8b4
#10 0.599 warning: ignoring symlink /src/examples/kube-consistent-hash
#10 1.027 go: github.com/moby/buildkit/util/testutil/integration imports
#10 1.027       github.com/docker/docker/testutil/daemon imports
#10 1.027   github.com/docker/docker/opts imports
#10 1.027   github.com/docker/libnetwork/ipamutils imports
#10 1.027   github.com/docker/libnetwork/osl imports
#10 1.027   github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.8.1: parsing go.mod:
#10 1.027   module declares its path as: github.com/sirupsen/logrus
#10 1.027           but was required as: github.com/Sirupsen/logrus
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c go mod tidy && go mod vendor &&   mkdir /out && cp -r go.mod go.sum vendor /out]: exit code: 1
make: *** [vendor] Error 1

@thaJeztah thaJeztah marked this pull request as draft June 5, 2021 16:11
@thaJeztah thaJeztah marked this pull request as ready for review June 5, 2021 19:00
@thaJeztah
Copy link
Member Author

Rebased; this should also be ready for review now

@tonistiigi @cpuguy83 @AkihiroSuda

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

@thaJeztah
Copy link
Member Author

w.r.t. "why do we need the replace rule" ?

I think the problem (or at least one of them) is that BuildKit depends on tonistiigi/fsutil:

  • github.com/tonistiigi/fsutil@v0.0.0-20210525040343-5dfbf5db66b9
  • which depends on github.com/docker/docker@v20.10.5 (see https://github.com/tonistiigi/fsutil/blob/5dfbf5db66b9/go.mod#L8)
    • This is "newer than" v20.10.3-0.20210608030740-0ad2293d0e5b+incompatible (AKA master)
    • So go.mod downgrades master to v20.10.5
  • which depends on github.com/docker/libnetwork
  • and because there's no go.mod in v20.10.5, it picks the latest "stable" release, which is libnetwork@v0.5.6 (there's some tags on that repo and this is the last tag that is not an -rc)
  • which depends on github.com/Sirupsen/logrus (capital S) (in Godeps.json)
  • and depends on github.com/docker/docker@v1.4.1 (in GoDeps.json)
    • So go.mod pick "latest `v1.x.x" version of docker/docker (v1.13.1)

@thaJeztah
Copy link
Member Author

fsutil currently uses:

  • github.com/docker/docker/pkg/fileutils
  • github.com/docker/docker/pkg/archive (only in a test)
  • github.com/docker/docker/pkg/reexec (only in a test)

The test could be moved to a submodule (have its own go.mod so that it doesn't affect project that use fsutil as a dependency)

For github.com/docker/docker/pkg/fileutils, it looks like fsutils (and "buildkit") is using the fileutils.NewPatternMatcher (used for .dockerignore, as well as COPY matching).

Docker uses fileutils for some other utilities in that package; fileutils.GetTotalUsedFds(), fileutils.ReadSymlinkedDirectory(), fileutils.CreateIfNotExists().

I think we could / should move the pattern matching to tonistiigi/fsutils, or BuildKit. Perhaps consider fsutils to be in the Moby org (?) WDYT?

@tonistiigi
Copy link
Member

@thaJeztah So if fsutil dependency is changed to also point to master then this can be fixed? If you confirm this can be fixed as follow up I can merge current. If we would create a -dev tag in moby, would it help?

@thaJeztah
Copy link
Member Author

I wanted to test that today, yes.

The swarmkit update was also revendored in moby, so perhaps that helps as well (will test when I get to my computer)

@thaJeztah thaJeztah force-pushed the update_docker_master branch 2 times, most recently from a79f6b4 to 0048cb2 Compare June 9, 2021 08:58
@thaJeztah
Copy link
Member Author

@tonistiigi yes, that looks to be working; I opened tonistiigi/fsutil#104, and pushed a temporary commit to update fsutil from my branch).

(there's still a chance that once the replace for fsutil is removed, we'll end up with some transient dependencies on older versions, but probably not)

I think we should still look at #2150 (comment), but we can do so separately

@thaJeztah
Copy link
Member Author

updated with latest fsutil (after tonistiigi/fsutil#104 was merged)

…ion)

full diff: https://github.com/docker/docker/compare/v20.10.7..0ad2293d0e5b

This applies the same / similar local changes to buildkit as were made in
the branch that moby is currently vendoring:
moby/buildkit@244e8cd...cpuguy83:update_libnetwork_import

Unfortunately, this (again) requires a "replace" rule (probably until we tagged
a release with this change). Go mod refuses to pick a version from master, and
(without the replace rule), does weird, reverting docker to a very old version,
predating the sirupsen rename:

    > [vendored 4/4] RUN --mount=target=/src,rw   --mount=target=/go/pkg/mod,type=cache   go mod tidy && go mod vendor &&   mkdir /out && cp -r go.mod go.sum vendor /out:
    moby#10 0.500 go: finding github.com/docker/docker 8dbd90ec00daa26dc45d7da2431c965dec99e8b4
    moby#10 0.599 warning: ignoring symlink /src/examples/kube-consistent-hash
    moby#10 1.027 go: github.com/moby/buildkit/util/testutil/integration imports
    moby#10 1.027       github.com/docker/docker/testutil/daemon imports
    moby#10 1.027 	github.com/docker/docker/opts imports
    moby#10 1.027 	github.com/docker/libnetwork/ipamutils imports
    moby#10 1.027 	github.com/docker/libnetwork/osl imports
    moby#10 1.027 	github.com/Sirupsen/logrus: github.com/Sirupsen/logrus@v1.8.1: parsing go.mod:
    moby#10 1.027 	module declares its path as: github.com/sirupsen/logrus
    moby#10 1.027 	        but was required as: github.com/Sirupsen/logrus
    ------
    error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c go mod tidy && go mod vendor &&   mkdir /out && cp -r go.mod go.sum vendor /out]: exit code: 1
    make: *** [vendor] Error 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

I'll create a tracking issue for the replace rule.

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.

4 participants