Commit Graph

1169 Commits

Author SHA1 Message Date
11e5be135f Merge pull request #12190 from rhvgoyal/deferred-removal
Devicemapper: Provide deferred device removal capability
Upstream-commit: 56c991781564e8cc292166d3b3e27e304c240468
Component: engine
2015-05-04 14:22:52 -07:00
e79952cb66 Merge pull request #12718 from Microsoft/10662-mkdirall
Windows: Volume path aware mkdirall
Upstream-commit: 3fcf387d52676d9c4f24b7a4d2f48c4992d7485f
Component: engine
2015-05-04 15:51:56 -04:00
f81d4d4161 Merge pull request #12769 from calavera/git_build_fragment
Use git url fragment to specify build reference and dir context.
Upstream-commit: 0a2ccb1cb54834d3b97982f93c42671be5861082
Component: engine
2015-05-04 12:48:24 -07:00
204fb1504f Merge pull request #12954 from vdemeester/11595-pkg-ioutils-coverage
More test on pkg/ioutils (coverage)
Upstream-commit: 87a0ca5283aa5b1c3d04cc35e1c415de6b00d323
Component: engine
2015-05-04 14:57:58 -04:00
f23ef4fe69 Add more ioutils tests.
Closes #11595

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 815b472a02dc0f593daee4006ce893fe17236b70
Component: engine
2015-05-04 19:56:10 +02:00
a0ae4df58b Use git url fragment to specify reference and dir context.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 49fd83a25e2e6604014de41d4f4099a7bc07a09b
Component: engine
2015-05-04 09:28:06 -07:00
9eba4b1b6c Merge pull request #11034 from HuKeping/oom_kill_disable
enable cgroups memory.oom_control
Upstream-commit: ac324e5e52af1f2489320f3bdb7e2ebbd83ee869
Component: engine
2015-05-04 11:53:05 -04:00
af54781255 Merge pull request #12943 from tianon/go-patricia-v2
Update go-patricia to 2.1.0
Upstream-commit: 175339ffb6c7d6e4c2aa78f01f227643a0d97c42
Component: engine
2015-05-04 16:28:03 +03:00
ad3d66108b Feature: option for disable OOM killer
Add cgroup support for disable OOM killer.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: a4a924e1b6c50f0f02460489259d73468a6c282e
Component: engine
2015-05-04 21:11:29 +08:00
6fb6ee62f9 Merge pull request #12888 from jmzwcn/patch-3
`docker images` friendly duration gets unfriendly after a while
Upstream-commit: e8bbd87ba831dbda27bad452cd367a8e7e34f584
Component: engine
2015-05-03 11:09:25 -04:00
5b22f64f34 docker images friendly duration gets unfriendly after a while
fix #12852
Signed-off-by: Daniel Zhang <jmzwcn@gmail.com>
Upstream-commit: 28ea4a63d00e9d0e28375adc80d24461193e7a28
Component: engine
2015-05-03 21:19:18 +08:00
ba5fba5a8d Update go-patricia to 2.1.0
This includes a fix for the minor v2 API change introduced by 341a37095f. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: b447fef7ecb740bc0f9ece75e10926fc5f121b5c
Component: engine
2015-05-02 23:25:57 -06:00
7bd38d02c2 Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
IT'S ABOUT TIME. 🎉

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 576985a1dcd76a9af2c5c483e6f12035a1f47b96
Component: engine
2015-05-01 16:01:10 -06:00
c72735069d Fix race in FirewalldInit
It was possible that signalHandler won't start because connections is
not assigned.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a05bcd12c44b4daada51267d89fd9ac53812be02
Component: engine
2015-05-01 13:35:54 -07:00
b17cfc7a0a Merge pull request #12841 from Mashimiao/use-CustomSize-to-replace-intToString
use CustomSize replace intToString
Upstream-commit: d2e380b687ddf7fa83ff3a17add41278300926b7
Component: engine
2015-04-30 17:24:41 -07:00
207d227709 Merge pull request #12900 from gaurav-gosec/master
Make use of iptablesPath variable which has the path of iptables, instea...
Upstream-commit: 5221fd2ba5fbf78ad7a5d4edf039d54ae32141ef
Component: engine
2015-04-30 16:12:03 -07:00
8259fbca23 Windows: mkdirall volume path aware
Signed-off-by: jhowardmsft <jhoward@microsoft.com>
Upstream-commit: 86d1223a29907ffc6afba557b5138cfad7816bb4
Component: engine
2015-04-30 11:59:42 -07:00
203abf3991 Merge pull request #12771 from runcom/say-bye-to-engine
Remove engine
Upstream-commit: 0d0b42547e74e183c7c459a13877bd27c21dba0c
Component: engine
2015-04-30 12:18:16 -04:00
135331b0d1 Merge pull request #12664 from Mashimiao/sysinfo-support-ipv4_forward-check
sysinfo: add IPv4Forwarding check
Upstream-commit: fc9033a9c89a86e28d77053b0737aecbb068246d
Component: engine
2015-04-30 11:44:44 -04:00
be98ccedad Make use of iptablesPath variable which has the path of iptables, instead of using string iptables directly
Signed-off-by: Gaurav <gaurav.gosec@gmail.com>
Upstream-commit: 1d5f1bb0f5689be2f0262163ec05930e233f0ad0
Component: engine
2015-04-30 18:22:12 +05:30
016ac4bf61 Remove engine mechanism
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 531f4122bdcd4de289f613a5ef010f4c1989f098
Component: engine
2015-04-30 01:35:16 +02:00
f9039974fb Add coverage on pkg/fileutils
Should fix #11598

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8454e1a3b24e2e076bb08a2a6b1fcb56efe2924e
Component: engine
2015-04-29 16:27:12 +02:00
382de8a5eb use CustomSize replace intToString
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 8a2f8992865a706df30eb23bd861444a5ecf6198
Component: engine
2015-04-29 08:30:25 +08:00
bc3d7f1531 add support for exclusion rules in dockerignore
Signed-off-by: Dave Goodchild <buddhamagnet@gmail.com>
Upstream-commit: 6fd8e485c85c4f8ca62578d0840bdeddc4cba151
Component: engine
2015-04-28 18:56:45 +01:00
fb5280aecd Merge pull request #11882 from hqhq/hq_warn_device_cg
add devices cgroup check as hard requirement
Upstream-commit: a07e96352600fe69ff82aeb39725f142dac06ac7
Component: engine
2015-04-27 18:42:57 -04:00
0b5b481a6d Merge pull request #12828 from tdmackey/trivial-spelling
trivial: typo cleanup
Upstream-commit: 0153edcda1527cd19f5952046b51c4e8358d01ed
Component: engine
2015-04-27 17:05:46 -04:00
ae74d9f34f trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
Upstream-commit: 3941623fbc3fa724d61f53121513ffd87d03b61c
Component: engine
2015-04-27 13:35:08 -07:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
e5f7f8da6f Replace json.Unmarshal with json.Decoder().Decode()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 26543e03095eaa45d9afc12c029f07539323fee5
Component: engine
2015-04-26 15:02:01 +02:00
3e9177d587 Add coverage on pkg/archive
Add tests on:
- changes.go
- archive.go
- wrap.go

