Commit Graph

1485 Commits

Author SHA1 Message Date
469c5478aa 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>
Upstream-commit: 4a5d40fdb7896282a1d8b4069a8384ff0af40bed
Component: engine
2015-09-11 10:54:40 -07:00
e7b8d5068c 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>
Upstream-commit: 23e68679f080fee7ceb25cf791832f523a3a024a
Component: engine
2015-09-11 10:52:34 -07:00
128f497a4a Merge pull request #16026 from vdemeester/integration-cli-utils-tests
Add unit tests for integration cli utils.go functions
Upstream-commit: 335689118bfb0451885221a9706d01c7d3c2bda6
Component: engine
2015-09-11 10:21:09 -07:00
811680bcf5 Merge pull request #15307 from calavera/stop_signal
Signal to stop a container.
Upstream-commit: db54c79d7cd4ca055f9a1ddf4198cdcba9eb7d46
Component: engine
2015-09-11 09:25:18 -07:00
665a3fd69c Merge pull request #16226 from aaronlehmann/broadcaster-catch-up
Broadcaster writer goroutines must only finish when they are caught up
Upstream-commit: 7064fe283f1d63785f2812b8a23c8b4d80b58178
Component: engine
2015-09-10 22:55:44 -04:00
d563cc164c 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>
Upstream-commit: 0e50d946a25beb134bce2aaf4a209b5cfcbacf8f
Component: engine
2015-09-10 19:56:05 -04:00
b0cc871982 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>
Upstream-commit: 947519bfb31024ea8c76e8e303f2c338b00265f2
Component: engine
2015-09-10 14:58:06 -07:00
12562031e9 Merge pull request #16086 from cezarsa/full_stack_dump
Ensure goroutines dump is not truncated
Upstream-commit: c8dc729af41f8b10ea4cc42e1ae12b0966e66e1d
Component: engine
2015-09-10 11:16:28 -04:00
353e9fa1d4 Merge pull request #16104 from vdemeester/httputils-withmock
Update httputils tests
Upstream-commit: 08a2e475bc4d012e5eac43ea4556753ad16354b1
Component: engine
2015-09-10 11:00:17 -04:00
2126535e6d 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>
Upstream-commit: d4a123b20b4f8fb1858f3cf411b3695353c0a973
Component: engine
2015-09-09 15:57:52 +02:00
3d19f9af55 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>
Upstream-commit: 5109071706cab06257b21172627ce51e5fa3a88c
Component: engine
2015-09-09 15:36:44 +02:00
e738ec47f9 Update httputils tests
- Make sure we use httptest instead of depending on network
- Update resumablerequestreader tests

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5c80c3fb3c38dcf5b19dd728f17473519c5cdca3
Component: engine
2015-09-09 14:59:25 +02:00
fcbe186c1d Update validate-lint to find go files by itself
… and fixes the last bits that were missing :3.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0c70eb83813af6d5266769bc908593f9660b13f1
Component: engine
2015-09-08 22:07:42 +02:00
05ac4217a0 Lint package pkg/devicemapper
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6990b76a696dd265674f4c2973f25755a6485f05
Component: engine
2015-09-05 23:15:13 +02:00
954de3578f Lint package pkg/plugins/pluginrpc-gen
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 915d6ec76d159a49082157be63d365f9b238d130
Component: engine
2015-09-05 23:15:13 +02:00
721651d0df Ensure goroutines dump is not truncated
Calling runtime.Stack requires the buffer to be big enough to fit the
goroutines dump. If it's not big enough the dump will be truncated and
the value returned will be the same size as the buffer.

The code was changed to handle this situation and try again with a
bigger buffer. Each time the dump doesn't fit in the buffer its size is
doubled.

