Re-enable CRIU tests by not using overlayfs snapshotter
While the issue hasn't been fixed in the kernel yet, we can workaround the issue by not using overlayfs snapshotter. The newly added step runs all tests that match /TestCheckpoint/. So, TestCRWithImagePath has been renamed to match the regexp. Fixes #3930. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
parent
b520428b5a
commit
8731888ec0
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -322,6 +322,22 @@ jobs:
|
|||||||
sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu
|
sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu
|
||||||
working-directory: src/github.com/containerd/containerd
|
working-directory: src/github.com/containerd/containerd
|
||||||
|
|
||||||
|
# CRIU wouldn't work with overlay snapshotter yet.
|
||||||
|
# See https://github.com/containerd/containerd/pull/4708#issuecomment-724322294.
|
||||||
|
- name: CRIU Integration
|
||||||
|
env:
|
||||||
|
GOPROXY: direct
|
||||||
|
TEST_RUNTIME: ${{ matrix.runtime }}
|
||||||
|
RUNC_FLAVOR: ${{ matrix.runc }}
|
||||||
|
# crun doesn't have "checkpoint" command.
|
||||||
|
if: ${{ matrix.runc == 'runc' }}
|
||||||
|
run: |
|
||||||
|
sudo GOPATH=$GOPATH GOPROXY=$GOPROXY \
|
||||||
|
TEST_RUNTIME=$TEST_RUNTIME RUNC_FLAVOR=$RUNC_FLAVOR TESTFLAGS_PARALLEL=1 \
|
||||||
|
TEST_SNAPSHOTTER=native \
|
||||||
|
make integration EXTRA_TESTFLAGS='-run TestCheckpoint'
|
||||||
|
working-directory: src/github.com/containerd/containerd
|
||||||
|
|
||||||
- name: CRI Integration Test
|
- name: CRI Integration Test
|
||||||
env:
|
env:
|
||||||
TEST_RUNTIME: ${{ matrix.runtime }}
|
TEST_RUNTIME: ${{ matrix.runtime }}
|
||||||
|
@ -50,6 +50,7 @@ var (
|
|||||||
noCriu bool
|
noCriu bool
|
||||||
supportsCriu bool
|
supportsCriu bool
|
||||||
testNamespace = "testing"
|
testNamespace = "testing"
|
||||||
|
testSnapshotter = DefaultSnapshotter
|
||||||
ctrdStdioFilePath string
|
ctrdStdioFilePath string
|
||||||
|
|
||||||
ctrd = &daemon{}
|
ctrd = &daemon{}
|
||||||
@ -132,11 +133,30 @@ func TestMain(m *testing.M) {
|
|||||||
|
|
||||||
// allow comparison with containerd under test
|
// allow comparison with containerd under test
|
||||||
log.G(ctx).WithFields(logrus.Fields{
|
log.G(ctx).WithFields(logrus.Fields{
|
||||||
"version": version.Version,
|
"version": version.Version,
|
||||||
"revision": version.Revision,
|
"revision": version.Revision,
|
||||||
"runtime": os.Getenv("TEST_RUNTIME"),
|
"runtime": os.Getenv("TEST_RUNTIME"),
|
||||||
|
"snapshotter": os.Getenv("TEST_SNAPSHOTTER"),
|
||||||
}).Info("running tests against containerd")
|
}).Info("running tests against containerd")
|
||||||
|
|
||||||
|
snapshotter := DefaultSnapshotter
|
||||||
|
if ss := os.Getenv("TEST_SNAPSHOTTER"); ss != "" {
|
||||||
|
snapshotter = ss
|
||||||
|
}
|
||||||
|
|
||||||
|
ns, ok := namespaces.Namespace(ctx)
|
||||||
|
if !ok {
|
||||||
|
fmt.Fprintln(os.Stderr, "error getting namespace")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
err = client.NamespaceService().SetLabel(ctx, ns, defaults.DefaultSnapshotterNSLabel, snapshotter)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "error setting %s's default snapshotter as %s: %s\n", ns, snapshotter, err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
testSnapshotter = snapshotter
|
||||||
|
|
||||||
// pull a seed image
|
// pull a seed image
|
||||||
log.G(ctx).WithField("image", testImage).Info("start to pull seed image")
|
log.G(ctx).WithField("image", testImage).Info("start to pull seed image")
|
||||||
if _, err = client.Pull(ctx, testImage, WithPullUnpack); err != nil {
|
if _, err = client.Pull(ctx, testImage, WithPullUnpack); err != nil {
|
||||||
@ -285,7 +305,7 @@ func TestImagePullWithDiscardContent(t *testing.T) {
|
|||||||
t.Fatalf("there is no layers in the target image(parent: %v)", img.Target())
|
t.Fatalf("there is no layers in the target image(parent: %v)", img.Target())
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
sn = client.SnapshotService("")
|
sn = client.SnapshotService(testSnapshotter)
|
||||||
chain []digest.Digest
|
chain []digest.Digest
|
||||||
)
|
)
|
||||||
for i, dgst := range layers {
|
for i, dgst := range layers {
|
||||||
|
@ -414,7 +414,7 @@ func TestCheckpointLeaveRunning(t *testing.T) {
|
|||||||
<-statusC
|
<-statusC
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCRWithImagePath(t *testing.T) {
|
func TestCheckpointRestoreWithImagePath(t *testing.T) {
|
||||||
if !supportsCriu {
|
if !supportsCriu {
|
||||||
t.Skip("system does not have criu installed")
|
t.Skip("system does not have criu installed")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user