Commit Graph

551 Commits

Author SHA1 Message Date
0d867da41c Move AuthConfig to api/types
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Upstream-commit: 5b321e328769cc93c3454e82ec3fe07672156f2e
Component: engine
2015-12-14 11:22:01 -05: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
1c526ceb5c Move networking api types to the api/types/networking package.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Upstream-commit: efda9618db07152ce6a94e0ac391ba58d1463fcd
Component: engine
2015-12-09 13:55:59 -08:00
be83c5ad37 Rebase from master
Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: f28230d35c19befe5d6799667f37c1362dd1b782
Component: engine
2015-12-08 19:45:22 +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
d76bf17816 Merge pull request #18442 from MHBauer/move-configs
move configs structs to remove dependency on deamon
Upstream-commit: 41ae615aa13508b8f8958dc1c338fce5bccb8e6b
Component: engine
2015-12-07 13:38:43 -05:00
b12523fdf4 move configs structs to remove dependency on daemon
- Moved the following config structs to api/types
   - ContainerRmConfig
   - ContainerCommitConfig

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 63fb931a0b7298c6281898bcc5f53ab0655ad1a6
Component: engine
2015-12-07 09:03:25 -08:00
c2790f1174 Merge pull request #18425 from wenchma/18424-ErrorCodeNoSuchContainer
Correct the message of ErrorCodeNoSuchContainer to "No such container"
Upstream-commit: 0bb4f82d2d9f3d741fea6251dc4b2925576a8d02
Component: engine
2015-12-07 07:48:04 -05:00
cae2a5b6ac Correct the message of ErrorCodeNoSuchContainer to "No such container"
Fixes issue #18424

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
Upstream-commit: c424c8c32c86d5e02964ad84802e9f9fa4e55522
Component: engine
2015-12-04 15:00:08 +08:00
13f897ae0e 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>
Upstream-commit: 867f432985d6b4a46c2f66225d70a4ffdb28d8a3
Component: engine
2015-12-03 13:38:56 -05: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
cf1f5d3461 Merge pull request #18350 from duglin/Issue9798a
Deprecate -f flag from docker tag
Upstream-commit: fcccf2dae4770bdb7781d57e20ae94b9565b67ac
Component: engine
2015-12-02 08:16:09 -08: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
22eaa04494 Move defaultSHMSize in daemon pkg
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 2969abc6c55a9ab126b90d0af4b67860b4103f3f
Component: engine
2015-12-02 10:28:10 +01:00
2603d9d05a 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>
Upstream-commit: 8d4fe141c4c3f456df9c2be75ffe5071d1665717
Component: engine
2015-12-01 19:53:49 -08:00
a68d03ab84 Merge pull request #18343 from calavera/unify_debug_logging
[Carry 18260] Remove info logging from every api call.
Upstream-commit: 3962fe5d7b47383b752383b48adf7e1ac0a6f202
Component: engine
2015-12-01 13:42:57 -08:00
d583bad1ef Unify both debug logging middlewares.
We can remove one function from the stack by injecting the middleware
only when logging in enabled and the level is debug.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 82323294db96e8043244027c262481af6c8f478d
Component: engine
2015-12-01 14:33:33 -05:00
ec12c4920e fix shm size handling
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: ef1d410b0270fa7309d76aded34113396def7fb2
Component: engine
2015-12-01 16:29:40 +01: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
681dc550e7 The loggingMiddleware function is adding lots of messages to the log
When tools like kubernetes and cockpit are talking to the docker daemon
actively, we are seeing large number of log messages that look like debug
information.

For example

docker info adds the following line to journald.

Nov 26 07:09:23 dhcp-10-19-62-196.boston.devel.redhat.com docker[32686]: time="2015-11-26T07:09:23.124503455-05:00" level=info msg="GET /v1.22/info"

We think this should be Debug level not Info level.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: cf4fb150880ec5f4153c291e67238e28f3cbdf9b
Component: engine
2015-11-26 07:10:38 -05:00
c862a7ae5b Revert "Return listenbuffer behavior"
This reverts commit 281a48d092fa84500c63b984ad45c59a06f301c4.

Signed-off-by: Alex Crawford <alex.crawford@coreos.com>
Upstream-commit: a8b84cd8fb63d237b488f8b137b45187a6efaa5a
Component: engine
2015-11-24 18:32:57 -08:00
08fb779389 Split container backend into several specialized interfaces.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 85c3c6865ef4eb334f9fbdec6dd270d525b68914
Component: engine
2015-11-24 14:03:39 -05:00
b1098ef990 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>
Upstream-commit: 38abba9e2c8f7ac27bd26bf98685b51585922317
Component: engine
2015-11-24 14:03:39 -05:00
15fa54f208 Add container package for container APIs.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: fa8d96ebe21f5bb83e4d2da8e59234e701a8ee70
Component: engine
2015-11-24 14:03:07 -05:00
a62c883d3d move container files to a separate folder. Following changes will update them.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: a5bf10f37e150873fe5c0a6b5bccd8ac145bee58
Component: engine
2015-11-24 14:03:07 -05: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
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
4581692a0e Addition of "--shm-size" to which size of /dev/shm is changed.
- Optional "--shm-size=" was added to the sub-command(run, create,and build).
- The size of /dev/shm in the container can be changed
  when container is made.
- Being able to specify is a numerical value that applies number,
  b, k, m, and g.
- The default value is 64MB, when this option is not set.
- It deals with both native and lxc drivers.

