Commit graph

1211 commits

Author SHA1 Message Date
Jess Frazelle
67e38cc54c Merge pull request #16638 from MHBauer/daemon-derepo
refactor daemon image tagging
2015-10-08 14:14:20 -07:00
Jess Frazelle
01cd67e752 Merge pull request #16366 from MHBauer/logs-refactor
refactor logs to not use internal data structures
2015-10-08 14:05:02 -07:00
Vincent Demeester
caf7d83c67 Merge pull request #16826 from LK4D4/refactor_listenfd
Refactor listenFD function
2015-10-08 22:08:52 +02:00
Jess Frazelle
4796b5c2f8 Merge pull request #16544 from Mashimiao/fix-bug-client-start-signal-discarded
client/start: fix logic for discarded signal
2015-10-08 12:54:31 -07:00
Jess Frazelle
cc411c054f Merge pull request #16785 from cpuguy83/exec_cleanup
Cleanup some issues with exec
2015-10-08 12:02:03 -07:00
Jess Frazelle
b5d914188e Merge pull request #16674 from coolljt0725/use_consistent_command_description
Use consistent command description
2015-10-08 12:01:16 -07:00
Jess Frazelle
9123f77a78 Merge pull request #16817 from cpuguy83/explicit_volume_ls
Make `docker volume` behave like `docker network`
2015-10-08 11:36:51 -07:00
Lei Jitang
2b0927c9ac Use consistent command description
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-08 08:46:21 -04:00
Morgan Bauer
1eecc1e7e5
refactor logs to not use internal data structures
- refactor to make it easier to split the api in the future
 - additional tests for non existent container case

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-10-07 15:44:16 -07:00
Morgan Bauer
77c592d26a
refactor daemon
- create pass through in daemon for access to functions on daemon
   member
 - import image
push image
export image and corrections
lookup image & comments
load image
list images
image history & comments

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-10-07 15:29:02 -07:00
Alexander Morozov
fb04043ca5 Refactor listenFD function
* fixed weird logic with "*"
* return error if fdNum is failed to parse
* check if listener at offset is nil
* close unused listeners

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-07 14:26:48 -07:00
Alexander Morozov
281a48d092 Return listenbuffer behavior
Now we're start to serve early, but all Accept calls are intercepted by
listenbuffer or systemd socket.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-07 14:18:42 -07:00
Arnaud Porterie
8e31036816 Merge pull request #16645 from mavenugo/ux
Docker Network UX & remote API changes
2015-10-07 10:44:58 -07:00
Brian Goff
2feebd95d3 Make docker volume behave like docker network
Before, typing `docker volume` with no args would forward to the handler
for `docker volume ls`, except the flags for the `ls` subcommand were
not supported.
Instead just print the cmd usage.

This makes the behavior of the `docker volume` subcommand behave exactly
like the `docker network` subcommand.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-07 13:36:46 -04:00
Madhu Venugopal
22a9ba090e Network UX and integration tests
* Exiting experimental network UX
* removed experimental service UX
* integrated with the new network remote API

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-07 03:54:27 -07:00
Madhu Venugopal
2ab94e11a2 Network remote APIs using new router, --net=<user-defined-network> changes
* Moving Network Remote APIs out of experimental
* --net can now accept user created networks using network drivers/plugins
* Removed the experimental services concept and --default-network option
* Neccessary backend changes to accomodate multiple networks per container
* Integration Tests

Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-07 03:54:19 -07:00
Brian Goff
2606a2e4d3 Merge pull request #16147 from tiborvass/refactor-builder
Refactor builder with new Go interfaces
2015-10-06 20:36:07 -04:00
Tibor Vass
e0ef11a4c2 Abstract builder and implement server-side dockerfile builder
This patch creates interfaces in builder/ for building Docker images.
It is a first step in a series of patches to remove the daemon
dependency on builder and later allow a client-side Dockerfile builder
as well as potential builder plugins.

It is needed because we cannot remove the /build API endpoint, so we
need to keep the server-side Dockerfile builder, but we also want to
reuse the same Dockerfile parser and evaluator for both server-side and
client-side.

