diff --git a/drivers/docker/driver_test.go b/drivers/docker/driver_test.go index d49514860..4aaf17817 100644 --- a/drivers/docker/driver_test.go +++ b/drivers/docker/driver_test.go @@ -1849,9 +1849,9 @@ func TestDockerDriver_Mounts(t *testing.T) { }, } - d := dockerDriverHarness(t, nil) for _, c := range cases { t.Run(c.Name, func(t *testing.T) { + d := dockerDriverHarness(t, nil) // Build the task task, cfg, _ := dockerTask(t) cfg.Command = "/bin/sleep" diff --git a/drivers/shared/executor/client.go b/drivers/shared/executor/client.go index 918431bc0..063e30dec 100644 --- a/drivers/shared/executor/client.go +++ b/drivers/shared/executor/client.go @@ -36,6 +36,8 @@ func (c *grpcExecutorClient) Launch(cmd *ExecCommand) (*ProcessState, error) { TaskDir: cmd.TaskDir, ResourceLimits: cmd.ResourceLimits, BasicProcessCgroup: cmd.BasicProcessCgroup, + Mounts: drivers.MountsToProto(cmd.Mounts), + Devices: drivers.DevicesToProto(cmd.Devices), } resp, err := c.client.Launch(ctx, req) if err != nil { diff --git a/drivers/shared/executor/proto/executor.pb.go b/drivers/shared/executor/proto/executor.pb.go index a076d0f18..6f57a0263 100644 --- a/drivers/shared/executor/proto/executor.pb.go +++ b/drivers/shared/executor/proto/executor.pb.go @@ -36,6 +36,8 @@ type LaunchRequest struct { TaskDir string `protobuf:"bytes,8,opt,name=task_dir,json=taskDir,proto3" json:"task_dir,omitempty"` ResourceLimits bool `protobuf:"varint,9,opt,name=resource_limits,json=resourceLimits,proto3" json:"resource_limits,omitempty"` BasicProcessCgroup bool `protobuf:"varint,10,opt,name=basic_process_cgroup,json=basicProcessCgroup,proto3" json:"basic_process_cgroup,omitempty"` + Mounts []*proto1.Mount `protobuf:"bytes,11,rep,name=mounts,proto3" json:"mounts,omitempty"` + Devices []*proto1.Device `protobuf:"bytes,12,rep,name=devices,proto3" json:"devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -45,7 +47,7 @@ func (m *LaunchRequest) Reset() { *m = LaunchRequest{} } func (m *LaunchRequest) String() string { return proto.CompactTextString(m) } func (*LaunchRequest) ProtoMessage() {} func (*LaunchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{0} + return fileDescriptor_executor_b646d273b48eddd5, []int{0} } func (m *LaunchRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LaunchRequest.Unmarshal(m, b) @@ -135,6 +137,20 @@ func (m *LaunchRequest) GetBasicProcessCgroup() bool { return false } +func (m *LaunchRequest) GetMounts() []*proto1.Mount { + if m != nil { + return m.Mounts + } + return nil +} + +func (m *LaunchRequest) GetDevices() []*proto1.Device { + if m != nil { + return m.Devices + } + return nil +} + type LaunchResponse struct { Process *ProcessState `protobuf:"bytes,1,opt,name=process,proto3" json:"process,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -146,7 +162,7 @@ func (m *LaunchResponse) Reset() { *m = LaunchResponse{} } func (m *LaunchResponse) String() string { return proto.CompactTextString(m) } func (*LaunchResponse) ProtoMessage() {} func (*LaunchResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{1} + return fileDescriptor_executor_b646d273b48eddd5, []int{1} } func (m *LaunchResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LaunchResponse.Unmarshal(m, b) @@ -183,7 +199,7 @@ func (m *WaitRequest) Reset() { *m = WaitRequest{} } func (m *WaitRequest) String() string { return proto.CompactTextString(m) } func (*WaitRequest) ProtoMessage() {} func (*WaitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{2} + return fileDescriptor_executor_b646d273b48eddd5, []int{2} } func (m *WaitRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WaitRequest.Unmarshal(m, b) @@ -214,7 +230,7 @@ func (m *WaitResponse) Reset() { *m = WaitResponse{} } func (m *WaitResponse) String() string { return proto.CompactTextString(m) } func (*WaitResponse) ProtoMessage() {} func (*WaitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{3} + return fileDescriptor_executor_b646d273b48eddd5, []int{3} } func (m *WaitResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WaitResponse.Unmarshal(m, b) @@ -253,7 +269,7 @@ func (m *ShutdownRequest) Reset() { *m = ShutdownRequest{} } func (m *ShutdownRequest) String() string { return proto.CompactTextString(m) } func (*ShutdownRequest) ProtoMessage() {} func (*ShutdownRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{4} + return fileDescriptor_executor_b646d273b48eddd5, []int{4} } func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ShutdownRequest.Unmarshal(m, b) @@ -297,7 +313,7 @@ func (m *ShutdownResponse) Reset() { *m = ShutdownResponse{} } func (m *ShutdownResponse) String() string { return proto.CompactTextString(m) } func (*ShutdownResponse) ProtoMessage() {} func (*ShutdownResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{5} + return fileDescriptor_executor_b646d273b48eddd5, []int{5} } func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ShutdownResponse.Unmarshal(m, b) @@ -328,7 +344,7 @@ func (m *UpdateResourcesRequest) Reset() { *m = UpdateResourcesRequest{} func (m *UpdateResourcesRequest) String() string { return proto.CompactTextString(m) } func (*UpdateResourcesRequest) ProtoMessage() {} func (*UpdateResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{6} + return fileDescriptor_executor_b646d273b48eddd5, []int{6} } func (m *UpdateResourcesRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateResourcesRequest.Unmarshal(m, b) @@ -365,7 +381,7 @@ func (m *UpdateResourcesResponse) Reset() { *m = UpdateResourcesResponse func (m *UpdateResourcesResponse) String() string { return proto.CompactTextString(m) } func (*UpdateResourcesResponse) ProtoMessage() {} func (*UpdateResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{7} + return fileDescriptor_executor_b646d273b48eddd5, []int{7} } func (m *UpdateResourcesResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateResourcesResponse.Unmarshal(m, b) @@ -395,7 +411,7 @@ func (m *VersionRequest) Reset() { *m = VersionRequest{} } func (m *VersionRequest) String() string { return proto.CompactTextString(m) } func (*VersionRequest) ProtoMessage() {} func (*VersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{8} + return fileDescriptor_executor_b646d273b48eddd5, []int{8} } func (m *VersionRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VersionRequest.Unmarshal(m, b) @@ -426,7 +442,7 @@ func (m *VersionResponse) Reset() { *m = VersionResponse{} } func (m *VersionResponse) String() string { return proto.CompactTextString(m) } func (*VersionResponse) ProtoMessage() {} func (*VersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{9} + return fileDescriptor_executor_b646d273b48eddd5, []int{9} } func (m *VersionResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VersionResponse.Unmarshal(m, b) @@ -463,7 +479,7 @@ func (m *StatsRequest) Reset() { *m = StatsRequest{} } func (m *StatsRequest) String() string { return proto.CompactTextString(m) } func (*StatsRequest) ProtoMessage() {} func (*StatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{10} + return fileDescriptor_executor_b646d273b48eddd5, []int{10} } func (m *StatsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StatsRequest.Unmarshal(m, b) @@ -494,7 +510,7 @@ func (m *StatsResponse) Reset() { *m = StatsResponse{} } func (m *StatsResponse) String() string { return proto.CompactTextString(m) } func (*StatsResponse) ProtoMessage() {} func (*StatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{11} + return fileDescriptor_executor_b646d273b48eddd5, []int{11} } func (m *StatsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StatsResponse.Unmarshal(m, b) @@ -532,7 +548,7 @@ func (m *SignalRequest) Reset() { *m = SignalRequest{} } func (m *SignalRequest) String() string { return proto.CompactTextString(m) } func (*SignalRequest) ProtoMessage() {} func (*SignalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{12} + return fileDescriptor_executor_b646d273b48eddd5, []int{12} } func (m *SignalRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRequest.Unmarshal(m, b) @@ -569,7 +585,7 @@ func (m *SignalResponse) Reset() { *m = SignalResponse{} } func (m *SignalResponse) String() string { return proto.CompactTextString(m) } func (*SignalResponse) ProtoMessage() {} func (*SignalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{13} + return fileDescriptor_executor_b646d273b48eddd5, []int{13} } func (m *SignalResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalResponse.Unmarshal(m, b) @@ -602,7 +618,7 @@ func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (m *ExecRequest) String() string { return proto.CompactTextString(m) } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{14} + return fileDescriptor_executor_b646d273b48eddd5, []int{14} } func (m *ExecRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExecRequest.Unmarshal(m, b) @@ -655,7 +671,7 @@ func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (m *ExecResponse) String() string { return proto.CompactTextString(m) } func (*ExecResponse) ProtoMessage() {} func (*ExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{15} + return fileDescriptor_executor_b646d273b48eddd5, []int{15} } func (m *ExecResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExecResponse.Unmarshal(m, b) @@ -703,7 +719,7 @@ func (m *ProcessState) Reset() { *m = ProcessState{} } func (m *ProcessState) String() string { return proto.CompactTextString(m) } func (*ProcessState) ProtoMessage() {} func (*ProcessState) Descriptor() ([]byte, []int) { - return fileDescriptor_executor_47d1ec212828d159, []int{16} + return fileDescriptor_executor_b646d273b48eddd5, []int{16} } func (m *ProcessState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ProcessState.Unmarshal(m, b) @@ -1075,61 +1091,64 @@ var _Executor_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("drivers/shared/executor/proto/executor.proto", fileDescriptor_executor_47d1ec212828d159) + proto.RegisterFile("drivers/shared/executor/proto/executor.proto", fileDescriptor_executor_b646d273b48eddd5) } -var fileDescriptor_executor_47d1ec212828d159 = []byte{ - // 827 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4b, 0x6f, 0xe4, 0x44, - 0x10, 0x5e, 0xcf, 0x7b, 0x6a, 0x9e, 0x6a, 0xa1, 0xe0, 0x35, 0x87, 0x1d, 0x7c, 0x60, 0x47, 0x02, - 0xd9, 0xab, 0xec, 0x8b, 0x0b, 0x20, 0x11, 0x96, 0x53, 0xb4, 0x8a, 0x9c, 0x85, 0x95, 0x38, 0x30, - 0x74, 0xec, 0xc6, 0x6e, 0x65, 0xc6, 0x6d, 0xba, 0xdb, 0x43, 0x56, 0x42, 0xe2, 0xc4, 0x3f, 0xe0, - 0x1f, 0xf2, 0x27, 0x38, 0x22, 0xf7, 0xc3, 0x99, 0x49, 0x42, 0xe4, 0x01, 0xed, 0xc9, 0x5d, 0xe5, - 0xaa, 0xef, 0xab, 0xea, 0xae, 0xfa, 0xe0, 0xb3, 0x84, 0xd3, 0x2d, 0xe1, 0x22, 0x14, 0x19, 0xe6, - 0x24, 0x09, 0xc9, 0x15, 0x89, 0x4b, 0xc9, 0x78, 0x58, 0x70, 0x26, 0x59, 0x6d, 0x06, 0xca, 0x44, - 0x9f, 0x64, 0x58, 0x64, 0x34, 0x66, 0xbc, 0x08, 0x72, 0xb6, 0xc1, 0x49, 0x50, 0xac, 0xcb, 0x94, - 0xe6, 0x22, 0xd8, 0x8f, 0xf3, 0x1e, 0xa5, 0x8c, 0xa5, 0x6b, 0xa2, 0x41, 0x2e, 0xca, 0x9f, 0x43, - 0x49, 0x37, 0x44, 0x48, 0xbc, 0x29, 0x4c, 0xc0, 0x17, 0x29, 0x95, 0x59, 0x79, 0x11, 0xc4, 0x6c, - 0x13, 0xd6, 0x98, 0xa1, 0xc2, 0x0c, 0x0d, 0x66, 0x68, 0x2b, 0xd3, 0x95, 0x68, 0x4b, 0xa7, 0xfb, - 0x7f, 0xb5, 0x60, 0x72, 0x8a, 0xcb, 0x3c, 0xce, 0x22, 0xf2, 0x4b, 0x49, 0x84, 0x44, 0x73, 0x68, - 0xc7, 0x9b, 0xc4, 0x75, 0x16, 0xce, 0x72, 0x18, 0x55, 0x47, 0x84, 0xa0, 0x83, 0x79, 0x2a, 0xdc, - 0xd6, 0xa2, 0xbd, 0x1c, 0x46, 0xea, 0x8c, 0x5e, 0xc3, 0x90, 0x13, 0xc1, 0x4a, 0x1e, 0x13, 0xe1, - 0xb6, 0x17, 0xce, 0x72, 0x74, 0xfc, 0x24, 0xf8, 0xb7, 0x9e, 0x0c, 0xbf, 0xa6, 0x0c, 0x22, 0x9b, - 0x17, 0x5d, 0x43, 0xa0, 0x47, 0x30, 0x12, 0x32, 0x61, 0xa5, 0x5c, 0x15, 0x58, 0x66, 0x6e, 0x47, - 0xb1, 0x83, 0x76, 0x9d, 0x61, 0x99, 0x99, 0x00, 0xc2, 0xb9, 0x0e, 0xe8, 0xd6, 0x01, 0x84, 0x73, - 0x15, 0x30, 0x87, 0x36, 0xc9, 0xb7, 0x6e, 0x4f, 0x15, 0x59, 0x1d, 0xab, 0xba, 0x4b, 0x41, 0xb8, - 0xdb, 0x57, 0xb1, 0xea, 0x8c, 0x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0xbf, 0xfb, 0x30, 0x78, 0x65, 0x96, 0x05, 0xbd, 0x83, 0x9e, 0xde, 0x70, 0xf4, - 0xbc, 0xe9, 0x66, 0xed, 0xc9, 0xae, 0xf7, 0xe2, 0xd0, 0x34, 0xf3, 0x7e, 0x0f, 0x90, 0x80, 0x4e, - 0xb5, 0xeb, 0xe8, 0x69, 0x53, 0x84, 0x1d, 0xa1, 0xf0, 0x9e, 0x1d, 0x96, 0x54, 0x93, 0xfe, 0x0e, - 0x03, 0xbb, 0xb2, 0xe8, 0x65, 0x53, 0x8c, 0x1b, 0x92, 0xe1, 0x7d, 0x7e, 0x78, 0x62, 0x5d, 0xc0, - 0x9f, 0x0e, 0xcc, 0x6e, 0xac, 0x2d, 0xfa, 0xb2, 0x29, 0xde, 0xdd, 0xca, 0xe2, 0x7d, 0xf5, 0x9f, - 0xf3, 0xeb, 0xb2, 0x7e, 0x83, 0xbe, 0xd1, 0x07, 0xd4, 0xf8, 0x45, 0xf7, 0x25, 0xc6, 0x7b, 0x79, - 0x70, 0x5e, 0xcd, 0xbe, 0x85, 0xae, 0xd2, 0x05, 0xd4, 0xf8, 0x59, 0x77, 0xf5, 0xc9, 0x7b, 0x7e, - 0x60, 0x56, 0xcd, 0xfb, 0x0e, 0x7a, 0x5a, 0x56, 0x9a, 0x4f, 0xff, 0x9e, 0x5e, 0x35, 0x9f, 0xfe, - 0x1b, 0xea, 0xa5, 0xa6, 0xbf, 0x5a, 0xc2, 0xe6, 0xd3, 0xbf, 0xa3, 0x76, 0xcd, 0xa7, 0x7f, 0x57, - 0xb5, 0xfc, 0x07, 0x5f, 0xf7, 0x7f, 0xe8, 0x6a, 0x59, 0xe8, 0xa9, 0xcf, 0xd3, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x6b, 0xfb, 0xa5, 0x9a, 0xfd, 0x09, 0x00, 0x00, +var fileDescriptor_executor_b646d273b48eddd5 = []byte{ + // 871 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4b, 0x8f, 0xdc, 0x44, + 0x10, 0xce, 0xac, 0x77, 0x5e, 0xe5, 0xd9, 0x87, 0x5a, 0x68, 0x71, 0xcc, 0x21, 0x83, 0x0f, 0x64, + 0x24, 0x82, 0x1d, 0x6d, 0x5e, 0x5c, 0x00, 0x89, 0xdd, 0xc0, 0x65, 0x89, 0x56, 0xde, 0x40, 0x24, + 0x0e, 0x0c, 0xbd, 0x76, 0x63, 0xb7, 0x76, 0xc6, 0x6d, 0xba, 0xdb, 0xc3, 0x46, 0x42, 0xe2, 0xc4, + 0x3f, 0xe0, 0x97, 0x72, 0xe2, 0x88, 0xfa, 0xe5, 0x9d, 0xd9, 0x84, 0xc8, 0x03, 0xe2, 0x34, 0x5d, + 0xe5, 0xfa, 0xbe, 0xaa, 0xea, 0xae, 0xfa, 0x06, 0x1e, 0xe4, 0x9c, 0xae, 0x08, 0x17, 0x89, 0x28, + 0x31, 0x27, 0x79, 0x42, 0xae, 0x49, 0xd6, 0x48, 0xc6, 0x93, 0x9a, 0x33, 0xc9, 0x5a, 0x33, 0xd6, + 0x26, 0xfa, 0xa8, 0xc4, 0xa2, 0xa4, 0x19, 0xe3, 0x75, 0x5c, 0xb1, 0x25, 0xce, 0xe3, 0x7a, 0xd1, + 0x14, 0xb4, 0x12, 0xf1, 0x66, 0x5c, 0x78, 0xaf, 0x60, 0xac, 0x58, 0x10, 0x43, 0x72, 0xd9, 0xfc, + 0x94, 0x48, 0xba, 0x24, 0x42, 0xe2, 0x65, 0x6d, 0x03, 0x3e, 0x2b, 0xa8, 0x2c, 0x9b, 0xcb, 0x38, + 0x63, 0xcb, 0xa4, 0xe5, 0x4c, 0x34, 0x67, 0x62, 0x39, 0x13, 0x57, 0x99, 0xa9, 0xc4, 0x58, 0x06, + 0x1e, 0xfd, 0xe9, 0xc1, 0xde, 0x19, 0x6e, 0xaa, 0xac, 0x4c, 0xc9, 0xcf, 0x0d, 0x11, 0x12, 0x1d, + 0x82, 0x97, 0x2d, 0xf3, 0xa0, 0x37, 0xed, 0xcd, 0xc6, 0xa9, 0x3a, 0x22, 0x04, 0xbb, 0x98, 0x17, + 0x22, 0xd8, 0x99, 0x7a, 0xb3, 0x71, 0xaa, 0xcf, 0xe8, 0x05, 0x8c, 0x39, 0x11, 0xac, 0xe1, 0x19, + 0x11, 0x81, 0x37, 0xed, 0xcd, 0xfc, 0xe3, 0x87, 0xf1, 0x3f, 0xf5, 0x64, 0xf3, 0x9b, 0x94, 0x71, + 0xea, 0x70, 0xe9, 0x0d, 0x05, 0xba, 0x07, 0xbe, 0x90, 0x39, 0x6b, 0xe4, 0xbc, 0xc6, 0xb2, 0x0c, + 0x76, 0x75, 0x76, 0x30, 0xae, 0x73, 0x2c, 0x4b, 0x1b, 0x40, 0x38, 0x37, 0x01, 0xfd, 0x36, 0x80, + 0x70, 0xae, 0x03, 0x0e, 0xc1, 0x23, 0xd5, 0x2a, 0x18, 0xe8, 0x22, 0xd5, 0x51, 0xd5, 0xdd, 0x08, + 0xc2, 0x83, 0xa1, 0x8e, 0xd5, 0x67, 0x74, 0x17, 0x46, 0x12, 0x8b, 0xab, 0x79, 0x4e, 0x79, 0x30, + 0xd2, 0xfe, 0xa1, 0xb2, 0x4f, 0x29, 0x47, 0xf7, 0xe1, 0xc0, 0xd5, 0x33, 0x5f, 0xd0, 0x25, 0x95, + 0x22, 0x18, 0x4f, 0x7b, 0xb3, 0x51, 0xba, 0xef, 0xdc, 0x67, 0xda, 0x8b, 0x1e, 0xc2, 0x7b, 0x97, + 0x58, 0xd0, 0x6c, 0x5e, 0x73, 0x96, 0x11, 0x21, 0xe6, 0x59, 0xc1, 0x59, 0x53, 0x07, 0xa0, 0xa3, + 0x91, 0xfe, 0x76, 0x6e, 0x3e, 0x9d, 0xe8, 0x2f, 0xe8, 0x14, 0x06, 0x4b, 0xd6, 0x54, 0x52, 0x04, + 0xfe, 0xd4, 0x9b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0xa3, + 0xae, 0x0c, 0x6b, 0x42, 0x11, 0x3e, 0xde, 0x0e, 0xd4, 0x26, 0xfd, 0x0d, 0x46, 0x6e, 0x65, 0xd1, + 0xb3, 0xae, 0x1c, 0xb7, 0x24, 0x23, 0xfc, 0x74, 0x7b, 0x60, 0x5b, 0xc0, 0x1f, 0x3d, 0x38, 0xb8, + 0xb5, 0xb6, 0xe8, 0xf3, 0xae, 0x7c, 0x6f, 0x57, 0x96, 0xf0, 0x8b, 0x7f, 0x8d, 0x6f, 0xcb, 0xfa, + 0x15, 0x86, 0x56, 0x1f, 0x50, 0xe7, 0x17, 0xdd, 0x94, 0x98, 0xf0, 0xd9, 0xd6, 0xb8, 0x36, 0xfb, + 0x0a, 0xfa, 0x5a, 0x17, 0x50, 0xe7, 0x67, 0x5d, 0xd7, 0xa7, 0xf0, 0xc9, 0x96, 0xa8, 0x36, 0xef, + 0x6b, 0x18, 0x18, 0x59, 0xe9, 0x3e, 0xfd, 0x1b, 0x7a, 0xd5, 0x7d, 0xfa, 0x6f, 0xa9, 0x97, 0x9e, + 0x7e, 0xb5, 0x84, 0xdd, 0xa7, 0x7f, 0x4d, 0xed, 0xba, 0x4f, 0xff, 0xba, 0x6a, 0x45, 0x77, 0xbe, + 0x1c, 0x7e, 0xdf, 0x37, 0xb2, 0x30, 0xd0, 0x3f, 0x8f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x9f, + 0x81, 0x07, 0x03, 0x8c, 0x0a, 0x00, 0x00, } diff --git a/drivers/shared/executor/proto/executor.proto b/drivers/shared/executor/proto/executor.proto index 0ce382903..dd4f36e1d 100644 --- a/drivers/shared/executor/proto/executor.proto +++ b/drivers/shared/executor/proto/executor.proto @@ -27,6 +27,8 @@ message LaunchRequest { string task_dir = 8; bool resource_limits = 9; bool basic_process_cgroup = 10; + repeated hashicorp.nomad.plugins.drivers.proto.Mount mounts = 11; + repeated hashicorp.nomad.plugins.drivers.proto.Device devices = 12; } message LaunchResponse { diff --git a/drivers/shared/executor/server.go b/drivers/shared/executor/server.go index 2900334e7..8d9053299 100644 --- a/drivers/shared/executor/server.go +++ b/drivers/shared/executor/server.go @@ -26,6 +26,8 @@ func (s *grpcExecutorServer) Launch(ctx context.Context, req *proto.LaunchReques TaskDir: req.TaskDir, ResourceLimits: req.ResourceLimits, BasicProcessCgroup: req.BasicProcessCgroup, + Mounts: drivers.MountsFromProto(req.Mounts), + Devices: drivers.DevicesFromProto(req.Devices), }) if err != nil { diff --git a/plugins/drivers/utils.go b/plugins/drivers/utils.go index 34ad01d11..4b104bec0 100644 --- a/plugins/drivers/utils.go +++ b/plugins/drivers/utils.go @@ -57,8 +57,8 @@ func taskConfigFromProto(pb *proto.TaskConfig) *TaskConfig { Env: pb.Env, rawDriverConfig: pb.MsgpackDriverConfig, Resources: ResourcesFromProto(pb.Resources), - Devices: devicesFromProto(pb.Devices), - Mounts: mountsFromProto(pb.Mounts), + Devices: DevicesFromProto(pb.Devices), + Mounts: MountsFromProto(pb.Mounts), User: pb.User, AllocDir: pb.AllocDir, StdoutPath: pb.StdoutPath, @@ -78,8 +78,8 @@ func taskConfigToProto(cfg *TaskConfig) *proto.TaskConfig { Name: cfg.Name, Env: cfg.Env, Resources: ResourcesToProto(cfg.Resources), - Devices: devicesToProto(cfg.Devices), - Mounts: mountsToProto(cfg.Mounts), + Devices: DevicesToProto(cfg.Devices), + Mounts: MountsToProto(cfg.Mounts), User: cfg.User, AllocDir: cfg.AllocDir, MsgpackDriverConfig: cfg.rawDriverConfig, @@ -193,20 +193,20 @@ func ResourcesToProto(r *Resources) *proto.Resources { return &pb } -func devicesFromProto(devices []*proto.Device) []*DeviceConfig { +func DevicesFromProto(devices []*proto.Device) []*DeviceConfig { if devices == nil { return nil } out := make([]*DeviceConfig, len(devices)) for i, d := range devices { - out[i] = deviceFromProto(d) + out[i] = DeviceFromProto(d) } return out } -func deviceFromProto(device *proto.Device) *DeviceConfig { +func DeviceFromProto(device *proto.Device) *DeviceConfig { if device == nil { return nil } @@ -218,20 +218,20 @@ func deviceFromProto(device *proto.Device) *DeviceConfig { } } -func mountsFromProto(mounts []*proto.Mount) []*MountConfig { +func MountsFromProto(mounts []*proto.Mount) []*MountConfig { if mounts == nil { return nil } out := make([]*MountConfig, len(mounts)) for i, m := range mounts { - out[i] = mountFromProto(m) + out[i] = MountFromProto(m) } return out } -func mountFromProto(mount *proto.Mount) *MountConfig { +func MountFromProto(mount *proto.Mount) *MountConfig { if mount == nil { return nil } @@ -243,20 +243,20 @@ func mountFromProto(mount *proto.Mount) *MountConfig { } } -func devicesToProto(devices []*DeviceConfig) []*proto.Device { +func DevicesToProto(devices []*DeviceConfig) []*proto.Device { if devices == nil { return nil } out := make([]*proto.Device, len(devices)) for i, d := range devices { - out[i] = deviceToProto(d) + out[i] = DeviceToProto(d) } return out } -func deviceToProto(device *DeviceConfig) *proto.Device { +func DeviceToProto(device *DeviceConfig) *proto.Device { if device == nil { return nil } @@ -268,20 +268,20 @@ func deviceToProto(device *DeviceConfig) *proto.Device { } } -func mountsToProto(mounts []*MountConfig) []*proto.Mount { +func MountsToProto(mounts []*MountConfig) []*proto.Mount { if mounts == nil { return nil } out := make([]*proto.Mount, len(mounts)) for i, m := range mounts { - out[i] = mountToProto(m) + out[i] = MountToProto(m) } return out } -func mountToProto(mount *MountConfig) *proto.Mount { +func MountToProto(mount *MountConfig) *proto.Mount { if mount == nil { return nil }