Signed-off-by: NIWA Hideyuki <niwa.hiedyuki@jp.fujitsu.com>
Upstream-commit: 5aeaf2a0c4236711e0981515d8627b30e22a1637
Component: engine
2015-11-20 09:24:18 +09:00
0179308537 Merge pull request #17211 from endocode/kayrus/docker_fd_https
Added possibility to use TLS with systemd socket activation
Upstream-commit: dc136b710b70a51510726576761f7bf9aa2455e2
Component: engine
2015-11-14 08:36:54 +01:00
bab21d6431 Merge pull request #17859 from liusdu/remove-rebundent
remove unnecessary logs from daemon
Upstream-commit: 1f53bf90972141bc6f5888fb3520dbc68ff9ed14
Component: engine
2015-11-13 16:45:30 -08:00
3898bf4aaf Merge pull request #17615 from WeiZhang555/17404-net-inspect-name
Include container names in `network inspect`
Upstream-commit: a4acb1db4ae899e5b331b4b2724bda990e6f1371
Component: engine
2015-11-13 11:54:59 -08:00
cf625298ac Added possibility to use TLS with systemd socket activation
Signed-off-by: kayrus <kay.diam@gmail.com>
Upstream-commit: 0f2b3191d9e4f48b1915e2da4acc4f28b0d71494
Component: engine
2015-11-13 17:01:23 +01:00
2f6a89e161 modifying docker --since and --until to support nanoseconds and time zones
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
Upstream-commit: 430d8ff6113e41edc4605267081fa424a9bfe19f
Component: engine
2015-11-13 09:56:15 -06:00
3ddd694ddd remove unnecessary logs from daemon
if daemon encounters removing-file error. It will record two
similar logs as following . The later is meaningful for client, But not for
daemon. So remove it.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 343e15fa3f3e6838a6cf6ebd2dd02e4e627fffcc
Component: engine
2015-11-10 17:44:38 +08:00
2f262fa249 Merge pull request #17431 from vdemeester/hope-it-does-not-broke-everything-again
Another try at dockerversion placeholder for library import
Upstream-commit: 58b270c338e831ac6668a29788c72d202f9fc251
Component: engine
2015-11-09 13:15:50 -08:00
48001c30bb dockerversion placeholder for library import
- Add a *version* file placeholder.
- Update autogen and builds to use it and an autogen build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8054a303870b81eebe05e38261c1b68197b68558
Component: engine
2015-11-09 19:32:46 +01:00
f04b3ed326 Modify improper comments in api/server/router/volume/volume.go
Signed-off-by: Shuwei Hao <haoshuwei24@gmail.com>
Upstream-commit: 6efa10f6687d78f15ee0a3a192b5b41f215c84a9
Component: engine
2015-11-08 04:05:59 +00:00
8e86de45f2 Include container names in network inspect
This commit makes `docker network inspect` print container names as
service discovery is based on container name.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: fbed26297dca2adc59d891c661548302ec848984
Component: engine
2015-11-05 19:16:13 +08:00
fa6a6b811f Merge pull request #17703 from aboch/np
Verify Endpoint.Info() before accessing it
Upstream-commit: f18c5e9714face6eaa4ff63a32ecd6f01444ef4b
Component: engine
2015-11-04 19:23:11 -05:00
6cd1649ca5 Verify Endpoint.Info() before accessing it
- During concurrent operations in multihost environment,
  it is possible that the implementer of `EndpointInfo`
  is nil. It simply means the endpoint is no longer
  available in the datastore.

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 54d22cbd9a04a965c935a693bf403d2c87109b5a
Component: engine
2015-11-04 13:27:17 -08:00
b92bac632d Do not rely on string comparison in truncindex
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: d4a8d09d1a7ced5c711fcc7a939986d22a0554eb
Component: engine
2015-11-04 11:34:05 -08:00
9aef196743 Merge pull request #17614 from LK4D4/fix_golint
Update linting tools to latest versions
Upstream-commit: e704182c9c5bea1655791d11d13878b6a5ec949c
Component: engine
2015-11-03 15:32:12 -08:00
71e9a8abba Merge pull request #17634 from stevvooe/avoid-panic-on-flush
Avoid panic on write after close in http
Upstream-commit: 3c695d7ed73e9992fba51a9d4bfa745763230c79
Component: engine
2015-11-02 21:11:52 -08:00
c45875750d Avoid panic on write after close in http
By adding a (*WriteFlusher).Close, we limit the Write calls to possibly
deallocated http response buffers to the lifetime of an http request.
Typically, this is seen as a very confusing panic, the cause is usually a
situation where an http.ResponseWriter is held after request completion. We
avoid the panic by disallowing further writes to the response writer after the
request is completed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: ec2289b2d9ac79fd5e0f69f56f023dfe8ee78bf8
Component: engine
2015-11-02 18:14:43 -08:00
114ad6dae4 create generic backend to cut dependency on daemon
- create a volume-specific interface that for the methods of daemon
   that are used
 - remove dependency on daemon package by volume package of server
 - like 5087977fc1a4279be55f25e0b8782c9cf9bc65f3

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 836df9c4469db89ba2fecfe512ce67003a61cc1e
Component: engine
2015-11-02 16:29:16 -08:00
51dda01ea0 create generic backend to cut dependency on daemon
- create a network-specific interface that for the methods of daemon
   that are used
 - remove dependency on daemon package

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 5087977fc1a4279be55f25e0b8782c9cf9bc65f3
Component: engine
2015-11-02 12:30:10 -08:00