Commit Graph

8706 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
Lantao Liu
6e14e01307
Merge pull request #1148 from congliu01/log
Override container log path to empty if either of sandbox log directory or container log path is empty.
2019-05-14 15:50:20 -07:00
Cong Liu
fda2902f30 Validate log paths in sandbox and container config.
Only compose full container log path if neither of the paths is empty. Otherwise container won't start properly.

Signed-off-by: Cong Liu <conliu@google.com>
2019-05-14 13:46:52 -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
Lantao Liu
ebce49f0ea
Merge pull request #1145 from jterry75/fix_typo
Fix typo in WithoutRunMount
2019-05-12 23:55:06 -07: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
Justin Terry (VM)
8ba5c02f8f Fix typo in WithoutRunMount
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 13:30:22 -07:00
Lantao Liu
179ca59478
Merge pull request #1147 from jterry75/unix_to_syscall_signal
Move from unix to syscall package for SIG* signals
2019-05-10 13:14:10 -07:00
Lantao Liu
d6af03abbd
Merge pull request #1146 from jterry75/forward_sandbox_to_pull
Forward sandbox config to PullImage request
2019-05-10 12:10:30 -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
Justin Terry (VM)
c1468cdeec Move from unix to syscall package for SIG* signals
To support cross compilation for SIG* signals perfer the syscall package over
the unix package.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 11:50:45 -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
Justin Terry (VM)
bc445d7595 Forward sandbox config to PullImage request
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-05-10 11:35:09 -07: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
Mike Brown
e4ebb718c6
Merge pull request #1142 from Random-Liu/better-logging-for-registry-try
Log failed registry mirror attempt in debug.
2019-05-09 10:04:42 -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
Lantao Liu
4037806184 Log failed registry mirror attempt in debug.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-08 23:56:29 -07: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
Lantao Liu
51910edf0d
Merge pull request #1140 from lifupan/fix_taskdelete
Integration test task.Delete fix
2019-05-08 18:21:20 -07: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
lifupan
47fc645682 Integration test task.Delete fix
task.Delete() will try to kill the task before delete it,
but once the task is killed, the TaskExit event will also
tigger another task.Delete() which would conflict with this
test task.Delete(). To avoid this conflict, kill the task instead
of Delete it, and let TaskExit trigger task.Delete().

Signed-off-by: lifupan <lifupan@gmail.com>
2019-05-08 12:28:22 +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