Commit Graph

371 Commits

Author SHA1 Message Date
407bf841c2 graph: remove unused functions parameters
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 723f587b56b940ac5ea79e567b47da91270955b1
Component: engine
2015-09-15 15:34:15 +02:00
943e453907 Merge pull request #16197 from aaronlehmann/carry-15539
Carry #15539: Avoid redundant HEAD requests on push
Upstream-commit: 58d6919183f9e796b1d3462fa79ce30fc0b72082
Component: engine
2015-09-14 17:15:32 -07:00
6b4c313413 Merge pull request #15886 from xiekeyang/master
Fix: Docker Daemon didn't send actual actions client ask for to Token Server
Upstream-commit: d25dada639fe475ff6496b1d357d2250a0e014e3
Component: engine
2015-09-14 09:47:19 -07:00
189e37d591 Remove io.Pipe used for download progress
The original purpose of this was to cancel downloads if pullV2Tag
returns an error, preventing an associated crash (see #15353). The
broadcaster now accomplishes the same thing that the pipe does, making
the pipe redundant. When pullV2Tag returns, all broadcasters are closed,
which means all further writes to those broadcasters will return errors.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 50c355777e31c08d3a97ec70b67bbe5a3bc883af
Component: engine
2015-09-11 10:54:40 -07:00
0534c3bd2c Fix races accessing d.poolKey and d.tmpFile when pullV2Tag returns
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 64faec8269f33be3ac3f3a80322a619668bcb9d5
Component: engine
2015-09-11 10:54:35 -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
eae23b07ab Fix layer exclusion bug on multiple tag push
Ensure that layers are not excluded from manifests based on previous pushes.
Continue skipping pushes on layers which were pushed by a previous tag.

Update push multiple tag tests.
Ensure that each tag pushed exists on the registry and is pullable.
Add output comparison on multiple tag push check.

fixes #15536

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a0d9ffd6f70fdbbc392b31fe1a230bec3ce58df0
Component: engine
2015-09-10 18:08:59 -07:00
9f56a7069d Added tags list to /images/:id/json api.
It closes #10139.

Signed-off-by: Rozhnov Alexandr <nox73@ya.ru>
Upstream-commit: e9e68fa2d29a5e3053fb876b19b5ac5bc6d1c222
Component: engine
2015-09-10 11:55:01 +03:00
7b6e69864b We don't need image layer stream when create the rootfs
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: f70c592137833cae83e4ba05f760465200829975
Component: engine
2015-09-09 20:31:08 +08:00
e87532e652 Kind of typo
It seems the author foget to change the variable name after copying
from the valid testcase.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: fd5c33194ca6ff0851925bf1efe386a5375362a5
Component: engine
2015-09-09 19:03:53 +08:00
0d3b198734 Refactor some code to use simply format
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: cd33b98041385a2b96edfa7705f1d512a14d3f92
Component: engine
2015-09-06 20:59:09 +08:00
075e783df0 Fix goroutine leak on pull
Close the pipeWriter even if there was no error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 3037e4f7c4eec06cf3a5afca6f58ec58b4bdd63e
Component: engine
2015-08-31 15:56:19 -07: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
e9d8afb4a3 Fix: Docker Daemon didn't send actual actions client ask for to Token Server
The Docker Daemon should send actual actions client ask for to issue tokens,

not all the permissions that client is guaranteed.

Signed-off-by: xiekeyang <xiekeyang@huawei.com>
Upstream-commit: e451ddbf4657cbe72f539e1f9513a5bc3a31f3d6
Component: engine
2015-08-30 16:40:26 +08:00
f6d5f51a76 [daemon] Refactor image_delete.go
This file was not well documented and had very high cyclomatic complexity.
This patch completely rearranges this file and the ImageDelete method to
be easier to follow and more maintainable in the future.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 111d2f348767692a34366ff5cd01f607cf54ad57
Component: engine
2015-08-28 11:01:24 -07:00
49179849ea Remove "...already being pulled" messages
These don't get seen, so they are unnecessary.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 9b9d70ad271b46a67bde57b8a807121f6e85b75f
Component: engine
2015-08-27 13:22:08 -07: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
9802667a69 Merge pull request #15882 from vdemeester/14756-lint-opts-trust
Carry #14813 on linting package opts and trust
Upstream-commit: ba019dc0d0a89b3152fc3791495af2ddf18e173d
Component: engine
2015-08-27 15:58:13 -04:00
4366d3278e Change poolAdd to return a boolean instead of an error
Previously, its other return value was used even when it returned an
error. This is awkward and goes against the convention. It also could
have resulted in a nil pointer dereference when an error was returned
because of an unknown pool type. This changes the unknown pool type
error to a panic (since the pool types are hardcoded at call sites and
must always be "push" or "pull"), and returns a "found" boolean instead
of an error.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 80513d85cfc0e46f8202fc3030f11052bbfeea7a
Component: engine
2015-08-27 11:18:42 -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
bab25931f6 Merge pull request #15646 from tonistiigi/15589-pull-cancellation
Fix pull on client disconnect
Upstream-commit: 0634c653d5214c7d8e5f1a154ce35d40ac8d25d7
Component: engine
2015-08-27 17:54:08 +02:00
a8d6119113 Finish linting opts and trust package.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0bd016b1c31f807169019d10a496144c34698431
Component: engine
2015-08-27 17:36:11 +02:00
cd1363a47b golint: trust
contributes to #14756

Signed-off-by: Sevki Hasirci <s@sevki.org>
Upstream-commit: 5572148477ad069989bc3301e662cd6ee44832d2
Component: engine
2015-08-27 11:40:27 +02: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
15378abfc2 adding message option to the import subcommand
Signed-off-by: Taylor Jones <monitorjbl@gmail.com>
Upstream-commit: 936b2c6afe490b562df4ebea854b116c3b40a9f5
Component: engine
2015-08-25 02:55:04 +00: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
69dbe5953f Merge pull request #15393 from azurezk/exportImage-toplevel
change exportImage to top-level func
Upstream-commit: 82e2dec06de63d85db14c954e472deffdd18c5b7
Component: engine
2015-08-24 14:35:55 -07:00
a45c2b3952 Merge pull request #15756 from tonistiigi/15724-remove-nil-contexts
Remove nil contexts
Upstream-commit: 25f4f5588e1b862f1f26a2e4edb57807a9affda4
Component: engine
2015-08-24 14:29:48 -07:00
32eed5b907 Mitigate parallel pull issues
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b779bc31022fddd165ac7d919cb06d78288a93c9
Component: engine
2015-08-24 11:41:45 -07:00
84c411f6f2 Merge pull request #15735 from tonistiigi/graph-register-readcloser
Make graph.Register take in io.Reader
Upstream-commit: 1544c5edb6fc796918a0bc2968a48df4e23a9fdb
Component: engine
2015-08-24 10:40:04 -07:00
9c87b64804 Remove nil contexts
Causes daemon panic because loggers can’t be found.

Fixes #15724

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0c08913d523da2a935e65ade93884194c1906991
Component: engine
2015-08-21 10:31:27 -07:00
aa86f75147 Merge pull request #15754 from mountkin/fix-return
modify a return value in graph/tags.go to increase readability
Upstream-commit: 85bef48bf5a0c781cfa6418fa63318a94032efc7
Component: engine
2015-08-21 10:55:50 -04:00
226177670d modify a return value in graph/tags.go to increase readability
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: f11b7acc73b333eb480d2520f703f0a9c50d0a0e
Component: engine
2015-08-21 21:36:30 +08:00
d84f50c157 Make graph.Register take in io.Reader
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 2d1158790dc56df6d2b39a9c94acf34d62299b91
Component: engine
2015-08-20 20:37:11 -07:00
2a748ae2e6 Fix pull on client disconnect
Fixes #15589

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8eeafa058c762b303436422a4682c364fe469985
Component: engine
2015-08-18 09:41:37 -07:00
73f39654a9 Windows: Graph remove custom interface and add central store
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>

Windows: add support for images stored in alternate location.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: dfbb5520e3b35030f3eef38d5a2d86ad20ea0a2f
Component: engine
2015-08-14 23:45:53 -07:00
da97ba6880 Merge pull request #15545 from LK4D4/refactor_pullv2
Refactoring of pullV2Tag
Upstream-commit: b93d99b25d2d0797d985c4529292435c74da75c3
Component: engine
2015-08-13 15:52:14 -07:00
f1cc5568e9 Merge pull request #13501 from vdemeester/8048-image-repository-tag
Fix #8048 : make `docker images repository:tag` work
Upstream-commit: c6c195a465652e96b06e76b44a1df075cba9ad80
Component: engine
2015-08-13 21:36:21 +02:00
8771bcf9d5 Refactoring of pullV2Tag
* use downloadInfo pointers everywhere
* use downloads slice only for things that we really download
* cleanup tmp files in all cases

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9b2426c606b92fa37b7484d9d884edd43352b69c
Component: engine
2015-08-13 11:50:19 -07:00
b52277b7fd fix a typo in graph/graph.go
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 883fcfe4256d5d5bf1b3bfbced61fa585fe07a73
Component: engine
2015-08-13 20:01:43 +08:00
d024131050 Fix #8048 : make docker images repository:tag work
Make command like "docker images ubuntu:14.04" work and filter out the
image with the given tag.

Closes #8048.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 4fb88d2e11f2f16c520b36e4c6e00db44ae26b8c
Component: engine
2015-08-13 08:50:09 +02:00
6585a8728e Revert #14884
This reverts commit 810d3b2642d4a82dc186d6eff8c2e487ee624bc5.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 4f3b0d0f4ad046a5180f524ba320990c67282dd0
Component: engine
2015-08-12 18:46:48 -07:00
33a35ed586 change exportImage to top-level func
Signed-off-by: Kun Zhang <zkazure@gmail.com>

remove useless FIXME

Signed-off-by: Kun Zhang <zkazure@gmail.com>

fix

Signed-off-by: Kun Zhang <zkazure@gmail.com>
Upstream-commit: a7c00bc1a23571dbd5e0085aac22a0e5b0d5fe40
Component: engine
2015-08-10 22:18:57 +08:00
c8706706f4 Merge pull request #14897 from WeiZhang555/golint-api-types
fix golint warnings/errors on package api/types/
Upstream-commit: 0a0e9701f7bbe58e75eff9d1934fde0a5038ee9c
Component: engine
2015-08-07 10:51:27 -07:00
8778d71536 Merge pull request #14828 from brahmaroutu/lint_graph_tags
/graph/tag fix lint errors/warnings
Upstream-commit: b1009d1fdd551a57e7c266d9cc8122ed3f80aa2c
Component: engine
2015-08-07 10:49:26 -07:00
502a6d4faf fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 3d6617ffe7d9242107ac09eab4f2d8ce87acb95c
Component: engine
2015-08-07 09:43:43 +08:00
9970a2eed5 registry: Do not push to mirrors
This patch splits LookupEndpoints into LookupPullEndpoints and
LookupPushEndpoints so that mirrors added with --registry-mirror are
skipped in the list returned by LookupPushEndpoints.

Fixes https://github.com/docker/distribution/issues/823

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: b899977ee283d6bccf35ad9a079ed92a291ad34c
Component: engine
2015-08-06 17:41:59 -04:00
fc48931914 [graph] Use a pipe for downloads to write progress
The process of pulling an image spawns a new goroutine for each layer in the
image manifest. If any of these downloads fail we would stop everything and
return the error, even though other goroutines would still be running and
writing output through a progress reader which is attached to an http response
writer. Since the request handler had already returned from the first error,
the http server panics when one of these download goroutines makes a write to
the response writer buffer.

This patch prevents this crash in the daemon http server by waiting for all of
the download goroutines to complete, even if one of them fails. Only then does
it return, terminating the request handler.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: d80c4244d322fe0a9cbdd996d23e37fb5b089544
Component: engine
2015-08-05 18:13:39 -07:00
9d9a4fd0c0 Merge pull request #15252 from coolljt0725/14765_enable_golint_3
Enable golint in pkg/archive
Upstream-commit: 8534090476b6eae66f1eca81e8bc0e0c61ed7197
Component: engine
2015-08-05 19:27:48 -04:00
65b70bf683 /graph/tag fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: d9b261221aa6ada89a2dac3e535cb1d48be37cad
Component: engine
2015-08-05 17:46:41 +00:00