Commit Graph

5275 Commits

Author SHA1 Message Date
Michael Crosby
6096fa2b37
Merge pull request #3262 from renzhengeek/renzhen/devmapper-bugfix
snapshots/devmapper: deactivate thin device after committed
2019-05-09 10:29:46 -04:00
Li Yuxuan
cf6e008542 Fix fd leak of shim log
Open shim v2 log with the flag `O_RDWR` will cause the `Read()` block
forever even if the pipe has been closed on the shim side. Then the
`io.Copy()` would never return and lead to a fd leak.
Fix typo when closing shim v1 log which causes the `stdouLog` leak.
Update `numPipes` function in test case to get the opened FIFO
correctly.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-05-09 20:21:57 +08:00
Eric Ren
6f463d3505 test/snapshots: umount before committing snapshot
For block device like devicemapper, umount before committing
active snapshot can sync data onto disk. Otherewise:

1. deactivating a block device in use will fail or IO error
when forced;
2. new snapshot on it will not catch the data not laid on disk yet.

Signed-off-by: Eric Ren <renzhen.rz@alibaba-linux.com>
2019-05-09 12:27:05 +08:00
renzhen.rz
3887053177 snapshots/devmapper: deactivate thin device after committed
1. reason to deactivate committed snapshot

The thin device will not be used for IO after committed,
and further thin snapshotting is OK using an inactive thin
device as origin. The benefits to deactivate are:
 - device is not unneccesary visible avoiding any unexpected IO;
 - save useless kernel data structs for maintaining active dm.

 Quote from kernel doc (Documentation/device-mapper/provisioning.txt):

"
  ii) Using an internal snapshot.

  Once created, the user doesn't have to worry about any connection
  between the origin and the snapshot.  Indeed the snapshot is no
  different from any other thinly-provisioned device and can be
  snapshotted itself via the same method.  It's perfectly legal to
  have only one of them active, and there's no ordering requirement on
  activating or removing them both.  (This differs from conventional
  device-mapper snapshots.)
"

2. an thinpool metadata bug is naturally removed

An problem happens when failed to suspend/resume origin thin device
when creating snapshot:

"failed to create snapshot device from parent vg0-mythinpool-snap-3"
error="failed to save initial metadata for snapshot "vg0-mythinpool-snap-19":
object already exists"

This issue occurs because when failed to create snapshot, the
snapshotter.store can be rollbacked, but the thin pool metadata
boltdb failed to rollback in PoolDevice.CreateSnapshotDevice(),
therefore metadata becomes inconsistent: the snapshotID is not
taken in snapshotter.store, but saved in pool metadata boltdb.

The cause is, in PoolDevice.CreateSnapshotDevice(), the defer calls
are invoked on "first-in-last-out" order. When the error happens
on the "resume device" defer call, the metadata is saved and
snapshot is created, which has no chance to be rollbacked.

Signed-off-by: Eric Ren <renzhen@linux.alibaba.com>
2019-05-09 10:58:21 +08:00
Yikun Jiang
bdd7dce31f Add OpenLab CI configuration
This patch adds the OpenLab CI configuration to enable
the support for arm build in OpenLab.

After this, each pull request in containerd will trigger the
containerd-arm64-build job which verified the arm build
on OpenLab ARM cluster.

Related: https://github.com/containerd/containerd/issues/2901

Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
2019-05-08 17:21:41 +08:00
Phil Estes
d68b593de4
Merge pull request #3263 from Random-Liu/fix-task-deletion
Fix error handling for task deletion.
2019-05-07 23:12:14 +02:00
Derek McGowan
7c1e88399e
Merge pull request #3245 from msg555/master
Compute manifest metadata when not provided
2019-05-07 14:09:59 -07:00
Lantao Liu
660554d671 Fix error handling for task deletion.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-07 08:48:54 -07:00
Michael Crosby
5cf1356c5c
Merge pull request #3255 from dvrkps/usecancel
Use cancel on errors
2019-05-07 11:40:35 -04:00
Phil Estes
836cf53e40
Merge pull request #3244 from Random-Liu/fix-container-cleanup
Return NotFound error for kill and delete in deleted state.
2019-05-07 16:49:45 +02:00
Michael Crosby
19af235051
Merge pull request #3148 from masters-of-cats/wip-rootless-containerd
Skip rootfs unmount when no mounts are provided
2019-05-07 10:39:02 -04:00
Sebastiaan van Stijn
2ed8e60fa1
bump google.golang.org/grpc v1.20.1
full diff: https://github.com/grpc/grpc-go/compare/v1.12.2...v1.20.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-05 12:39:23 -07:00
Sebastiaan van Stijn
d1c59513d8
bump google.golang.org/grpc v1.12.2
full diff: https://github.com/grpc/grpc-go/compare/v1.12.0...v1.12.2

