Commit Graph

1698 Commits

Author SHA1 Message Date
ba9d0503c4 Make pkg/devicemapper/ log messages with a common, consistent prefix.
Closes #16667

Uses the prefix "devicemapper:" for all the fmt and logrus error, debug, and info messages.

Signed-off-by: Chris Dituri <csdituri@gmail.com>
Upstream-commit: 9b584781ad9c810bc9060448f391a3ae6a7d7cbb
Component: engine
2015-12-14 21:35:15 -06:00
86409751de utils: move git functions to pkg/gitutils
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 135cca6f52c7862f13f50c30ccf5925038ba40a9
Component: engine
2015-12-14 14:59:52 +01:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
1d681e5873 Merge pull request #15365 from twistlock/14674-docker-authz
Docker authorization plug-in infrastructure
Upstream-commit: 1fffc0270ffb56d99a8440a10a0effdb3acd934d
Component: engine
2015-12-12 12:30:33 +01:00
9847131043 Merge pull request #18353 from aaronlehmann/transfer-manager
Improved push and pull with upload manager and download manager
Upstream-commit: ac453a310bac6bdd7cd9d780a63d4168064570d1
Component: engine
2015-12-10 14:52:48 -08:00
547342d777 Improved push and pull with upload manager and download manager
This commit adds a transfer manager which deduplicates and schedules
transfers, and also an upload manager and download manager that build on
top of the transfer manager to provide high-level interfaces for uploads
and downloads. The push and pull code is modified to use these building
blocks.

Some benefits of the changes:

- Simplification of push/pull code
- Pushes can upload layers concurrently
- Failed downloads and uploads are retried after backoff delays
- Cancellation is supported, but individual transfers will only be
  cancelled if all pushes or pulls using them are cancelled.
- The distribution code is decoupled from Docker Engine packages and API
  conventions (i.e. streamformatter), which will make it easier to split
  out.

This commit also includes unit tests for the new distribution/xfer
package. The tests cover 87.8% of the statements in the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 572ce802306a4e919802e5b77cbeca94acda7c0a
Component: engine
2015-12-09 19:13:35 -08:00
4abf2d4ba4 Merge pull request #18538 from estesp/aufs-whiteout-userns-fix
Skip aufs whiteout files on userns translation to container
Upstream-commit: 8b6132aa15367456b04cf659045e7996252df1f0
Component: engine
2015-12-09 14:47:01 -05:00
a984ad154d Remove redundant check
jm.ID is already checked in the outer "if",
so theres no reason to check it again here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7a6f5d9b3186de2116686d5e2c40eff673dae6ec
Component: engine
2015-12-09 17:38:06 +01:00
439d751051 Skip aufs whiteout files on userns translation to container
aufs kernel module creates whiteout files on upper layer delete (and
other situations) and those files already are 'translated' regarding
ownership in host terms (e.g. they are already "0:0" owned), so when
these layers are copied around with pkg/archive we don't want to try and
translate these files regarding ownership.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 1626c9dae0f285185e3ef4c1e2be55a807e8c0ed
Component: engine
2015-12-09 10:11:32 -05:00
1c96ff9a0b Fixing documentation according to comments by @moxiegirl and @thaJeztah
Signed-off-by: Dima Stopel <dima@twistlock.com>
Upstream-commit: 8cc0892269fb532f117aadc0e8acf7a173fe4e1b
Component: engine
2015-12-08 17:34:15 +02:00
2491643ccf Docker authorization plug-in infrastructure enables extending the functionality of the Docker daemon with respect to user authorization. The infrastructure enables registering a set of external authorization plug-in. Each plug-in receives information about the user and the request and decides whether to allow or deny the request. Only in case all plug-ins allow accessing the resource the access is granted.
Each plug-in operates as a separate service, and registers with Docker
through general (plug-ins API)
[https://blog.docker.com/2015/06/extending-docker-with-plugins/]. No
Docker daemon recompilation is required in order to add / remove an
authentication plug-in. Each plug-in is notified twice for each
operation: 1) before the operation is performed and, 2) before the
response is returned to the client. The plug-ins can modify the response
that is returned to the client.

