Implement options for runtime specific settings

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-23 14:55:10 -07:00
parent eedcbc64cc
commit 82d0208aaa
18 changed files with 1701 additions and 467 deletions

View File

@@ -0,0 +1,3 @@
package runcopts
const URIBase = "containerd.io/linux/runc"

1153
linux/runcopts/runc.pb.go Normal file

File diff suppressed because it is too large Load Diff

33
linux/runcopts/runc.proto Normal file
View File

@@ -0,0 +1,33 @@
syntax = "proto3";
package containerd.linux.runc;
import "gogoproto/gogo.proto";
option go_package = "github.com/containerd/containerd/linux/runcopts;runcopts";
message RuncOptions {
string criu_path = 1;
string systemd_cgroup = 2;
}
message CreateOptions {
bool no_pivot_root = 1;
bool open_tcp = 2;
bool external_unix_sockets = 3;
bool terminal = 4;
bool file_locks = 5;
repeated string empty_namespaces = 6;
string cgroups_mode = 7;
bool no_new_keyring = 8;
}
message CheckpointOptions {
bool exit = 1;
bool open_tcp = 2;
bool external_unix_sockets = 3;
bool terminal = 4;
bool file_locks = 5;
repeated string empty_namespaces = 6;
string cgroups_mode = 7;
}

View File

