From 6195204dcca8ee938022890078d04d231ec3c669 Mon Sep 17 00:00:00 2001 From: criyle Date: Sat, 5 Jun 2021 20:24:08 -0700 Subject: [PATCH] envexec: add optional flag for copyOut files fix #14 --- README.cn.md | 1 + README.md | 1 + cmd/executorserver/grpc_executor/grpc.go | 17 +- cmd/executorserver/main.go | 9 +- cmd/executorserver/model/model.go | 23 +- env/linuxcontainer/environment_linux.go | 2 +- envexec/cmd.go | 8 +- envexec/file_collect.go | 12 +- pb/judge.pb.go | 506 +++++++++++++---------- pb/judge.proto | 9 +- worker/model.go | 4 +- worker/worker.go | 10 +- 12 files changed, 364 insertions(+), 238 deletions(-) diff --git a/README.cn.md b/README.cn.md index 7d4bbaf..afabb3f 100644 --- a/README.cn.md +++ b/README.cn.md @@ -213,6 +213,7 @@ interface Cmd { copyIn?: {[dst:string]:LocalFile | MemoryFile | PreparedFile}; // 在执行程序后从容器文件系统中复制出来的文件列表 + // 在文件名之后加入 '?' 来使文件变为可选,可选文件不存在的情况不会触发 FileError copyOut?: string[]; // 和 copyOut 相同,不过文件不返回内容,而是返回一个对应文件 ID ,内容可以通过 /file/:fileId 接口下载 copyOutCached?: string[]; diff --git a/README.md b/README.md index a7260e5..112d463 100644 --- a/README.md +++ b/README.md @@ -256,6 +256,7 @@ interface Cmd { copyIn?: {[dst:string]:LocalFile | MemoryFile | PreparedFile}; // copy out specifies files need to be copied out from the container after execution + // append '?' after file name will make the file optional and do not cause FileError when missing copyOut?: string[]; // similar to copyOut but stores file in executor service and returns fileId, later download through /file/:fileId copyOutCached?: string[]; diff --git a/cmd/executorserver/grpc_executor/grpc.go b/cmd/executorserver/grpc_executor/grpc.go index f60f888..2ce80db 100644 --- a/cmd/executorserver/grpc_executor/grpc.go +++ b/cmd/executorserver/grpc_executor/grpc.go @@ -52,7 +52,7 @@ func (e *execServer) Exec(ctx context.Context, req *pb.Request) (*pb.Response, e return nil, err } if len(si) > 0 || len(so) > 0 { - return nil, fmt.Errorf("Stream in / out are not available for exec request") + return nil, fmt.Errorf("stream in / out are not available for exec request") } e.logger.Sugar().Debugf("request: %+v", r) rt := <-e.worker.Submit(ctx, r) @@ -203,8 +203,8 @@ func convertPBCmd(c *pb.Request_CmdType, srcPrefix string) (cm worker.Cmd, strea ProcLimit: c.GetProcLimit(), CPURateLimit: c.GetCPURateLimit(), StrictMemoryLimit: c.GetStrictMemoryLimit(), - CopyOut: c.GetCopyOut(), - CopyOutCached: c.GetCopyOutCached(), + CopyOut: convertCopyOut(c.GetCopyOut()), + CopyOutCached: convertCopyOut(c.GetCopyOutCached()), CopyOutMax: c.GetCopyOutMax(), CopyOutDir: c.GetCopyOutDir(), } @@ -277,3 +277,14 @@ func checkPathPrefix(path, prefix string) (bool, error) { } return strings.HasPrefix(filepath.Join(wd, path), prefix), nil } + +func convertCopyOut(copyOut []*pb.Request_CmdCopyOutFile) []envexec.CmdCopyOutFile { + rt := make([]envexec.CmdCopyOutFile, 0, len(copyOut)) + for _, n := range copyOut { + rt = append(rt, envexec.CmdCopyOutFile{ + Name: n.GetName(), + Optional: n.GetOptional(), + }) + } + return rt +} diff --git a/cmd/executorserver/main.go b/cmd/executorserver/main.go index 169910c..1564239 100644 --- a/cmd/executorserver/main.go +++ b/cmd/executorserver/main.go @@ -341,9 +341,10 @@ func newWorker(conf *config.Config, envPool worker.EnvironmentPool, fs filestore func handleVersion(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ - "buildVersion": version.Version, - "goVersion": runtime.Version(), - "platform": runtime.GOARCH, - "os": runtime.GOOS, + "buildVersion": version.Version, + "goVersion": runtime.Version(), + "platform": runtime.GOARCH, + "os": runtime.GOOS, + "copyOutOptional": true, }) } diff --git a/cmd/executorserver/model/model.go b/cmd/executorserver/model/model.go index cfac165..cabbb8f 100644 --- a/cmd/executorserver/model/model.go +++ b/cmd/executorserver/model/model.go @@ -185,8 +185,8 @@ func convertCmd(c Cmd, srcPrefix string) (worker.Cmd, error) { ProcLimit: c.ProcLimit, CPURateLimit: c.CPURateLimit, StrictMemoryLimit: c.StrictMemoryLimit, - CopyOut: c.CopyOut, - CopyOutCached: c.CopyOutCached, + CopyOut: convertCopyOut(c.CopyOut), + CopyOutCached: convertCopyOut(c.CopyOutCached), CopyOutMax: c.CopyOutMax, CopyOutDir: c.CopyOutDir, } @@ -246,3 +246,22 @@ func checkPathPrefix(path, prefix string) (bool, error) { } return strings.HasPrefix(filepath.Join(wd, path), prefix), nil } + +const optionalSuffix = "?" + +func convertCopyOut(copyOut []string) []envexec.CmdCopyOutFile { + rt := make([]envexec.CmdCopyOutFile, 0, len(copyOut)) + for _, n := range copyOut { + if strings.HasSuffix(n, optionalSuffix) { + rt = append(rt, envexec.CmdCopyOutFile{ + Name: strings.TrimSuffix(n, optionalSuffix), + Optional: true, + }) + continue + } + rt = append(rt, envexec.CmdCopyOutFile{ + Name: n, + }) + } + return rt +} diff --git a/env/linuxcontainer/environment_linux.go b/env/linuxcontainer/environment_linux.go index d7314e1..c0bc7c2 100644 --- a/env/linuxcontainer/environment_linux.go +++ b/env/linuxcontainer/environment_linux.go @@ -107,7 +107,7 @@ func (c *environ) WorkDir() *os.File { func (c *environ) Open(path string, flags int, perm os.FileMode) (*os.File, error) { fd, err := syscall.Openat(int(c.wd.Fd()), path, flags|syscall.O_CLOEXEC, uint32(perm)) if err != nil { - return nil, fmt.Errorf("openAtWorkDir: %v", err) + return nil, &os.PathError{Op: "open", Path: path, Err: err} } f := os.NewFile(uintptr(fd), path) if f == nil { diff --git a/envexec/cmd.go b/envexec/cmd.go index f72a919..4dbe643 100644 --- a/envexec/cmd.go +++ b/envexec/cmd.go @@ -44,13 +44,19 @@ type Cmd struct { Waiter func(context.Context, Process) bool // file names to copyout after exec - CopyOut []string + CopyOut []CmdCopyOutFile CopyOutMax Size // file size limit // CopyOutDir specifies a dir to dump all /w contnet CopyOutDir string } +// CmdCopyOutFile defines the file to be copy out after cmd execution +type CmdCopyOutFile struct { + Name string // Name is the file out to copyOut + Optional bool // Optional ignores the file if not exists +} + // Result defines the running result for single Cmd type Result struct { Status Status diff --git a/envexec/file_collect.go b/envexec/file_collect.go index 988f92d..27cdea8 100644 --- a/envexec/file_collect.go +++ b/envexec/file_collect.go @@ -2,6 +2,7 @@ package envexec import ( "bytes" + "errors" "fmt" "io" "os" @@ -28,8 +29,11 @@ func copyOutAndCollect(m Environment, c *Cmd, ptc []pipeCollector) (map[string][ for _, n := range c.CopyOut { n := n g.Go(func() error { - cf, err := m.Open(n, os.O_RDONLY, 0777) + cf, err := m.Open(n.Name, os.O_RDONLY, 0777) if err != nil { + if errors.Is(err, os.ErrNotExist) && n.Optional { + return nil + } return err } defer cf.Close() @@ -40,12 +44,12 @@ func copyOutAndCollect(m Environment, c *Cmd, ptc []pipeCollector) (map[string][ } // check regular file if stat.Mode()&os.ModeType != 0 { - return fmt.Errorf("File(%s) is not a regular file %d", n, stat.Mode()&os.ModeType) + return fmt.Errorf("%s: not a regular file %d", n.Name, stat.Mode()&os.ModeType) } // check size limit s := stat.Size() if c.CopyOutMax > 0 && s > int64(c.CopyOutMax) { - return fmt.Errorf("File(%s) have size (%d) exceeded the limit (%d)", n, s, c.CopyOutMax) + return fmt.Errorf("%s: size (%d) exceeded the limit (%d)", n.Name, s, c.CopyOutMax) } var buf bytes.Buffer buf.Grow(int(s)) @@ -55,7 +59,7 @@ func copyOutAndCollect(m Environment, c *Cmd, ptc []pipeCollector) (map[string][ if err != nil { return err } - put(buf.Bytes(), n) + put(buf.Bytes(), n.Name) return nil }) } diff --git a/pb/judge.pb.go b/pb/judge.pb.go index 0acc9f0..d21a51c 100644 --- a/pb/judge.pb.go +++ b/pb/judge.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.15.8 +// protoc v3.17.2 // source: judge.proto package pb @@ -985,22 +985,22 @@ type Request_CmdType struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` - Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"` - Files []*Request_File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` - Tty bool `protobuf:"varint,13,opt,name=tty,proto3" json:"tty,omitempty"` - CpuTimeLimit uint64 `protobuf:"varint,4,opt,name=cpuTimeLimit,proto3" json:"cpuTimeLimit,omitempty"` - ClockTimeLimit uint64 `protobuf:"varint,5,opt,name=clockTimeLimit,proto3" json:"clockTimeLimit,omitempty"` - MemoryLimit uint64 `protobuf:"varint,6,opt,name=memoryLimit,proto3" json:"memoryLimit,omitempty"` - StackLimit uint64 `protobuf:"varint,12,opt,name=stackLimit,proto3" json:"stackLimit,omitempty"` - ProcLimit uint64 `protobuf:"varint,7,opt,name=procLimit,proto3" json:"procLimit,omitempty"` - CPURateLimit float64 `protobuf:"fixed64,15,opt,name=CPURateLimit,proto3" json:"CPURateLimit,omitempty"` - CopyIn map[string]*Request_File `protobuf:"bytes,8,rep,name=copyIn,proto3" json:"copyIn,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - CopyOut []string `protobuf:"bytes,9,rep,name=copyOut,proto3" json:"copyOut,omitempty"` - CopyOutCached []string `protobuf:"bytes,10,rep,name=copyOutCached,proto3" json:"copyOutCached,omitempty"` - CopyOutDir string `protobuf:"bytes,11,opt,name=copyOutDir,proto3" json:"copyOutDir,omitempty"` - CopyOutMax uint64 `protobuf:"varint,14,opt,name=copyOutMax,proto3" json:"copyOutMax,omitempty"` - StrictMemoryLimit bool `protobuf:"varint,16,opt,name=strictMemoryLimit,proto3" json:"strictMemoryLimit,omitempty"` + Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,2,rep,name=env,proto3" json:"env,omitempty"` + Files []*Request_File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` + Tty bool `protobuf:"varint,13,opt,name=tty,proto3" json:"tty,omitempty"` + CpuTimeLimit uint64 `protobuf:"varint,4,opt,name=cpuTimeLimit,proto3" json:"cpuTimeLimit,omitempty"` + ClockTimeLimit uint64 `protobuf:"varint,5,opt,name=clockTimeLimit,proto3" json:"clockTimeLimit,omitempty"` + MemoryLimit uint64 `protobuf:"varint,6,opt,name=memoryLimit,proto3" json:"memoryLimit,omitempty"` + StackLimit uint64 `protobuf:"varint,12,opt,name=stackLimit,proto3" json:"stackLimit,omitempty"` + ProcLimit uint64 `protobuf:"varint,7,opt,name=procLimit,proto3" json:"procLimit,omitempty"` + CPURateLimit float64 `protobuf:"fixed64,15,opt,name=CPURateLimit,proto3" json:"CPURateLimit,omitempty"` + CopyIn map[string]*Request_File `protobuf:"bytes,8,rep,name=copyIn,proto3" json:"copyIn,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + CopyOut []*Request_CmdCopyOutFile `protobuf:"bytes,9,rep,name=copyOut,proto3" json:"copyOut,omitempty"` + CopyOutCached []*Request_CmdCopyOutFile `protobuf:"bytes,10,rep,name=copyOutCached,proto3" json:"copyOutCached,omitempty"` + CopyOutDir string `protobuf:"bytes,11,opt,name=copyOutDir,proto3" json:"copyOutDir,omitempty"` + CopyOutMax uint64 `protobuf:"varint,14,opt,name=copyOutMax,proto3" json:"copyOutMax,omitempty"` + StrictMemoryLimit bool `protobuf:"varint,16,opt,name=strictMemoryLimit,proto3" json:"strictMemoryLimit,omitempty"` } func (x *Request_CmdType) Reset() { @@ -1112,14 +1112,14 @@ func (x *Request_CmdType) GetCopyIn() map[string]*Request_File { return nil } -func (x *Request_CmdType) GetCopyOut() []string { +func (x *Request_CmdType) GetCopyOut() []*Request_CmdCopyOutFile { if x != nil { return x.CopyOut } return nil } -func (x *Request_CmdType) GetCopyOutCached() []string { +func (x *Request_CmdType) GetCopyOutCached() []*Request_CmdCopyOutFile { if x != nil { return x.CopyOutCached } @@ -1147,6 +1147,61 @@ func (x *Request_CmdType) GetStrictMemoryLimit() bool { return false } +type Request_CmdCopyOutFile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Optional bool `protobuf:"varint,2,opt,name=optional,proto3" json:"optional,omitempty"` +} + +func (x *Request_CmdCopyOutFile) Reset() { + *x = Request_CmdCopyOutFile{} + if protoimpl.UnsafeEnabled { + mi := &file_judge_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request_CmdCopyOutFile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request_CmdCopyOutFile) ProtoMessage() {} + +func (x *Request_CmdCopyOutFile) ProtoReflect() protoreflect.Message { + mi := &file_judge_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request_CmdCopyOutFile.ProtoReflect.Descriptor instead. +func (*Request_CmdCopyOutFile) Descriptor() ([]byte, []int) { + return file_judge_proto_rawDescGZIP(), []int{3, 8} +} + +func (x *Request_CmdCopyOutFile) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Request_CmdCopyOutFile) GetOptional() bool { + if x != nil { + return x.Optional + } + return false +} + type Request_PipeMap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1159,7 +1214,7 @@ type Request_PipeMap struct { func (x *Request_PipeMap) Reset() { *x = Request_PipeMap{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[15] + mi := &file_judge_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1172,7 +1227,7 @@ func (x *Request_PipeMap) String() string { func (*Request_PipeMap) ProtoMessage() {} func (x *Request_PipeMap) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[15] + mi := &file_judge_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1185,7 +1240,7 @@ func (x *Request_PipeMap) ProtoReflect() protoreflect.Message { // Deprecated: Use Request_PipeMap.ProtoReflect.Descriptor instead. func (*Request_PipeMap) Descriptor() ([]byte, []int) { - return file_judge_proto_rawDescGZIP(), []int{3, 8} + return file_judge_proto_rawDescGZIP(), []int{3, 9} } func (x *Request_PipeMap) GetIn() *Request_PipeMap_PipeIndex { @@ -1214,7 +1269,7 @@ type Request_PipeMap_PipeIndex struct { func (x *Request_PipeMap_PipeIndex) Reset() { *x = Request_PipeMap_PipeIndex{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[17] + mi := &file_judge_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1227,7 +1282,7 @@ func (x *Request_PipeMap_PipeIndex) String() string { func (*Request_PipeMap_PipeIndex) ProtoMessage() {} func (x *Request_PipeMap_PipeIndex) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[17] + mi := &file_judge_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1240,7 +1295,7 @@ func (x *Request_PipeMap_PipeIndex) ProtoReflect() protoreflect.Message { // Deprecated: Use Request_PipeMap_PipeIndex.ProtoReflect.Descriptor instead. func (*Request_PipeMap_PipeIndex) Descriptor() ([]byte, []int) { - return file_judge_proto_rawDescGZIP(), []int{3, 8, 0} + return file_judge_proto_rawDescGZIP(), []int{3, 9, 0} } func (x *Request_PipeMap_PipeIndex) GetIndex() int32 { @@ -1275,7 +1330,7 @@ type Response_Result struct { func (x *Response_Result) Reset() { *x = Response_Result{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[18] + mi := &file_judge_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1288,7 +1343,7 @@ func (x *Response_Result) String() string { func (*Response_Result) ProtoMessage() {} func (x *Response_Result) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[18] + mi := &file_judge_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1372,7 +1427,7 @@ type StreamRequest_Input struct { func (x *StreamRequest_Input) Reset() { *x = StreamRequest_Input{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[21] + mi := &file_judge_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1385,7 +1440,7 @@ func (x *StreamRequest_Input) String() string { func (*StreamRequest_Input) ProtoMessage() {} func (x *StreamRequest_Input) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[21] + mi := &file_judge_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1430,7 +1485,7 @@ type StreamRequest_Resize struct { func (x *StreamRequest_Resize) Reset() { *x = StreamRequest_Resize{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[22] + mi := &file_judge_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1443,7 +1498,7 @@ func (x *StreamRequest_Resize) String() string { func (*StreamRequest_Resize) ProtoMessage() {} func (x *StreamRequest_Resize) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[22] + mi := &file_judge_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1506,7 +1561,7 @@ type StreamResponse_Output struct { func (x *StreamResponse_Output) Reset() { *x = StreamResponse_Output{} if protoimpl.UnsafeEnabled { - mi := &file_judge_proto_msgTypes[23] + mi := &file_judge_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1519,7 +1574,7 @@ func (x *StreamResponse_Output) String() string { func (*StreamResponse_Output) ProtoMessage() {} func (x *StreamResponse_Output) ProtoReflect() protoreflect.Message { - mi := &file_judge_proto_msgTypes[23] + mi := &file_judge_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1563,7 +1618,7 @@ var file_judge_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x22, 0xc5, 0x0b, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x22, 0xbf, 0x0c, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x12, 0x25, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, @@ -1607,7 +1662,7 @@ var file_judge_proto_rawDesc = []byte{ 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4f, 0x75, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, - 0x1a, 0xed, 0x04, 0x0a, 0x07, 0x43, 0x6d, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x1a, 0xa5, 0x05, 0x0a, 0x07, 0x43, 0x6d, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x26, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, @@ -1630,139 +1685,147 @@ var file_judge_proto_rawDesc = []byte{ 0x63, 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6d, 0x64, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x43, 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x63, - 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, - 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x12, - 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, - 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, - 0x44, 0x69, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, - 0x75, 0x74, 0x44, 0x69, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, - 0x4d, 0x61, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, - 0x75, 0x74, 0x4d, 0x61, 0x78, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x1a, 0x4b, 0x0a, 0x0b, 0x43, 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x9c, 0x01, 0x0a, 0x07, 0x50, 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x2d, 0x0a, 0x02, - 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x2e, 0x50, 0x69, - 0x70, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x2f, 0x0a, 0x03, 0x6f, - 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x2e, 0x50, 0x69, - 0x70, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x1a, 0x31, 0x0a, 0x09, - 0x50, 0x69, 0x70, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x0e, 0x0a, 0x02, 0x66, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x66, 0x64, 0x22, - 0xb9, 0x06, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x12, 0x2d, 0x0a, 0x07, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, - 0xc9, 0x05, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x72, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, - 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x34, - 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, - 0x44, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, - 0x1a, 0x38, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x46, 0x69, - 0x6c, 0x65, 0x49, 0x44, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa2, 0x02, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x10, 0x01, - 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x72, 0x6f, 0x6e, 0x67, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x10, - 0x02, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x43, 0x6f, - 0x72, 0x72, 0x65, 0x63, 0x74, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x04, - 0x12, 0x15, 0x0a, 0x11, 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, - 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x06, - 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x07, 0x12, - 0x15, 0x0a, 0x11, 0x4e, 0x6f, 0x6e, 0x5a, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x69, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x10, 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x10, 0x09, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x6f, - 0x75, 0x73, 0x53, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x10, 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x4a, - 0x75, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x0b, - 0x12, 0x16, 0x0a, 0x12, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x0d, 0x22, 0xd9, 0x02, 0x0a, 0x0d, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, - 0x0b, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x00, 0x52, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, - 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, - 0x65, 0x63, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x52, - 0x65, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, - 0x65, 0x73, 0x69, 0x7a, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, - 0x69, 0x7a, 0x65, 0x1a, 0x35, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x60, 0x0a, 0x06, 0x52, 0x65, - 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x73, - 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x78, 0x12, 0x0c, - 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x79, 0x42, 0x09, 0x0a, 0x07, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xc5, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0c, 0x65, 0x78, - 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, - 0x52, 0x0c, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, - 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, - 0x0a, 0x65, 0x78, 0x65, 0x63, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, 0x36, 0x0a, 0x06, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x9e, 0x02, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x04, - 0x45, 0x78, 0x65, 0x63, 0x12, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x37, 0x0a, 0x0a, 0x45, 0x78, 0x65, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x11, 0x2e, - 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x34, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, - 0x0a, 0x07, 0x46, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x74, 0x12, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x49, 0x44, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x07, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x64, - 0x64, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x12, 0x30, - 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x0a, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x42, 0x1f, 0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x72, 0x69, 0x79, 0x6c, 0x65, 0x2f, 0x67, 0x6f, 0x2d, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6d, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x12, 0x40, 0x0a, 0x0d, 0x63, + 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x43, 0x6d, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0d, + 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x44, 0x69, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x44, 0x69, 0x72, 0x12, 0x1e, 0x0a, + 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x4d, 0x61, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x4d, 0x61, 0x78, 0x12, 0x2c, 0x0a, + 0x11, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x4b, 0x0a, 0x0b, 0x43, + 0x6f, 0x70, 0x79, 0x49, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x0e, 0x43, 0x6d, 0x64, 0x43, + 0x6f, 0x70, 0x79, 0x4f, 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x1a, 0x9c, 0x01, 0x0a, 0x07, 0x50, + 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x2d, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x50, 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x2f, 0x0a, 0x03, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x50, 0x69, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x52, 0x03, 0x6f, 0x75, 0x74, 0x1a, 0x31, 0x0a, 0x09, 0x50, 0x69, 0x70, 0x65, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x66, 0x64, 0x22, 0xb9, 0x06, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x44, 0x12, 0x2d, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xc9, 0x05, 0x0a, 0x06, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, + 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x75, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3a, + 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0xa2, 0x02, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x72, + 0x6f, 0x6e, 0x67, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x10, + 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x69, + 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, + 0x05, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x69, + 0x6c, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x6f, 0x6e, + 0x5a, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x10, 0x08, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0x09, 0x12, + 0x14, 0x0a, 0x10, 0x44, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x6f, 0x75, 0x73, 0x53, 0x79, 0x73, 0x63, + 0x61, 0x6c, 0x6c, 0x10, 0x0a, 0x12, 0x13, 0x0a, 0x0f, 0x4a, 0x75, 0x64, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x6e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x10, 0x0d, 0x22, 0xd9, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x78, 0x65, + 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x63, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, + 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x65, 0x63, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x48, + 0x00, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x1a, 0x35, 0x0a, + 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x60, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x6c, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x01, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xc5, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x0c, 0x65, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x65, 0x78, 0x65, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x65, 0x78, 0x65, 0x63, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x65, 0x63, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, 0x36, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0a, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9e, 0x02, 0x0a, 0x08, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x0b, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x45, 0x78, 0x65, + 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, + 0x30, 0x01, 0x12, 0x34, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x46, 0x69, 0x6c, 0x65, + 0x47, 0x65, 0x74, 0x12, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x1a, + 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x26, 0x0a, 0x07, 0x46, 0x69, 0x6c, 0x65, 0x41, 0x64, 0x64, 0x12, 0x0f, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x0a, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x44, 0x12, 0x30, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x49, 0x44, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1f, 0x5a, 0x1d, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x72, 0x69, 0x79, 0x6c, 0x65, 0x2f, + 0x67, 0x6f, 0x2d, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1778,7 +1841,7 @@ func file_judge_proto_rawDescGZIP() []byte { } var file_judge_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_judge_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_judge_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_judge_proto_goTypes = []interface{}{ (Response_Result_StatusType)(0), // 0: pb.Response.Result.StatusType (*FileID)(nil), // 1: pb.FileID @@ -1796,26 +1859,27 @@ var file_judge_proto_goTypes = []interface{}{ (*Request_StreamOutput)(nil), // 13: pb.Request.StreamOutput (*Request_File)(nil), // 14: pb.Request.File (*Request_CmdType)(nil), // 15: pb.Request.CmdType - (*Request_PipeMap)(nil), // 16: pb.Request.PipeMap - nil, // 17: pb.Request.CmdType.CopyInEntry - (*Request_PipeMap_PipeIndex)(nil), // 18: pb.Request.PipeMap.PipeIndex - (*Response_Result)(nil), // 19: pb.Response.Result - nil, // 20: pb.Response.Result.FilesEntry - nil, // 21: pb.Response.Result.FileIDsEntry - (*StreamRequest_Input)(nil), // 22: pb.StreamRequest.Input - (*StreamRequest_Resize)(nil), // 23: pb.StreamRequest.Resize - (*StreamResponse_Output)(nil), // 24: pb.StreamResponse.Output - (*emptypb.Empty)(nil), // 25: google.protobuf.Empty + (*Request_CmdCopyOutFile)(nil), // 16: pb.Request.CmdCopyOutFile + (*Request_PipeMap)(nil), // 17: pb.Request.PipeMap + nil, // 18: pb.Request.CmdType.CopyInEntry + (*Request_PipeMap_PipeIndex)(nil), // 19: pb.Request.PipeMap.PipeIndex + (*Response_Result)(nil), // 20: pb.Response.Result + nil, // 21: pb.Response.Result.FilesEntry + nil, // 22: pb.Response.Result.FileIDsEntry + (*StreamRequest_Input)(nil), // 23: pb.StreamRequest.Input + (*StreamRequest_Resize)(nil), // 24: pb.StreamRequest.Resize + (*StreamResponse_Output)(nil), // 25: pb.StreamResponse.Output + (*emptypb.Empty)(nil), // 26: google.protobuf.Empty } var file_judge_proto_depIdxs = []int32{ 15, // 0: pb.Request.cmd:type_name -> pb.Request.CmdType - 16, // 1: pb.Request.pipeMapping:type_name -> pb.Request.PipeMap - 19, // 2: pb.Response.results:type_name -> pb.Response.Result + 17, // 1: pb.Request.pipeMapping:type_name -> pb.Request.PipeMap + 20, // 2: pb.Response.results:type_name -> pb.Response.Result 4, // 3: pb.StreamRequest.execRequest:type_name -> pb.Request - 22, // 4: pb.StreamRequest.execInput:type_name -> pb.StreamRequest.Input - 23, // 5: pb.StreamRequest.execResize:type_name -> pb.StreamRequest.Resize + 23, // 4: pb.StreamRequest.execInput:type_name -> pb.StreamRequest.Input + 24, // 5: pb.StreamRequest.execResize:type_name -> pb.StreamRequest.Resize 5, // 6: pb.StreamResponse.execResponse:type_name -> pb.Response - 24, // 7: pb.StreamResponse.execOutput:type_name -> pb.StreamResponse.Output + 25, // 7: pb.StreamResponse.execOutput:type_name -> pb.StreamResponse.Output 8, // 8: pb.Request.File.local:type_name -> pb.Request.LocalFile 9, // 9: pb.Request.File.memory:type_name -> pb.Request.MemoryFile 10, // 10: pb.Request.File.cached:type_name -> pb.Request.CachedFile @@ -1823,30 +1887,32 @@ var file_judge_proto_depIdxs = []int32{ 12, // 12: pb.Request.File.streamIn:type_name -> pb.Request.StreamInput 13, // 13: pb.Request.File.streamOut:type_name -> pb.Request.StreamOutput 14, // 14: pb.Request.CmdType.files:type_name -> pb.Request.File - 17, // 15: pb.Request.CmdType.copyIn:type_name -> pb.Request.CmdType.CopyInEntry - 18, // 16: pb.Request.PipeMap.in:type_name -> pb.Request.PipeMap.PipeIndex - 18, // 17: pb.Request.PipeMap.out:type_name -> pb.Request.PipeMap.PipeIndex - 14, // 18: pb.Request.CmdType.CopyInEntry.value:type_name -> pb.Request.File - 0, // 19: pb.Response.Result.status:type_name -> pb.Response.Result.StatusType - 20, // 20: pb.Response.Result.files:type_name -> pb.Response.Result.FilesEntry - 21, // 21: pb.Response.Result.fileIDs:type_name -> pb.Response.Result.FileIDsEntry - 4, // 22: pb.Executor.Exec:input_type -> pb.Request - 6, // 23: pb.Executor.ExecStream:input_type -> pb.StreamRequest - 25, // 24: pb.Executor.FileList:input_type -> google.protobuf.Empty - 1, // 25: pb.Executor.FileGet:input_type -> pb.FileID - 2, // 26: pb.Executor.FileAdd:input_type -> pb.FileContent - 1, // 27: pb.Executor.FileDelete:input_type -> pb.FileID - 5, // 28: pb.Executor.Exec:output_type -> pb.Response - 7, // 29: pb.Executor.ExecStream:output_type -> pb.StreamResponse - 3, // 30: pb.Executor.FileList:output_type -> pb.FileListType - 2, // 31: pb.Executor.FileGet:output_type -> pb.FileContent - 1, // 32: pb.Executor.FileAdd:output_type -> pb.FileID - 25, // 33: pb.Executor.FileDelete:output_type -> google.protobuf.Empty - 28, // [28:34] is the sub-list for method output_type - 22, // [22:28] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 18, // 15: pb.Request.CmdType.copyIn:type_name -> pb.Request.CmdType.CopyInEntry + 16, // 16: pb.Request.CmdType.copyOut:type_name -> pb.Request.CmdCopyOutFile + 16, // 17: pb.Request.CmdType.copyOutCached:type_name -> pb.Request.CmdCopyOutFile + 19, // 18: pb.Request.PipeMap.in:type_name -> pb.Request.PipeMap.PipeIndex + 19, // 19: pb.Request.PipeMap.out:type_name -> pb.Request.PipeMap.PipeIndex + 14, // 20: pb.Request.CmdType.CopyInEntry.value:type_name -> pb.Request.File + 0, // 21: pb.Response.Result.status:type_name -> pb.Response.Result.StatusType + 21, // 22: pb.Response.Result.files:type_name -> pb.Response.Result.FilesEntry + 22, // 23: pb.Response.Result.fileIDs:type_name -> pb.Response.Result.FileIDsEntry + 4, // 24: pb.Executor.Exec:input_type -> pb.Request + 6, // 25: pb.Executor.ExecStream:input_type -> pb.StreamRequest + 26, // 26: pb.Executor.FileList:input_type -> google.protobuf.Empty + 1, // 27: pb.Executor.FileGet:input_type -> pb.FileID + 2, // 28: pb.Executor.FileAdd:input_type -> pb.FileContent + 1, // 29: pb.Executor.FileDelete:input_type -> pb.FileID + 5, // 30: pb.Executor.Exec:output_type -> pb.Response + 7, // 31: pb.Executor.ExecStream:output_type -> pb.StreamResponse + 3, // 32: pb.Executor.FileList:output_type -> pb.FileListType + 2, // 33: pb.Executor.FileGet:output_type -> pb.FileContent + 1, // 34: pb.Executor.FileAdd:output_type -> pb.FileID + 26, // 35: pb.Executor.FileDelete:output_type -> google.protobuf.Empty + 30, // [30:36] is the sub-list for method output_type + 24, // [24:30] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_judge_proto_init() } @@ -2036,6 +2102,18 @@ func file_judge_proto_init() { } } file_judge_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request_CmdCopyOutFile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_judge_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Request_PipeMap); i { case 0: return &v.state @@ -2047,7 +2125,7 @@ func file_judge_proto_init() { return nil } } - file_judge_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_judge_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Request_PipeMap_PipeIndex); i { case 0: return &v.state @@ -2059,7 +2137,7 @@ func file_judge_proto_init() { return nil } } - file_judge_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_judge_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Response_Result); i { case 0: return &v.state @@ -2071,7 +2149,7 @@ func file_judge_proto_init() { return nil } } - file_judge_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_judge_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamRequest_Input); i { case 0: return &v.state @@ -2083,7 +2161,7 @@ func file_judge_proto_init() { return nil } } - file_judge_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_judge_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamRequest_Resize); i { case 0: return &v.state @@ -2095,7 +2173,7 @@ func file_judge_proto_init() { return nil } } - file_judge_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_judge_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamResponse_Output); i { case 0: return &v.state @@ -2131,7 +2209,7 @@ func file_judge_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_judge_proto_rawDesc, NumEnums: 1, - NumMessages: 24, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/pb/judge.proto b/pb/judge.proto index 9b789e9..3404209 100644 --- a/pb/judge.proto +++ b/pb/judge.proto @@ -85,13 +85,18 @@ message Request { map copyIn = 8; - repeated string copyOut = 9; - repeated string copyOutCached = 10; + repeated CmdCopyOutFile copyOut = 9; + repeated CmdCopyOutFile copyOutCached = 10; string copyOutDir = 11; uint64 copyOutMax = 14; bool strictMemoryLimit = 16; } + message CmdCopyOutFile { + string name = 1; + bool optional = 2; + } + message PipeMap { message PipeIndex { int32 index = 1; diff --git a/worker/model.go b/worker/model.go index d7ac432..592d8fa 100644 --- a/worker/model.go +++ b/worker/model.go @@ -24,8 +24,8 @@ type Cmd struct { CopyIn map[string]CmdFile - CopyOut []string - CopyOutCached []string + CopyOut []envexec.CmdCopyOutFile + CopyOutCached []envexec.CmdCopyOutFile CopyOutMax uint64 CopyOutDir string } diff --git a/worker/worker.go b/worker/worker.go index 29f6f10..106f738 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -276,18 +276,18 @@ func (w *worker) prepareCmd(rc Cmd) (*envexec.Cmd, map[string]bool, error) { for k := range pipeFileName { copyOutSet[k] = true } - copyOut := make([]string, 0, len(rc.CopyOut)+len(rc.CopyOutCached)) + copyOut := make([]envexec.CmdCopyOutFile, 0, len(rc.CopyOut)+len(rc.CopyOutCached)) for _, fn := range rc.CopyOut { - if !pipeFileName[fn] { + if !pipeFileName[fn.Name] { copyOut = append(copyOut, fn) } - copyOutSet[fn] = true + copyOutSet[fn.Name] = true } for _, fn := range rc.CopyOutCached { - if !pipeFileName[fn] { + if !pipeFileName[fn.Name] { copyOut = append(copyOut, fn) } else { - delete(copyOutSet, fn) + delete(copyOutSet, fn.Name) } }