Should fix #11603 as the coverage is now 81.2% on the ``pkg/archive``
package. There is still room for improvement though :).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c21d408ad24cf8e2b5bd761d562fae7e3ae1bc54
Component: engine
2015-04-24 17:03:33 +02:00
22db717a0c simplify memory limit check
If memory cgroup is mounted, memory limit is always supported,
no need to check if these files are exist.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 667b1e220cf82fb77fd776426a4b712ae5fee0ae
Component: engine
2015-04-24 08:43:44 +08:00
af1b9c60d9 add devices cgroup check and errors
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 47e5acfbaefc45e536b953af6bf8a3993669c816
Component: engine
2015-04-24 08:37:59 +08:00
249f3df46c Merge pull request #9397 from jpopelka/9395-firewalld
Firewalld support
Upstream-commit: 259effc6dfd901130ca6d2926090bddfe35f7cdc
Component: engine
2015-04-23 16:58:08 -04:00
44bb7756b2 sysinfo: add IPv4Forwarding check
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 05418df539dfed118da099aacfe4250f2f6ad5e0
Component: engine
2015-04-23 12:19:46 +08:00
f01047d748 Merge pull request #12543 from vdemeester/11584-pkg-stdcopy-test-coverage
Add some stdcopy_test (coverage)
Upstream-commit: 60ad23a7b3ea6a06cd8ded165ebaab5fd0cc3bd9
Component: engine
2015-04-22 22:03:15 -04:00
3a0cec3089 remove redundant warning
And warning is not supposed to have a prefix WARNING.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: f3dc35169780e1555b4116986649b729cb80b5d1
Component: engine
2015-04-22 08:15:00 +08:00
3d40ab6ccb devicemapper: Create a method to get device info with deferred remove field
Deferred reove functionality was added to library later. So in old version
of library it did not report deferred_remove field. 