builder/dockerfile/ and api/server/builder.go contain implementations
of those interfaces as a refactoring of the current code.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-06 19:10:19 -04:00
Jess Frazelle
c1c3475c6a Merge pull request #16786 from LK4D4/fix_systemd_serve
Remove wait on start channel for butts socket
2015-10-06 14:04:15 -07:00
Brian Goff
561005e5ca Cleanup some issues with exec
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-06 15:22:20 -04:00
Alexander Morozov
806e4c4a02 Remove wait on start channel for systemd socket
Because Serve will be called after daemon creation

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-05 17:41:25 -07:00
Doug Davis
cc833c5e2b Fix daemon logs so that "API listen on" is INFO not ERROR
W/o this PR the logs would show:
```
ERRO[0000] API listen on [::]:2375
ERRO[0000] API listen on /var/run/docker.sock
```
which is misleading since these aren't "errors" they're just informational.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-10-05 16:17:25 -07:00
Tibor Vass
f41230b93a Move builder files to builder/dockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-05 18:26:47 -04:00
Vincent Demeester
80f2e3f0c6 Merge pull request #16769 from LK4D4/fix_volume_socket
Allocate resources for server API before daemon creation
2015-10-05 20:48:41 +02:00
Alexander Morozov
5eda566f93 Allocate resources for server API before daemon creation
It prevents occupying of those resources (ports, unix-sockets) by
containers.
Also fixed false-positive test for that case.