- grpc/grpc-go#2074 transport/server: fix race between writing status and header
  - fix grpc/grpc-go#1972 Possible race sending headers from server while receiving message over size limit
- grpc/grpc-go#2074 transport: account for user configured small io write buffer
  - fix grpc/grpc-go#2089 Server abruptly terminates connections if write buffer is small enough

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-05 12:38:25 -07:00
Phil Estes
d71c7ada27
Merge pull request #3259 from BenTheElder/no-unpack
ctr images import: add --no-unpack option
2019-05-05 12:29:45 -07:00
Derek McGowan
82f2ac7ede
Merge pull request #3252 from jterry75/remove_log_connect_error
Stop logging error on v2 multi shim log failure
2019-05-03 17:03:49 -07:00
Derek McGowan
c10eb8d122
Merge pull request #3256 from dvrkps/redundant
Remove redundant error checks
2019-05-03 16:23:40 -07:00
Derek McGowan
5423986111
Merge pull request #3260 from sarangjo/master
Fix broken link to containerd logo
2019-05-03 16:22:21 -07:00
Sarang Joshi
2f22d8e677 Fix broken link to containerd logo
Signed-off-by: Sarang Joshi <sarangj@msn.com>
2019-05-03 11:56:46 -07:00
Benjamin Elder
cb7c780af2 ctr images import: add --no-unpack option
Signed-off-by: Benjamin Elder <bentheelder@google.com>
2019-05-01 17:09:30 -07:00
msg555
ee902afa5f Compute manifest metadata when not provided.
This closes #3238

Signed-off-by: msg555 <msg555@gmail.com>
2019-05-01 00:53:16 -04:00
Lantao Liu
5c9811ded0 Cleanup dead v2 shim.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-30 13:45:01 -07:00
Davor Kapsa
cfc36388b3 Remove redundant error checks
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
2019-04-30 21:28:51 +02:00
Michael Crosby
a17c809571
Merge pull request #3253 from dvrkps/master
Fix misspells
2019-04-30 15:25:26 -04:00
Davor Kapsa
38e3696574 Use cancel on errors
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
2019-04-30 21:11:34 +02:00
Davor Kapsa
eded188f4f Fix misspells
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
2019-04-30 20:38:24 +02:00
Justin Terry (VM)
969035bcbd Stop logging error on v2 multi shim log failure
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-04-30 11:20:58 -07:00
Michael Crosby
bf5a424679
Merge pull request #3246 from thaJeztah/bump_ttrpc
bump containerd/ttrpc 699c4e40d1e7416e08bf7019c7ce2e9beced4636
2019-04-29 17:32:19 -04:00
Derek McGowan
a6cd37e5c2
Merge pull request #3243 from Random-Liu/update-cri
Update cri to 2fc62db814.
2019-04-29 11:31:19 -07:00
Derek McGowan
5bba53f239
Merge pull request #3249 from msg555/vndr_update
Update vendor/ with new required vndr go.mod files
2019-04-29 10:25:31 -07:00
msg555
c7f067f278 Update vendor/ with new required vndr go.mod files
Signed-off-by: msg555 <msg555@gmail.com>
2019-04-28 18:20:43 -04:00
Phil Estes
53830f66fd
Merge pull request #3240 from thaJeztah/bump_runc_1.0.0-rc.8
Bump runc 1.0.0-rc8, opencontainers/selinux v1.2.2
2019-04-27 20:08:01 -04:00
Sebastiaan van Stijn
8c5779c32b
bump containerd/ttrpc 699c4e40d1e7416e08bf7019c7ce2e9beced4636
full diff: f02858b145...699c4e40d1

- containerd/ttrpc#33 Fix returns error message
- containerd/ttrpc#35 Make onclose an option

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-27 15:30:18 -07:00
Lantao Liu
dff7456804 Return NotFound error for kill and delete in deleted state.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-26 15:17:18 -07:00
Lantao Liu
5d17ed2302 Update cri to 2fc62db814.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-26 10:54:51 -07:00
Akihiro Suda
3a3f0aac88
Merge pull request #3241 from tonistiigi/differ-close
differ: fix deadlock on commit error
2019-04-26 15:02:38 +09:00
Sebastiaan van Stijn
e5aab17a0e
bump opencontainers/selinux v1.2.2
full diff: https://github.com/opencontainers/selinux/compare/v1.2.1...v1.2.2

