Commit Graph

32 Commits

Author SHA1 Message Date
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
547342d777 Improved push and pull with upload manager and download manager
This commit adds a transfer manager which deduplicates and schedules
transfers, and also an upload manager and download manager that build on
top of the transfer manager to provide high-level interfaces for uploads
and downloads. The push and pull code is modified to use these building
blocks.

Some benefits of the changes:

- Simplification of push/pull code
- Pushes can upload layers concurrently
- Failed downloads and uploads are retried after backoff delays
- Cancellation is supported, but individual transfers will only be
  cancelled if all pushes or pulls using them are cancelled.
- The distribution code is decoupled from Docker Engine packages and API
  conventions (i.e. streamformatter), which will make it easier to split
  out.

This commit also includes unit tests for the new distribution/xfer
package. The tests cover 87.8% of the statements in the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 572ce802306a4e919802e5b77cbeca94acda7c0a
Component: engine
2015-12-09 19:13:35 -08:00
971f161db1 Cap the amount of buffering done by BytesPipe
Turn BytesPipe's Read and Write functions into blocking, goroutine-safe
functions. Add a CloseWithError function to propagate an error code to
the Read function.

Adjust tests to work with the blocking Read and Write functions.

Remove BufReader, since now its users can use BytesPipe directly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 64f8ee444d23ae29a236f169f1d7faf7042b524a
Component: engine
2015-11-12 10:11:29 -08:00
c45875750d Avoid panic on write after close in http
By adding a (*WriteFlusher).Close, we limit the Write calls to possibly
deallocated http response buffers to the lifetime of an http request.
Typically, this is seen as a very confusing panic, the cause is usually a
situation where an http.ResponseWriter is held after request completion. We
avoid the panic by disallowing further writes to the response writer after the
request is completed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: ec2289b2d9ac79fd5e0f69f56f023dfe8ee78bf8
Component: engine
2015-11-02 18:14:43 -08:00
d8db4defa7 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>
Upstream-commit: e0ef11a4c2c6789e08b61df082b5b9aa70898e7a
Component: engine
2015-10-06 19:10:19 -04:00
1e6abba179 Merge pull request #16570 from duglin/ReaderFix
Make Close() on simpleReaderCloser actually close the reader
Upstream-commit: 252af0ae2fe8cd68c527b8c5bf6e3dd1c23d8574
Component: engine
2015-09-29 12:55:03 -04:00
df6cc87bb6 goroutine fairness is not guaranteed causing the hang with GCCGO
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7c52fcce855e446752b6ad642dd4d6c0d732b8f3
Component: engine
2015-09-25 14:40:16 +00:00
c440969f20 Make Close() on simpleReaderCloser actually close the reader
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: b5265fe7adac2c0895fab442595dbedb80b5717f
Component: engine
2015-09-24 20:22:59 -07:00
3a638e5279 Merge pull request #16190 from LK4D4/drain_refactor
Refactoring of bufReader
Upstream-commit: 8c33c6c737c887f05c0dfc1eb7f1002d16250f69
Component: engine
2015-09-24 01:54:40 -07:00
be78ccc6cf Make bytesPipe use linear allocations
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: c5b23337c37f0bcf01a7bf6a5129c326df136396
Component: engine
2015-09-23 17:12:54 -07:00
f73d781736 Refactor bufReader to use BytesPipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 56b70bf84e253bfedef94248a0b6b1f8d730091c
Component: engine
2015-09-23 16:00:28 -07:00
1c8652eb77 Add BytesPipe datastructure to ioutils
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 24310b5b4ab600ab5cb046d2f2ceaaa086b30be3
Component: engine
2015-09-23 16:00:27 -07:00
75633de557 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>
Upstream-commit: 141e91c4803124bdf55dd45a06998748b0ef5fb2
Component: engine
2015-09-23 14:35:13 +08: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
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
e840b8ec78 Enable golint part of #14756
pkg/broadcastwriter
pkg/graphdb
pkg/httputils
pkg/ioutils

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 27a8f9937ece67015d06b219bb8aa5cc4f6b7d32
Component: engine
2015-08-03 09:45:05 +08:00
116e469838 Fix reset timeout for buffer readers.
Use our goroutine-safe random source.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 40ea67a5962d5e47f883421a637c93b888206677
Component: engine
2015-07-28 14:30:18 -07:00
5104b34c44 Split reader interface from logger interface
Implement new reader interface on jsonfile.
Moves jsonlog decoding from daemon to jsonfile logger.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c0391bf5545afef5e675138556c39e4c0e9bf91b
Component: engine
2015-07-21 20:47:31 -04:00
4b2f3f5f76 Merge pull request #14605 from brahmaroutu/gccgo_scheduler
Go Scheduler issue with sync.Mutex
Upstream-commit: 7b83b0e15c4507871ed411aca5610aa7da751bd9
Component: engine
2015-07-17 08:16:32 -07:00
d905b9673f Go Scheduler issue with sync.Mutex using gccgo
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 9ca913d0f168d943f6e15f32f52f777732b354a7
Component: engine
2015-07-17 01:33:58 +00:00
0a78587632 remove pkg/transport and use the one from distribution
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 276c640be4b4335e3b8d684cb3562a56d3337b39
Component: engine
2015-07-16 13:13:46 -04:00
a8436a9c51 no not print empty keys in docker info
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: c790aa36ea92799593fe4b32fc516784eb0c2c43
Component: engine
2015-06-01 15:05:20 -07:00
a587ee906f fix to gccgo compilation error
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: d2a2c974d9d0862ddd9974c861c080159a53cd4b
Component: engine
2015-05-14 16:28:23 +00:00
a9af2bce60 Move WriteFlusher out of utils into ioutils
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 223d6de728ac5df5394b4990f81a466c858d519c
Component: engine
2015-05-08 12:33:33 -06:00
f23ef4fe69 Add more ioutils tests.
Closes #11595

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 815b472a02dc0f593daee4006ce893fe17236b70
Component: engine
2015-05-04 19:56:10 +02:00
a4111cba55 Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c30a55f14dbbe3971ba0ac716ba69a60868f4490
Component: engine
2015-04-14 01:37:36 +02:00
c6028dad54 pkg/ioutils: avoid huge Buffer growth in bufreader
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: e5ea2b235720db8dec7689b410de1830f707284a
Component: engine
2015-03-18 19:51:55 +02:00
b9849b445a pkg/ioutils: add tests for BufReader
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 028f7987fe455d958d08db98ae267d9fd4cf3813
Component: engine
2015-03-18 19:32:46 +02:00
dd97f278a0 pkg/ioutils: add ReaderErrWrapper to readers
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: bd130e72a06dc3e8de521ce365bf4933f36b2417
Component: engine
2014-09-03 11:36:21 +03:00
dca3941db1 pkg/ioutils: add NewBufReaderWithDrainbufAndBuffer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c93b9e81c03168ca69def94ba231d2ecc6672ce9
Component: engine
2014-09-03 11:36:21 +03:00
0e15abc25d pkg/ioutils: add WriteCloserWrapper
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 7b6f34057cee94bf22e4e58cd164731e6b0e8851
Component: engine
2014-09-03 11:36:21 +03:00
e9ab736d16 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 76212635b594d4472dd8d5b2e071fac416addbe7
Component: engine
2014-09-03 11:36:21 +03:00