Commit Graph

11 Commits

Author SHA1 Message Date
allencloud 8acef98c5f use grep to find a/an misuse
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-03 16:35:33 +08:00
Alessandro Boch c378054576 Fix cross compilation issues
- Fix circle-ci-cross target
- Remove unsupported os/arch targets
- Fix dnet build for windows/amd64
- Fix a solaris build breakage

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-21 11:20:01 -07:00
Alessandro Boch 478259b36c Merge pull request #1095 from mrjana/ipam
Remove all netlink/osl deps from ipam/ipamutils
2016-04-15 11:46:47 -07:00
Amit Krishnan 1882f69175 Get libnetwork to build on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-04-14 14:03:50 -07:00
Jana Radhakrishnan 5ca79d6b87 Remove all netlink/osl deps from ipam/ipamutils
Currently ipam/ipamutils has a bunch of dependencies
in osl and netlink which makes the ipam/ipamutils harder
to use independently with other applications. This PR
modularizes ipam/ipamutils into a standalone package
with no OS level dependencies.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-10 11:05:39 -07:00
Brian Goff fc4ef5fce9 Remove pre-defined networks from package init
This moves the initialization of the pre-defined networks to where it's
used instead of in package init.
This reason for this change is having this be populated in `init()`
causes it to always consume cpu, and memory (4.3MB of memory), to
populate even if the package is unused (like for instnace, in a re-exec).

Here is a memory profile of docker/docker just after starting the daemon of the
top 10 largest memory consumers:

Before:
```
      flat  flat%   sum%        cum   cum%
         0     0%     0%    11.89MB 95.96%  runtime.goexit
         0     0%     0%     6.79MB 54.82%  runtime.main
         0     0%     0%     5.79MB 46.74%  main.init
         0     0%     0%     4.79MB 38.67%  github.com/docker/docker/api/server/router/network.init
         0     0%     0%     4.79MB 38.67%  github.com/docker/libnetwork.init
         0     0%     0%     4.29MB 34.63%  github.com/docker/libnetwork/ipam.init
         0     0%     0%     4.29MB 34.63%  github.com/docker/libnetwork/ipams/builtin.init
         0     0%     0%     4.29MB 34.63%  github.com/docker/libnetwork/ipamutils.init
         0     0%     0%     4.29MB 34.63%  github.com/docker/libnetwork/ipamutils.init.1
    4.29MB 34.63% 34.63%     4.29MB 34.63%  github.com/docker/libnetwork/ipamutils.initGranularPredefinedNetworks
```

After:
```
      flat  flat%   sum%        cum   cum%
         0     0%     0%  4439.37kB 89.66%  runtime.goexit
         0     0%     0%  4439.37kB 89.66%  runtime.main
         0     0%     0%  3882.11kB 78.40%  github.com/docker/docker/cli.(*Cli).Run
         0     0%     0%  3882.11kB 78.40%  main.main
 3882.11kB 78.40% 78.40%  3882.11kB 78.40%  reflect.callMethod
         0     0% 78.40%  3882.11kB 78.40%  reflect.methodValueCall
         0     0% 78.40%   557.26kB 11.25%  github.com/docker/docker/api/server.init
  557.26kB 11.25% 89.66%   557.26kB 11.25%  html.init
         0     0% 89.66%   557.26kB 11.25%  html/template.init
         0     0% 89.66%   557.26kB 11.25%  main.init
```

Now, of course the docker daemon will still need to consume this memory, but
at least now re-execs and such won't have to re-init these variables.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-04-04 15:25:29 -04:00
Miguel Perez 1a802e4204 Allow libnetwork to compile on freebsd
Signed-off-by: Miguel Perez <miguel@voyat.com>
2015-11-26 10:10:09 -05:00
Alessandro Boch 84049931c5 Explicitly set namepsace for ipamutils.ElectInterface
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-15 22:16:40 -07:00
Jana Radhakrishnan e9f2439673 Make ipamutils compile for windows
currently ipamutils package uses apis which are linux
specific and makes windows compile error out. Separated
the OS specific apis into linux and windows files to
diverge the implementation.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-10 13:16:52 -07:00
Alessandro Boch 2b63947602 Default IPAM to use ipamutils pkg
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-06 15:13:58 -07:00
Alessandro Boch 26ffa28e0b Add ipamutils package
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-04 16:50:53 -07:00