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

updated vendoring #424

Merged
merged 2 commits into from
Sep 5, 2017
Merged

updated vendoring #424

merged 2 commits into from
Sep 5, 2017

Conversation

simonferquel
Copy link
Contributor

- What I did
Updated dependencies so that we can use the new sirupsen import path
- How I did it
Had to fork notary
- How to verify it
See vendor.conf

@codecov-io
Copy link

codecov-io commented Aug 7, 2017

Codecov Report

Merging #424 into master will decrease coverage by <.01%.
The diff coverage is 25%.

@@            Coverage Diff             @@
##           master     #424      +/-   ##
==========================================
- Coverage    48.8%   48.79%   -0.01%     
==========================================
  Files         199      199              
  Lines       16389    16392       +3     
==========================================
  Hits         7998     7998              
- Misses       7976     7978       +2     
- Partials      415      416       +1

@aluzzardi
Copy link
Contributor

Hey @simonferquel:

  1. why do we need to update the logrus import path?
  2. If we need to do so, why do we need to change the other dependencies?
  3. Why do we need to change notary, and if we do need to change it, why not change upstream directly rather than using a fork?

@vdemeester
Copy link
Collaborator

vdemeester commented Aug 16, 2017

@aluzzardi

why do we need to update the logrus import path?

Because it has been changed upstream (i.e. moby/moby for example) and thus, any vendoring update will need to fix thoses.

If we need to do so, why do we need to change the other dependencies?

Because most of the time the sirupsen fix is in updated version of the deps.

Why do we need to change notary, and if we do need to change it, why not change upstream directly rather than using a fork?