Signed-off-by: Cezar Sa Espinola <cezarsa@gmail.com>
Upstream-commit: e787296c75c15d1a4d32474432f674d6d58ee4c1
Component: engine
2015-09-04 14:50:37 -03:00
35638190ef Merge pull request #16054 from jfrazelle/update-sqlite3-dep
code.google.com is shutting down so update the dep
Upstream-commit: 38ecc7fc32ba2acdb95559292d4a7aed5b1cbabe
Component: engine
2015-09-03 19:20:57 -07:00
4de5cdb2f1 code.google.com is shutting down so update the dep
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 4a864a755240709612f564f64839604a0697e11f
Component: engine
2015-09-03 17:39:29 -07:00
7db3a64e57 Merge pull request #16060 from vdemeester/14756-lint-pkg-term-windows
Lint pkg/term/windows package
Upstream-commit: 07d2eae6d57ecdac82fa41ad342b6bb21d537848
Component: engine
2015-09-03 19:54:20 -04:00
32bca980ee Merge pull request #16022 from nalind/cgo-windows
Fix a daemon build error when cgo isn't available
Upstream-commit: f0a5d03400429c6e97efacdb50d175c3fd85ba63
Component: engine
2015-09-03 18:42:58 -04:00
ff114b4d32 Lint pkg/term/windows package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3409de971c7bd3c84c324d19f422fcb3c6777f02
Component: engine
2015-09-03 22:25:52 +02:00
87f00c9aac Fix a daemon build error when cgo isn't available
Avoid duplicate definitions of NewSqliteConn when cgo isn't enabled, so
that we can at least build the daemon.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
Upstream-commit: 00ab6d9d471ccaa4a66395e747eadb6eeb5dd3f5
Component: engine
2015-09-02 11:41:42 -04:00
262b85d1ce Remove PortMapping from container NetworkSettings
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: db4f20404d2b8c4da5a15e447f52cd634445cfe3
Component: engine
2015-09-02 14:32:53 +02:00
49cb61bb67 Merge pull request #15921 from srust/volume_driver_register_retry
Retry registering a volume driver
Upstream-commit: 1ed3cb2b6c47d7e3d83882181346f0b9708f3e2c
Component: engine
2015-09-02 11:24:52 +02:00
16c77243f1 Normalized, ungrouped, and sorted names
Signed-off-by: Todd Crane <todd@toddcrane.com>
Upstream-commit: ed14fe2afa77120d07676f30ff61db93ecd38ec9
Component: engine
2015-09-01 21:57:01 -07:00
3ce116129d Retry registering a volume driver
Signed-off-by: Stephen Rust <srust@blockbridge.com>
Upstream-commit: 45fdce8a0d36d9b0825a6dfb6634a81f9af258af
Component: engine
2015-09-01 14:56:29 -04:00
98ff0ef802 pkg: stringutils: Add more tests to strslice
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: cac8f4f0d057dd89fd2ef16e3a58e96d2fee2e70
Component: engine
2015-09-01 20:27:45 +02:00
49e7160994 Windows: Fix absolute checks
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 49c1b51ae22e54edc2e13f3195583e47b987fc15
Component: engine
2015-09-01 08:41:37 -07:00
c60fcca7ee Merge pull request #15913 from mountkin/abstract
abstract the string slice struct to stringutils package
Upstream-commit: 4bb2449188a7d09de5fd35d1be4b35dd5780c825
Component: engine
2015-09-01 17:06:13 +02:00
1f4c9f858c Merge pull request #15927 from SvenDowideit/clean-up-parsehost
Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
Upstream-commit: 5eb4a6b93357d73fa0ec9c952114c0d225be8524
Component: engine
2015-09-01 08:25:59 -04:00
472d3d817f Merge pull request #15922 from unclejack/lower_reset_timeout_bufreader
pkg/ioutils: lower bufReader reset timeout
Upstream-commit: 3bd8016259711c951bd9b2023c176f7825c5d56c
Component: engine
2015-08-31 18:43:45 +02:00
4e8cadcb64 Merge pull request #15489 from aaronlehmann/pull-updates
Show pull progress in terminal for inflight pull requests
Upstream-commit: 84614fdae00fbdb66b5ae6de1c8246c470ef4f5c
Component: engine
2015-08-31 09:37:33 -07:00
5a287b0f3a Change ParseTCPAddr to use tcp://127.0.0.0:2375 format as default consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: 3d510f15da32a98a22f84a0f1afa250cc277488d
Component: engine
2015-08-29 11:23:51 +00:00
7981f6d0c0 pkg/ioutils: lower bufReader reset timeout
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: f9df813a992505ba2b37fad843ab943347d3ef11
Component: engine
2015-08-28 23:13:02 +03:00
ff33b3e79f More httputil tests for the docker header
follow-on to #15911

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 5e540bdc132669dfb8c13ae2796104a03aca6287
Component: engine
2015-08-28 12:16:37 -07:00
7ee1aa79e9 Make the broadcaster write messages to the observers in the same units they were written to the broadcaster
This means the writing to a WriteFlusher will flush in the same places
as it would if the broadcaster wasn't sitting in front of it.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 317a5462e428fab6248fe3b028822250c8c9ff7f
Component: engine
2015-08-28 10:09:00 -07:00
6190aee4a2 abstract the string slice struct to stringutils package
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: ea4a06740b6d4579f77507c1d7e0897a870fd72d
Component: engine
2015-08-29 01:08:40 +08:00
aa8f27039b Merge pull request #15902 from SvenDowideit/add-more-tests-for-parsehost
Exploring the parsehost using unit tests
Upstream-commit: 50bcf17c39e96c1032eac9e8a450533f84129220
Component: engine
2015-08-28 09:14:35 -07:00
ed84a12688 Fix server header parsing.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 243f98ff6de7aa16319be25c57ef1d910dfb6770
Component: engine
2015-08-28 11:06:24 -04:00
51511f9e16 unit test refactor in pkg/httputils as suggested by vdemeester; using pattern if x := …; x == nil {}
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit c3f1b2a5bd4a4330bcbad401c316af90925b99ad)
Upstream-commit: f753f6d597efb218d4b5786b9a4f09b6e73b48bc
Component: engine
2015-08-28 10:41:19 -04:00
208ac7a049 Increased test coverage of httputils to 70 %
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit d71817464e859cd323d6cdaf4dec5a9dd530f57e)
Upstream-commit: b3f999e86331b3c19572a88b5e123ea961ac54fb
Component: engine
2015-08-28 10:41:19 -04:00
d04df77c91 Exploring the code using unit tests - these 2 functions do not work consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
Upstream-commit: e48a22282897c4755552fd79bf0d7af220116dc9
Component: engine
2015-08-28 10:29:52 +00:00
d4bbf5d640 Clean up ProgressStatus
- Rename to Broadcaster

