Commit graph

2625 commits

Author SHA1 Message Date
Jess Frazelle
a56f258c8a Merge pull request #18436 from estesp/fix-initlayer-perms
Fix init layer chown of existing dir ownership
2015-12-04 11:53:09 -08:00
Phil Estes
51b0f23127 Merge pull request #18398 from calavera/system_backend
Move docker system information to a dedicated router and backend.
2015-12-04 12:56:57 -05:00
Phil Estes
23b771782a Fix init layer chown of existing dir ownership
This solves a bug where /etc may have pre-existing permissions from
build time, but init layer setup (reworked for user namespaces) was
assuming root ownership.  Adds a test as well to catch this situation in
the future.

Minor fix to wrong ordering of chown/close on files created during the
same initlayer setup.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-12-04 12:18:05 -05:00
Ma Shimiao
3f15a055e5 Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-04 09:26:03 +08:00
Michael Crosby
168b490062 Merge pull request #18347 from tiborvass/container_package
Move Container to its own package (carry of 17969)
2015-12-03 14:10:16 -08:00
Tibor Vass
5bb4d0d9ea Move DisconnectFromNetwork back to daemon/
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-03 20:10:27 +01:00
David Calavera
867f432985 Move docker system information to a dedicated router and backend.
Because I like the name `system` better than `local` :)

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-03 13:38:56 -05:00
Phil Estes
d9755df2b3 Merge pull request #18391 from runcom/remove-daemon-config-func
daemon: remove private func config()
2015-12-03 11:42:31 -05:00
David Calavera
6bb0d1816a Move Container to its own package.
So other packages don't need to import the daemon package when they
want to use this struct.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-12-03 17:39:49 +01:00
Tibor Vass
33ab2bb52c Merge pull request #18266 from calavera/events_pub_sub
Event PubSub topics + linear filtering.
2015-12-03 17:11:40 +01:00
Antonio Murdaca
3662f58083 daemon: remove private func config()
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-03 11:46:53 +01:00
David Calavera
434d2e8745 Add PubSub topics.
A TopicFunc is an interface to let the pubisher decide whether it needs
to send a message to a subscriber or not. It returns true if the
publisher must send the message and false otherwise.

Users of the pubsub package can create a subscriber with a topic
function by calling `pubsub.SubscribeTopic`.

Message delivery has also been modified to use concurrent channels per
subscriber. That way, topic verification and message delivery is not
o(N+M) anymore, based on the number of subscribers and topic verification
complexity.

Using pubsub topics, the API stops controlling the message delivery,
delegating that function to a topic generated with the filtering
provided by the user. The publisher sends every message to the
subscriber if there is no filter, but the api doesn't have to select
messages to return anymore.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-02 16:43:49 -05:00
David Calavera
f8364c013d Merge pull request #18369 from LK4D4/misleading_rm
daemon/delete.go: use less confusing naming of functions
2015-12-02 11:57:18 -08:00
Arnaud Porterie
8f1f53f735 Merge pull request #16277 from runcom/add-oom-score-adj
Add OomScoreAdj
2015-12-02 11:49:51 -08:00
Brian Goff
f411b101ac Merge pull request #18285 from hqhq/hq_fix_swappiness
Set default MemorySwappiness when adapt
2015-12-02 14:25:08 -05:00
David Calavera
d4be46def4 Merge pull request #13587 from rhatdan/volume-tmpfs
Add tmpfs as a valid volume source command.
2015-12-02 11:16:49 -08:00
Alexander Morozov
828f63f1ab daemon/delete.go: use less confusing naming of functions
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-02 11:10:14 -08:00
Jess Frazelle
fcccf2dae4 Merge pull request #18350 from duglin/Issue9798a
Deprecate -f flag from docker tag
2015-12-02 08:16:09 -08:00
Jess Frazelle
e07769bc5a Merge pull request #18351 from LK4D4/fix_rm_race
Fix race between two ContainerRm
2015-12-02 08:13:52 -08:00
David Calavera
93d1dd8036 Make filtering a linear operation.
Improves the current filtering implementation complixity.
Currently, the best case is O(N) and worst case O(N^2) for key-value filtering.
In the new implementation, the best case is O(1) and worst case O(N), again for key-value filtering.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-02 11:12:42 -05:00
Dan Walsh
b3e527dfd2 This patch adds --tmpfs as a option for mounting tmpfs on directories
It will Tar up contents of child directory onto tmpfs if mounted over

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-12-02 10:06:59 -05:00
Antonio Murdaca
2969abc6c5 Move defaultSHMSize in daemon pkg
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-02 10:28:10 +01:00
Alexander Morozov
4d1007d75c Fix race between two ContainerRm
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-01 20:13:18 -08:00
Doug Davis
8d4fe141c4 Deprecate -f flag from docker tag
Closes #9798

