Skip to content

Commit 45088e7

Browse files
authored
Merge pull request #575 from henry118/containerd-1.6.0
Upgrade to containerd 1.6.0 release
2 parents df1a4b7 + c68b61c commit 45088e7

File tree

21 files changed

+554
-210
lines changed

21 files changed

+554
-210
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: ['ubuntu-18.04', 'ubuntu-20.04']
17-
go: ['1.15', '1.16', '1.17']
17+
go: ['1.16', '1.17']
1818
# Build all variants regardless of failures
1919
fail-fast: false
2020

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SUBMODULES=_submodules
2828
UID:=$(shell id -u)
2929
GID:=$(shell id -g)
3030

31-
FIRECRACKER_CONTAINERD_BUILDER_IMAGE?=golang:1.15-buster
31+
FIRECRACKER_CONTAINERD_BUILDER_IMAGE?=golang:1.16-buster
3232
export FIRECRACKER_CONTAINERD_TEST_IMAGE?=localhost/firecracker-containerd-test
3333
export GO_CACHE_VOLUME_NAME?=gocache
3434

@@ -257,7 +257,7 @@ $(TEST_BRIDGED_TAP_BIN): $(shell find internal/cmd/test-bridged-tap -name *.go)
257257
go build -o $@ $(CURDIR)/internal/cmd/test-bridged-tap
258258

259259
LOOPBACK_BIN?=$(BINPATH)/loopback
260-
$(LOOPBACK_BIN):
260+
$(LOOPBACK_BIN):
261261
GOBIN=$(dir $@) GO111MODULE=off go get -u github.com/containernetworking/plugins/plugins/main/loopback
262262

263263
.PHONY: cni-bins

agent/drive_handler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/containerd/containerd/mount"
2727
"github.com/firecracker-microvm/firecracker-containerd/internal"
2828
drivemount "github.com/firecracker-microvm/firecracker-containerd/proto/service/drivemount/ttrpc"
29-
"github.com/golang/protobuf/ptypes/empty"
29+
"github.com/gogo/protobuf/types"
3030
"github.com/pkg/errors"
3131
)
3232

@@ -165,7 +165,7 @@ func isStubDrive(d drive) bool {
165165
return internal.IsStubDrive(f)
166166
}
167167

168-
func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriveRequest) (*empty.Empty, error) {
168+
func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriveRequest) (*types.Empty, error) {
169169
logger := log.G(ctx)
170170
logger.Debugf("%+v", req.String())
171171
logger = logger.WithField("drive_id", req.DriveID)
@@ -201,7 +201,7 @@ func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriv
201201
Options: req.Options,
202202
}}, req.DestinationPath)
203203
if err == nil {
204-
return &empty.Empty{}, nil
204+
return &types.Empty{}, nil
205205
}
206206

207207
if isRetryableMountError(err) {
@@ -218,15 +218,15 @@ func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriv
218218
drive.Path(), req.DestinationPath)
219219
}
220220

