Commit graph

368 commits

Author SHA1 Message Date
David Calavera
d25dada639 Merge pull request #15886 from xiekeyang/master
Fix: Docker Daemon didn't send actual actions client ask for to Token Server
2015-09-14 09:47:19 -07:00
Aaron Lehmann
50c355777e 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>
2015-09-11 10:54:40 -07:00
Aaron Lehmann
64faec8269 Fix races accessing d.poolKey and d.tmpFile when pullV2Tag returns
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-09-11 10:54:35 -07:00
Aaron Lehmann
23e68679f0 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
Rozhnov Alexandr
e9e68fa2d2 Added tags list to /images/:id/json api.
It closes #10139.

Signed-off-by: Rozhnov Alexandr <nox73@ya.ru>
2015-09-10 11:55:01 +03:00
Hu Keping
f70c592137 We don't need image layer stream when create the rootfs
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-09 20:31:08 +08:00
Hu Keping
fd5c33194c 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>
2015-09-09 19:03:53 +08:00
Hu Keping
cd33b98041 Refactor some code to use simply format
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-06 20:59:09 +08:00
Tonis Tiigi
3037e4f7c4 Fix goroutine leak on pull
Close the pipeWriter even if there was no error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-31 15:56:19 -07:00
Arnaud Porterie
84614fdae0 Merge pull request #15489 from aaronlehmann/pull-updates
Show pull progress in terminal for inflight pull requests
2015-08-31 09:37:33 -07:00
xiekeyang
e451ddbf46 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>
2015-08-30 16:40:26 +08:00
Josh Hawn
111d2f3487 [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)
2015-08-28 11:01:24 -07:00
Aaron Lehmann
9b9d70ad27 Remove "...already being pulled" messages
These don't get seen, so they are unnecessary.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-27 13:22:08 -07:00
Aaron Lehmann
26c9b58504 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>
2015-08-27 13:22:08 -07:00
Brian Goff
ba019dc0d0 Merge pull request #15882 from vdemeester/14756-lint-opts-trust
Carry #14813 on linting package opts and trust
2015-08-27 15:58:13 -04:00
Aaron Lehmann
80513d85cf 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>
2015-08-27 11:18:42 -07:00
Sam Abed
572f008e89 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>
2015-08-27 11:18:40 -07:00
David Calavera
0634c653d5 Merge pull request #15646 from tonistiigi/15589-pull-cancellation
Fix pull on client disconnect
2015-08-27 17:54:08 +02:00
Vincent Demeester
0bd016b1c3 Finish linting opts and trust package.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-08-27 17:36:11 +02:00
Sevki Hasirci
5572148477 golint: trust
contributes to #14756

Signed-off-by: Sevki Hasirci <s@sevki.org>
2015-08-27 11:40:27 +02:00
Alexander Morozov
70a814c3f3 Merge pull request #15493 from stevvooe/no-buffer-on-push
Avoid buffering to tempfile when pushing with V2
2015-08-26 13:59:01 -07:00
Taylor Jones
936b2c6afe adding message option to the import subcommand
Signed-off-by: Taylor Jones <monitorjbl@gmail.com>
2015-08-25 02:55:04 +00:00
Stephen J Day
349aef06d5 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>
2015-08-24 18:08:05 -07:00
Jessie Frazelle
82e2dec06d Merge pull request #15393 from azurezk/exportImage-toplevel
change exportImage to top-level func
2015-08-24 14:35:55 -07:00
Jessie Frazelle
25f4f5588e Merge pull request #15756 from tonistiigi/15724-remove-nil-contexts
Remove nil contexts
2015-08-24 14:29:48 -07:00
Tonis Tiigi
b779bc3102 Mitigate parallel pull issues
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-24 11:41:45 -07:00
Alexander Morozov
1544c5edb6 Merge pull request #15735 from tonistiigi/graph-register-readcloser
Make graph.Register take in io.Reader
2015-08-24 10:40:04 -07:00
Tonis Tiigi
0c08913d52 Remove nil contexts
Causes daemon panic because loggers can’t be found.

Fixes #15724

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-21 10:31:27 -07:00
Brian Goff
85bef48bf5 Merge pull request #15754 from mountkin/fix-return
modify a return value in graph/tags.go to increase readability
2015-08-21 10:55:50 -04:00
Shijiang Wei
f11b7acc73 modify a return value in graph/tags.go to increase readability
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-21 21:36:30 +08:00
Tonis Tiigi
2d1158790d Make graph.Register take in io.Reader
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-20 20:37:11 -07:00
Tonis Tiigi
8eeafa058c Fix pull on client disconnect
Fixes #15589

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-08-18 09:41:37 -07:00
Stefan J. Wernli
dfbb5520e3 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>
2015-08-14 23:45:53 -07:00
Jessie Frazelle
b93d99b25d Merge pull request #15545 from LK4D4/refactor_pullv2
Refactoring of pullV2Tag
2015-08-13 15:52:14 -07:00
Sebastiaan van Stijn
c6c195a465 Merge pull request #13501 from vdemeester/8048-image-repository-tag
Fix #8048 : make `docker images repository:tag` work
2015-08-13 21:36:21 +02:00
Alexander Morozov
9b2426c606 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>
2015-08-13 11:50:19 -07:00
Liu Hua
883fcfe425 fix a typo in graph/graph.go
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2015-08-13 20:01:43 +08:00
Vincent Demeester
4fb88d2e11 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>
2015-08-13 08:50:09 +02:00
Arnaud Porterie
4f3b0d0f4a Revert #14884
This reverts commit 810d3b2642.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-08-12 18:46:48 -07:00
Kun Zhang
a7c00bc1a2 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>
2015-08-10 22:18:57 +08:00
David Calavera
0a0e9701f7 Merge pull request #14897 from WeiZhang555/golint-api-types
fix golint warnings/errors on package api/types/
2015-08-07 10:51:27 -07:00
David Calavera
b1009d1fdd Merge pull request #14828 from brahmaroutu/lint_graph_tags
/graph/tag fix lint errors/warnings
2015-08-07 10:49:26 -07:00
Zhang Wei
3d6617ffe7 fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-07 09:43:43 +08:00
Tibor Vass
b899977ee2 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>
2015-08-06 17:41:59 -04:00
Josh Hawn
d80c4244d3 [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)
2015-08-05 18:13:39 -07:00
Tibor Vass
8534090476 Merge pull request #15252 from coolljt0725/14765_enable_golint_3
Enable golint in pkg/archive
2015-08-05 19:27:48 -04:00
Srini Brahmaroutu
d9b261221a /graph/tag fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-08-05 17:46:41 +00:00
John Howard
67e670b79f Windows: Fix docker/master daemon compile again
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-04 19:32:05 -07:00
Arnaud Porterie
7374852be9 Merge pull request #14921 from aaronlehmann/int64
Fix uses of "int" where "int64" should be used instead
2015-08-04 19:16:13 -07:00
Lei Jitang
ba332b7d12 Enable golint in pkg/arcive
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-04 09:52:54 +08:00