Commit graph

1552 commits

Author SHA1 Message Date
Stefan J. Wernli
09a9d216d9 Windows: Fixing longpath hanlding of UNC paths.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-09-30 19:36:08 -07:00
Brian Goff
92c1310f61 Merge pull request #16570 from duglin/ReaderFix
Make Close() on simpleReaderCloser actually close the reader
2015-09-29 12:55:03 -04:00
Arnaud Porterie
35c086fa6b Add pkg/discovery for nodes discovery
Absorb Swarm's discovery package in order to provide a common node
discovery mechanism to be used by both Swarm and networking code.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-09-25 13:33:23 -07:00
Jess Frazelle
fdd5ab2fc3 Merge pull request #16569 from brahmaroutu/ioutil_hang_gccgo
goroutine fairness is not guaranteed causing the hang with GCCGO (x86 GCCGO CI)
2015-09-25 10:24:13 -07:00
Srini Brahmaroutu
2d0927a08b goroutine fairness is not guaranteed causing the hang with GCCGO
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-09-25 14:40:16 +00:00
Doug Davis
83d0df9cdc Make Close() on simpleReaderCloser actually close the reader
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-24 20:22:59 -07:00
David Calavera
c0bd79f3f8 Merge pull request #16228 from duglin/ContextualizeEvents
Add context.RequestID to event stream
2015-09-24 14:16:22 -07:00
Jess Frazelle
ce0cf62ce0 Merge pull request #16559 from Microsoft/10662-fix16556
Fixes 16556 CI failures
2015-09-24 12:31:36 -07:00
Jess Frazelle
ad3c33e73d Merge pull request #14579 from hqhq/hq_add_softlimit
Add support for memory reservation
2015-09-24 12:11:36 -07:00
Doug Davis
cd4326596a 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
John Howard
ec75a8049c Fixes 16556 CI failures
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-24 11:19:00 -07:00
John Howard
b5e2a90aa3 TestRandomUnixTmpDirPath platform agnostic
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-24 09:37:07 -07:00
Jess Frazelle
f09705e6aa Merge pull request #16190 from LK4D4/drain_refactor
Refactoring of bufReader
2015-09-24 01:54:40 -07:00
Brian Goff
3e03208272 Merge pull request #16415 from HuKeping/dockerinfo
Format output of docker info
2015-09-23 21:15:23 -04:00
Tonis Tiigi
3c6dcfb6ca Make bytesPipe use linear allocations
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-09-23 17:12:54 -07:00
Alexandre Beslic
9e0bd3aca0 Merge pull request #16494 from calavera/fix_plugin_url_scheme
Do not hardcode http as plugin URL scheme for secure connections.
2015-09-23 16:18:00 -07:00
Alexander Morozov
46b458fe3b Refactor bufReader to use BytesPipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-23 16:00:28 -07:00
Alexander Morozov
434c274741 Add BytesPipe datastructure to ioutils
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-09-23 16:00:27 -07:00
Jess Frazelle
866815e91d Merge pull request #16500 from sergeyevstifeev/11584-pkg-stdcopy-test-coverage
Adding some more coverage to StdCopy to address #11584
2015-09-23 15:51:21 -07:00
Tibor Vass
22afd88a00 Merge pull request #16493 from cpuguy83/doc_plugin_rpcgen
Add README for pluginrpc-gen
2015-09-23 15:36:05 -04:00
Sergey Evstifeev
499745a729 Add StdCopy happy path test: both reading and writing
Signed-off-by: Sergey Evstifeev <sergey.evstifeev@gmail.com>
2015-09-23 17:27:32 +02:00
Hu Keping
0f16fb62e3 Format output of docker info
Format those info which will only be displayed when daemon is
in debug mode.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-23 14:35:13 +08:00
qhuang
f0bff37edc Add support for memory reservation
Signed-off-by: qhuang <qhuang@10.0.2.15>
2015-09-23 14:02:45 +08:00
Brian Goff
3b036bd029 Add README for pluginrpc-gen
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-22 19:34:44 -04:00
David Calavera
f624804e8f Do not hardcode http as plugin URL scheme for secure connections.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-22 15:54:29 -04:00
Antonio Murdaca
c8e890aa4b Merge pull request #16444 from fgimenez/11584-pkg-stdcopy-test-coverage
Added tests for Write
2015-09-22 14:28:14 +02:00
Federico Gimenez
2ef06c2b56 Added tests for StdWriter.Write.
The tests added cover the case when the Writer field returns and error
and, related to that, when the number of written bytes is less than 0.