Multiple reason here :

  • cycle vendoring (libnetwork, swarmkit with moby/moby for example — so while it's been merge upstream and update in moby/moby we need to vendor the same)
  • waiting for PR to get reviewed and merged (notary, etc..)
  • dependencies that are heavily changed if update (and would need change to our code other than the import) and likely to not getting merged (rethinkdb for example)

@simonferquel
Copy link
Contributor Author

@vdemeester can we move along on this PR (don't want to rebase it once again, and only code coverage fails - there is no code addition, only vendoring) ?

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

vendor.conf Outdated
github.com/docker/distribution b38e5838b7b2f2ad48e06ec4b500011976080621
github.com/docker/docker d58ffa0364c04d03a8f25704d7f0489ee6cd9634
github.com/docker/docker-credential-helpers v0.5.1
# docker
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should leave this file sorted. It makes it easier to maintain and avoid conflicts when multiple PRs change this file. Commented sections are difficult to maintain and will lead to an unsorted mess. I guess there were a few lines that were not sorted previously. I'll see about adding a validation for this file to keep it sorted.

I checked out this PR and re-sorted the file to look at the vendor changes. I noticed that we have a bunch of new dependencies that I don't think we actually use. Somewhere in the dependency there are some bad packages that are overloaded and forcing us to pull in a bunch of unnecessary extra libraries.

I'm going to look into this to see if we can remove some of these.

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

I looked over the dependency tree for the new dependencies. (notes are here https://gist.github.com/dnephin/137d578fd0095d15ab9da63f236fb7c6)

It looks like everything can be removed with two small changes:

1. Remove the import of github.com/docker/docker/opts from github.com/docker/docker/registry. This should be really easy because that package should not be doing anything with options. I believe it will be as easy as moving InstallCliFlags to a new package. (opened moby/moby#34668, will need to be included in this vendor update once merged)

2. Remove the import of docker/runconfig from cli/command/container/opts_test.go (opened #480 for this)

Both of these should now be fixed with the latest moby/moby master

vendor.conf Outdated
github.com/docker/notary v0.4.2-sirupsen https://github.com/simonferquel/notary.git
github.com/docker/swarmkit 0554c9bc9a485025e89b8e5c2c1f0d75961906a2
github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like this is not used, please remove

"github.com/docker/docker/pkg/progress"
"github.com/moby/buildkit/session"
"github.com/moby/buildkit/session/filesync"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep this for a separate PR. This code is still in docker/docker/client in master, so we shouldn't need to do this right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not there anymore on moby/moby master :(

Copy link
Contributor

Choose a reason for hiding this comment

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

oops, I thought I checked before commenting, but it must have been an old branch. ok to ignore this one

vendor.conf Outdated
github.com/gogo/protobuf 7efa791bd276fd4db00867cbd982b552627c24cb
github.com/docker/notary v0.4.2-sirupsen https://github.com/simonferquel/notary.git
github.com/docker/swarmkit 0554c9bc9a485025e89b8e5c2c1f0d75961906a2
github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed, we should be using docker/docker/client

@simonferquel
Copy link
Contributor Author

@dnephin I updated to latest master and was able to remove quite a few dependencies. I went back to a sorted vendor.conf (and sorted it correctly).

@simonferquel
Copy link
Contributor Author

Oh and btw, thanks a lot @dnephin for reducing the dependency surface. It makes this PR far more manageable :)

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

It looks like there are some bugs in vndr because those 2 dependencies should have caused the vendor check to fail. I ran it locally and vndr isn't complaining about unused things.

I had to manually remove them. I'm going to push a fix to this PR which removes the two unused things.

Just one remaining question about why we need a fork for buildkit

vendor.conf Outdated
github.com/docker/go-units 9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1
github.com/docker/libnetwork 19ac3ea7f52bb46e0eb10669756cdae0c441a5b1
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is not used, can be removed.

vendor.conf Outdated
github.com/golang/protobuf 7a211bcf3bce0e3f1d74f9894916e6f116ae83b4
github.com/gotestyourself/gotestyourself v1.0.0
github.com/google/certificate-transparency 0f6e3d1d1ba4d03fdaab7cd716f36255c2e48341
Copy link
Contributor

Choose a reason for hiding this comment

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

not used

github.com/opencontainers/go-digest a6d0ee40d4207ea02364bd3b9e8e77b9159ba1eb
github.com/opencontainers/image-spec f03dbe35d449c54915d235f1a3cf8f585a24babe
github.com/opencontainers/runc 9c2d8d184e5da67c95d601382adf14862e4f2228 https://github.com/docker/runc.git
github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we get this fix into an official buildkit branch at least? Why is this a fork?

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

sounds like master of buildkit has a different API, so let's use the fork for now

LGTM

@andrewhsu
Copy link
Contributor

@simonferquel @dnephin looks like this has issues when tests run code from moby/moby master branch: https://jenkins.dockerproject.org/job/docker-integration-tests/114/console

@dnephin
Copy link
Contributor

dnephin commented Sep 1, 2017

I think this hasn't been rebased with master, let me do that now.

simonferquel and others added 2 commits September 1, 2017 19:41
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
@dnephin
Copy link
Contributor

dnephin commented Sep 1, 2017

done. Can you try again?

@dnephin
Copy link
Contributor

dnephin commented Sep 1, 2017

Most of the failures seem to be from the panic we fixed a couple days ago.

@andrewhsu
Copy link
Contributor

@andrewhsu
Copy link
Contributor

hmm...seeing new errors:

[DockerSwarmSuite] FAIL: docker_api_swarm_test.go:349: DockerSwarmSuite.TestAPISwarmRaftQuorum
[DockerSwarmSuite] 
[DockerSwarmSuite] [dfb093aea8ec6] waiting for daemon to start
[DockerSwarmSuite] [dfb093aea8ec6] daemon started
[DockerSwarmSuite] 
[DockerSwarmSuite] [ddc9a034c25d9] waiting for daemon to start
[DockerSwarmSuite] [ddc9a034c25d9] daemon started
[DockerSwarmSuite] 
[DockerSwarmSuite] [df42acc6abc29] waiting for daemon to start
[DockerSwarmSuite] [df42acc6abc29] daemon started
[DockerSwarmSuite] 
[DockerSwarmSuite] [ddc9a034c25d9] exiting daemon
[DockerSwarmSuite] [df42acc6abc29] exiting daemon
[DockerSwarmSuite] docker_api_swarm_test.go:374:
[DockerSwarmSuite]     c.Assert(err.Error(), checker.Contains, "deadline exceeded")
[DockerSwarmSuite] ... obtained string = "Error response from daemon: rpc error: code = Internal desc = transport is closing"
[DockerSwarmSuite] ... substring string = "deadline exceeded"
[DockerSuite] FAIL: docker_api_containers_test.go:1894: DockerSuite.TestContainersAPICreateMountsCreate
[DockerSuite] 
[DockerSuite] case 0 - config: {volume  /foo false  <nil> <nil> <nil>}
[DockerSuite] case 1 - config: {volume  /foo/ false  <nil> <nil> <nil>}
[DockerSuite] case 2 - config: {volume test1 /foo false  <nil> <nil> <nil>}
[DockerSuite] case 3 - config: {volume test2 /foo true  <nil> <nil> <nil>}
[DockerSuite] case 4 - config: {volume test3 /foo false  <nil> 0xc420539940 <nil>}
[DockerSuite] case 5 - config: {bind /tmp/test-mounts-api-1758465792 /foo false  <nil> <nil> <nil>}
[DockerSuite] docker_api_containers_test.go:2018:
[DockerSuite]     c.Assert(err, checker.NotNil, check.Commentf(out))
[DockerSuite] ... value = nil
[DockerSuite] ... [
[DockerSuite]     {
[DockerSuite]         "Driver": "",
[DockerSuite]         "Labels": null,
[DockerSuite]         "Mountpoint": "",
[DockerSuite]         "Name": "",
[DockerSuite]         "Options": null,
[DockerSuite]         "Scope": ""
[DockerSuite]     }
[DockerSuite] ]

and a lot of these:

[DockerExternalVolumeSuite] --- FAIL: TestInspect (0.51s)
[DockerExternalVolumeSuite] 	daemon.go:285: [db2c0ab830136] waiting for daemon to start
[DockerExternalVolumeSuite] 	daemon.go:317: [db2c0ab830136] daemon started
[DockerExternalVolumeSuite] 	assertions.go:226:

@dnephin
Copy link
Contributor

dnephin commented Sep 2, 2017

TestInspect is fixed by moby/moby#34682

The other 2 are API tests, so should not be affected by the CLI, probably flakes.

@dnephin
Copy link
Contributor

dnephin commented Sep 5, 2017

Let's merge this?

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

7 participants