mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Upgrade containerd in gVisor, from v1.4.13 to v1.6.36.
PiperOrigin-RevId: 679295130
This commit is contained in:
@@ -2405,8 +2405,8 @@ go_repository(
|
||||
name = "com_github_containerd_containerd",
|
||||
build_file_proto_mode = "disable",
|
||||
importpath = "github.com/containerd/containerd",
|
||||
sum = "h1:Z0CbagVdn9VN4K6htOCY/jApSw8YKP+RdLZ5dkXF8PM=",
|
||||
version = "v1.4.13",
|
||||
sum = "h1:Bcj0ZXqgIs6GG+YbaKkMX3Dap0JsIVG4UYFOLRo7iX4=",
|
||||
version = "v1.6.36",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
@@ -2726,6 +2726,14 @@ go_repository(
|
||||
version = "v0.3.0",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_containerd_errdefs",
|
||||
build_file_proto_mode = "disable",
|
||||
importpath = "github.com/containerd/errdefs",
|
||||
sum = "h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM=",
|
||||
version = "v0.1.0",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_containerd_fifo",
|
||||
importpath = "github.com/containerd/fifo",
|
||||
@@ -2733,6 +2741,14 @@ go_repository(
|
||||
version = "v1.0.0",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_containerd_log",
|
||||
build_file_proto_mode = "disable",
|
||||
importpath = "github.com/containerd/log",
|
||||
sum = "h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=",
|
||||
version = "v0.1.0",
|
||||
)
|
||||
|
||||
go_repository(
|
||||
name = "com_github_containerd_go_runc",
|
||||
importpath = "github.com/containerd/go-runc",
|
||||
|
||||
@@ -7,9 +7,9 @@ require (
|
||||
github.com/bazelbuild/rules_go v0.44.2
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/cilium/ebpf v0.12.3
|
||||
github.com/containerd/cgroups v1.0.1
|
||||
github.com/containerd/console v1.0.1
|
||||
github.com/containerd/containerd v1.4.13
|
||||
github.com/containerd/cgroups v1.0.4
|
||||
github.com/containerd/console v1.0.3
|
||||
github.com/containerd/containerd v1.6.36
|
||||
github.com/containerd/fifo v1.0.0
|
||||
github.com/containerd/go-runc v1.0.0
|
||||
github.com/containerd/typeurl v1.0.2
|
||||
@@ -19,7 +19,7 @@ require (
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/google/btree v1.1.2
|
||||
github.com/google/subcommands v1.0.2-0.20190508160503-636abe8753b8
|
||||
github.com/kr/pty v1.1.1
|
||||
github.com/kr/pty v1.1.5
|
||||
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a
|
||||
github.com/mohae/deepcopy v0.0.0-20170308212314-bb9b5e7adda9
|
||||
github.com/opencontainers/runtime-spec v1.1.0-rc.1
|
||||
@@ -28,10 +28,10 @@ require (
|
||||
github.com/vishvananda/netlink v1.1.1-0.20211118161826-650dca95af54
|
||||
golang.org/x/mod v0.14.0
|
||||
golang.org/x/sync v0.6.0
|
||||
golang.org/x/sys v0.17.0
|
||||
golang.org/x/sys v0.18.0
|
||||
golang.org/x/time v0.5.0
|
||||
golang.org/x/tools v0.16.1
|
||||
google.golang.org/protobuf v1.32.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
k8s.io/api v0.23.16
|
||||
k8s.io/apimachinery v0.23.16
|
||||
k8s.io/client-go v0.23.16
|
||||
@@ -39,38 +39,51 @@ require (
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.6.0 // indirect
|
||||
github.com/Microsoft/hcsshim v0.8.14 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.12 // indirect
|
||||
github.com/containerd/continuity v0.3.0 // indirect
|
||||
github.com/containerd/ttrpc v1.1.0 // indirect
|
||||
github.com/containerd/errdefs v0.1.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/ttrpc v1.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/go-logr/logr v1.2.0 // indirect
|
||||
github.com/go-logr/logr v1.3.0 // indirect
|
||||
github.com/gogo/googleapis v1.4.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/mock v1.7.0-rc.1 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/go-github/v56 v56.0.0 // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/googleapis/gnostic v0.5.5 // indirect
|
||||
github.com/hanwen/go-fuse/v2 v2.3.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.15.9 // indirect
|
||||
github.com/moby/locker v1.0.1 // indirect
|
||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||
github.com/moby/sys/signal v0.6.0 // indirect
|
||||
github.com/moby/sys/user v0.1.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.1.0 // indirect
|
||||
github.com/opencontainers/selinux v1.10.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
|
||||
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
|
||||
golang.org/x/net v0.20.0 // indirect
|
||||
golang.org/x/oauth2 v0.4.0 // indirect
|
||||
golang.org/x/term v0.16.0 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/oauth2 v0.11.0 // indirect
|
||||
golang.org/x/term v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
|
||||
google.golang.org/grpc v1.53.0-dev.0.20230123225046-4075ef07c5d5 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
|
||||
google.golang.org/grpc v1.59.0 // indirect
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||
@@ -84,4 +97,4 @@ require (
|
||||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
sigs.k8s.io/yaml v1.2.0 // indirect
|
||||
)
|
||||
)
|
||||
@@ -19,6 +19,7 @@ go_library(
|
||||
"@com_github_containerd_containerd//namespaces:go_default_library",
|
||||
"@com_github_containerd_containerd//runtime/v2/shim:go_default_library",
|
||||
"@com_github_containerd_containerd//runtime/v2/task:go_default_library",
|
||||
"@com_github_containerd_containerd//sys:go_default_library",
|
||||
"@com_github_gogo_protobuf//types:go_default_library",
|
||||
"@org_golang_x_sys//unix:go_default_library",
|
||||
],
|
||||
|
||||
@@ -238,7 +238,7 @@ func (e *execProcess) start(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to retrieve console master: %w", err)
|
||||
}
|
||||
if e.console, err = e.parent.Platform.CopyConsole(ctx, console, e.stdio.Stdin, e.stdio.Stdout, e.stdio.Stderr, &e.wg); err != nil {
|
||||
if e.console, err = e.parent.Platform.CopyConsole(ctx, console, e.id, e.stdio.Stdin, e.stdio.Stdout, e.stdio.Stderr, &e.wg); err != nil {
|
||||
return fmt.Errorf("failed to start console copy: %w", err)
|
||||
}
|
||||
} else if !e.stdio.IsNull() {
|
||||
|
||||
@@ -155,7 +155,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) (err error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to retrieve console master: %w", err)
|
||||
}
|
||||
console, err = p.Platform.CopyConsole(ctx, console, r.Stdin, r.Stdout, r.Stderr, &p.wg)
|
||||
console, err = p.Platform.CopyConsole(ctx, console, r.ID, r.Stdin, r.Stdout, r.Stderr, &p.wg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to start console copy: %w", err)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ type linuxPlatform struct {
|
||||
epoller *console.Epoller
|
||||
}
|
||||
|
||||
func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console, stdin, stdout, stderr string, wg *sync.WaitGroup) (console.Console, error) {
|
||||
func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console, id, stdin, stdout, stderr string, wg *sync.WaitGroup) (console.Console, error) {
|
||||
if p.epoller == nil {
|
||||
return nil, fmt.Errorf("uninitialized epoller")
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ func (r *Runsc) Create(context context.Context, id, bundle string, opts *CreateO
|
||||
return err
|
||||
}
|
||||
|
||||
// Pause will pause a running container.
|
||||
func (r *Runsc) Pause(context context.Context, id string) error {
|
||||
if out, _, err := cmdOutput(r.command(context, "pause", id), true); err != nil {
|
||||
return fmt.Errorf("unable to pause: %w: %s", err, out)
|
||||
@@ -185,6 +186,7 @@ func (r *Runsc) Pause(context context.Context, id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Resume will resume a paused container.
|
||||
func (r *Runsc) Resume(context context.Context, id string) error {
|
||||
if out, _, err := cmdOutput(r.command(context, "resume", id), true); err != nil {
|
||||
return fmt.Errorf("unable to resume: %w: %s", err, out)
|
||||
|
||||
+8
-5
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/containerd/containerd/namespaces"
|
||||
"github.com/containerd/containerd/runtime/v2/shim"
|
||||
taskapi "github.com/containerd/containerd/runtime/v2/task"
|
||||
"github.com/containerd/containerd/sys"
|
||||
"github.com/gogo/protobuf/types"
|
||||
"golang.org/x/sys/unix"
|
||||
"gvisor.dev/gvisor/pkg/cleanup"
|
||||
@@ -39,6 +40,8 @@ const (
|
||||
// shimAddressPath is the relative path to a file that contains the address
|
||||
// to the shim UDS. See service.shimAddress.
|
||||
shimAddressPath = "address"
|
||||
// oomScoreMaxKillable is the maximum score keeping the process killable by the oom killer
|
||||
oomScoreMaxKillable = -999
|
||||
)
|
||||
|
||||
// New returns a new shim service that can be used via gRPC.
|
||||
@@ -149,14 +152,14 @@ func (s *service) newCommand(ctx context.Context, containerdBinary, containerdAd
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (string, error) {
|
||||
log.L.Debugf("StartShim, id: %s, binary: %q, address: %q", id, containerdBinary, containerdAddress)
|
||||
func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (string, error) {
|
||||
log.L.Debugf("StartShim, id: %s, binary: %q, address: %q", opts.ID, opts.ContainerdBinary, opts.Address)
|
||||
|
||||
cmd, err := s.newCommand(ctx, containerdBinary, containerdAddress)
|
||||
cmd, err := s.newCommand(ctx, opts.ContainerdBinary, opts.Address)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
address, err := shim.SocketAddress(ctx, containerdAddress, id)
|
||||
address, err := shim.SocketAddress(ctx, opts.Address, opts.ID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -210,7 +213,7 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container
|
||||
if err := shim.WriteAddress(shimAddressPath, address); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := shim.SetScore(cmd.Process.Pid); err != nil {
|
||||
if err := sys.SetOOMScore(cmd.Process.Pid, oomScoreMaxKillable); err != nil {
|
||||
return "", fmt.Errorf("failed to set OOM Score on shim: %w", err)
|
||||
}
|
||||
cu.Release()
|
||||
|
||||
Reference in New Issue
Block a user