- opencontainers/selinux#51 Older kernels do not support keyring labeling

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-25 22:43:05 -07:00
Sebastiaan van Stijn
dd85aea625
bump runc v1.0.0-rc8
full diff: 029124da7a...425e105d5a

- opencontainers/runc#2043 Vendor in latest selinux code for keycreate errors

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-25 22:42:50 -07:00
Tonis Tiigi
5b9bd993a8 differ: fix deadlock on commit error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-04-25 17:50:17 -07:00
Phil Estes
810b3c37bb
Merge pull request #3239 from sipsma/nosetuplog
Support disabling default setup of shim logger.
2019-04-25 17:48:11 -04:00
Erik Sipsma
48f46516ad Support disabling default setup of shim logger.
Before this change, the v2 runtime shim setup code was hardcoded to always
configure logrus to write logs to the "log" FIFO present in the current working
directory. This only happens in the "default" action codepath
(i.e. not shim start or shim delete).

This is problematic for shims that execute outside the current working
directory of a bundle. For example, it often doesn't make sense for shims that
manage multiple containers to execute in a single bundle directory. Additionally,
shim processes that require being pre-created, i.e. spun up before tasks they
will handle are actually created, won't have a log FIFO to write to until a task
is created.

This change leaves the default behavior as is but introduces a Binary Config
field that will optionally disable automatic configuration of logrus to use the
"log" FIFO. This allows shims to configure their own logger if necessary while
still re-using the rest of the shim helper code in containerd.

Signed-off-by: Erik Sipsma <sipsma@amazon.com>
2019-04-24 19:01:12 +00:00
Michael Crosby
2d780a7a60
Merge pull request #3237 from thaJeztah/bump_go_units
bump docker/go-units v0.4.0
2019-04-23 17:07:13 -04:00
Sebastiaan van Stijn
c79c7921c0
bump docker/go-units v0.4.0
relevant changes:

- docker/go-units#19 make 1 second not to be plural seconds
- docker/go-units#20 Add `HumanSizeWithPrecision` function
- docker/go-units#21 change week display rule
- docker/go-units#22 Better human duration precision
- docker/go-units#23 Removes spaces before unit
- docker/go-units#27 Fix #26 - RAMInBytes Bug
- docker/go-units#33 Fix handling of unlimited (-1) ulimit values
- docker/go-units#34 Revert 46 minute threshold

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-23 17:07:58 +02:00
Ace-Tang
dfa51c9279 runtime-v1: kill shim in cleanupAfterDeadShim
1. kill shim in cleanupAfterDeadShim avoid shim leak
2. refactor cleanupAfterDeadShim, get pid from bundle
path instead of make pid as a parameter

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-04-22 14:29:40 +08:00
Phil Estes
835e6d01fb
Merge pull request #3231 from kevpar/dump-stacks-to-file
Don't write dumped stacks to file for ETW capture state
2019-04-19 13:43:49 -04:00
Kevin Parsons
0376dd4605 Don't write dumped stacks to file for ETW capture state
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-04-19 10:11:24 -07:00
Phil Estes
c2fb5d73f9
Merge pull request #3230 from jterry75/fix_windows_image
Convert Windows CI to use Microsoft MCR image urls
2019-04-19 09:32:38 -04:00
Justin Terry (VM)
e6fc0ed22d Convert Windows CI to use Microsoft MCR image urls
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-04-18 16:07:00 -07:00
Michael Crosby
a91e04356d
Merge pull request #3223 from thaJeztah/bump_gocapability
Bump syndtr/gocapability d983527, containerd/console
2019-04-18 15:26:34 -04:00
Phil Estes
ffe0b6927b
Merge pull request #3190 from jhowardmsft/jjh/stack2file
Write stack dump to `os.TempDir()` as well
2019-04-18 14:43:25 -04:00
Phil Estes
a905b0f0af
Merge pull request #3224 from thaJeztah/bump_crypto
Update x/crypto to 88737f569e3a9c7ab309cdc09a07fe7fc87233c3
2019-04-18 13:52:39 -04:00