@maintainers please note that this is a change to the UX. We no longer
require the -f flag on `docker tag` to move a tag from an existing image.
However, this does make us more consistent across our commands,
see https://github.com/docker/docker/issues/9798 for the history.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-12-01 19:53:49 -08:00
Qiang Huang
4089b4e440 Set default MemorySwappiness when adapt
It makes the inspect result consistent between cli and REST api
when MemorySwappiness is not set.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-02 10:53:52 +08:00
Qiang Huang
1415f55cc0 Move security opt adaption to adapt function
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-02 08:26:11 +08:00
Alexander Morozov
5efb37616f Merge pull request #18308 from mountkin/delete-graphdb-later
fix 2 corner cases in container create cleanup and container removal
2015-12-01 13:19:59 -08:00
Shijiang Wei
4953ea1eae fix 2 corner cases in container create cleanup and container removal
- avoid empty Names in container list API when fails to remove
    a container
  - avoid dead containers when fails to create a container

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-12-02 01:37:50 +08:00
Antonio Murdaca
ef1d410b02 fix shm size handling
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-01 16:29:40 +01:00
Phil Estes
c8891158bd Merge pull request #18310 from rhvgoyal/log-fs-creation
devmapper: Log start and end of filesystem creation
2015-12-01 09:49:13 -05:00
Sebastiaan van Stijn
c6a2bce919 Merge pull request #18331 from runcom/fix-typo
daemon: daemon_experimental.go: fix typo
2015-12-01 15:48:10 +01:00
Vivek Goyal
a489e685c0 devmapper: Log start and end of filesystem creation
ext4 filesystem creation can take a long time on 100G thin device and
systemd might time out and kill docker service. Often user is left thinking
why docker is taking so long and logs don't give any hint. Log an info
message in journal for start and end of filesystem creation. That way
a user can look at logs and figure out that filesystem creation is
taking long time.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-12-01 13:05:46 +00:00
Antonio Murdaca
4c8088268c daemon: daemon_experimental.go: fix typo
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-01 12:03:50 +01:00
David Calavera
d7117a1b71 Make sure container start doesn't make the DNS fields nil.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-30 22:46:31 -05:00
Jess Frazelle
e852959fad Merge pull request #18178 from jfrazelle/apparmor-we-meet-again
Fix docker-default profile handing signals
2015-11-30 11:34:34 -08:00
Alexandre Beslic
0f0cf267e8 Merge pull request #18204 from mavenugo/dhb
Configurable discovery ttl and heartbeat timer
2015-11-30 11:00:53 -08:00
Jessica Frazelle
f8db9a09e0
check version for docker-default aa profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-11-30 10:18:12 -08:00
Jess Frazelle
360a106511 Merge pull request #18303 from runcom/lxc-leftover
daemon: remove sysInitPath, lxc leftover
2015-11-30 09:37:05 -08:00
Alexander Morozov
377e1d75f9 Merge pull request #18239 from jfrazelle/17783-fix-regex
Fix parsing of apparmor pcre syntax
2015-11-30 09:15:25 -08:00
Antonio Murdaca
d3af7f283d Add OomScoreAdj to configure container oom killer preferences
libcontainer v0.0.4 introduces setting `/proc/self/oom_score_adj` to
better tune oom killing preferences for container process. This patch
simply integrates OomScoreAdj libcontainer's config option and adjust
the cli with this new option.

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-30 11:19:04 +01:00
Antonio Murdaca
1b726b29b2 daemon: remove sysInitPath, lxc leftover
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-30 10:04:13 +01:00
Qiang Huang
dd7b4fd651 Fix kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-11-28 09:47:25 +08:00
Alexander Morozov
b8c21783f0 Merge pull request #17108 from coolljt0725/fix_remove_image
Fix docker rmi trying to remove a being used parent
2015-11-26 12:21:30 -08:00
Brian Goff
9ebf7dfae3 Merge pull request #18252 from aaronlehmann/tarstream-readcloser
Make TarStream return an io.ReadCloser
2015-11-25 21:35:21 -05:00
Lei Jitang
0bbc9f1d2d Fix docker rmi trying to remove a being used parent
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-11-26 09:57:20 +08:00
Aaron Lehmann
21278efaee Make TarStream return an io.ReadCloser
Currently, the resources associated with the io.Reader returned by
TarStream are only freed when it is read until EOF. This means that
partial uploads or exports (for example, in the case of a full disk or
severed connection) can leak a goroutine and open file. This commit
changes TarStream to return an io.ReadCloser. Resources are freed when
Close is called.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-11-25 16:39:54 -08:00
Tonis Tiigi
20e759ab56 Validate adding digests to tagstore with go types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-25 15:06:51 -08:00
Jessica Frazelle
c0f7fdc025
Fix parsing of apparmor pcre syntax
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-11-25 10:38:18 -08:00
Madhu Venugopal
2efdb8cbf5 Make discovery ttl and heartbeat configurable
Docker daemon uses kv-store as the host-discovery backend.
Discovery module tracks the liveness of a node through a simple
keepalive mechanism.  The keepalive mechanism depends on every
node performing heartbeat by registering itself with the discovery
module (via KV-Store Put operation). And for every Put operation,
the discovery module in all other nodes will receive a Watch
notification. That keeps the node alive.
Any node that fails to register itself within the TTL timer is
considered dead and removed from the discovery database.

The default timer (heartbeat = 20 seconds & ttl = 60 seconds)
works fine for small clusters.  But for large clusters, these
default timers are extremely aggressive and that causes high CPU
& most of the processing is spent managing the node discovery
and that impacts normal daemon operation.

Hence we need a way to make the discovery ttl and heartbeat
configurable.  As the cluster size grows, the user can change
these timers to make sure the daemon scales.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-11-25 06:51:55 -08:00
David Calavera
38abba9e2c Move versioned references of inspect functions to the daemon.
Leaving only one versioned main function that a backend must implement.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-24 14:03:39 -05:00