-
Notifications
You must be signed in to change notification settings - Fork 565
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
Requires 32 external dependencies, mostly unnecessary #599
Comments
thanks, |
Hi @ahmetalpbalkan, thanks for bringing this up. I'd be happy to review and pull-in some code for some of the dependencies, as long as the copies are small (and, ideally, automated). @rusenask what kind of pain are you referring to? |
There was a comment here yesterday from "Hassan Syed", it doesn't appear here now, so let me bring that back from my inbox:
|
@ahmetalpbalkan I saw it here, it looks like he deleted it for some reason. |
I removed it, I was only a few days into go at the time -- it looks like a rant (it probably was) ! I figured out that the majority of the bulk was due to the large parts of the stdlib being linked in statically and that the dependency sprawl I was perceiving was just my naivity. I was also getting my head around vendoring and go packages -- the dependency list above looks fairly standard now ! The Kubernetes client is insane though :D I have no clue what it could be linking in to make it build 37 mb hello world binaries on a mac. |
@hsyed thanks for clarifying! :D |
I also think that such a large dependency graph for a client library is far from ideal. We use this library for a few projects, some of them use it for running tests. To give a context, we are running basic Go tests on CI and docker tests on other environments. Importing (and vendoring) this library significantly increases the time for each build/test to pass on CI in particular. If it's possible to get rid of at least some dependencies by copying types/functions, this will save us a huge amount of time waiting for these CI builds to finish :) |
I have done some work to clean-up/copy some dependencies. It gets tricky with swarm stuff as we're exposing types from dependencies in our public API (a mistake that can't be fixed without a breaking change). I'm going to close this issue for now, but PRs are welcome. |
Here's the dependency graph of this package: https://godoc.org/github.com/fsouza/go-dockerclient?import-graph&hide=2
When I vendor this repo with govendor, here's the list of packages I'm getting:
github.com/Azure/go-ansiterm
github.com/Azure/go-ansiterm/winterm
github.com/Microsoft/go-winio
github.com/Sirupsen/logrus
github.com/docker/docker/api/types/filters
github.com/docker/docker/api/types/mount
github.com/docker/docker/api/types/swarm
github.com/docker/docker/api/types/versions
github.com/docker/docker/opts
github.com/docker/docker/pkg/archive
github.com/docker/docker/pkg/fileutils
github.com/docker/docker/pkg/homedir
github.com/docker/docker/pkg/idtools
github.com/docker/docker/pkg/ioutils
github.com/docker/docker/pkg/jsonlog
github.com/docker/docker/pkg/jsonmessage
github.com/docker/docker/pkg/longpath
github.com/docker/docker/pkg/pools
github.com/docker/docker/pkg/promise
github.com/docker/docker/pkg/stdcopy
github.com/docker/docker/pkg/system
github.com/docker/docker/pkg/term
github.com/docker/docker/pkg/term/windows
github.com/docker/go-units
github.com/fsouza/go-dockerclient
github.com/hashicorp/go-cleanhttp
github.com/opencontainers/runc/libcontainer/system
github.com/opencontainers/runc/libcontainer/user
golang.org/x/net/context
golang.org/x/net/context/ctxhttp
golang.org/x/sys/unix
golang.org/x/sys/windows
I'm like: WAT?!
This shouldn't be happening. I get that some functionality may require some methods implemented in
docker/docker
, but this is 19 packages fromdocker/docker
.Especially seeing dependencies like
github.com/docker/docker/api/types/swarm
is quite sad. The whole point of having an SDK is that we can rely on it to consume docker Remote API, independently from the revs that happen ondocker/docker
codebase.Many other dependencies, like
pkg/jsonmessage
, this package is using offers some streaming method calledDisplayJSONMessagesStream
(which, by the way, is designed to "display" messages, and actually does not return some valuable data of jsonmessage provided on the API) eventually end up pulling dependencies like:github.com/docker/docker/pkg/term
, and since this can build on windows, the following:github.com/Azure/go-ansiterm
github.com/Sirupsen/logrus
github.com/Azure/go-ansiterm/winterm
github.com/docker/docker/pkg/term/windows
This is not ideal.
I suggest getting rid of these little dependencies and just copy/pasting parts used on these.
The text was updated successfully, but these errors were encountered: