Commit graph

2050 commits

Author SHA1 Message Date
Nalin Dahyabhai
dff96cdeb2 Remove pkg/ioutils.cancelReadCloser
Remove pkg/ioutils's cancelReadCloser type and the vendored copy of
golang.org/x/net/context which it needed, neither of which was used
anywhere else in here.  This should let us sidestep any potential
incompatibilities with the standard library's context package, which was
introduced in golang 1.7.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-06 14:00:16 -05:00
Daniel J Walsh
417d28901b Remove "docker" strings from container storage
We want to make sure that content created out of container storage
does not refer to docker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-01-26 09:47:23 +01:00
Nalin Dahyabhai
c4bcd1cf17 Remove the unused pkgs
We're not using pkg/jsonmessage, pkg/parsers/operatingsystem,
pkg/pidfile, or pkg/sysinfo, so remove them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-12 11:05:25 -05:00
Nalin Dahyabhai
55e5d76085 Rename "DevmapperLogCallback" to avoid conflicts
Rename the "DevmapperLogCallback" exported-to-C function to
"StorageDevmapperLogCallback", to avoid tripping up anyone who vendors
the library but already has a copy of the "pkg/devicemapper" pkg which
defines the callback with its previous name.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-09 11:54:40 -05:00
Derek McGowan
cad8eb40eb Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-08-16 12:06:33 -04:00
Nalin Dahyabhai
aded075f80 Rework some of the build machinery
- Run tests in VMs with sufficiently-new gccgo
- Assume that all binary builds build dynamic binaries

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-28 14:01:54 -04:00
Nalin Dahyabhai
47d8aeb637 Look for plugins in a non-conflicting location
When we do plugin discovery, don't look in places that would cause our
plugins to be mixed up with docker's or vice-versa.  Drop plugin
management, since we don't talk to remote anything.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-19 14:32:49 -04:00
Nalin Dahyabhai
2783450a92 Rename: cow/cowman -> storage/oci-storage
Rename the library module and CLI wrapper.
Rename daemon/graphdriver to drivers.
Catch up vendoring to match modules we've pruned.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-18 17:35:50 -04:00
Nalin Dahyabhai
f191bf69ff Remove more code
Based on a patch by Grant Seltzer <grantseltzer@gmail.com>

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-18 17:35:49 -04:00
Nalin Dahyabhai
076755f4a2 Remove some code we no longer depend on
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-18 17:35:41 -04:00
Nalin Dahyabhai
b350de236d Switch from fsync to a plain old lock
We don't need the complexity of fsync when we just want to take an
exclusive lock, so replace its use with an advisory file lock.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2016-07-15 17:23:15 -04:00
Nalin Dahyabhai
bd3b44be3e Add a file-backed read-write mutex implementation
The fsync package provides Mutex and RWMutex types which aim to provide
the same semantics as their namesakes in the sync package, extending
that locking across processes by using file locks and randomly-generated
identifiers to allow processes to determine whether or not they were the
last to modify a resource that's protected by the lock.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
2016-07-15 17:21:14 -04:00
allencloud
fa358584a0 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-12 00:59:30 +08:00
Justin Cormack
bae354f800 Make the docker proxy a standalone binary not a re-exec
This reduces memory usage with a lot of docker proxy processes.
On Docker for Mac we are currently carrying a patch to replace
the binary as we modify it to forward ports to the Mac rather
than the Linux VM, this allows us to simply replace this binary
in our packaging with one that has a compatible interface. This
patch does not provide an easy way to substitute a binary as
the interface is complex and there are few use cases, but where
needed this can be done.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-07 12:53:39 +01:00
Brian Goff
dfe4019f03 Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-06 22:34:39 -04:00
Sebastiaan van Stijn
9344f05303 Merge pull request #22472 from allencloud/make-pkg-fileutils-support-darwin
add fileutils_darwin.go in pkg/fileutils to support darwin platform
2016-07-02 14:15:22 -07:00
Shourya Sarcar
f81e29abbd Add Andrew Wiles, Florence Nightingale, Thomas Edison to container names.
British mathematician Andrew Wiles is notable for solving Fermat's LAst
Theorem. Florence Nightingale was the first female inducted into the
Royal Statistical Society. Thomas Alva Edison was a prolific inventor,
noted for inventing the incandescent light bulb, the phonograph and the
motion picture camera (among many other).

Signed-off-by: Shourya Sarcar <shourya.sarcar@gmail.com>
2016-07-02 02:56:03 +00:00
allencloud
0df28b9294 add fileutils_darwin.go in pkg/fileutils to support darwin platform
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-01 13:02:26 +08:00
Yong Tang
f718d6b8c6 Fix s390x build failure by removing golang.org/x/sys
This fix tries to fix the issue raised in #24168 where
golang.org/x/sys causes s390x build failure.

This fix removed the import of "golang.org/x/sys/unix".

