diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index 005ed7c5a3..76ef109634 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -1,33 +1,20 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto -/* - Package options is a generated protocol buffer package. - - It is generated from these files: - github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto - - It has these top-level messages: - Options - ProcessDetails -*/ package options -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// skipping weak import gogoproto "github.com/gogo/protobuf/gogoproto" -import _ "github.com/gogo/protobuf/types" - -import time "time" - -import types "github.com/gogo/protobuf/types" +import ( + fmt "fmt" + io "io" + math "math" + reflect "reflect" + strings "strings" + time "time" -import strings "strings" -import reflect "reflect" - -import io "io" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -54,6 +41,7 @@ var Options_DebugType_name = map[int32]string{ 1: "FILE", 2: "ETW", } + var Options_DebugType_value = map[string]int32{ "NPIPE": 0, "FILE": 1, @@ -63,7 +51,10 @@ var Options_DebugType_value = map[string]int32{ func (x Options_DebugType) String() string { return proto.EnumName(Options_DebugType_name, int32(x)) } -func (Options_DebugType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRunhcs, []int{0, 0} } + +func (Options_DebugType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b643df6839c75082, []int{0, 0} +} type Options_SandboxIsolation int32 @@ -76,6 +67,7 @@ var Options_SandboxIsolation_name = map[int32]string{ 0: "PROCESS", 1: "HYPERVISOR", } + var Options_SandboxIsolation_value = map[string]int32{ "PROCESS": 0, "HYPERVISOR": 1, @@ -84,8 +76,9 @@ var Options_SandboxIsolation_value = map[string]int32{ func (x Options_SandboxIsolation) String() string { return proto.EnumName(Options_SandboxIsolation_name, int32(x)) } + func (Options_SandboxIsolation) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRunhcs, []int{0, 1} + return fileDescriptor_b643df6839c75082, []int{0, 1} } // Options are the set of customizations that can be passed at Create time. @@ -128,17 +121,60 @@ type Options struct { // be adjusted to account for the difference in number of cores between the // host and UVM. ScaleCpuLimitsToSandbox bool `protobuf:"varint,11,opt,name=scale_cpu_limits_to_sandbox,json=scaleCpuLimitsToSandbox,proto3" json:"scale_cpu_limits_to_sandbox,omitempty"` + // default_container_scratch_size_in_gb is the default scratch size (sandbox.vhdx) + // to be used for containers. Every container will get a sandbox of `size_in_gb` assigned + // instead of the familiar 20GB as usual. + DefaultContainerScratchSizeInGb int32 `protobuf:"varint,12,opt,name=default_container_scratch_size_in_gb,json=defaultContainerScratchSizeInGb,proto3" json:"default_container_scratch_size_in_gb,omitempty"` + // default_container_scratch_size_in_gb is the default scratch size (sandbox.vhdx) + // to be used for the UVM. This only applies to WCOW as LCOW doesn't mount a scratch + // specifically for the UVM. + DefaultVmScratchSizeInGb int32 `protobuf:"varint,13,opt,name=default_vm_scratch_size_in_gb,json=defaultVmScratchSizeInGb,proto3" json:"default_vm_scratch_size_in_gb,omitempty"` + // share_scratch specifies if we'd like to reuse scratch space between multiple containers. + // This currently only affects LCOW. The sandbox containers scratch space is re-used for all + // subsequent containers launched in the pod. + ShareScratch bool `protobuf:"varint,14,opt,name=share_scratch,json=shareScratch,proto3" json:"share_scratch,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Options) Reset() { *m = Options{} } -func (*Options) ProtoMessage() {} -func (*Options) Descriptor() ([]byte, []int) { return fileDescriptorRunhcs, []int{0} } +func (m *Options) Reset() { *m = Options{} } +func (*Options) ProtoMessage() {} +func (*Options) Descriptor() ([]byte, []int) { + return fileDescriptor_b643df6839c75082, []int{0} +} +func (m *Options) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Options.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Options) XXX_Merge(src proto.Message) { + xxx_messageInfo_Options.Merge(m, src) +} +func (m *Options) XXX_Size() int { + return m.Size() +} +func (m *Options) XXX_DiscardUnknown() { + xxx_messageInfo_Options.DiscardUnknown(m) +} + +var xxx_messageInfo_Options proto.InternalMessageInfo // ProcessDetails contains additional information about a process. This is the additional // info returned in the Pids query. type ProcessDetails struct { ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` - CreatedAt time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,stdtime" json:"created_at"` + CreatedAt time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` KernelTime_100Ns uint64 `protobuf:"varint,3,opt,name=kernel_time_100_ns,json=kernelTime100Ns,proto3" json:"kernel_time_100_ns,omitempty"` MemoryCommitBytes uint64 `protobuf:"varint,4,opt,name=memory_commit_bytes,json=memoryCommitBytes,proto3" json:"memory_commit_bytes,omitempty"` MemoryWorkingSetPrivateBytes uint64 `protobuf:"varint,5,opt,name=memory_working_set_private_bytes,json=memoryWorkingSetPrivateBytes,proto3" json:"memory_working_set_private_bytes,omitempty"` @@ -146,18 +182,114 @@ type ProcessDetails struct { ProcessID uint32 `protobuf:"varint,7,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` UserTime_100Ns uint64 `protobuf:"varint,8,opt,name=user_time_100_ns,json=userTime100Ns,proto3" json:"user_time_100_ns,omitempty"` ExecID string `protobuf:"bytes,9,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ProcessDetails) Reset() { *m = ProcessDetails{} } -func (*ProcessDetails) ProtoMessage() {} -func (*ProcessDetails) Descriptor() ([]byte, []int) { return fileDescriptorRunhcs, []int{1} } +func (m *ProcessDetails) Reset() { *m = ProcessDetails{} } +func (*ProcessDetails) ProtoMessage() {} +func (*ProcessDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_b643df6839c75082, []int{1} +} +func (m *ProcessDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProcessDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessDetails.Merge(m, src) +} +func (m *ProcessDetails) XXX_Size() int { + return m.Size() +} +func (m *ProcessDetails) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessDetails proto.InternalMessageInfo func init() { - proto.RegisterType((*Options)(nil), "containerd.runhcs.v1.Options") - proto.RegisterType((*ProcessDetails)(nil), "containerd.runhcs.v1.ProcessDetails") proto.RegisterEnum("containerd.runhcs.v1.Options_DebugType", Options_DebugType_name, Options_DebugType_value) proto.RegisterEnum("containerd.runhcs.v1.Options_SandboxIsolation", Options_SandboxIsolation_name, Options_SandboxIsolation_value) + proto.RegisterType((*Options)(nil), "containerd.runhcs.v1.Options") + proto.RegisterType((*ProcessDetails)(nil), "containerd.runhcs.v1.ProcessDetails") +} + +func init() { + proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_b643df6839c75082) } + +var fileDescriptor_b643df6839c75082 = []byte{ + // 883 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xdb, 0x6e, 0xdb, 0x36, + 0x18, 0xc7, 0xad, 0x26, 0x71, 0xa2, 0x2f, 0x71, 0xea, 0x70, 0x06, 0x26, 0xa4, 0xab, 0x6d, 0xa4, + 0x03, 0x9a, 0x62, 0x8d, 0x94, 0x74, 0x97, 0x1b, 0x30, 0xcc, 0x87, 0xb4, 0x1e, 0x9a, 0xc4, 0x90, + 0xb3, 0x74, 0x87, 0x0b, 0x42, 0x07, 0x5a, 0x26, 0x6a, 0x8a, 0x82, 0x48, 0x7b, 0x71, 0xaf, 0xf6, + 0x08, 0x7b, 0x9b, 0xbd, 0x42, 0x2e, 0x77, 0x39, 0x60, 0x40, 0xb6, 0xfa, 0x49, 0x06, 0x52, 0x94, + 0xbb, 0x05, 0xc1, 0x6e, 0x76, 0x65, 0xea, 0xff, 0xfd, 0xf8, 0xe7, 0xc7, 0xc3, 0xdf, 0x70, 0x91, + 0x50, 0x39, 0x99, 0x85, 0x6e, 0xc4, 0x99, 0x77, 0x46, 0xa3, 0x9c, 0x0b, 0x3e, 0x96, 0xde, 0x24, + 0x12, 0x62, 0x42, 0x99, 0x17, 0xb1, 0xd8, 0x8b, 0x78, 0x2a, 0x03, 0x9a, 0x92, 0x3c, 0x3e, 0x52, + 0xda, 0x51, 0x3e, 0x4b, 0x27, 0x91, 0x38, 0x9a, 0x9f, 0x78, 0x3c, 0x93, 0x94, 0xa7, 0xc2, 0x2b, + 0x14, 0x37, 0xcb, 0xb9, 0xe4, 0xa8, 0xf1, 0x81, 0x77, 0x4d, 0x61, 0x7e, 0xb2, 0xdf, 0x48, 0x78, + 0xc2, 0x35, 0xe0, 0xa9, 0x51, 0xc1, 0xee, 0xb7, 0x12, 0xce, 0x93, 0x29, 0xf1, 0xf4, 0x57, 0x38, + 0x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0xe5, 0x74, 0x1e, 0x48, 0x62, 0x26, 0x6f, 0xe8, 0xc9, 0x9f, 0x14, + 0xdc, 0x9b, 0x02, 0x1b, 0x11, 0x39, 0x2c, 0xa0, 0xc2, 0xa7, 0x07, 0xad, 0x7b, 0x7c, 0xf4, 0xd5, + 0xc4, 0xc6, 0xa6, 0xaa, 0x6d, 0x1e, 0xdd, 0xb5, 0x19, 0x69, 0xa6, 0x70, 0x79, 0x0e, 0x60, 0xb2, + 0x82, 0x69, 0xac, 0x53, 0x55, 0xeb, 0xd4, 0x96, 0xb7, 0x2d, 0xdb, 0x1c, 0xfb, 0xa0, 0xe7, 0xdb, + 0x06, 0x18, 0xc4, 0xe8, 0x29, 0xd4, 0x67, 0x82, 0xe4, 0xff, 0x3a, 0x96, 0x2d, 0xbd, 0x48, 0x4d, + 0xe9, 0x1f, 0x0e, 0xe5, 0x09, 0x6c, 0x92, 0x6b, 0x12, 0x29, 0x4f, 0x15, 0x25, 0xbb, 0x03, 0xcb, + 0xdb, 0x56, 0xb5, 0x7f, 0x4d, 0xa2, 0x41, 0xcf, 0xaf, 0xaa, 0xd2, 0x20, 0xee, 0xc4, 0x37, 0xef, + 0x9b, 0x95, 0xdf, 0xdf, 0x37, 0x2b, 0x3f, 0x2f, 0x9b, 0xd6, 0xcd, 0xb2, 0x69, 0xfd, 0xb6, 0x6c, + 0x5a, 0x7f, 0x2d, 0x9b, 0xd6, 0x0f, 0xdf, 0xfc, 0xff, 0xff, 0xf3, 0x2f, 0xcc, 0xef, 0x77, 0x95, + 0xb0, 0xaa, 0xef, 0xfd, 0xf3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xb6, 0x6d, 0x09, 0x26, + 0x06, 0x00, 0x00, +} + func (m *Options) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -243,6 +375,29 @@ func (m *Options) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.DefaultContainerScratchSizeInGb != 0 { + dAtA[i] = 0x60 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) + } + if m.DefaultVmScratchSizeInGb != 0 { + dAtA[i] = 0x68 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) + } + if m.ShareScratch { + dAtA[i] = 0x70 + i++ + if m.ShareScratch { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -269,8 +424,8 @@ func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x12 i++ - i = encodeVarintRunhcs(dAtA, i, uint64(types.SizeOfStdTime(m.CreatedAt))) - n1, err := types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) + i = encodeVarintRunhcs(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) + n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) if err != nil { return 0, err } @@ -311,6 +466,9 @@ func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) i += copy(dAtA[i:], m.ExecID) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -324,6 +482,9 @@ func encodeVarintRunhcs(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *Options) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.Debug { @@ -364,17 +525,32 @@ func (m *Options) Size() (n int) { if m.ScaleCpuLimitsToSandbox { n += 2 } + if m.DefaultContainerScratchSizeInGb != 0 { + n += 1 + sovRunhcs(uint64(m.DefaultContainerScratchSizeInGb)) + } + if m.DefaultVmScratchSizeInGb != 0 { + n += 1 + sovRunhcs(uint64(m.DefaultVmScratchSizeInGb)) + } + if m.ShareScratch { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *ProcessDetails) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ImageName) if l > 0 { n += 1 + l + sovRunhcs(uint64(l)) } - l = types.SizeOfStdTime(m.CreatedAt) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) n += 1 + l + sovRunhcs(uint64(l)) if m.KernelTime_100Ns != 0 { n += 1 + sovRunhcs(uint64(m.KernelTime_100Ns)) @@ -398,6 +574,9 @@ func (m *ProcessDetails) Size() (n int) { if l > 0 { n += 1 + l + sovRunhcs(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -430,6 +609,10 @@ func (this *Options) String() string { `VmMemorySizeInMb:` + fmt.Sprintf("%v", this.VmMemorySizeInMb) + `,`, `GPUVHDPath:` + fmt.Sprintf("%v", this.GPUVHDPath) + `,`, `ScaleCpuLimitsToSandbox:` + fmt.Sprintf("%v", this.ScaleCpuLimitsToSandbox) + `,`, + `DefaultContainerScratchSizeInGb:` + fmt.Sprintf("%v", this.DefaultContainerScratchSizeInGb) + `,`, + `DefaultVmScratchSizeInGb:` + fmt.Sprintf("%v", this.DefaultVmScratchSizeInGb) + `,`, + `ShareScratch:` + fmt.Sprintf("%v", this.ShareScratch) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -440,7 +623,7 @@ func (this *ProcessDetails) String() string { } s := strings.Join([]string{`&ProcessDetails{`, `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`, - `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, + `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`, `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`, `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`, @@ -448,6 +631,7 @@ func (this *ProcessDetails) String() string { `ProcessID:` + fmt.Sprintf("%v", this.ProcessID) + `,`, `UserTime_100Ns:` + fmt.Sprintf("%v", this.UserTime_100Ns) + `,`, `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s @@ -475,7 +659,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -503,7 +687,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -523,7 +707,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DebugType |= (Options_DebugType(b) & 0x7F) << shift + m.DebugType |= Options_DebugType(b&0x7F) << shift if b < 0x80 { break } @@ -542,7 +726,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -552,6 +736,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -571,7 +758,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -581,6 +768,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -600,7 +790,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -610,6 +800,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -629,7 +822,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SandboxIsolation |= (Options_SandboxIsolation(b) & 0x7F) << shift + m.SandboxIsolation |= Options_SandboxIsolation(b&0x7F) << shift if b < 0x80 { break } @@ -648,7 +841,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -658,6 +851,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -677,7 +873,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VmProcessorCount |= (int32(b) & 0x7F) << shift + m.VmProcessorCount |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -696,7 +892,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VmMemorySizeInMb |= (int32(b) & 0x7F) << shift + m.VmMemorySizeInMb |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -715,7 +911,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -725,6 +921,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -744,12 +943,70 @@ func (m *Options) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ScaleCpuLimitsToSandbox = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultContainerScratchSizeInGb", wireType) + } + m.DefaultContainerScratchSizeInGb = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRunhcs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultContainerScratchSizeInGb |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultVmScratchSizeInGb", wireType) + } + m.DefaultVmScratchSizeInGb = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRunhcs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultVmScratchSizeInGb |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareScratch", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRunhcs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ShareScratch = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRunhcs(dAtA[iNdEx:]) @@ -759,9 +1016,13 @@ func (m *Options) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthRunhcs } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRunhcs + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -786,7 +1047,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -814,7 +1075,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -824,6 +1085,9 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -843,7 +1107,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -852,10 +1116,13 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } - if err := types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -873,7 +1140,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.KernelTime_100Ns |= (uint64(b) & 0x7F) << shift + m.KernelTime_100Ns |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -892,7 +1159,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemoryCommitBytes |= (uint64(b) & 0x7F) << shift + m.MemoryCommitBytes |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -911,7 +1178,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemoryWorkingSetPrivateBytes |= (uint64(b) & 0x7F) << shift + m.MemoryWorkingSetPrivateBytes |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -930,7 +1197,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MemoryWorkingSetSharedBytes |= (uint64(b) & 0x7F) << shift + m.MemoryWorkingSetSharedBytes |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -949,7 +1216,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProcessID |= (uint32(b) & 0x7F) << shift + m.ProcessID |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -968,7 +1235,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.UserTime_100Ns |= (uint64(b) & 0x7F) << shift + m.UserTime_100Ns |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -987,7 +1254,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -997,6 +1264,9 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { return ErrInvalidLengthRunhcs } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRunhcs + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1011,9 +1281,13 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthRunhcs } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthRunhcs + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1077,10 +1351,13 @@ func skipRunhcs(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthRunhcs } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } return iNdEx, nil case 3: for { @@ -1109,6 +1386,9 @@ func skipRunhcs(dAtA []byte) (n int, err error) { return 0, err } iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } } return iNdEx, nil case 4: @@ -1127,62 +1407,3 @@ var ( ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") ) - -func init() { - proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptorRunhcs) -} - -var fileDescriptorRunhcs = []byte{ - // 813 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xdb, 0x36, - 0x18, 0xb6, 0x9a, 0x38, 0xb6, 0xde, 0x2c, 0xa9, 0xc3, 0x19, 0x98, 0x90, 0x6e, 0xb6, 0x91, 0x1e, - 0x9a, 0x62, 0x8d, 0x94, 0x74, 0xc7, 0xed, 0x32, 0x7f, 0x64, 0xd5, 0xd0, 0x24, 0x82, 0x9c, 0xb5, - 0xfb, 0x38, 0x10, 0xfa, 0x60, 0x64, 0xa2, 0xa6, 0x28, 0x88, 0xb4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0x1f, 0xfe, 0x69, 0xfc, 0xd2, 0xfc, 0x7e, 0xdf, 0x88, 0xb7, 0xf4, 0xbb, 0x7f, 0xf1, 0x4f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0xc9, 0x9f, 0x44, 0x71, 0x05, 0x00, 0x00, -} diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.proto b/cmd/containerd-shim-runhcs-v1/options/runhcs.proto index e184ebe621..72b2100eec 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.proto @@ -64,10 +64,25 @@ message Options { // when a container requests a gpu string GPUVHDPath = 10; - // scale_cpu_limits_to_sandbox indicates that container CPU limits should - // be adjusted to account for the difference in number of cores between the - // host and UVM. - bool scale_cpu_limits_to_sandbox = 11; + // scale_cpu_limits_to_sandbox indicates that container CPU limits should + // be adjusted to account for the difference in number of cores between the + // host and UVM. + bool scale_cpu_limits_to_sandbox = 11; + + // default_container_scratch_size_in_gb is the default scratch size (sandbox.vhdx) + // to be used for containers. Every container will get a sandbox of `size_in_gb` assigned + // instead of the default of 20GB. + int32 default_container_scratch_size_in_gb = 12; + + // default_vm_scratch_size_in_gb is the default scratch size (sandbox.vhdx) + // to be used for the UVM. This only applies to WCOW as LCOW doesn't mount a scratch + // specifically for the UVM. + int32 default_vm_scratch_size_in_gb = 13; + + // share_scratch specifies if we'd like to reuse scratch space between multiple containers. + // This currently only affects LCOW. The sandbox containers scratch space is re-used for all + // subsequent containers launched in the pod. + bool share_scratch = 14; } // ProcessDetails contains additional information about a process. This is the additional diff --git a/internal/hcsoci/create.go b/internal/hcsoci/create.go index 70ae8cbba1..e425316298 100644 --- a/internal/hcsoci/create.go +++ b/internal/hcsoci/create.go @@ -118,10 +118,10 @@ func CreateContainer(ctx context.Context, createOptions *CreateOptions) (_ cow.C }() if coi.HostingSystem != nil { - n := coi.HostingSystem.ContainerCounter() if coi.Spec.Linux != nil { r.SetContainerRootInUVM(fmt.Sprintf(lcowRootInUVM, createOptions.ID)) } else { + n := coi.HostingSystem.ContainerCounter() r.SetContainerRootInUVM(fmt.Sprintf(wcowRootInUVM, strconv.FormatUint(n, 16))) } } diff --git a/internal/layers/layers.go b/internal/layers/layers.go index 187ca7df62..ab97fb11e5 100644 --- a/internal/layers/layers.go +++ b/internal/layers/layers.go @@ -146,6 +146,18 @@ func MountContainerLayers(ctx context.Context, layerFolders []string, guestRoot hostPath := filepath.Join(layerFolders[len(layerFolders)-1], "sandbox.vhdx") containerScratchPathInUVM := ospath.Join(uvm.OS(), guestRoot) log.G(ctx).WithField("hostPath", hostPath).Debug("mounting scratch VHD") + + // For LCOW, we can reuse another container's scratch space (usually the sandbox container's). + // + // When sharing a scratch space, the `hostPath` will be a symlink to the sandbox.vhdx location to use. + // When not sharing a scratch space, `hostPath` will be the path to the sandbox.vhdx to use. + // + // Evaluate the symlink here (if there is one). + hostPath, err = filepath.EvalSymlinks(hostPath) + if err != nil { + return "", fmt.Errorf("failed to eval symlinks: %s", err) + } + scsiMount, err := uvm.AddSCSI(ctx, hostPath, containerScratchPathInUVM, false, uvmpkg.VMAccessTypeIndividual) if err != nil { return "", fmt.Errorf("failed to add SCSI scratch VHD: %s", err) @@ -285,6 +297,12 @@ func UnmountContainerLayers(ctx context.Context, layerFolders []string, containe // Unload the SCSI scratch path if (op & UnmountOperationSCSI) == UnmountOperationSCSI { hostScratchFile := filepath.Join(layerFolders[len(layerFolders)-1], "sandbox.vhdx") + // Need to check if the sandbox is a symlink to another sandbox to handle the case + // where a container is sharing a scratch space. + hostScratchFile, err := filepath.EvalSymlinks(hostScratchFile) + if err != nil { + retError = err + } if err := uvm.RemoveSCSI(ctx, hostScratchFile); err != nil { log.G(ctx).WithError(err).Warn("failed to remove scratch") if retError == nil { diff --git a/internal/uvm/create_wcow.go b/internal/uvm/create_wcow.go index 6c2b1bf395..d9956b1342 100644 --- a/internal/uvm/create_wcow.go +++ b/internal/uvm/create_wcow.go @@ -16,6 +16,7 @@ import ( hcsschema "github.com/Microsoft/hcsshim/internal/schema2" "github.com/Microsoft/hcsshim/internal/schemaversion" "github.com/Microsoft/hcsshim/internal/uvmfolder" + "github.com/Microsoft/hcsshim/internal/wclayer" "github.com/Microsoft/hcsshim/internal/wcow" "github.com/pkg/errors" "go.opencensus.io/trace" @@ -110,6 +111,11 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error if err := wcow.CreateUVMScratch(ctx, uvmFolder, scratchFolder, uvm.id); err != nil { return nil, fmt.Errorf("failed to create scratch: %s", err) } + } else { + // Sandbox.vhdx exists, just need to grant vm access to it. + if err := wclayer.GrantVmAccess(ctx, uvm.id, scratchPath); err != nil { + return nil, errors.Wrap(err, "failed to grant vm access to scratch") + } } processorTopology, err := hostProcessorInfo(ctx)