Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to containerd 1.6.0 release #575

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-18.04', 'ubuntu-20.04']
go: ['1.15', '1.16', '1.17']
go: ['1.16', '1.17']
# Build all variants regardless of failures
fail-fast: false

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SUBMODULES=_submodules
UID:=$(shell id -u)
GID:=$(shell id -g)

FIRECRACKER_CONTAINERD_BUILDER_IMAGE?=golang:1.15-buster
FIRECRACKER_CONTAINERD_BUILDER_IMAGE?=golang:1.16-buster
export FIRECRACKER_CONTAINERD_TEST_IMAGE?=localhost/firecracker-containerd-test
export GO_CACHE_VOLUME_NAME?=gocache

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

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

.PHONY: cni-bins
Expand Down
10 changes: 5 additions & 5 deletions agent/drive_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/containerd/containerd/mount"
"github.com/firecracker-microvm/firecracker-containerd/internal"
drivemount "github.com/firecracker-microvm/firecracker-containerd/proto/service/drivemount/ttrpc"
"github.com/golang/protobuf/ptypes/empty"
"github.com/gogo/protobuf/types"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -165,7 +165,7 @@ func isStubDrive(d drive) bool {
return internal.IsStubDrive(f)
}

func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriveRequest) (*empty.Empty, error) {
func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriveRequest) (*types.Empty, error) {
logger := log.G(ctx)
logger.Debugf("%+v", req.String())
logger = logger.WithField("drive_id", req.DriveID)
Expand Down Expand Up @@ -201,7 +201,7 @@ func (dh driveHandler) MountDrive(ctx context.Context, req *drivemount.MountDriv
Options: req.Options,
}}, req.DestinationPath)
if err == nil {
return &empty.Empty{}, nil
return &types.Empty{}, nil
}

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

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

err := mount.Unmount(drive.Path(), 0)
if err == nil {
return &empty.Empty{}, nil
return &types.Empty{}, nil
}

return nil, errors.Errorf("failed to unmount the drive %q",
Expand Down
6 changes: 3 additions & 3 deletions agent/ioproxy_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/containerd/containerd/runtime/v2/task"
"github.com/firecracker-microvm/firecracker-containerd/internal/vm"
ioproxy "github.com/firecracker-microvm/firecracker-containerd/proto/service/ioproxy/ttrpc"
"github.com/golang/protobuf/ptypes/empty"
"github.com/gogo/protobuf/types"
)

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

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

return &empty.Empty{}, nil
return &types.Empty{}, nil
}
1 change: 1 addition & 0 deletions firecracker-control/cmd/containerd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
// Register containerd builtins
// See https://github.com/containerd/containerd/blob/master/cmd/containerd/builtins.go
_ "github.com/containerd/containerd/diff/walking/plugin"
_ "github.com/containerd/containerd/events/plugin"
_ "github.com/containerd/containerd/gc/scheduler"
_ "github.com/containerd/containerd/runtime/restart/monitor"
_ "github.com/containerd/containerd/services/containers"
Expand Down
16 changes: 8 additions & 8 deletions firecracker-control/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/runtime/v2/shim"
"github.com/containerd/containerd/sys"
"github.com/golang/protobuf/ptypes/empty"
"github.com/gogo/protobuf/types"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -231,7 +231,7 @@ func (s *local) shimFirecrackerClient(requestCtx context.Context, vmID string) (

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

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

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

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

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

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

// UpdateBalloonStats updates an existing balloon device statistics interval, before or after machine startup.
func (s *local) UpdateBalloonStats(requestCtx context.Context, req *proto.UpdateBalloonStatsRequest) (*empty.Empty, error) {
func (s *local) UpdateBalloonStats(requestCtx context.Context, req *proto.UpdateBalloonStatsRequest) (*types.Empty, error) {
client, err := s.shimFirecrackerClient(requestCtx, req.VMID)
if err != nil {
return nil, err
Expand Down
16 changes: 8 additions & 8 deletions firecracker-control/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/plugin"
"github.com/containerd/ttrpc"
"github.com/golang/protobuf/ptypes/empty"
"github.com/gogo/protobuf/types"

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

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

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

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

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

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

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

func (s *service) UpdateBalloonStats(ctx context.Context, req *proto.UpdateBalloonStatsRequest) (*empty.Empty, error) {
func (s *service) UpdateBalloonStats(ctx context.Context, req *proto.UpdateBalloonStatsRequest) (*types.Empty, error) {
log.G(ctx).Debug("Updating balloon device statistics polling interval")
return s.local.UpdateBalloonStats(ctx, req)
}
29 changes: 7 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
module github.com/firecracker-microvm/firecracker-containerd

require (
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
github.com/awslabs/tc-redirect-tap v0.0.0-20211025175357-e30dfca224c2
github.com/bits-and-blooms/bitset v1.2.1 // indirect
github.com/containerd/containerd v1.5.9
github.com/containerd/continuity v0.2.0
github.com/containerd/containerd v1.6.0
github.com/containerd/continuity v0.2.2
github.com/containerd/fifo v1.0.0
github.com/containerd/go-cni v1.1.1 // indirect
github.com/containerd/go-runc v1.0.0
github.com/containerd/ttrpc v1.1.0
github.com/containerd/typeurl v1.0.2
Expand All @@ -17,42 +14,30 @@ require (
github.com/firecracker-microvm/firecracker-go-sdk v0.22.1-0.20220214213810-2380785d98b7
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gofrs/uuid v3.3.0+incompatible
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2
github.com/hashicorp/go-multierror v1.1.1
github.com/klauspost/compress v1.13.6 // indirect
github.com/mdlayher/vsock v1.1.0
github.com/miekg/dns v1.1.25
github.com/opencontainers/image-spec v1.0.2
github.com/opencontainers/runc v1.0.3
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
github.com/opencontainers/runc v1.1.0
github.com/opencontainers/runtime-spec v1.0.3-0.20210910115017-0d6cc581aeea
github.com/opencontainers/selinux v1.8.5 // indirect
github.com/pkg/errors v0.9.1
github.com/shirou/gopsutil v2.18.12+incompatible
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
go.opencensus.io v0.23.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220209214540-3681064d5158
google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e // indirect
google.golang.org/grpc v1.41.0
google.golang.org/grpc v1.43.0
)

// Upgrade mongo-driver before go-openapi packages update the package.
replace (
// Pin gPRC-related dependencies as like containerd v1.5.x.
github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5

// Upgrade mongo-driver before go-openapi packages update the package.
go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver v1.5.1

// Pin gPRC-related dependencies as like containerd v1.5.x.
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
google.golang.org/grpc => google.golang.org/grpc v1.27.1
google.golang.org/grpc => google.golang.org/grpc v1.38.1
)

go 1.11
Loading