Skip to content

Commit 13aeab3

Browse files
authored
Merge pull request #302 from kzys/upgrade-containerd
Upgrade containerd from v1.3.0-beta.2 to v1.3.0
2 parents 777c336 + 1fec606 commit 13aeab3

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

firecracker-control/local.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ import (
4444
)
4545

4646
var (
47-
_ fccontrolTtrpc.FirecrackerService = (*local)(nil)
47+
_ fccontrolTtrpc.FirecrackerService = (*local)(nil)
48+
ttrpcAddressEnv = "TTRPC_ADDRESS"
4849
)
4950

5051
func init() {
@@ -305,7 +306,9 @@ func (s *local) newShim(ns, vmID, containerdAddress string, shimSocket *net.Unix
305306
cmd.ExtraFiles = append(cmd.ExtraFiles, shimSocketFile, fcSocketFile)
306307
fcSocketFDNum := 2 + len(cmd.ExtraFiles) // "2 +" because ExtraFiles come after stderr (fd #2)
307308

309+
ttrpc := containerdAddress + ".ttrpc"
308310
cmd.Env = append(os.Environ(),
311+
fmt.Sprintf("%s=%s", ttrpcAddressEnv, ttrpc),
309312
fmt.Sprintf("%s=%s", internal.VMIDEnvVarKey, vmID),
310313
fmt.Sprintf("%s=%s", internal.FCSocketFDEnvKey, strconv.Itoa(fcSocketFDNum))) // TODO remove after containerd is updated to expose ttrpc server to shim
311314

@@ -318,6 +321,8 @@ func (s *local) newShim(ns, vmID, containerdAddress string, shimSocket *net.Unix
318321
// shim stdout on the other hand is already formatted by logrus, so pass that transparently through to containerd logs
319322
cmd.Stdout = logger.Logger.Out
320323

324+
logger.Debugf("starting %s", internal.ShimBinaryName)
325+
321326
err = cmd.Start()
322327
if err != nil {
323328
err = errors.Wrap(err, "failed to start shim child process")

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require (
55
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 // indirect
66
github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779 // indirect
77
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 // indirect
8-
github.com/containerd/containerd v1.3.0-beta.2
8+
github.com/containerd/containerd v1.3.0
99
github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac
1010
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c
1111
github.com/containerd/go-runc v0.0.0-20190226155025-7d11b49dc076 // indirect
@@ -27,6 +27,7 @@ require (
2727
github.com/golang/protobuf v1.3.1
2828
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
2929
github.com/hashicorp/go-multierror v1.0.0
30+
github.com/imdario/mergo v0.3.8 // indirect
3031
github.com/mdlayher/vsock v0.0.0-20190329173812-a92c53d5dcab
3132
github.com/miekg/dns v1.1.16
3233
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779 h1:j1IsLW6/hNZP
2323
github.com/containerd/cgroups v0.0.0-20181105182409-82cb49fc1779/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI=
2424
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 h1:WMpHmC6AxwWb9hMqhudkqG7A/p14KiMnl6d3r1iUMjU=
2525
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
26-
github.com/containerd/containerd v1.3.0-beta.2 h1:pNq4VOyEjYN11bpJK0EQkWF31vi5LmWLWwGeSD5MRlo=
27-
github.com/containerd/containerd v1.3.0-beta.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
26+
github.com/containerd/containerd v1.3.0 h1:xjvXQWABwS2uiv3TWgQt5Uth60Gu86LTGZXMJkjc7rY=
27+
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
2828
github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac h1:PThQaO4yCvJzJBUW1XoFQxLotWRhvX2fgljJX8yrhFI=
2929
github.com/containerd/continuity v0.0.0-20181027224239-bea7585dbfac/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
3030
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c h1:KFbqHhDeaHM7IfFtXHfUHMDaUStpM2YwBR+iJCIOsKk=
@@ -119,6 +119,8 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U
119119
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
120120
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
121121
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
122+
github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
123+
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
122124
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56 h1:742eGXur0715JMq73aD95/FU0XpVKXqNuTnEfXsLOYQ=
123125
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
124126
github.com/juju/errors v0.0.0-20180806074554-22422dad46e1/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=

runtime/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (s *service) serveFCControl() error {
268268
return nil
269269
}
270270

271-
func (s *service) StartShim(shimCtx context.Context, containerID, containerdBinary, containerdAddress string) (string, error) {
271+
func (s *service) StartShim(shimCtx context.Context, containerID, containerdBinary, containerdAddress, containerdTTRPCAddress string) (string, error) {
272272
// In the shim start routine, we can assume that containerd provided a "log" FIFO in the current working dir.
273273
// We have to use that instead of stdout/stderr because containerd reads the stdio pipes of shim start to get
274274
// either the shim address or the error returned here.
@@ -325,7 +325,7 @@ func (s *service) StartShim(shimCtx context.Context, containerID, containerdBina
325325
log.Info("will start a persistent VM")
326326
}
327327

328-
client, err := ttrpcutil.NewClient(containerdAddress + ".ttrpc")
328+
client, err := ttrpcutil.NewClient(containerdTTRPCAddress)
329329
if err != nil {
330330
return "", err
331331
}

0 commit comments

Comments
 (0)