Fix #15912

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-05 09:32:08 -07:00
Sebastiaan van Stijn
67eb810a60 Merge pull request #16744 from runcom/fix-mam-commandline
Fix man and commandline docs
2015-10-04 22:28:19 +02:00
Antonio Murdaca
14e8898648 Fix man and commandline docs
- missing help option in `docs/reference/commandline/*.md` (some files
  have it, the other I fixed didn't)
- missing `[OPTIONS]` in Usage description
- missing options
- formatting
- start/stop idempotence

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
2015-10-04 21:22:27 +02:00
Antonio Murdaca
e86291edd8 Merge pull request #16530 from dnephin/filter_events_by_label
Filter events by labels
2015-10-04 20:36:42 +02:00
Vincent Demeester
b78f66c472 Merge pull request #16509 from HuKeping/search-problem
Fix docker search problem
2015-10-04 18:21:32 +02:00
Hu Keping
f04e8fdb9b Fix docker search problem
Search terms shouldn't be restricted to only full valid repository
names. It should be perfectly valid to search using a part of a name,
even if it ends with a period, dash or underscore.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-10-04 23:23:43 +08:00
Antonio Murdaca
0e17547af2 Merge pull request #16735 from LK4D4/style_fix
Fix some style issues
2015-10-03 01:03:44 +02:00
Alexander Morozov
01112989b7 Fix some style issues
Just read code and saw inconsistencies in variable decls and stuff.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-02 13:39:33 -07:00
Daniel Nephin
08b117517d Resolves #16458 - filter events by labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-02 16:33:20 -04:00
Brian Goff
2d43d93410 Make exec start return proper error codes
Exec start was sending HTTP 500 for every error.

Fixed an error where pausing a container and then calling exec start
caused the daemon to freeze.

Updated API docs which incorrectly showed that a successful exec start
was an HTTP 201, in reality it is HTTP 200.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-02 14:40:22 -04:00
Lei Jitang
3fcf481361 Fix docker ps truncate long image name by default
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-02 22:56:42 +08:00
David Calavera
61634758c4 Extract api types to version packages.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-30 14:14:27 -04:00
David Calavera
da982cf551 Separate API router from server.
Implement basic interfaces to write custom routers that can be plugged
to the server. Remove server coupling with the daemon.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-29 19:43:03 -04:00
Tibor Vass
94e3b0f428 Use golang.org/x/net/context in api/server/
This patch removes the internal context package and uses golang's
package instead.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-09-29 17:40:55 -04:00
Tibor Vass
b08f071e18 Revert "Merge pull request #16228 from duglin/ContextualizeEvents"
Although having a request ID available throughout the codebase is very
valuable, the impact of requiring a Context as an argument to every
function in the codepath of an API request, is too significant and was
not properly understood at the time of the review.

Furthermore, mixing API-layer code with non-API-layer code makes the
latter usable only by API-layer code (one that has a notion of Context).

This reverts commit de41640435, reversing
changes made to 7daeecd42d.

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
2015-09-29 14:26:51 -04:00
Tibor Vass
79c31f4b13 Revert "Merge pull request #16567 from calavera/context_per_request"
This reverts commit ff92f45be4, reversing
changes made to 80e31df3b6.

Reverting to make the next revert easier.

Signed-off-by: Tibor Vass <tibor@docker.com>
2015-09-29 13:40:46 -04:00
Arnaud Porterie
7d193ef1f3 Add builtin nodes discovery
Use `pkg/discovery` to provide nodes discovery between daemon instances.

The functionality is driven by two different command-line flags: the
experimental `--cluster-store` (previously `--kv-store`) and
`--cluster-advertise`. It can be used in two ways by interested
components:

1. Externally by calling the `/info` API and examining the cluster store
   field. The `pkg/discovery` package can then be used to hit the same
   endpoint and watch for appearing or disappearing nodes. That is the
   method that will for example be used by Swarm.
2. Internally by using the `Daemon.discoveryWatcher` instance. That is
   the method that will for example be used by libnetwork.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-09-25 14:52:09 -07:00
Jess Frazelle
ff92f45be4 Merge pull request #16567 from calavera/context_per_request
Define a context per request.
2015-09-25 13:01:51 -07:00
Morgan Bauer
93bd57b0b2
refactor create to not expose internal data structures
- use existing exposed type

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
2015-09-25 09:35:18 -07:00
Ma Shimiao
6d25eb6e7c client/start: fix logic for discarded signal
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-09-25 11:25:29 +08:00
David Calavera
27c76522de Define a context per request.
Avoid creating a global context object that will be used while the daemon is running.

Not only this object won't ever be garbage collected, but it won't ever be used for anything else than creating other contexts in each request. I think it's a bad practive to have something like this sprawling aroud the code.

This change removes that global object and initializes a context in the cases we don't have already one, like shutting down the server.
This also removes a bunch of context arguments from functions that did nothing with it.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-24 18:44:53 -04:00
David Calavera
de41640435 Merge pull request #16228 from duglin/ContextualizeEvents
Add context.RequestID to event stream
2015-09-24 14:16:22 -07:00
Doug Davis
26b1064967 Add context.RequestID to event stream
This PR adds a "request ID" to each event generated, the 'docker events'
stream now looks like this:

```
2015-09-10T15:02:50.000000000-07:00 [reqid: c01e3534ddca] de7c5d4ca927253cf4e978ee9c4545161e406e9b5a14617efb52c658b249174a: (from ubuntu) create
```
Note the `[reqID: c01e3534ddca]` part, that's new.

Each HTTP request will generate its own unique ID. So, if you do a
`docker build` you'll see a series of events all with the same reqID.
This allow for log processing tools to determine which events are all related
to the same http request.

I didn't propigate the context to all possible funcs in the daemon,
I decided to just do the ones that needed it in order to get the reqID
into the events. I'd like to have people review this direction first, and
if we're ok with it then I'll make sure we're consistent about when
we pass around the context - IOW, make sure that all funcs at the same level
have a context passed in even if they don't call the log funcs - this will
ensure we're consistent w/o passing it around for all calls unnecessarily.

ping @icecrime @calavera @crosbymichael

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-24 11:56:37 -07:00
Ma Shimiao
19613feddf client/search: small logic fix
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-09-24 11:11:03 +08:00
Brian Goff
ebe7ef9fc2 Merge pull request #16411 from duglin/DaemonErrors
Move more 'daemon' errors to the new error package
2015-09-23 21:20:56 -04:00
Brian Goff
40e8560412 Merge pull request #16415 from HuKeping/dockerinfo
Format output of docker info
2015-09-23 21:15:23 -04:00