- Document exported types

- Change Wait function to just wait. Writing a message to the writer and
  adding the writer to the observers list are now handled by separate
  function calls.

- Avoid importing logrus (the condition where it was used should never
  happen, anyway).

- Make writes non-blocking

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 26c9b585042ac7dce8db83478a69fd01a4b003d7
Component: engine
2015-08-27 13:22:08 -07:00
2b816e64e2 Show pull progress in terminal for inflight pull requests
Based on #12874 from Sam Abed <sam.abed@gmail.com>. His original commit
was brought up to date by manually porting the changes in pull.go into
the new code in pull_v1.go and pull_v2.go.

Fixes #8385

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 572f008e892b06262963ccb75c631f2f5d6c6fcd
Component: engine
2015-08-27 11:18:40 -07:00
4602da3b1b Merge pull request #15493 from stevvooe/no-buffer-on-push
Avoid buffering to tempfile when pushing with V2
Upstream-commit: 70a814c3f378a5873aedf3be85397272de4f6672
Component: engine
2015-08-26 13:59:01 -07:00
20b02657f2 Merge pull request #15865 from Microsoft/10662-isabs
Windows: Fix use of IsAbs check
Upstream-commit: 47cdae243a7e0108d487e88cab966ff09e8d94c0
Component: engine
2015-08-26 13:29:24 -07:00
799fa64220 Windows: Fix use of IsAbs check
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f11ba3135b19006a47cf80861f3c291a3211eb1e
Component: engine
2015-08-26 12:38:28 -07:00
bfe1bbc7d2 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b3b7eb2723461b1eb4be692f4bced0ae8ea9cb58
Component: engine
2015-08-26 13:37:52 -04:00
c4be78888c tarsum: add a big fat warning
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 459451de8b6760034dd4bf7a782b7875441254a5
Component: engine
2015-08-25 16:50:08 -04:00
78b5767538 Avoid buffering to tempfile when pushing with V2
The practice of buffering to a tempfile during a pushing contributes massively
to slow V2 push performance perception. The protocol was actually designed to
avoid precalculation, supporting cut-through data push. This means we can
assemble the layer, calculate its digest and push to the remote endpoint, all
at the same time.

This should increase performance massively on systems with slow disks or IO
bottlenecks.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 349aef06d51a9425f70a877585fe45283366c2c4
Component: engine
2015-08-24 18:08:05 -07:00