@@ -25,6 +25,7 @@ import (
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/runtime"
runc "github.com/containerd/go-runc"
protobuf "github.com/gogo/protobuf/types"
google_protobuf "github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
@@ -171,6 +172,9 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
Stderr: opts.IO.Stderr,
Terminal: opts.IO.Terminal,
Checkpoint: opts.Checkpoint,
Options: &protobuf.Any{
Value: opts.Options,
},
}
for _, m := range opts.Rootfs {
sopts.Rootfs = append(sopts.Rootfs, &types.Mount{

View File

@@ -17,12 +17,14 @@ import (
"golang.org/x/sys/unix"
"github.com/containerd/console"
"github.com/containerd/containerd/linux/runcopts"
shimapi "github.com/containerd/containerd/linux/shim/v1"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/runtime"
"github.com/containerd/fifo"
runc "github.com/containerd/go-runc"
"github.com/gogo/protobuf/proto"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
)
@@ -54,6 +56,12 @@ type initProcess struct {
}
func newInitProcess(context context.Context, path, namespace string, r *shimapi.CreateTaskRequest) (*initProcess, error) {
var options runcopts.CreateOptions
if r.Options != nil {
if err := proto.Unmarshal(r.Options.Value, &options); err != nil {
return nil, err
}
}
for _, rm := range r.Rootfs {
m := &mount.Mount{
Type: rm.Type,
@@ -105,10 +113,9 @@ func newInitProcess(context context.Context, path, namespace string, r *shimapi.
WorkDir: filepath.Join(r.Bundle, "work"),
ParentPath: r.ParentCheckpoint,
},
PidFile: pidFile,
IO: io,
// TODO: implement runtime options
//NoPivot: r.NoPivot,
PidFile: pidFile,
IO: io,
NoPivot: options.NoPivotRoot,
Detach: true,
NoSubreaper: true,
}
@@ -117,9 +124,10 @@ func newInitProcess(context context.Context, path, namespace string, r *shimapi.
}
} else {
opts := &runc.CreateOpts{
PidFile: pidFile,
IO: io,
// NoPivot: r.NoPivot,
PidFile: pidFile,
IO: io,
NoPivot: options.NoPivotRoot,
NoNewKeyring: options.NoNewKeyring,
}
if socket != nil {
opts.ConsoleSocket = socket
@@ -256,25 +264,26 @@ func (p *initProcess) Stdin() io.Closer {
}
func (p *initProcess) Checkpoint(context context.Context, r *shimapi.CheckpointTaskRequest) error {
var actions []runc.CheckpointAction
/*
if !r.Exit {
actions = append(actions, runc.LeaveRunning)
var options runcopts.CheckpointOptions
if r.Options != nil {
if err := proto.Unmarshal(r.Options.Value, &options); err != nil {
return err
}
*/
}
var actions []runc.CheckpointAction
if !options.Exit {
actions = append(actions, runc.LeaveRunning)
}
work := filepath.Join(p.bundle, "work")
defer os.RemoveAll(work)
// TODO: convert options into runc flags or a better format for criu
if err := p.runc.Checkpoint(context, p.id, &runc.CheckpointOpts{
WorkDir: work,
ImagePath: r.Path,
/*
AllowOpenTCP: r.AllowTcp,
AllowExternalUnixSockets: r.AllowUnixSockets,
AllowTerminal: r.AllowTerminal,
FileLocks: r.FileLocks,
EmptyNamespaces: r.EmptyNamespaces,
*/
WorkDir: work,
ImagePath: r.Path,
AllowOpenTCP: options.OpenTcp,
AllowExternalUnixSockets: options.ExternalUnixSockets,
AllowTerminal: options.Terminal,
FileLocks: options.FileLocks,
EmptyNamespaces: options.EmptyNamespaces,
}, actions...); err != nil {
dumpLog := filepath.Join(p.bundle, "criu-dump.log")
if cerr := copyFile(dumpLog, filepath.Join(work, "dump.log")); cerr != nil {

View File

@@ -50,7 +50,6 @@ import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
import io "io"
@@ -77,6 +76,7 @@ type CreateTaskRequest struct {
Stderr string `protobuf:"bytes,8,opt,name=stderr,proto3" json:"stderr,omitempty"`
Checkpoint string `protobuf:"bytes,9,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
ParentCheckpoint string `protobuf:"bytes,10,opt,name=parent_checkpoint,json=parentCheckpoint,proto3" json:"parent_checkpoint,omitempty"`
Options *google_protobuf.Any `protobuf:"bytes,11,opt,name=options" json:"options,omitempty"`
}
func (m *CreateTaskRequest) Reset() { *m = CreateTaskRequest{} }
@@ -191,8 +191,8 @@ func (*ListPidsResponse) ProtoMessage() {}
func (*ListPidsResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{11} }
type CheckpointTaskRequest struct {
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Options map[string]string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Options *google_protobuf.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
}
func (m *CheckpointTaskRequest) Reset() { *m = CheckpointTaskRequest{} }
@@ -925,6 +925,16 @@ func (m *CreateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintShim(dAtA, i, uint64(len(m.ParentCheckpoint)))
i += copy(dAtA[i:], m.ParentCheckpoint)
}
if m.Options != nil {
dAtA[i] = 0x5a
i++
i = encodeVarintShim(dAtA, i, uint64(m.Options.Size()))
n1, err := m.Options.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
return i, nil
}
@@ -979,11 +989,11 @@ func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x1a
i++
i = encodeVarintShim(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
i += n2
return i, nil
}
@@ -1057,11 +1067,11 @@ func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x2a
i++
i = encodeVarintShim(dAtA, i, uint64(m.Spec.Size()))
n2, err := m.Spec.MarshalTo(dAtA[i:])
n3, err := m.Spec.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
i += n3
}
return i, nil
}
@@ -1313,21 +1323,21 @@ func (m *ListPidsResponse) MarshalTo(dAtA []byte) (int, error) {
var l int
_ = l
if len(m.Pids) > 0 {
dAtA4 := make([]byte, len(m.Pids)*10)
var j3 int
dAtA5 := make([]byte, len(m.Pids)*10)
var j4 int
for _, num := range m.Pids {
for num >= 1<<7 {
dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j3++
j4++
}
dAtA4[j3] = uint8(num)
j3++
dAtA5[j4] = uint8(num)
j4++
}
dAtA[i] = 0xa
i++
i = encodeVarintShim(dAtA, i, uint64(j3))
i += copy(dAtA[i:], dAtA4[:j3])
i = encodeVarintShim(dAtA, i, uint64(j4))
i += copy(dAtA[i:], dAtA5[:j4])
}
return i, nil
}
@@ -1353,22 +1363,15 @@ func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintShim(dAtA, i, uint64(len(m.Path)))
i += copy(dAtA[i:], m.Path)
}
if len(m.Options) > 0 {
for k, _ := range m.Options {
dAtA[i] = 0x12
i++
v := m.Options[k]
mapSize := 1 + len(k) + sovShim(uint64(len(k))) + 1 + len(v) + sovShim(uint64(len(v)))
i = encodeVarintShim(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintShim(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintShim(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
if m.Options != nil {
dAtA[i] = 0x12
i++
i = encodeVarintShim(dAtA, i, uint64(m.Options.Size()))
n6, err := m.Options.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
}
return i, nil
}
@@ -1433,11 +1436,11 @@ func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintShim(dAtA, i, uint64(m.Resources.Size()))
n5, err := m.Resources.MarshalTo(dAtA[i:])
n7, err := m.Resources.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n5
i += n7
}
return i, nil
}
@@ -1513,6 +1516,10 @@ func (m *CreateTaskRequest) Size() (n int) {
if l > 0 {
n += 1 + l + sovShim(uint64(l))
}
if m.Options != nil {
l = m.Options.Size()
n += 1 + l + sovShim(uint64(l))
}
return n
}
@@ -1695,13 +1702,9 @@ func (m *CheckpointTaskRequest) Size() (n int) {
if l > 0 {
n += 1 + l + sovShim(uint64(l))
}
if len(m.Options) > 0 {
for k, v := range m.Options {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovShim(uint64(len(k))) + 1 + len(v) + sovShim(uint64(len(v)))
n += mapEntrySize + 1 + sovShim(uint64(mapEntrySize))
}
if m.Options != nil {
l = m.Options.Size()
n += 1 + l + sovShim(uint64(l))
}
return n
}
@@ -1759,6 +1762,7 @@ func (this *CreateTaskRequest) String() string {
`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
`Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`,
`ParentCheckpoint:` + fmt.Sprintf("%v", this.ParentCheckpoint) + `,`,
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf.Any", 1) + `,`,
`}`,
}, "")
return s
@@ -1896,19 +1900,9 @@ func (this *CheckpointTaskRequest) String() string {
if this == nil {
return "nil"
}
keysForOptions := make([]string, 0, len(this.Options))
for k, _ := range this.Options {
keysForOptions = append(keysForOptions, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
mapStringForOptions := "map[string]string{"
for _, k := range keysForOptions {
mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k])
}
mapStringForOptions += "}"
s := strings.Join([]string{`&CheckpointTaskRequest{`,
`Path:` + fmt.Sprintf("%v", this.Path) + `,`,
`Options:` + mapStringForOptions + `,`,
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf.Any", 1) + `,`,
`}`,
}, "")
return s
@@ -2262,6 +2256,39 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error {
}
m.ParentCheckpoint = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 11:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthShim
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Options == nil {
m.Options = &google_protobuf.Any{}
}
if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipShim(dAtA[iNdEx:])
@@ -3661,94 +3688,11 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
var keykey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
keykey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthShim
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey := string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
if m.Options == nil {
m.Options = make(map[string]string)
m.Options = &google_protobuf.Any{}
}
if iNdEx < postIndex {
var valuekey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
valuekey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapvalue uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapvalue |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapvalue := int(stringLenmapvalue)
if intStringLenmapvalue < 0 {
return ErrInvalidLengthShim
}
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
if postStringIndexmapvalue > l {
return io.ErrUnexpectedEOF
}
mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue])
iNdEx = postStringIndexmapvalue
m.Options[mapkey] = mapvalue
} else {
var mapvalue string
m.Options[mapkey] = mapvalue
if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
@@ -4084,77 +4028,75 @@ func init() {
}
var fileDescriptorShim = []byte{
// 1148 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x73, 0xdb, 0x44,
0x14, 0xaf, 0x6c, 0x47, 0xb1, 0x9f, 0x71, 0x48, 0xb6, 0x69, 0x50, 0x5d, 0xc6, 0xc9, 0xe8, 0x50,
0xcc, 0x74, 0x2a, 0x35, 0x0e, 0x6d, 0x43, 0x38, 0xe5, 0xdf, 0x30, 0x19, 0xc8, 0xd4, 0xa3, 0xb4,
0x30, 0xc3, 0x0c, 0x64, 0x14, 0x6b, 0x63, 0xef, 0x44, 0x96, 0x54, 0xed, 0xca, 0xc4, 0x9c, 0x38,
0x71, 0xe6, 0x23, 0x70, 0xe0, 0xc6, 0x67, 0xe0, 0x4c, 0x8e, 0x1c, 0x39, 0x15, 0x9a, 0x4f, 0xc2,
0xec, 0x6a, 0x15, 0xc9, 0x76, 0x84, 0xed, 0x0e, 0x97, 0x78, 0xdf, 0xee, 0xfb, 0xbd, 0x7d, 0xfb,
0x7b, 0xff, 0x14, 0xf8, 0xb4, 0x4b, 0x58, 0x2f, 0x3a, 0x33, 0x3a, 0x7e, 0xdf, 0xec, 0xf8, 0x1e,
0xb3, 0x89, 0x87, 0x43, 0x27, 0xbb, 0x74, 0x89, 0x17, 0x5d, 0x9a, 0xb4, 0x47, 0xfa, 0xe6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16, 0x44,
0xa9, 0x2c, 0xf8, 0x1a, 0x2a, 0x37, 0xf3, 0x18, 0xcd, 0x91, 0x46, 0x93, 0xc3, 0x3b, 0xd7, 0x9a,
0x63, 0x58, 0x51, 0x23, 0x02, 0xcd, 0x51, 0x0e, 0xe3, 0xd3, 0x24, 0xf7, 0xd2, 0xaf, 0xa0, 0x9c,
0x74, 0xe3, 0xdc, 0xe4, 0x9b, 0xc3, 0x88, 0xa9, 0x8e, 0xfe, 0x1a, 0xf4, 0xb8, 0x3f, 0xcf, 0xd3,
0xfb, 0xa6, 0x3a, 0x79, 0x1e, 0xdd, 0xbd, 0xa3, 0xeb, 0x77, 0x8d, 0xa5, 0x3f, 0xde, 0x35, 0x96,
0x7e, 0x1c, 0x35, 0xb4, 0xeb, 0x51, 0x43, 0xfb, 0x7d, 0xd4, 0xd0, 0xfe, 0x1a, 0x35, 0xb4, 0x6f,
0x76, 0x16, 0xfb, 0x27, 0xed, 0x53, 0xf1, 0x7b, 0xaa, 0xcb, 0xeb, 0x77, 0xfe, 0x09, 0x00, 0x00,
0xff, 0xff, 0xe2, 0x51, 0xa8, 0x39, 0xe2, 0x0d, 0x00, 0x00,
}

View File

@@ -63,6 +63,7 @@ message CreateTaskRequest {
string stderr = 8;
string checkpoint = 9;
string parent_checkpoint = 10;
google.protobuf.Any options = 11;
}
message CreateTaskResponse {
@@ -130,7 +131,7 @@ message ListPidsResponse{
message CheckpointTaskRequest {
string path = 1;
map<string, string> options = 2;
google.protobuf.Any options = 2;
}
message ShimInfoResponse {

View File

@@ -160,10 +160,12 @@ func (t *Task) CloseIO(ctx context.Context, pid uint32) error {
return err
}
func (t *Task) Checkpoint(ctx context.Context, path string, options map[string]string) error {
func (t *Task) Checkpoint(ctx context.Context, path string, options []byte) error {
r := &shim.CheckpointTaskRequest{
Path: path,
Options: options,
Path: path,
Options: &protobuf.Any{
Value: options,
},
}
if _, err := t.shim.Checkpoint(ctx, r); err != nil {
return errors.New(grpc.ErrorDesc(err))