This fix fixes #24168.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-30 06:32:32 -07:00
Sebastiaan van Stijn
2f63d74eda Merge pull request #24080 from dmcgowan/atomic-writer-mode
Set permission on atomic file write
2016-06-30 01:00:08 -07:00
Derek McGowan
003449018b Set permission on atomic file write
Perform chmod before rename with the atomic file writer.
Ensure writeErr is set on short write and file is removed on write error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-29 13:09:13 -07:00
Sebastiaan van Stijn
830a8c60bd Merge pull request #23955 from yongtang/23768-cpu-count
Fix wrong CPU count after CPU hot-plugging
2016-06-29 12:00:13 -07:00
Daniel Nephin
f0219b6c64 Fix service update of Args
add a unit test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-29 12:41:57 -04:00
Yong Tang
6c046817ae Fix wrong CPU count after CPU hot-plugging on Windows
This fix tries to fix wrong CPU count after CPU hot-plugging.
On windows, GetProcessAffinityMask has been used to probe the
number of CPUs in real time.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-25 22:20:29 -07:00
Yong Tang
4b5413396a Fix wrong CPU count after CPU hot-plugging
This fix tries to address issues raised in #23768 where the CPU count
is not updated after cpu ho-plugging.

This fix follows the suggestion from #23768 and replace go's `runtime.NumCPU()`
with `sysconf(_SC_NPROCESSORS_ONLN)` so that correct CPU count could
be obtained even after CPU hot-plugging.

This fix is tested manually, as is suggested in #23768.

This fix fixes #23768.

The NumCPU() in Linux is based on @wmark 's implementation.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-25 20:48:36 -07:00
Vincent Demeester
754ae20ec5 Merge pull request #23918 from LK4D4/avoid_copy
pkg/pools: avoid copy of sync.Pool
2016-06-24 19:35:43 +02:00
Alexander Morozov
e74a7f42a9 pkg/pools: avoid copy of sync.Pool
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-23 16:09:13 -07:00
Vincent Demeester
120a4b0276 Merge pull request #23912 from dmcgowan/fix-overlay2-whiteout-exclusion
Fix overlay2 ignoring whiteout files
2016-06-24 01:06:38 +02:00
Derek McGowan
c880caae4e Fix overlay2 ignoring whiteout files
Currently when overlay creates a whiteout file then the overlay2 layer is archived,
the correct tar header will be created for the whiteout file, but the tar logic will then attempt to open the file causing a failure.
When tar encounters such failures the file is skipped and excluded for the archive, causing the whiteout to be ignored.
By skipping the copy of empty files, no open attempt will be made on whiteout files.

Fixes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-23 13:34:38 -07:00
bin liu
53ce0aa26a fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-21 15:29:25 +08:00
Daniel Nephin
d112f3fb84 Add some tests for bundlefile and improve the error messages for LoadFile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-06-16 18:18:25 -04:00
Tibor Vass
59c8eda724 plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-06-14 14:20:27 -07:00
Vincent Demeester
789aee497c Merge pull request #23425 from runcom/authz-race
pkg: authorization: lock when lazy loading
2016-06-13 23:20:37 +02:00
Michael Crosby
14c99e5f48 Merge pull request #22126 from dmcgowan/overlay-native-diff
Overlay multiple lower directory support
2016-06-13 13:15:39 -07:00
Alexander Morozov
2711a9d3b2 Merge pull request #22631 from runcom/fix-leak-mount
pkg: chrootarchive: chroot_linux: fix mount leak
2016-06-13 09:29:46 -07:00
Antonio Murdaca
bcc185702c authz: cleanups
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:23:19 +02:00
Antonio Murdaca
32a661fee9 pkg: authorization: lock when lazy loading
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-12 17:19:43 +02:00
Yong Tang
85fa96aa57 Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-06-11 13:16:55 -07:00
Vincent Demeester
3ff8d449c4 Merge pull request #23458 from runcom/warnf
*: fix logrus.Warn[f]
2016-06-11 21:42:12 +02:00
Antonio Murdaca
3f69598101 *: fix logrus.Warn[f]
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 19:42:38 +02:00
Antonio Murdaca
375c8c3e4a pkg: proxy: fix TCPEchoServer.Close() in unit test
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 15:27:56 +02:00
Antonio Murdaca
f9023a4094 pkg: chrootarchive: chroot_linux: fix mount leak
When pivot_root fails we need to unmount the bind mounted path we
previously mounted in preparation for pivot_root.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-11 00:07:41 +02:00
fortinux
b33348682f update peaceful zen
Signed-off-by: fortinux <info@fortinux.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-10 16:39:05 +02:00
Aleksa Sarai
e24aa430f9 pkg: archive: only ignore ENOTSUP when xattr fails
There might be other (valid) reasons for setxattr(2) to fail, so only
ignore it when it's a not supported error (ENOTSUP). Otherwise, bail.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-10 00:56:40 +10:00
Derek McGowan
9bb13f8f51 Update archive package to support overlay whiteouts
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-06-08 00:10:16 -07:00
Viktor Stanchev
60dbea6c25 aufs compatibility
Signed-off-by: Viktor Stanchev <me@viktorstanchev.com>
2016-06-08 00:10:16 -07:00
Tibor Vass
9b79cbe713 Cleanup
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-06-06 15:57:51 -07:00
Alexander Morozov
a6496e5b41 ioutils: fix race in access closeErr in bytespipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-06-06 11:29:47 -07:00
Brian Goff
7ee212504d Add support for volume scopes
This is similar to network scopes where a volume can either be `local`
or `global`. A `global` volume is one that exists across the entire
cluster where as a `local` volume exists on a single engine.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-05 15:37:15 -04:00
Brian Goff
f636807065 Enhance pluginrpc-gen parser
Now handles `package.Type` and `*package.Type`
Fixes parsing issues with slice and map types.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-05 15:37:15 -04:00