Signed-off-by: Federico Gimenez <fgimenez@coit.es>
2015-09-22 09:05:22 +02:00
Antonio Murdaca
30ae8b046b pkg: integration: utils_test: fix int format
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-20 02:42:08 +02:00
Jess Frazelle
a6d3018c00 Merge pull request #16405 from michaelhuettermann/master
Adding another scientist to the hall of fame.
2015-09-18 16:09:01 -07:00
John Howard
9017024f6e Windows: Fix warning on info
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-18 13:39:12 -07:00
michaelhuettermann
7288198da6 Adding another scientist to the hall of fame.
Signed-off-by: Michael Hüttermann <michael@huettermann.net>
2015-09-18 21:31:12 +02:00
Vincent Batts
511ee61980 events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-09-18 13:15:26 -04:00
David Calavera
8b9b50396c Merge pull request #15898 from Microsoft/15775-buildcontextfix
Windows: Fix long path handling for docker build
2015-09-17 09:19:23 -07:00
Antonio Murdaca
b7aa7dcdeb Skip racey TestDockerCmdInDirWithTimeout
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-17 15:30:07 +02:00
Brian Goff
c44ac99292 Skip racey TestDockerCmdWithTimeout
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-16 18:36:35 -04:00
Brian Goff
fdcdc04837 Merge pull request #16261 from vdemeester/integration-dockercmd
Move dockerCmd to pkg/integration and add tests to it
2015-09-16 17:40:33 -04:00
Christian Rotzoll
3f417b0769 Remove unused variable, fix #16310
Signed-off-by: Christian Rotzoll <ch.rotzoll@gmail.com>
2015-09-15 22:20:10 +02:00
Stefan J. Wernli
fe637416e9 Windows: Fix long path handling for docker build
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-09-15 10:58:11 -07:00
Vincent Demeester
e37dae1be4 Move dockerCmd… to pkg/integration…
… and add some tests on them.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-13 13:09:04 +02:00
Aaron Lehmann
5bebf3cbac Make Broadcaster Wait function wait for all writers to finish before returning
Also, use the channel to determine if the broadcaster is closed,
removing the redundant isClosed variable.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-11 10:54:40 -07:00
Aaron Lehmann
572a785718 Fix race condition when waiting for a concurrent layer pull
Before, this only waited for the download to complete. There was no
guarantee that the layer had been registered in the graph and was ready
use. This is especially problematic with v2 pulls, which wait for all
downloads before extracting layers.

Change Broadcaster to allow an error value to be propagated from Close
to the waiters.

Make the wait stop when the extraction is finished, rather than just the
download.

This also fixes v2 layer downloads to prefix the pool key with "layer:"
instead of "img:". "img:" is the wrong prefix, because this is what v1
uses for entire images. A v1 pull waiting for one of these operations to
finish would only wait for that particular layer, not all its
dependencies.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-11 10:52:34 -07:00
Jess Frazelle
975bd63ecd Merge pull request #16026 from vdemeester/integration-cli-utils-tests
Add unit tests for integration cli utils.go functions
2015-09-11 10:21:09 -07:00
David Calavera
1870f91823 Merge pull request #15307 from calavera/stop_signal
Signal to stop a container.
2015-09-11 09:25:18 -07:00
Brian Goff
3f268f7166 Merge pull request #16226 from aaronlehmann/broadcaster-catch-up
Broadcaster writer goroutines must only finish when they are caught up
2015-09-10 22:55:44 -04:00
David Calavera
cc9407ba0d Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 19:56:05 -04:00
Aaron Lehmann
0a0831ff0d Broadcaster writer goroutines must only finish when they are caught up
Without this change, there was a narrow race condition that would allow
writers to finish when there was still data left to write. This is
likely to be what was causing some integration tests to fail with
truncated pull output.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-10 14:58:06 -07:00
Brian Goff
48e15d83d2 Merge pull request #16086 from cezarsa/full_stack_dump
Ensure goroutines dump is not truncated
2015-09-10 11:16:28 -04:00
Brian Goff
6231b0f8eb Merge pull request #16104 from vdemeester/httputils-withmock
Update httputils tests
2015-09-10 11:00:17 -04:00
Antonio Murdaca
7ac0286ce7 pkg: devicemapper: fix typo in function declaration
6990b76a696dd265674f4c2973f25755a6485f05 introduced a typo in function
declaration, this patch fixes that.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-09 15:57:52 +02:00
Vincent Demeester
eb5e685405 Add unit tests for integration cli utils function
- utils_test.go and docker_utils_test.go
- Moved docker related function to docker_utils.go
- add a test for integration-cli/checker

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-09 15:36:44 +02:00