Skip to content

Commit ce42c4e

Browse files
committed
Remove FICD_SNAPSHOTTER and FICD_SNAPSHOTTER_OUTFILE
The only snapshotter we can use right now is devmapper. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 017fe90 commit ce42c4e

File tree

10 files changed

+39
-59
lines changed

10 files changed

+39
-59
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ steps:
101101
artifact_paths:
102102
- "runtime/logs/*"
103103
command:
104-
- make -C runtime integ-test FICD_SNAPSHOTTER=devmapper FICD_DM_POOL=build_${BUILDKITE_BUILD_NUMBER}_runtime
104+
- make -C runtime integ-test FICD_DM_POOL=build_${BUILDKITE_BUILD_NUMBER}_runtime
105105
timeout_in_minutes: 15
106106

107107
- label: ":rotating_light: :exclamation: example tests (devmapper)"

examples/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ integ-test:
4141
--volume $(CURDIR)/etc/containerd/firecracker-runtime.json:/etc/containerd/firecracker-runtime.json \
4242
--volume $(CURDIR)/logs:/var/log/firecracker-containerd-test \
4343
--volume $(CURDIR)/..:/src \
44-
--env FICD_SNAPSHOTTER=$(TEST_SS) \
4544
--env FICD_DM_POOL=$(TEST_POOL) \
4645
--env EXTRAGOARGS="${EXTRAGOARGS}" \
4746
--workdir="/src/examples" \
4847
$(FIRECRACKER_CONTAINERD_TEST_IMAGE):${DOCKER_IMAGE_TAG} \
49-
"make examples && make testtap && sleep 3 && ./taskworkflow -ip $(TEST_IP)$(TEST_SUBNET) -gw $(TEST_GATEWAY) -ss $(TEST_SS)"
48+
"make examples && make testtap && sleep 3 && ./taskworkflow -ip $(TEST_IP)$(TEST_SUBNET) -gw $(TEST_GATEWAY) -ss devmapper"
5049

5150
TEST_GATEWAY?=172.16.0.1
5251
TEST_IP?=172.16.0.2
5352
TEST_SUBNET?=/24
54-
TEST_SS?=devmapper
5553
TEST_POOL?=
5654
testtap:
5755
ip link add br0 type bridge

runtime/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ integ-test-%: logs
6262
--volume $(CURDIR)/..:/src \
6363
--volume $(GO_CACHE_VOLUME_NAME):/go \
6464
--env ENABLE_ISOLATED_TESTS=1 \
65-
--env FICD_SNAPSHOTTER=$(FICD_SNAPSHOTTER) \
6665
--env FICD_DM_POOL=$(FICD_DM_POOL) \
6766
--env GOPROXY=direct \
6867
--env GOSUMDB=off \
@@ -81,7 +80,6 @@ PERF_RUNTIME_SECONDS?=600
8180
PERF_VM_MEMSIZE_MB?=1024
8281
PERF_TARGET_BANDWIDTH?=1G
8382

84-
FICD_SNAPSHOTTER?=devmapper
8583
FICD_DM_POOL?=
8684

8785
tc-redirect-tap-perf:
@@ -109,7 +107,6 @@ perf-test:
109107
--env PERF_RUNTIME_SECONDS=$(PERF_RUNTIME_SECONDS) \
110108
--env PERF_VM_MEMSIZE_MB=$(PERF_VM_MEMSIZE_MB) \
111109
--env PERF_TARGET_BANDWIDTH=$(PERF_TARGET_BANDWIDTH) \
112-
--env FICD_SNAPSHOTTER=$(FICD_SNAPSHOTTER) \
113110
--env FICD_DM_POOL=$(FICD_DM_POOL) \
114111
--env GOPROXY=direct \
115112
--env GOSUMDB=off \