Create a new function which also gets deferred_remove field and it will be
called only on newer version of library. 

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 4986ce7cfbe74610d4fa2c4e79ceefe49c1aa155
Component: engine
2015-04-21 18:14:59 -04:00
f0bbbffba0 devicemapper: Create helpers to cancel deferred deactivation
If a device has been scheduled for deferred deactivation and container
is started again and we need to activate device again, we need to cancel
the deferred deactivation which is already scheduled on the device.

Create a method for the same.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 20b38f427aa05186bd09c8c4201dcc95ed56aa46
Component: engine
2015-04-21 18:14:59 -04:00
2651813036 devicemapper: Add helper functions to allow deferred device removal
A lot of time device mapper devices leak across mount namespace which docker
does not know about and when docker tries to deactivate/delete device,
operation fails as device is open in some mount namespace.

Create a mechanism where one can defer the device deactivation/deletion
so that docker operation does not fail and device automatically goes
away when last reference to it is dropped.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 6964ab94befd8723585556e560219e0eef48a488
Component: engine
2015-04-21 18:14:59 -04:00
cff18dc122 Merge pull request #10736 from coolljt0725/add_cpu_limit
Add support cpu cfs_quota
Upstream-commit: 17d5450bc31e81c22e8ccba806294e4d744af275
Component: engine
2015-04-20 17:55:01 -07:00
df94aca214 Merge pull request #12566 from fntlnz/remove-go1.3.3-support
Removed go1.3.3 support
Upstream-commit: e1fd7e25de4574b78cce41becd8ee50bdff23f0c
Component: engine
2015-04-20 17:01:57 -07:00
6f3bec0db9 Merge pull request #12471 from coolljt0725/fix_weird_output_format
Fix weird terminal output format
Upstream-commit: df217120cdc2336181eb3c97fea5acd18ede4ed0
Component: engine
2015-04-20 17:01:02 -07:00
88e80730cf Removed go1.3.3 support
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
Upstream-commit: 92849fdcce257dfd61a5c95f57cde085ff22b431
Component: engine
2015-04-20 23:09:08 +02:00
17684bee7e Add some stdcopy_test (coverage)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 2ed4ed50be3a0379d83b9267f62c4c7f665b849f
Component: engine
2015-04-20 22:58:22 +02:00
6f3b598444 Merge pull request #12453 from runcom/style-minor-fixes
Add minor stylistic fixes
Upstream-commit: a7690076c955d242b4590fcf557f15e1029d0c8b
Component: engine
2015-04-20 11:51:04 -07:00
f8f4bcdb38 Add support cpu cfs quota
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: dcc50e1d593fd7995189872791c6d7a013f16970
Component: engine
2015-04-20 08:16:47 -07:00
2e27fa9e39 Make API server datastructure
Added daemon field to it, will use it later for acces to daemon from
handlers

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: d9ed3165228b60cb89c31d0d66b99e01ab83eb3e
Component: engine
2015-04-20 08:13:39 -07:00
1b462401fc Firewalld tests
Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: 379773905c7ff4db3c16e2235f831a9552b4e158
Component: engine
2015-04-20 13:02:09 +02:00
fcda625311 React to firewalld's reload/restart
When firewalld (or iptables service) restarts/reloads,
all previously added docker firewall rules are flushed.