The authorization depends on the authorization effort that takes place
in parallel [https://github.com/docker/docker/issues/13697].

This is the official issue of the authorization effort:
https://github.com/docker/docker/issues/14674

(Here)[https://github.com/rhatdan/docker-rbac] you can find an open
document that discusses a default RBAC plug-in for Docker.

Signed-off-by: Liron Levin <liron@twistlock.com>
Added container create flow test and extended the verification for ps
Upstream-commit: 75c353f0ad73bd83ed18e92857dd99a103bb47e3
Component: engine
2015-12-08 17:34:15 +02:00
c64118158d Fix the scoping of "diff" so its value doesn't leak between loop iterations
In the existing code, "diff" has function scope and the value from the
previous iteration may be used if it is not reset. This appears to be an
oversight. This commit changes its scope to the for loop body.

One confusing point is that the cursor movement escape sequences appear
to be necessary even if the requested movement is 0. I haven't been able
to figure out why this makes a difference.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 59df2adc071e0186ccd0ba7ea9387142e168d735
Component: engine
2015-12-07 17:01:47 -08:00
a646b23843 Don't update lines on the terminal from a previous operation
When we handle a message that isn't tracked in the "line" map (for
example, one with no ID), clear the line map. This means we won't update
lines that were part of a previous, completed set of operations when
doing something like pull -a. It also has the beneficial side effect
of avoiding terminal glitching in these types of situations, since
messages that don't get tracked in the "line" map cause the count of the
number of lines to get out of sync.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: fc41d393946e6da59792da9ed6e5ab8ed6f58814
Component: engine
2015-12-07 16:04:42 -08:00
57ef1043ab Merge pull request #18449 from coolljt0725/plugins_cleanup
pkg/plugins/client.go: don't try to encode os decode if it's nil
Upstream-commit: 5f1af8da5bd824010d3c744d3adf23106f22c6a9
Component: engine
2015-12-07 16:03:28 +01:00
1af1c81aab Merge pull request #18123 from aidanhs/aphs-fail-on-broken-tar
Ensure adding a broken tar doesn't silently fail
Upstream-commit: 1f8efc687cdf8ba98a7332cf9d4401afb8108be6
Component: engine
2015-12-07 14:38:21 +01:00
54d257ee92 pkg/plugins/client.go: don't try to encode os decode if it's nil
When user call the `Call()` method, they don't always want to sent
some args or get the return value, so they use `nil` when call `Call()`
method and this will casue an error. It's better to not trying to
encode or decode if it's nil.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: a2d348968fe754df41d0a1b56c7ba29ebbaa6849
Component: engine
2015-12-05 02:55:50 -05:00
9e539c7be0 Merge pull request #14466 from Mashimiao/add-support-blkio_throtte_bps
Add support for blkio read/write bps device
Upstream-commit: cb6a1a6042fc30e0beeaa79a2f8def4b53019483
Component: engine
2015-12-04 12:29:58 +01:00
6790de2194 Merge pull request #18412 from aaronlehmann/runcommand-race
Fix race in RunCommandWithOutputForDuration
Upstream-commit: 7c1c96551d41e369a588e365a9bb99acb5bc8fdb
Component: engine
2015-12-03 19:35:04 -08:00
7be0f9667b Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 3f15a055e5c50d0f08d4c3e7cd9618d537b84f29
Component: engine
2015-12-04 09:26:03 +08:00
9dd07d2075 Merge pull request #18411 from aaronlehmann/unit-test-timing
Adjust TestDockerCmdWithTimeout timeout to improve reliability
Upstream-commit: 4e6bea596472a02509bb966d077a93fe9490f6e1
Component: engine
2015-12-03 16:34:36 -08:00
9a19c84124 Fix race in RunCommandWithOutputForDuration
This function was starting a goroutine that modifies one of its return
values. The intent is for the goroutine to only influence the return
value when it's causing the function to return, but it's racy and can
also modify the return value when the function is returning due to the
timeout. Fix the goroutine to not modify return values directly.

Also, give the channel a buffer so that the goroutine doesn't block
forever after a timeout.

Fixes #18305

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 2704fd9156bfb0fb8dc16c42902bb18ea5aa94a9
Component: engine
2015-12-03 16:34:01 -08:00
4ee82987ec Adjust TestDockerCmdWithTimeout timeout to improve reliability
I saw a failure of TestDockerCmdWithTimeout. This test starts a command
that produces output after 10 ms, but uses a 5 ms timeout, so normally
the command will be killed before the output. The time intervals are so
small that the timeout may not reliably trigger before the output, which
can cause the test to fail.

This commit changes the test to only fail if the process is still alive
after 10 seconds. This means the test will confirm that the timeouts are
happening, but not attempt to gauge that the timeouts are happening
within milliseconds of when they are expected (which can't be done
reliably).

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 13d768b8ee05d3158c62d761e4ebe657cd7a8c25
Component: engine
2015-12-03 14:42:32 -08:00
0082efd193 Merge pull request #18266 from calavera/events_pub_sub
Event PubSub topics + linear filtering.
Upstream-commit: 33ab2bb52c130380e038013d68fdd8ad3c663360
Component: engine
2015-12-03 17:11:40 +01:00
d555e15f77 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>
Upstream-commit: 434d2e8745696255a204d9eefc6a2854ff74e5c2
Component: engine
2015-12-02 16:43:49 -05:00
79750c94df 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>
Upstream-commit: 93d1dd8036d57f5cf1e5cbbbad875ae9a6fa6180
Component: engine
2015-12-02 11:12:42 -05:00
71b21cf347 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>
Upstream-commit: b3e527dfd242ad30c0297c8b257862116cf2c50e
Component: engine
2015-12-02 10:06:59 -05:00
57432b4d63 Merge pull request #17438 from pmalmgren/17037-systemd226-cgroup
Fix docker status incorrectly reports containerized
Upstream-commit: c84f5dfd7431dfef94a073b47f591515a58d9e00
Component: engine
2015-11-30 11:47:16 -08:00
e285c73838 Merge pull request #18241 from LK4D4/remove_listenbuffer
Remove listenbuffer
Upstream-commit: 2a354790a635537c2ed5325b6615e9bdccdc6954
Component: engine
2015-11-30 14:37:14 -05:00
d6e4b2d7b7 Merge pull request #18178 from jfrazelle/apparmor-we-meet-again
Fix docker-default profile handing signals
Upstream-commit: e852959fadf7ec77ffb57877806603b8c0bf523e
Component: engine
2015-11-30 11:34:34 -08:00
d3dbad3a43 check version for docker-default aa profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: f8db9a09e0ec9b1925839ffff4f1cc5fe3ace630
Component: engine
2015-11-30 10:18:12 -08:00
0940f2e2b9 Merge pull request #18296 from jfrazelle/add-james
add james golick to names generator
Upstream-commit: 221d979e7b6fbc1c631370a8d44bc588b68df543
Component: engine
2015-11-30 10:00:21 -08:00
3f8975aab8 Remove listenbuffer package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a0251b2bbfe259c8d089e34415159f1b609779be
Component: engine
2015-11-30 09:04:59 -08:00
59911bba39 Remove usage of listenbuffer package
It actually adds nothing to queuing requests.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ca5795cef810c85f101eb0aa3efe3ec8d756490b
Component: engine
2015-11-30 09:04:55 -08:00
21928a9bde Merge pull request #18226 from duglin/Issue18170
Fix for zero-sized layers
Upstream-commit: a26accfb5d52f81b6df339da36855b85d3a473fe
Component: engine
2015-11-30 09:57:37 -06:00
bbfa3215a0 add james golick to names generator
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: bf66deeb080787c3bda9aa619d3cdb22c68bbee1
Component: engine
2015-11-29 10:40:12 -08:00
a047f4a27c Fix for zero-sized layers
Moved a defer up to a better spot.

Fixed TestUntarPathWithInvalidDest to actually fail for the right reason

Closes #18170

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 7bb9fc415ac50abf5f754005264bfe152eeca7d6
Component: engine
2015-11-25 18:02:03 -08:00
89ca8a3104 Fix spelling of 'existent'
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Upstream-commit: 899caaca9c990067d541231c6d288de89dbb79e7
Component: engine
2015-11-25 13:45:37 +00:00
0093235ece Merge pull request #17924 from aaronlehmann/content-addressability
Content addressability
Upstream-commit: a2ab05098d1033f6b282ccaf7301f2a31eda1a9c
Component: engine
2015-11-24 11:01:33 -08:00
e105a29374 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>
Upstream-commit: 4352da7803d182a6013a5238ce20a7c749db979a
Component: engine
2015-11-24 09:40:25 -08:00
bea0c01ef1 Fix race in locker call to dec()
Can't safely use uint32 for locker since we need to decrement the count,
which requires loading the unit and doing some math, which is inherintly
racey.
Instead use Int32 which we can safely use with atomic and AddInt32 with
`-1`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 985175fd8f8f662d5067bd62a89330e9a437375c
Component: engine
2015-11-24 11:59:09 -05:00
60942ba73e Ensure adding a broken tar doesn't silently fail
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: 3243e504d01ea1efa141f3e3cc296903d7d62ca4
Component: engine
2015-11-23 14:18:58 +00:00
f9f128d85f Merge pull request #18146 from JamesKyburz/random-additions
Random additions
Upstream-commit: 692bfdaee3b48f4e5174bb80098692a0ded1aecf
Component: engine
2015-11-21 13:18:09 -05:00
9f0c131692 Merge pull request #16613 from WeiZhang555/docker-cp-symlink
Add option `-L` to allow `docker cp` follow symbol link
Upstream-commit: 3ff9bb53326312a66fee19bc56dd2ad9c642b133
Component: engine
2015-11-21 17:03:24 +01:00
d6089c6fe2 Add nauseous and pedantic
Signed-off-by: James Kyburz <james.kyburz@gmail.com>
Upstream-commit: f8a6726daddedd33c9e14db2133b0f5321c5ff5f
Component: engine
2015-11-21 16:23:07 +01:00
b97ed2a561 Merge pull request #17495 from mikebrow/docker-tz-and-nanosecond-updates
modifying docker --since and --until to support nanoseconds and time …
Upstream-commit: 6653f827965b431139af141fa2cc68a6513abe71
Component: engine
2015-11-20 23:37:44 +01:00
4599b4fbfc Merge pull request #17456 from Microsoft/TestChtimesFix
Fix ChTimes to prevent setting times past the Unix Max Time
Upstream-commit: 6e727a4c8037d3ea43913ee23f34c9babaf420eb
Component: engine
2015-11-20 18:07:09 +01:00
27af07df7b Add '-L' option for cp
Fixes #16555

Original docker `cp` always copy symbol link itself instead of target,
now we provide '-L' option to allow docker to follow symbol link to real
target.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 92600bdec1284f9031868751f61bef476d2e1dbd
Component: engine
2015-11-21 00:36:56 +08:00
e1191bf537 Merge pull request #17459 from brahmaroutu/Power_Z_CI
Build and test Docker on IBM Power and Z using gccgo. Enable CI on Po…
Upstream-commit: 249b3a9479048bcec8da0666c2e224dddcfc3de8
Component: engine
2015-11-19 15:50:07 -08:00
1d43e38301 Merge pull request #18082 from MHBauer/gh9406
Remove defaults for flags/options that expect no value
Upstream-commit: 9c21e852b2674a68d9b0fbbada368f5b7818b494
Component: engine
2015-11-19 15:06:21 -08:00
5fc4e385a6 This fixes Chtimes on systems with 32 bit Timespec
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 318ad1cb43bcf01f03d790ae258506121f30f117
Component: engine
2015-11-19 11:08:29 -08:00