runtime/cni_integ_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestCNISupport_Isolated(t *testing.T) {
5353
pluginClient, err := ttrpcutil.NewClient(containerdSockPath + ".ttrpc")
5454
require.NoError(t, err, "failed to create ttrpc client")
5555

56-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
56+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
5757
require.NoError(t, err, "failed to get alpine image")
5858

5959
numVMs := 5
@@ -127,7 +127,7 @@ func TestCNISupport_Isolated(t *testing.T) {
127127

128128
newContainer, err := client.NewContainer(ctx,
129129
containerName,
130-
containerd.WithSnapshotter(defaultSnapshotterName()),
130+
containerd.WithSnapshotter(defaultSnapshotterName),
131131
containerd.WithNewSnapshot(snapshotName, image),
132132
containerd.WithNewSpec(
133133
oci.WithProcessArgs("/usr/bin/wget",
@@ -160,7 +160,7 @@ func TestAutomaticCNISupport_Isolated(t *testing.T) {
160160
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
161161
defer client.Close()
162162

163-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
163+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
164164
require.NoError(t, err, "failed to get alpine image")
165165

166166
numVMs := 5
@@ -194,7 +194,7 @@ func TestAutomaticCNISupport_Isolated(t *testing.T) {
194194

195195
newContainer, err := client.NewContainer(ctx,
196196
taskID,
197-
containerd.WithSnapshotter(defaultSnapshotterName()),
197+
containerd.WithSnapshotter(defaultSnapshotterName),
198198
containerd.WithNewSnapshot(snapshotName, image),
199199
containerd.WithNewSpec(
200200
oci.WithProcessArgs("/usr/bin/wget",
@@ -237,7 +237,7 @@ func TestCNIPlugin_Performance(t *testing.T) {
237237

238238
fcClient := fccontrol.NewFirecrackerClient(pluginClient.Client())
239239

240-
image, err := iperf3Image(ctx, client, defaultSnapshotterName())
240+
image, err := iperf3Image(ctx, client, defaultSnapshotterName)
241241
require.NoError(t, err, "failed to get iperf3 image")
242242

243243
cniNetworkName := "fcnet"
@@ -296,7 +296,7 @@ func TestCNIPlugin_Performance(t *testing.T) {
296296

297297
newContainer, err := client.NewContainer(ctx,
298298
containerName,
299-
containerd.WithSnapshotter(defaultSnapshotterName()),
299+
containerd.WithSnapshotter(defaultSnapshotterName),
300300
containerd.WithNewSnapshot(snapshotName, image),
301301
containerd.WithNewSpec(
302302
oci.WithProcessArgs("/usr/bin/iperf3",

runtime/integ_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,8 @@ func shimBaseDir() string {
5555
return defaultShimBaseDir
5656
}
5757

58-
func defaultSnapshotterName() string {
59-
if name := os.Getenv("FICD_SNAPSHOTTER"); name != "" {
60-
return name
61-
}
62-
63-
return "devmapper"
64-
}
58+
// devmapper is the only snapshotter we can use with Firecracker
59+
const defaultSnapshotterName = "devmapper"
6560

6661
func prepareIntegTest(t *testing.T, options ...func(*config.Config)) {
6762
t.Helper()

runtime/jailer_integ_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func testJailer(t *testing.T, jailerConfig *proto.JailerConfig) {
5252

5353
ctx := namespaces.WithNamespace(context.Background(), "default")
5454

55-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
55+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
5656
require.NoError(err, "failed to get alpine image")
5757

5858
pluginClient, err := ttrpcutil.NewClient(containerdSockPath + ".ttrpc")
@@ -69,7 +69,7 @@ func testJailer(t *testing.T, jailerConfig *proto.JailerConfig) {
6969

7070
c, err := client.NewContainer(ctx,
7171
"container",
72-
containerd.WithSnapshotter(defaultSnapshotterName()),
72+
containerd.WithSnapshotter(defaultSnapshotterName),
7373
containerd.WithNewSnapshot("snapshot", image),
7474
containerd.WithNewSpec(oci.WithProcessArgs("/bin/echo", "-n", "hello"), firecrackeroci.WithVMID(vmID)),
7575
)

runtime/limits_integ_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestDiskLimit_Isolated(t *testing.T) {
3535
require.NoError(err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
3636
defer client.Close()
3737

38-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
38+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
3939
require.NoError(err, "failed to get alpine image")
4040

4141
// Right now, both naive snapshotter and devmapper snapshotter are configured to have 1024MB image size.
@@ -47,7 +47,7 @@ func TestDiskLimit_Isolated(t *testing.T) {
4747

4848
container, err := client.NewContainer(ctx,
4949
"container",
50-
containerd.WithSnapshotter(defaultSnapshotterName()),
50+
containerd.WithSnapshotter(defaultSnapshotterName),
5151
containerd.WithNewSnapshot("snapshot", image),
5252
sh,
5353
)

runtime/service_integ_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
119119
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
120120
defer client.Close()
121121

122-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
122+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
123123
require.NoError(t, err, "failed to get alpine image")
124124

125125
testTimeout := 60 * time.Second
@@ -131,7 +131,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
131131
container, err := client.NewContainer(testCtx,
132132
containerName,
133133
containerd.WithRuntime(firecrackerRuntime, nil),
134-
containerd.WithSnapshotter(defaultSnapshotterName()),
134+
containerd.WithSnapshotter(defaultSnapshotterName),
135135
containerd.WithNewSnapshot(snapshotName, image),
136136
containerd.WithNewSpec(
137137
oci.WithProcessArgs("sleep", fmt.Sprintf("%d", testTimeout/time.Second)),
@@ -143,7 +143,7 @@ func TestShimExitsUponContainerDelete_Isolated(t *testing.T) {
143143
_, err = client.NewContainer(testCtx,
144144
fmt.Sprintf("should-fail-%s-%d", t.Name(), time.Now().UnixNano()),
145145
containerd.WithRuntime(firecrackerRuntime, nil),
146-
containerd.WithSnapshotter(defaultSnapshotterName()),
146+
containerd.WithSnapshotter(defaultSnapshotterName),
147147
containerd.WithNewSnapshot(snapshotName, image),
148148
containerd.WithNewSpec(
149149
oci.WithProcessArgs("sleep", fmt.Sprintf("%d", testTimeout/time.Second)),
@@ -316,7 +316,7 @@ func (runner *testMultipleVMsRunner) TestMultipleVMs(t *testing.T) {
316316
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
317317
defer client.Close()
318318

319-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
319+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
320320
require.NoError(t, err, "failed to get alpine image")
321321

322322
pluginClient, err := ttrpcutil.NewClient(containerdSockPath + ".ttrpc")
@@ -446,7 +446,7 @@ func (runner *testMultipleVMsRunner) testMultipleExecs(
446446
// spawn a container that just prints the VM's eth0 mac address (which we have set uniquely per VM)
447447
newContainer, err := client.NewContainer(ctx,
448448
containerName,
449-
containerd.WithSnapshotter(defaultSnapshotterName()),
449+
containerd.WithSnapshotter(defaultSnapshotterName),
450450
containerd.WithNewSnapshot(snapshotName, image),
451451
containerd.WithNewSpec(
452452
processArgs,
@@ -646,7 +646,7 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
646646
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
647647
defer client.Close()
648648

649-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
649+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
650650
require.NoError(t, err, "failed to get alpine image")
651651

652652
tapName := fmt.Sprintf("tap%d", vmID)
@@ -677,7 +677,7 @@ func TestStubBlockDevices_Isolated(t *testing.T) {
677677

678678
newContainer, err := client.NewContainer(ctx,
679679
containerName,
680-
containerd.WithSnapshotter(defaultSnapshotterName()),
680+
containerd.WithSnapshotter(defaultSnapshotterName),
681681
containerd.WithNewSnapshot(snapshotName, image),
682682
containerd.WithNewSpec(
683683
firecrackeroci.WithVMID(strconv.Itoa(vmID)),
@@ -808,7 +808,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
808808
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
809809
defer client.Close()
810810

811-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
811+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
812812
require.NoError(t, err, "failed to get alpine image")
813813

814814
containerName := fmt.Sprintf("%s-%d", t.Name(), time.Now().UnixNano())
@@ -818,7 +818,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
818818

819819
c1, err := client.NewContainer(ctx,
820820
containerName,
821-
containerd.WithSnapshotter(defaultSnapshotterName()),
821+
containerd.WithSnapshotter(defaultSnapshotterName),
822822
containerd.WithNewSnapshot(snapshotName, image),
823823
withNewSpec,
824824
)
@@ -844,7 +844,7 @@ func testCreateContainerWithSameName(t *testing.T, vmID string) {
844844
// So, we can launch a new container with the same name
845845
c2, err := client.NewContainer(ctx,
846846
containerName,
847-
containerd.WithSnapshotter(defaultSnapshotterName()),
847+
containerd.WithSnapshotter(defaultSnapshotterName),
848848
containerd.WithNewSnapshot(snapshotName, image),
849849
withNewSpec,
850850
)
@@ -884,14 +884,14 @@ func TestStubDriveReserveAndReleaseByContainers_Isolated(t *testing.T) {
884884
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
885885
defer client.Close()
886886

887-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
887+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
888888
require.NoError(t, err, "failed to get alpine image")
889889

890890
runEchoHello := containerd.WithNewSpec(oci.WithProcessArgs("echo", "-n", "hello"), firecrackeroci.WithVMID("reuse-same-vm"), oci.WithDefaultPathEnv)
891891

892892
c1, err := client.NewContainer(ctx,
893893
"c1",
894-
containerd.WithSnapshotter(defaultSnapshotterName()),
894+
containerd.WithSnapshotter(defaultSnapshotterName),
895895
containerd.WithNewSnapshot("c1", image),
896896
runEchoHello,
897897
)
@@ -905,7 +905,7 @@ func TestStubDriveReserveAndReleaseByContainers_Isolated(t *testing.T) {
905905

906906
c2, err := client.NewContainer(ctx,
907907
"c2",
908-
containerd.WithSnapshotter(defaultSnapshotterName()),
908+
containerd.WithSnapshotter(defaultSnapshotterName),
909909
containerd.WithNewSnapshot("c2", image),
910910
runEchoHello,
911911
)
@@ -936,7 +936,7 @@ func TestDriveMount_Isolated(t *testing.T) {
936936
fcClient, err := fcClient.New(containerdSockPath + ".ttrpc")
937937
require.NoError(t, err, "failed to create fccontrol client")
938938

939-
image, err := alpineImage(ctx, ctrdClient, defaultSnapshotterName())
939+
image, err := alpineImage(ctx, ctrdClient, defaultSnapshotterName)
940940
require.NoError(t, err, "failed to get alpine image")
941941

942942
vmID := "test-drive-mount"
@@ -1041,7 +1041,7 @@ func TestDriveMount_Isolated(t *testing.T) {
10411041

10421042
newContainer, err := ctrdClient.NewContainer(ctx,
10431043
containerName,
1044-
containerd.WithSnapshotter(defaultSnapshotterName()),
1044+
containerd.WithSnapshotter(defaultSnapshotterName),
10451045
containerd.WithNewSnapshot(snapshotName, image),
10461046
containerd.WithNewSpec(
10471047
oci.WithProcessArgs("/bin/sh", "-c", strings.Join(append(ctrCommands,
@@ -1211,13 +1211,13 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
12111211
assert.Equal(t, expected, resp.Metadata)
12121212

12131213
// Check inside the vm
1214-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
1214+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
12151215
require.NoError(t, err, "failed to get alpine image")
12161216
containerName := "mmds-test"
12171217

12181218
newContainer, err := client.NewContainer(ctx,
12191219
containerName,
1220-
containerd.WithSnapshotter(defaultSnapshotterName()),
1220+
containerd.WithSnapshotter(defaultSnapshotterName),
12211221
containerd.WithNewSnapshot("mmds-test-all", image),
12221222
containerd.WithNewSpec(
12231223
oci.WithProcessArgs("/usr/bin/wget",
@@ -1237,7 +1237,7 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
12371237
containerName += "-entry"
12381238
newContainer, err = client.NewContainer(ctx,
12391239
containerName,
1240-
containerd.WithSnapshotter(defaultSnapshotterName()),
1240+
containerd.WithSnapshotter(defaultSnapshotterName),
12411241
containerd.WithNewSnapshot("mmds-test-entry", image),
12421242
containerd.WithNewSpec(
12431243
oci.WithProcessArgs("/usr/bin/wget",
@@ -1277,14 +1277,14 @@ func TestRandomness_Isolated(t *testing.T) {
12771277
require.NoError(t, err, "unable to create client to containerd service at %s, is containerd running?", containerdSockPath)
12781278
defer client.Close()
12791279

1280-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
1280+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
12811281
require.NoError(t, err, "failed to get alpine image")
12821282
containerName := "test-entropy"
12831283

12841284
const blockCount = 1024
12851285
ddContainer, err := client.NewContainer(ctx,
12861286
containerName,
1287-
containerd.WithSnapshotter(defaultSnapshotterName()),
1287+
containerd.WithSnapshotter(defaultSnapshotterName),
12881288
containerd.WithNewSnapshot("test-entropy-snapshot", image),
12891289
containerd.WithNewSpec(
12901290
oci.WithDefaultUnixDevices,
@@ -1412,7 +1412,7 @@ func TestStopVM_Isolated(t *testing.T) {
14121412

14131413
ctx := namespaces.WithNamespace(context.Background(), "default")
14141414

1415-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
1415+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
14161416
require.NoError(err, "failed to get alpine image")
14171417

14181418
pluginClient, err := ttrpcutil.NewClient(containerdSockPath + ".ttrpc")
@@ -1530,7 +1530,7 @@ func TestStopVM_Isolated(t *testing.T) {
15301530

15311531
c, err := client.NewContainer(ctx,
15321532
"container-"+vmID,
1533-
containerd.WithSnapshotter(defaultSnapshotterName()),
1533+
containerd.WithSnapshotter(defaultSnapshotterName),
15341534
containerd.WithNewSnapshot("snapshot-"+vmID, image),
15351535
containerd.WithNewSpec(oci.WithProcessArgs("/bin/echo", "-n", "hello"), firecrackeroci.WithVMID(vmID)),
15361536
)
@@ -1604,7 +1604,7 @@ func TestEvents_Isolated(t *testing.T) {
16041604
defer subscribeCancel()
16051605
eventCh, errCh := client.Subscribe(subscribeCtx, "topic")
16061606

1607-
image, err := alpineImage(ctx, client, defaultSnapshotterName())
1607+
image, err := alpineImage(ctx, client, defaultSnapshotterName)
16081608
require.NoError(err, "failed to get alpine image")
16091609

16101610
pluginClient, err := ttrpcutil.NewClient(containerdSockPath + ".ttrpc")
@@ -1618,7 +1618,7 @@ func TestEvents_Isolated(t *testing.T) {
16181618

16191619
c, err := client.NewContainer(ctx,
16201620
"container-"+vmID,
1621-
containerd.WithSnapshotter(defaultSnapshotterName()),
1621+
containerd.WithSnapshotter(defaultSnapshotterName),
16221622
containerd.WithNewSnapshot("snapshot-"+vmID, image),
16231623
containerd.WithNewSpec(oci.WithProcessArgs("/bin/echo", "-n", "hello"), firecrackeroci.WithVMID(vmID)),
16241624
)

tools/docker/Dockerfile.integ-test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ ENV DEBIAN_FRONTEND="noninteractive"
88

99
ARG FIRECRACKER_TARGET=x86_64-unknown-linux-musl
1010
ENV FICD_LOG_DIR="/var/log/firecracker-containerd-test"
11-
ENV FICD_SNAPSHOTTER="devmapper"
12-
ENV FICD_SNAPSHOTTER_OUTFILE="${FICD_LOG_DIR}/snapshotter.out"
1311
ENV FICD_CONTAINERD_OUTFILE="${FICD_LOG_DIR}/containerd.out"
1412

1513
RUN apt-get update && apt-get install --yes --no-install-recommends \

0 commit comments

Comments
 (0)