Commit Graph

5305 Commits

Author SHA1 Message Date
Maksym Pavlenko
7f79fbb245 Move ttrpc client to pkg/ttrpcutil
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-05-20 16:44:49 -07:00
Ace-Tang
5b7a327c47 Improve atomic delete
skip hidden directories in load task, and return soon if path not exist
in atomicDelete

carry of #3233

Closes #3233

Signed-off-by: Ace-Tang <aceapril@126.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-20 20:13:35 +00:00
Michael Crosby
fe6a2b03ed Add shim cgroup support for v2 runtimes
Closes #3198

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-20 16:04:06 +00:00
Akihiro Suda
cafda1c50f
Merge pull request #3290 from estesp/typo
Fix typo in description comment
2019-05-20 16:32:14 +02:00
Phil Estes
62609d66d0
Fix typo in description comment
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-05-20 04:21:39 -04:00
Michael Crosby
90c6c1af43 Pass options on shim create for v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-17 21:02:23 +00:00
Phil Estes
b99a66c267
Merge pull request #3288 from Ace-Tang/easy-shim
ctr: make ctr shim command easy to use
2019-05-17 15:40:39 +02:00
Wei Fu
e61f7f4913
Merge pull request #3172 from dmcgowan/export-docker-compatibility
Update image export to support Docker format
2019-05-17 14:30:54 +08:00
Ace-Tang
6907062863 ctr: make ctr shim command easy to use
make ctr shim command easy to use for user, shim socket is generated
through sha256, and it can not get directly, change socket flag to id
command, generated socket in code.
It also avoid fail to connect shim v2, since shim v2 have multiple
containers, `ctr shim --socket state` should specify container id, or
get error `rpc error: code = NotFound desc = container not created: not
found`

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-05-17 11:56:08 +08:00
Michael Crosby
cd5369bace
Merge pull request #2896 from thaJeztah/bump_golang_1.12
Add Golang 1.12.5
2019-05-15 12:30:07 -04:00
Phil Estes
5158bc8de2
Merge pull request #3280 from jterry75/init_state_resize_unused
Remove unused Resize method from initState
2019-05-14 13:18:58 -04:00
Maksym Pavlenko
7b06c9a1ce Add TTRPC client
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-05-13 21:05:07 -07:00
Justin Terry (VM)
5e962dd8ba Remove unused Resize method from initState
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-13 12:35:22 -07:00
Michael Crosby
7acdb16882
Merge pull request #3276 from darfux/v1_respect_shim_debug
v1:Respect the `shim_debug` flag when load tasks
2019-05-13 13:02:32 -04:00
Phil Estes
c0d0fc32f5
Merge pull request #3278 from masters-of-cats/pr-bump-ttrpc
Bump ttrpc
2019-05-13 17:51:25 +02:00
Li Yuxuan
66036d9206 v1: Respect the shim_debug flag when load tasks
Currently when we restart containerd it will load all tasks with shim
logs whether the `shim_debug` is set or not.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-05-13 23:51:16 +08:00
Georgi Sabev
a6a888cb5e Bump ttrpc
Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
2019-05-13 16:21:04 +01:00
Phil Estes
7ad8848663
Merge pull request #3275 from fuweid/me-redirect-shim-v1-output-into-fifo
containerd-shim: redirect output into stdout fifo
2019-05-13 16:16:30 +02:00
Wei Fu
fbb80b9510 containerd-shim: redirect output into stdout fifo
Redirect is used to make sure that containerd still can read the log of
shim after restart.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-05-12 23:03:28 +08:00
Sebastiaan van Stijn
543d1e807f
Add travis_wait to prevent vndr timing out
Pervent travis from timing out because no output was printed;

    No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-10 14:09:57 -07:00
Sebastiaan van Stijn
00bc2f5cfd
Update to Golang 1.12, and prepare for ppc64le
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-10 14:07:32 -07:00
Derek McGowan
bc944553a8
Merge pull request #3206 from Random-Liu/cleanup-after-deadshim-v2
Cleanup dead v2 shim.
2019-05-10 11:56:57 -07:00
Phil Estes
cfbbda910d
Merge pull request #3271 from crosbymichael/info
Faster lookups for listing container metadata
2019-05-10 20:44:43 +02:00
Michael Crosby
67b45aef49 Add WithoutRefreshed metadata
Closes #2566

This provides faster lookups and lists for ctr commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-10 15:16:14 +00:00
Phil Estes
481103c879
Merge pull request #3270 from jcaamano/master
Improve ARM platform matching
2019-05-10 17:02:46 +02:00
Jaime Caamaño Ruiz
ad25c1a9c3 Improve ARM platform matching
This commit improves ARM platform matching in two instances:

* Some old kernels reported the CPU architecture of arm64 cpus as
  Aarch64 [1].
* In cases where the user is running with armv8 cpu and kernel but amrhf
  user land (so armhf containerd), a possibility given the compatibility
  of armv8 with armv7.

[1] https://elixir.bootlin.com/linux/v3.14.29/source/arch/arm64/kernel/setup.c#L420

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
2019-05-10 16:27:20 +02:00
Michael Crosby
bd27bef4ad Move checkpoint and restore commands to new files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-10 14:20:19 +00:00
Michael Crosby
f80d285079
Merge pull request #3242 from theopenlab/containerd_openlab_ci
Add OpenLab CI configuration for ARM64 build
2019-05-10 10:03:06 -04:00
Michael Crosby
57fbb16234
Merge pull request #3149 from lifubang/pidnamespace
fix killall when use pidnamespace
2019-05-09 14:28:44 -04:00
Michael Crosby
0485499d1c
Merge pull request #3266 from darfux/fix_shim_log_fd_leak
Fix fd leak of shim log
2019-05-09 10:30:53 -04:00
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