Commit graph

2615 commits

Author SHA1 Message Date
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
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
Tonis Tiigi
4352da7803 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-24 09:40:25 -08:00
Stefan Berger
5cd6b3eca2
Adjust docker-default profile when docker daemon is confined
Adjust the docker-default profile for when the docker daemon is running in
AppArmor confinement. To enable 'docker kill' we need to allow the container
to receive kill signals from the daemon.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-23 15:20:01 -08:00
Stefan Scherer
6f6f10a75f prevent journald from being built on ARM
Signed-off-by: Govinda Fichtner <govinda.fichtner@googlemail.com>
2015-11-21 15:17:31 +01:00
David Calavera
9ca2e4e81c Move exec store to its own package inside the daemon.
Remove double reference between containers and exec configurations by
keeping only the container id.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-20 17:40:16 -05:00
Michael Crosby
b5c507750f Merge pull request #18051 from calavera/extract_streams
Extract StreamConfig struct out of the daemon package.
2015-11-20 13:45:13 -08:00
David Calavera
3f5b8f712d Extract StreamConfig struct out of the daemon package.
This is a small configuration struct used in two scenarios:

1. To attach I/O pipes to a running containers.
2. To attach to execution processes inside running containers.

Although they are similar, keeping the struct in the same package
than exec and container can generate cycled dependencies if we
move any of them outside the daemon, like we want to do
with the container.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-20 15:04:27 -05:00
Vincent Demeester
f064b9941c Merge pull request #18073 from runcom/hostconfig-resources
runconfig: split resources into a struct
2015-11-20 20:29:44 +01:00
David Calavera
8fa09749fb Merge pull request #17718 from wenchma/17716_before_filter_doc
Re-implement --before and --since as options for --filter
2015-11-20 11:24:19 -08:00
Antonio Murdaca
1a0b483e02 runconfig: split resources into a struct
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-20 19:40:01 +01:00
Wen Cheng Ma
1921c62938 Re-implement --before and --since as options for --filter
* This commit will mark --before and --since as deprecated, but leave their behavior
  unchanged until they are removed, then re-implement them as options for --filter.

* And update the related docs.

* Update the integration tests.

Fixes issue #17716

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2015-11-20 13:10:13 +08:00