Skip to content

Commit 1e4ca67

Browse files
zkoopmansgvisor-bot
authored andcommitted
Internal change
PiperOrigin-RevId: 919856743
1 parent 27b70bc commit 1e4ca67

11 files changed

Lines changed: 1 addition & 219 deletions

File tree

pkg/shim/v1/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ go_library(
2020
"//pkg/shim/v1/extension",
2121
"//pkg/shim/v1/proc",
2222
"//pkg/shim/v1/runsc",
23-
"//pkg/shim/v1/runsc:hibernate_go_proto",
2423
"//pkg/shim/v1/runsccmd",
2524
"//pkg/sync",
2625
"//runsc/specutils",

pkg/shim/v1/extension/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ go_library(
1010
srcs = ["extension.go"],
1111
visibility = ["//visibility:public"],
1212
deps = [
13-
"//pkg/shim/v1/runsc:hibernate_go_proto",
1413
"@com_github_containerd_console//:go_default_library",
1514
"@com_github_containerd_containerd_api//runtime/task/v2:go_default_library",
1615
"@com_github_containerd_containerd_v2//pkg/stdio:go_default_library",

pkg/shim/v1/extension/extension.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/containerd/console"
2424
task "github.com/containerd/containerd/api/runtime/task/v2"
2525
"github.com/containerd/containerd/v2/pkg/stdio"
26-
hibernatepb "gvisor.dev/gvisor/pkg/shim/v1/runsc/hibernate_go_proto"
2726
)
2827

2928
// NewExtension registers an extension constructor. It may return nil, nil to indicate that the
@@ -99,6 +98,4 @@ type TaskServiceExt interface {
9998
task.TaskService
10099
CreateWithFSRestore(ctx context.Context, req *CreateWithFSRestoreRequest) (*task.CreateTaskResponse, error)
101100
Restore(ctx context.Context, req *RestoreRequest) (*task.StartResponse, error)
102-
Hide(ctx context.Context, req *hibernatepb.HideRequest, resp *hibernatepb.HideResponse) error
103-
Unhide(ctx context.Context, req *hibernatepb.UnhideRequest, resp *hibernatepb.UnhideResponse) error
104101
}

pkg/shim/v1/runsc/BUILD

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
load("//tools:defs.bzl", "go_library", "go_test", "proto_library")
1+
load("//tools:defs.bzl", "go_library", "go_test")
22

33
package(
44
default_applicable_licenses = ["//:license"],
55
licenses = ["notice"],
66
)
77

8-
proto_library(
9-
name = "hibernate",
10-
srcs = ["hibernate.proto"],
11-
has_services = True,
12-
visibility = [
13-
"//cloud/kubernetes/node/snapshot:__subpackages__",
14-
"//pkg/shim:__subpackages__",
15-
],
16-
)
17-
188
go_library(
199
name = "runsc",
2010
srcs = [
2111
"api.go",
2212
"container.go",
2313
"debug.go",
2414
"epoll.go",
25-
"hibernate.go",
26-
"hibernate_impl.go",
2715
"oom_v2.go",
2816
"options.go",
2917
"service.go",
@@ -32,7 +20,6 @@ go_library(
3220
],
3321
visibility = ["//pkg/shim:__subpackages__"],
3422
deps = [
35-
":hibernate_go_proto",
3623
"//pkg/cleanup",
3724
"//pkg/shim/v1/extension",
3825
"//pkg/shim/v1/proc",
@@ -67,7 +54,6 @@ go_library(
6754
"@com_github_containerd_fifo//:go_default_library",
6855
"@com_github_containerd_go_runc//:go_default_library",
6956
"@com_github_containerd_log//:go_default_library",
70-
"@com_github_containerd_ttrpc//:go_default_library",
7157
"@com_github_containerd_typeurl_v2//:go_default_library",
7258
"@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
7359
"@com_github_sirupsen_logrus//:go_default_library",

pkg/shim/v1/runsc/hibernate.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

pkg/shim/v1/runsc/hibernate.proto

Lines changed: 0 additions & 46 deletions
This file was deleted.

pkg/shim/v1/runsc/hibernate_impl.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

pkg/shim/v1/service.go

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package v1
1717

1818
import (
1919
"context"
20-
"fmt"
2120
"os"
2221

2322
task "github.com/containerd/containerd/api/runtime/task/v2"
@@ -27,7 +26,6 @@ import (
2726
errgrpc "github.com/containerd/errdefs/pkg/errgrpc"
2827
"github.com/containerd/log"
2928
"github.com/containerd/ttrpc"
30-
hibernatepb "gvisor.dev/gvisor/pkg/shim/v1/runsc/hibernate_go_proto"
3129

3230
"gvisor.dev/gvisor/pkg/shim/v1/extension"
3331
rsc "gvisor.dev/gvisor/pkg/shim/v1/runsc"
@@ -93,12 +91,6 @@ type shimRedirector struct {
9391
// grouping indicates if shim grouping is enabled.
9492
grouping bool
9593

96-
// hibernateServerOnce ensures that the hibernate service is only started once.
97-
hibernateServerOnce sync.Once
98-
99-
// hibernateServerEndpoint is the ttrpc server that listens for hibernate requests.
100-
hibernateServerEndpoint *rsc.HibernateServerEndpoint
101-
10294
shutdown shutdown.Service
10395
runtimeOptions *rsc.Options
10496
}
@@ -168,31 +160,6 @@ func (s *shimRedirector) initExt(ctx context.Context, r *task.CreateTaskRequest)
168160
}
169161
}
170162
}
171-
if s.runtimeOptions.EnableHibernateServer && isDaemon() {
172-
s.hibernateServerOnce.Do(func() {
173-
var err error
174-
s.hibernateServerEndpoint, err = rsc.NewHibernateServerEndpoint(s.runtimeOptions.Root, "shim", r.ID)
175-
if err != nil {
176-
log.L.Errorf("Failed to create hibernate server endpoint: %v", err)
177-
return
178-
}
179-
s.hibernateServerEndpoint.RegisterService(s.getLocked())
180-
s.shutdown.RegisterCallback(func(context.Context) error {
181-
return s.hibernateServerEndpoint.Shutdown(ctx)
182-
})
183-
if address, _ := shim.ReadAddress("hibernate_server"); len(address) > 0 {
184-
s.shutdown.RegisterCallback(func(context.Context) error {
185-
shim.RemoveSocket(fmt.Sprintf("unix://%s", address))
186-
return nil
187-
})
188-
}
189-
go func() {
190-
if err := s.hibernateServerEndpoint.Serve(context.Background()); err != nil {
191-
log.L.Errorf("Failed to start hibernate server: %v", err)
192-
}
193-
}()
194-
})
195-
}
196163
return nil
197164
}
198165

@@ -347,18 +314,6 @@ func (s *shimRedirector) Restore(ctx context.Context, r *extension.RestoreReques
347314
return resp, errgrpc.ToGRPC(err)
348315
}
349316

350-
func (s *shimRedirector) Hide(ctx context.Context, r *hibernatepb.HideRequest, resp *hibernatepb.HideResponse) error {
351-
log.L.Debugf("Hide, id: %s", r.GetContainerId())
352-
err := s.get().Hide(ctx, r, resp)
353-
return errgrpc.ToGRPC(err)
354-
}
355-
356-
func (s *shimRedirector) Unhide(ctx context.Context, r *hibernatepb.UnhideRequest, resp *hibernatepb.UnhideResponse) error {
357-
log.L.Debugf("Unhide, id: %s", r.GetContainerId())
358-
err := s.get().Unhide(ctx, r, resp)
359-
return errgrpc.ToGRPC(err)
360-
}
361-
362317
func (s *shimRedirector) RegisterTTRPC(server *ttrpc.Server) error {
363318
task.RegisterTaskService(server, s)
364319
return nil

runsc/cli/maincli/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ go_library(
99
name = "maincli",
1010
srcs = [
1111
"maincli.go",
12-
"maincli_impl.go",
1312
],
1413
visibility = [
1514
"//:__pkg__",

runsc/cli/maincli/maincli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ func commands() (map[util.SubCommand]string, []subcommands.Command) {
9191
new(cmd.Gofer): internalGroup,
9292
new(cmd.Umount): internalGroup,
9393
}
94-
extraCmds(cmds)
9594

9695
helpCmds := []subcommands.Command{
9796
// For historical reasons, these subcommands are invoked as `runsc help

0 commit comments

Comments
 (0)