With firewalld we can react to its Reloaded() [1]
D-Bus signal and recreate the firewall rules.
Also when firewalld gets restarted (stopped & started)
we can catch the NameOwnerChanged signal [2].
To specify which signals we want to react to we use AddMatch [3].

Libvirt has been doing this for quite a long time now.

Docker changes firewall rules on basically 3 places.
1) daemon/networkdriver/portmapper/mapper.go - port mappings
   Portmapper fortunatelly keeps list of mapped ports,
   so we can easily recreate firewall rules on firewalld restart/reload
   New ReMapAll() function does that
2) daemon/networkdriver/bridge/driver.go
   When setting a bridge, basic firewall rules are created.
   This is done at once during start, it's parametrized and nowhere
   tracked so how can one know what and how to set it again when
   there's been firewalld restart/reload ?
   The only solution that came to my mind is using of closures [4],
   i.e. I keep list of references to closures (anonymous functions
   together with a referencing environment) and when there's firewalld
   restart/reload I re-call them in the same order.
3) links/links.go - linking containers
   Link is added in Enable() and removed in Disable().
   In Enable() we add a callback function, which creates the link,
   that's OK so far.
   It'd be ideal if we could remove the same function from
   the list in Disable(). Unfortunatelly that's not possible AFAICT,
   because we don't know the reference to that function
   at that moment, so we can only add a reference to function,
   which removes the link. That means that after creating and
   removing a link there are 2 functions in the list,
   one adding and one removing the link and after
   firewalld restart/reload both are called.
   It works, but it's far from ideal.

[1] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.Signals.Reloaded
[2] http://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-owner-changed
[3] http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
[4] https://en.wikipedia.org/wiki/Closure_%28computer_programming%29

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: b052827e025267336f0d426df44ec536745821f8
Component: engine
2015-04-20 13:02:09 +02:00
8f2bd21917 Support for Firewalld
Firewalld [1] is a firewall managing daemon with D-Bus interface.

What sort of problem are we trying to solve with this ?

Firewalld internally also executes iptables/ip6tables to change firewall settings.
It might happen on systems where both docker and firewalld are running
concurrently, that both of them try to call iptables at the same time.
The result is that the second one fails because the first one is holding a xtables lock.
One workaround is to use --wait/-w option in both
docker & firewalld when calling iptables.
It's already been done in both upstreams:
b315c380f4
b3b451d6f8
But it'd still be better if docker used firewalld when it's running.

Other problem the firewalld support would solve is that
iptables/firewalld service's restart flushes all firewall rules
previously added by docker.
See next patch for possible solution.

This patch utilizes firewalld's D-Bus interface.
If firewalld is running, we call direct.passthrough() [2] method instead
of executing iptables directly.
direct.passthrough() takes the same arguments as iptables tool itself
and passes them through to iptables tool.
It might be better to use other methods, like direct.addChain and
direct.addRule [3] so it'd be more intergrated with firewalld, but
that'd make the patch much bigger.
If firewalld is not running, everything works as before.

[1] http://www.firewalld.org/
[2] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.passthrough
[3] https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addChain
    https://jpopelka.fedorapeople.org/firewalld/doc/firewalld.dbus.html#FirewallD1.direct.Methods.addRule

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
Upstream-commit: 8301dcc6d702a97feeb968ee79ae381fd8a4997a
Component: engine
2015-04-20 13:02:03 +02:00