221-
func (dh driveHandler) UnmountDrive(ctx context.Context, req *drivemount.UnmountDriveRequest) (*empty.Empty, error) {
221+
func (dh driveHandler) UnmountDrive(ctx context.Context, req *drivemount.UnmountDriveRequest) (*types.Empty, error) {
222222
drive, ok := dh.GetDrive(req.DriveID)
223223
if !ok {
224224
return nil, fmt.Errorf("drive %q could not be found", req.DriveID)
225225
}
226226

227227
err := mount.Unmount(drive.Path(), 0)
228228
if err == nil {
229-
return &empty.Empty{}, nil
229+
return &types.Empty{}, nil
230230
}
231231

232232
return nil, errors.Errorf("failed to unmount the drive %q",

agent/ioproxy_handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/containerd/containerd/runtime/v2/task"
2121
"github.com/firecracker-microvm/firecracker-containerd/internal/vm"
2222
ioproxy "github.com/firecracker-microvm/firecracker-containerd/proto/service/ioproxy/ttrpc"
23-
"github.com/golang/protobuf/ptypes/empty"
23+
"github.com/gogo/protobuf/types"
2424
)
2525

2626
// ioProxyHandler implements IOProxyService that exposes the state of
@@ -42,7 +42,7 @@ func (ps *ioProxyHandler) State(_ context.Context, req *ioproxy.StateRequest) (*
4242
}
4343

4444
// Attach a new IOProxy to the given exec.
45-
func (ps *ioProxyHandler) Attach(ctx context.Context, req *ioproxy.AttachRequest) (*empty.Empty, error) {
45+
func (ps *ioProxyHandler) Attach(ctx context.Context, req *ioproxy.AttachRequest) (*types.Empty, error) {
4646
state, err := ps.runcService.State(ctx, &task.StateRequest{ID: req.ID, ExecID: req.ExecID})
4747
if err != nil {
4848
return nil, err
@@ -66,5 +66,5 @@ func (ps *ioProxyHandler) Attach(ctx context.Context, req *ioproxy.AttachRequest
6666
return nil, err
6767
}
6868

69-
return &empty.Empty{}, nil
69+
return &types.Empty{}, nil
7070
}

firecracker-control/cmd/containerd/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
// Register containerd builtins
2424
// See https://github.com/containerd/containerd/blob/master/cmd/containerd/builtins.go
2525
_ "github.com/containerd/containerd/diff/walking/plugin"
26+
_ "github.com/containerd/containerd/events/plugin"
2627
_ "github.com/containerd/containerd/gc/scheduler"
2728
_ "github.com/containerd/containerd/runtime/restart/monitor"
2829
_ "github.com/containerd/containerd/services/containers"

firecracker-control/local.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"github.com/containerd/containerd/plugin"
3131
"github.com/containerd/containerd/runtime/v2/shim"
3232
"github.com/containerd/containerd/sys"
33-
"github.com/golang/protobuf/ptypes/empty"
33+
"github.com/gogo/protobuf/types"
3434
"github.com/hashicorp/go-multierror"
3535
"github.com/pkg/errors"
3636
"github.com/sirupsen/logrus"
@@ -231,7 +231,7 @@ func (s *local) shimFirecrackerClient(requestCtx context.Context, vmID string) (
231231

232232
// StopVM stops running VM instance by VM ID. This stops the VM, all tasks within the VM and the runtime shim
233233
// managing the VM.
234-
func (s *local) StopVM(requestCtx context.Context, req *proto.StopVMRequest) (*empty.Empty, error) {
234+
func (s *local) StopVM(requestCtx context.Context, req *proto.StopVMRequest) (*types.Empty, error) {
235235
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
236236
if err != nil {
237237
return nil, err
@@ -249,7 +249,7 @@ func (s *local) StopVM(requestCtx context.Context, req *proto.StopVMRequest) (*e
249249
}
250250

251251
// PauseVM pauses a VM
252-
func (s *local) PauseVM(ctx context.Context, req *proto.PauseVMRequest) (*empty.Empty, error) {
252+
func (s *local) PauseVM(ctx context.Context, req *proto.PauseVMRequest) (*types.Empty, error) {
253253
client, err := s.shimFirecrackerClient(ctx, req.VMID)
254254
if err != nil {
255255
return nil, err
@@ -267,7 +267,7 @@ func (s *local) PauseVM(ctx context.Context, req *proto.PauseVMRequest) (*empty.
267267
}
268268

269269
// ResumeVM resumes a VM
270-
func (s *local) ResumeVM(ctx context.Context, req *proto.ResumeVMRequest) (*empty.Empty, error) {
270+
func (s *local) ResumeVM(ctx context.Context, req *proto.ResumeVMRequest) (*types.Empty, error) {
271271
client, err := s.shimFirecrackerClient(ctx, req.VMID)
272272
if err != nil {
273273
return nil, err
@@ -322,7 +322,7 @@ func (s *local) GetVMInfo(requestCtx context.Context, req *proto.GetVMInfoReques
322322
}
323323

324324
// SetVMMetadata sets Firecracker instance metadata for the VM with the given VMID.
325-
func (s *local) SetVMMetadata(requestCtx context.Context, req *proto.SetVMMetadataRequest) (*empty.Empty, error) {
325+
func (s *local) SetVMMetadata(requestCtx context.Context, req *proto.SetVMMetadataRequest) (*types.Empty, error) {
326326
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
327327
if err != nil {
328328
return nil, err
@@ -341,7 +341,7 @@ func (s *local) SetVMMetadata(requestCtx context.Context, req *proto.SetVMMetada
341341
}
342342

343343
// UpdateVMMetadata updates Firecracker instance metadata for the VM with the given VMID.
344-
func (s *local) UpdateVMMetadata(requestCtx context.Context, req *proto.UpdateVMMetadataRequest) (*empty.Empty, error) {
344+
func (s *local) UpdateVMMetadata(requestCtx context.Context, req *proto.UpdateVMMetadataRequest) (*types.Empty, error) {
345345
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
346346
if err != nil {
347347
return nil, err
@@ -396,7 +396,7 @@ func (s *local) GetBalloonConfig(requestCtx context.Context, req *proto.GetBallo
396396
}
397397

398398
// UpdateBalloon updates memory size for an existing balloon device, before or after machine startup.
399-
func (s *local) UpdateBalloon(requestCtx context.Context, req *proto.UpdateBalloonRequest) (*empty.Empty, error) {
399+
func (s *local) UpdateBalloon(requestCtx context.Context, req *proto.UpdateBalloonRequest) (*types.Empty, error) {
400400
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
401401
if err != nil {
402402
return nil, err
@@ -432,7 +432,7 @@ func (s *local) GetBalloonStats(requestCtx context.Context, req *proto.GetBalloo
432432
}
433433

434434
// UpdateBalloonStats updates an existing balloon device statistics interval, before or after machine startup.
435-
func (s *local) UpdateBalloonStats(requestCtx context.Context, req *proto.UpdateBalloonStatsRequest) (*empty.Empty, error) {
435+
func (s *local) UpdateBalloonStats(requestCtx context.Context, req *proto.UpdateBalloonStatsRequest) (*types.Empty, error) {
436436
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
437437
if err != nil {
438438
return nil, err

firecracker-control/service.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/containerd/containerd/log"
2121
"github.com/containerd/containerd/plugin"
2222
"github.com/containerd/ttrpc"
23-
"github.com/golang/protobuf/ptypes/empty"
23+
"github.com/gogo/protobuf/types"
2424

2525
"github.com/firecracker-microvm/firecracker-containerd/proto"
2626
fccontrol "github.com/firecracker-microvm/firecracker-containerd/proto/service/fccontrol/ttrpc"
@@ -72,17 +72,17 @@ func (s *service) CreateVM(ctx context.Context, req *proto.CreateVMRequest) (*pr
7272
return s.local.CreateVM(ctx, req)
7373
}
7474

75-
func (s *service) PauseVM(ctx context.Context, req *proto.PauseVMRequest) (*empty.Empty, error) {
75+
func (s *service) PauseVM(ctx context.Context, req *proto.PauseVMRequest) (*types.Empty, error) {
7676
log.G(ctx).Debugf("pause VM request: %+v", req)
7777
return s.local.PauseVM(ctx, req)
7878
}
7979

80-
func (s *service) ResumeVM(ctx context.Context, req *proto.ResumeVMRequest) (*empty.Empty, error) {
80+
func (s *service) ResumeVM(ctx context.Context, req *proto.ResumeVMRequest) (*types.Empty, error) {
8181
log.G(ctx).Debugf("resume VM request: %+v", req)
8282
return s.local.ResumeVM(ctx, req)
8383
}
8484

85-
func (s *service) StopVM(ctx context.Context, req *proto.StopVMRequest) (*empty.Empty, error) {
85+
func (s *service) StopVM(ctx context.Context, req *proto.StopVMRequest) (*types.Empty, error) {
8686
log.G(ctx).Debugf("stop VM: %+v", req)
8787
return s.local.StopVM(ctx, req)
8888
}
@@ -92,12 +92,12 @@ func (s *service) GetVMInfo(ctx context.Context, req *proto.GetVMInfoRequest) (*
9292
return s.local.GetVMInfo(ctx, req)
9393
}
9494

95-
func (s *service) SetVMMetadata(ctx context.Context, req *proto.SetVMMetadataRequest) (*empty.Empty, error) {
95+
func (s *service) SetVMMetadata(ctx context.Context, req *proto.SetVMMetadataRequest) (*types.Empty, error) {
9696
log.G(ctx).Debug("Setting vm metadata")
9797
return s.local.SetVMMetadata(ctx, req)
9898
}
9999

100-
func (s *service) UpdateVMMetadata(ctx context.Context, req *proto.UpdateVMMetadataRequest) (*empty.Empty, error) {
100+
func (s *service) UpdateVMMetadata(ctx context.Context, req *proto.UpdateVMMetadataRequest) (*types.Empty, error) {
101101
log.G(ctx).Debug("Updating vm metadata")
102102
return s.local.UpdateVMMetadata(ctx, req)
103103
}
@@ -112,7 +112,7 @@ func (s *service) GetBalloonConfig(ctx context.Context, req *proto.GetBalloonCon
112112
return s.local.GetBalloonConfig(ctx, req)
113113
}
114114

115-
func (s *service) UpdateBalloon(ctx context.Context, req *proto.UpdateBalloonRequest) (*empty.Empty, error) {
115+
func (s *service) UpdateBalloon(ctx context.Context, req *proto.UpdateBalloonRequest) (*types.Empty, error) {
116116
log.G(ctx).Debug("Updating balloon memory size")
117117
return s.local.UpdateBalloon(ctx, req)
118118
}
@@ -122,7 +122,7 @@ func (s *service) GetBalloonStats(ctx context.Context, req *proto.GetBalloonStat
122122
return s.local.GetBalloonStats(ctx, req)
123123
}
124124

125-
func (s *service) UpdateBalloonStats(ctx context.Context, req *proto.UpdateBalloonStatsRequest) (*empty.Empty, error) {
125+
func (s *service) UpdateBalloonStats(ctx context.Context, req *proto.UpdateBalloonStatsRequest) (*types.Empty, error) {
126126
log.G(ctx).Debug("Updating balloon device statistics polling interval")
127127
return s.local.UpdateBalloonStats(ctx, req)
128128
}

go.mod

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
module github.com/firecracker-microvm/firecracker-containerd
22

33
require (
4-
github.com/Microsoft/go-winio v0.5.0 // indirect
54
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
65
github.com/awslabs/tc-redirect-tap v0.0.0-20211025175357-e30dfca224c2
7-
github.com/bits-and-blooms/bitset v1.2.1 // indirect
8-
github.com/containerd/containerd v1.5.9
9-
github.com/containerd/continuity v0.2.0
6+
github.com/containerd/containerd v1.6.0
7+
github.com/containerd/continuity v0.2.2
108
github.com/containerd/fifo v1.0.0
11-
github.com/containerd/go-cni v1.1.1 // indirect
129
github.com/containerd/go-runc v1.0.0
1310
github.com/containerd/ttrpc v1.1.0
1411
github.com/containerd/typeurl v1.0.2
@@ -17,42 +14,30 @@ require (
1714
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220214213810-2380785d98b7
1815
github.com/go-ole/go-ole v1.2.4 // indirect
1916
github.com/gofrs/uuid v3.3.0+incompatible
20-
github.com/gogo/googleapis v1.4.1 // indirect
2117
github.com/gogo/protobuf v1.3.2
22-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
23-
github.com/golang/protobuf v1.5.2
2418
github.com/hashicorp/go-multierror v1.1.1
2519
github.com/klauspost/compress v1.13.6 // indirect
2620
github.com/mdlayher/vsock v1.1.0
2721
github.com/miekg/dns v1.1.25
28-
github.com/opencontainers/image-spec v1.0.2
29-
github.com/opencontainers/runc v1.0.3
22+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
23+
github.com/opencontainers/runc v1.1.0
3024
github.com/opencontainers/runtime-spec v1.0.3-0.20210910115017-0d6cc581aeea
31-
github.com/opencontainers/selinux v1.8.5 // indirect
3225
github.com/pkg/errors v0.9.1
3326
github.com/shirou/gopsutil v2.18.12+incompatible
3427
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
3528
github.com/sirupsen/logrus v1.8.1
3629
github.com/stretchr/testify v1.7.0
3730
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
38-
go.opencensus.io v0.23.0 // indirect
3931
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
4032
golang.org/x/sys v0.0.0-20220209214540-3681064d5158
41-
google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e // indirect
42-
google.golang.org/grpc v1.41.0
33+
google.golang.org/grpc v1.43.0
4334
)
4435

36+
// Upgrade mongo-driver before go-openapi packages update the package.
4537
replace (
46-
// Pin gPRC-related dependencies as like containerd v1.5.x.
47-
github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2
48-
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5
49-
50-
// Upgrade mongo-driver before go-openapi packages update the package.
5138
go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver v1.5.1
52-
53-
// Pin gPRC-related dependencies as like containerd v1.5.x.
5439
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
55-
google.golang.org/grpc => google.golang.org/grpc v1.27.1
40+
google.golang.org/grpc => google.golang.org/grpc v1.38.1
5641
)
5742

5843
go 1.11

0 commit comments

Comments
 (0)