From c143771234f1d922fdddbdd4dc8dab0feb5c97e4 Mon Sep 17 00:00:00 2001 From: Anton Kosyakov Date: Mon, 21 Jun 2021 06:56:20 +0000 Subject: [PATCH] =?UTF-8?q?[supervisor]=C2=A0allow=20retry=20auto=20exposi?= =?UTF-8?q?ng=20port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/supervisor-api/go/port.pb.go | 231 ++++++++--- components/supervisor-api/go/port.pb.gw.go | 99 +++++ components/supervisor-api/go/port_grpc.pb.go | 38 ++ components/supervisor-api/go/status.pb.go | 370 +++++++++++------- components/supervisor-api/go/terminal.pb.go | 2 +- components/supervisor-api/port.proto | 12 + components/supervisor-api/status.proto | 8 + components/supervisor/pkg/ports/ports.go | 96 +++-- .../supervisor/pkg/supervisor/services.go | 6 + 9 files changed, 635 insertions(+), 227 deletions(-) diff --git a/components/supervisor-api/go/port.pb.go b/components/supervisor-api/go/port.pb.go index 83a209bbe161e9..03d957ff9e4305 100644 --- a/components/supervisor-api/go/port.pb.go +++ b/components/supervisor-api/go/port.pb.go @@ -480,6 +480,91 @@ func (*AutoTunnelResponse) Descriptor() ([]byte, []int) { return file_port_proto_rawDescGZIP(), []int{7} } +type RetryAutoExposeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *RetryAutoExposeRequest) Reset() { + *x = RetryAutoExposeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_port_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RetryAutoExposeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RetryAutoExposeRequest) ProtoMessage() {} + +func (x *RetryAutoExposeRequest) ProtoReflect() protoreflect.Message { + mi := &file_port_proto_msgTypes[8] + 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 RetryAutoExposeRequest.ProtoReflect.Descriptor instead. +func (*RetryAutoExposeRequest) Descriptor() ([]byte, []int) { + return file_port_proto_rawDescGZIP(), []int{8} +} + +func (x *RetryAutoExposeRequest) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +type RetryAutoExposeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RetryAutoExposeResponse) Reset() { + *x = RetryAutoExposeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_port_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RetryAutoExposeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RetryAutoExposeResponse) ProtoMessage() {} + +func (x *RetryAutoExposeResponse) ProtoReflect() protoreflect.Message { + mi := &file_port_proto_msgTypes[9] + 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 RetryAutoExposeResponse.ProtoReflect.Descriptor instead. +func (*RetryAutoExposeResponse) Descriptor() ([]byte, []int) { + return file_port_proto_rawDescGZIP(), []int{9} +} + var File_port_proto protoreflect.FileDescriptor var file_port_proto_rawDesc = []byte{ @@ -516,41 +601,55 @@ var file_port_proto_rawDesc = []byte{ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x32, 0x0a, 0x0f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x10, 0x02, 0x32, 0xbe, 0x03, 0x0a, 0x0b, 0x50, 0x6f, - 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x06, 0x54, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, - 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, - 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x7b, 0x70, 0x6f, 0x72, - 0x74, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x6e, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, - 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, - 0x72, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, - 0x72, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x7b, - 0x70, 0x6f, 0x72, 0x74, 0x7d, 0x12, 0x5e, 0x0a, 0x0f, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, - 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, - 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, - 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x73, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, - 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, - 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, - 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x61, 0x75, 0x74, 0x6f, - 0x2f, 0x7b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, - 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, - 0x69, 0x73, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x75, + 0x74, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, + 0x6f, 0x72, 0x74, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x75, 0x74, 0x6f, + 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x32, + 0x0a, 0x0f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x08, 0x0a, 0x04, 0x6e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x68, + 0x6f, 0x73, 0x74, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x10, 0x02, 0x32, 0xc8, 0x04, 0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x06, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, + 0x50, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x50, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x7b, 0x70, 0x6f, 0x72, 0x74, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x6e, + 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1e, 0x2e, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x72, 0x74, + 0x2f, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x7b, 0x70, 0x6f, 0x72, 0x74, 0x7d, 0x12, 0x5e, + 0x0a, 0x0f, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x75, 0x6e, 0x6e, 0x65, + 0x6c, 0x12, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x45, + 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, + 0x6f, 0x72, 0x2e, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x75, 0x6e, 0x6e, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x73, + 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x2e, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x54, 0x75, 0x6e, + 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x75, + 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x7b, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x7d, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x75, 0x74, + 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x22, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, + 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x78, + 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x75, + 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x79, 0x41, 0x75, + 0x74, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, + 0x72, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, + 0x2f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x2f, 0x7b, 0x70, 0x6f, 0x72, 0x74, 0x7d, 0x42, 0x2c, 0x5a, + 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -566,7 +665,7 @@ func file_port_proto_rawDescGZIP() []byte { } var file_port_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_port_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_port_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_port_proto_goTypes = []interface{}{ (TunnelVisiblity)(0), // 0: supervisor.TunnelVisiblity (*TunnelPortRequest)(nil), // 1: supervisor.TunnelPortRequest @@ -577,23 +676,27 @@ var file_port_proto_goTypes = []interface{}{ (*EstablishTunnelResponse)(nil), // 6: supervisor.EstablishTunnelResponse (*AutoTunnelRequest)(nil), // 7: supervisor.AutoTunnelRequest (*AutoTunnelResponse)(nil), // 8: supervisor.AutoTunnelResponse + (*RetryAutoExposeRequest)(nil), // 9: supervisor.RetryAutoExposeRequest + (*RetryAutoExposeResponse)(nil), // 10: supervisor.RetryAutoExposeResponse } var file_port_proto_depIdxs = []int32{ - 0, // 0: supervisor.TunnelPortRequest.visibility:type_name -> supervisor.TunnelVisiblity - 1, // 1: supervisor.EstablishTunnelRequest.desc:type_name -> supervisor.TunnelPortRequest - 1, // 2: supervisor.PortService.Tunnel:input_type -> supervisor.TunnelPortRequest - 3, // 3: supervisor.PortService.CloseTunnel:input_type -> supervisor.CloseTunnelRequest - 5, // 4: supervisor.PortService.EstablishTunnel:input_type -> supervisor.EstablishTunnelRequest - 7, // 5: supervisor.PortService.AutoTunnel:input_type -> supervisor.AutoTunnelRequest - 2, // 6: supervisor.PortService.Tunnel:output_type -> supervisor.TunnelPortResponse - 4, // 7: supervisor.PortService.CloseTunnel:output_type -> supervisor.CloseTunnelResponse - 6, // 8: supervisor.PortService.EstablishTunnel:output_type -> supervisor.EstablishTunnelResponse - 8, // 9: supervisor.PortService.AutoTunnel:output_type -> supervisor.AutoTunnelResponse - 6, // [6:10] is the sub-list for method output_type - 2, // [2:6] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // 0: supervisor.TunnelPortRequest.visibility:type_name -> supervisor.TunnelVisiblity + 1, // 1: supervisor.EstablishTunnelRequest.desc:type_name -> supervisor.TunnelPortRequest + 1, // 2: supervisor.PortService.Tunnel:input_type -> supervisor.TunnelPortRequest + 3, // 3: supervisor.PortService.CloseTunnel:input_type -> supervisor.CloseTunnelRequest + 5, // 4: supervisor.PortService.EstablishTunnel:input_type -> supervisor.EstablishTunnelRequest + 7, // 5: supervisor.PortService.AutoTunnel:input_type -> supervisor.AutoTunnelRequest + 9, // 6: supervisor.PortService.RetryAutoExpose:input_type -> supervisor.RetryAutoExposeRequest + 2, // 7: supervisor.PortService.Tunnel:output_type -> supervisor.TunnelPortResponse + 4, // 8: supervisor.PortService.CloseTunnel:output_type -> supervisor.CloseTunnelResponse + 6, // 9: supervisor.PortService.EstablishTunnel:output_type -> supervisor.EstablishTunnelResponse + 8, // 10: supervisor.PortService.AutoTunnel:output_type -> supervisor.AutoTunnelResponse + 10, // 11: supervisor.PortService.RetryAutoExpose:output_type -> supervisor.RetryAutoExposeResponse + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_port_proto_init() } @@ -698,6 +801,30 @@ func file_port_proto_init() { return nil } } + file_port_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RetryAutoExposeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_port_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RetryAutoExposeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_port_proto_msgTypes[4].OneofWrappers = []interface{}{ (*EstablishTunnelRequest_Desc)(nil), @@ -709,7 +836,7 @@ func file_port_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_port_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/components/supervisor-api/go/port.pb.gw.go b/components/supervisor-api/go/port.pb.gw.go index 7595b38b7f9f98..0b815c01b41444 100644 --- a/components/supervisor-api/go/port.pb.gw.go +++ b/components/supervisor-api/go/port.pb.gw.go @@ -207,6 +207,58 @@ func local_request_PortService_AutoTunnel_0(ctx context.Context, marshaler runti } +func request_PortService_RetryAutoExpose_0(ctx context.Context, marshaler runtime.Marshaler, client PortServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RetryAutoExposeRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port") + } + + protoReq.Port, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port", err) + } + + msg, err := client.RetryAutoExpose(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PortService_RetryAutoExpose_0(ctx context.Context, marshaler runtime.Marshaler, server PortServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RetryAutoExposeRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port") + } + + protoReq.Port, err = runtime.Uint32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port", err) + } + + msg, err := server.RetryAutoExpose(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterPortServiceHandlerServer registers the http handlers for service PortService to "mux". // UnaryRPC :call PortServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -282,6 +334,29 @@ func RegisterPortServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_PortService_RetryAutoExpose_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/supervisor.PortService/RetryAutoExpose") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PortService_RetryAutoExpose_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PortService_RetryAutoExpose_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -383,6 +458,26 @@ func RegisterPortServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_PortService_RetryAutoExpose_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/supervisor.PortService/RetryAutoExpose") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PortService_RetryAutoExpose_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PortService_RetryAutoExpose_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -392,6 +487,8 @@ var ( pattern_PortService_CloseTunnel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 1}, []string{"v1", "port", "tunnel"}, "")) pattern_PortService_AutoTunnel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "port", "tunnel", "auto", "enabled"}, "")) + + pattern_PortService_RetryAutoExpose_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 1}, []string{"v1", "port", "ports", "exposed", "retry"}, "")) ) var ( @@ -400,4 +497,6 @@ var ( forward_PortService_CloseTunnel_0 = runtime.ForwardResponseMessage forward_PortService_AutoTunnel_0 = runtime.ForwardResponseMessage + + forward_PortService_RetryAutoExpose_0 = runtime.ForwardResponseMessage ) diff --git a/components/supervisor-api/go/port_grpc.pb.go b/components/supervisor-api/go/port_grpc.pb.go index 9e746f120ee124..a3f3a35f500a96 100644 --- a/components/supervisor-api/go/port_grpc.pb.go +++ b/components/supervisor-api/go/port_grpc.pb.go @@ -31,6 +31,8 @@ type PortServiceClient interface { EstablishTunnel(ctx context.Context, opts ...grpc.CallOption) (PortService_EstablishTunnelClient, error) // AutoTunnel controls enablement of auto tunneling AutoTunnel(ctx context.Context, in *AutoTunnelRequest, opts ...grpc.CallOption) (*AutoTunnelResponse, error) + // RetryAutoExpose retries auto exposing the give port + RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error) } type portServiceClient struct { @@ -99,6 +101,15 @@ func (c *portServiceClient) AutoTunnel(ctx context.Context, in *AutoTunnelReques return out, nil } +func (c *portServiceClient) RetryAutoExpose(ctx context.Context, in *RetryAutoExposeRequest, opts ...grpc.CallOption) (*RetryAutoExposeResponse, error) { + out := new(RetryAutoExposeResponse) + err := c.cc.Invoke(ctx, "/supervisor.PortService/RetryAutoExpose", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // PortServiceServer is the server API for PortService service. // All implementations must embed UnimplementedPortServiceServer // for forward compatibility @@ -112,6 +123,8 @@ type PortServiceServer interface { EstablishTunnel(PortService_EstablishTunnelServer) error // AutoTunnel controls enablement of auto tunneling AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error) + // RetryAutoExpose retries auto exposing the give port + RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error) mustEmbedUnimplementedPortServiceServer() } @@ -131,6 +144,9 @@ func (UnimplementedPortServiceServer) EstablishTunnel(PortService_EstablishTunne func (UnimplementedPortServiceServer) AutoTunnel(context.Context, *AutoTunnelRequest) (*AutoTunnelResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AutoTunnel not implemented") } +func (UnimplementedPortServiceServer) RetryAutoExpose(context.Context, *RetryAutoExposeRequest) (*RetryAutoExposeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RetryAutoExpose not implemented") +} func (UnimplementedPortServiceServer) mustEmbedUnimplementedPortServiceServer() {} // UnsafePortServiceServer may be embedded to opt out of forward compatibility for this service. @@ -224,6 +240,24 @@ func _PortService_AutoTunnel_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _PortService_RetryAutoExpose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RetryAutoExposeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PortServiceServer).RetryAutoExpose(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/supervisor.PortService/RetryAutoExpose", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PortServiceServer).RetryAutoExpose(ctx, req.(*RetryAutoExposeRequest)) + } + return interceptor(ctx, in, info, handler) +} + // PortService_ServiceDesc is the grpc.ServiceDesc for PortService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -243,6 +277,10 @@ var PortService_ServiceDesc = grpc.ServiceDesc{ MethodName: "AutoTunnel", Handler: _PortService_AutoTunnel_Handler, }, + { + MethodName: "RetryAutoExpose", + Handler: _PortService_RetryAutoExpose_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/components/supervisor-api/go/status.pb.go b/components/supervisor-api/go/status.pb.go index 6c8b1a0204ba94..81ba60921196e0 100644 --- a/components/supervisor-api/go/status.pb.go +++ b/components/supervisor-api/go/status.pb.go @@ -175,6 +175,55 @@ func (OnPortExposedAction) EnumDescriptor() ([]byte, []int) { return file_status_proto_rawDescGZIP(), []int{2} } +type PortAutoExposure int32 + +const ( + PortAutoExposure_trying PortAutoExposure = 0 + PortAutoExposure_succeeded PortAutoExposure = 1 + PortAutoExposure_failed PortAutoExposure = 2 +) + +// Enum value maps for PortAutoExposure. +var ( + PortAutoExposure_name = map[int32]string{ + 0: "trying", + 1: "succeeded", + 2: "failed", + } + PortAutoExposure_value = map[string]int32{ + "trying": 0, + "succeeded": 1, + "failed": 2, + } +) + +func (x PortAutoExposure) Enum() *PortAutoExposure { + p := new(PortAutoExposure) + *p = x + return p +} + +func (x PortAutoExposure) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PortAutoExposure) Descriptor() protoreflect.EnumDescriptor { + return file_status_proto_enumTypes[3].Descriptor() +} + +func (PortAutoExposure) Type() protoreflect.EnumType { + return &file_status_proto_enumTypes[3] +} + +func (x PortAutoExposure) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PortAutoExposure.Descriptor instead. +func (PortAutoExposure) EnumDescriptor() ([]byte, []int) { + return file_status_proto_rawDescGZIP(), []int{3} +} + type TaskState int32 const ( @@ -208,11 +257,11 @@ func (x TaskState) String() string { } func (TaskState) Descriptor() protoreflect.EnumDescriptor { - return file_status_proto_enumTypes[3].Descriptor() + return file_status_proto_enumTypes[4].Descriptor() } func (TaskState) Type() protoreflect.EnumType { - return &file_status_proto_enumTypes[3] + return &file_status_proto_enumTypes[4] } func (x TaskState) Number() protoreflect.EnumNumber { @@ -221,7 +270,7 @@ func (x TaskState) Number() protoreflect.EnumNumber { // Deprecated: Use TaskState.Descriptor instead. func (TaskState) EnumDescriptor() ([]byte, []int) { - return file_status_proto_rawDescGZIP(), []int{3} + return file_status_proto_rawDescGZIP(), []int{4} } type SupervisorStatusRequest struct { @@ -842,6 +891,8 @@ type PortsStatus struct { // Exposed provides information when a port is exposed. If this field isn't set, // the port is not available from outside the workspace (i.e. the internet). Exposed *ExposedPortInfo `protobuf:"bytes,5,opt,name=exposed,proto3" json:"exposed,omitempty"` + // AutoExposure indicates the state of auto exposure + AutoExposure PortAutoExposure `protobuf:"varint,7,opt,name=auto_exposure,json=autoExposure,proto3,enum=supervisor.PortAutoExposure" json:"auto_exposure,omitempty"` // Tunneled provides information when a port is tunneled. If not present then // the port is not tunneled. Tunneled *TunneledPortInfo `protobuf:"bytes,6,opt,name=tunneled,proto3" json:"tunneled,omitempty"` @@ -907,6 +958,13 @@ func (x *PortsStatus) GetExposed() *ExposedPortInfo { return nil } +func (x *PortsStatus) GetAutoExposure() PortAutoExposure { + if x != nil { + return x.AutoExposure + } + return PortAutoExposure_trying +} + func (x *PortsStatus) GetTunneled() *TunneledPortInfo { if x != nil { return x.Tunneled @@ -1208,7 +1266,7 @@ var file_status_proto_rawDesc = []byte{ 0x6e, 0x74, 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, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x99, 0x02, 0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x70, 0x6f, @@ -1218,107 +1276,115 @@ var file_status_proto_rawDesc = []byte{ 0x65, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6f, - 0x73, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x65, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, - 0x6f, 0x72, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x65, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x65, 0x64, 0x22, 0x2e, 0x0a, - 0x12, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x22, 0x43, 0x0a, - 0x13, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, - 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x74, 0x61, 0x73, - 0x6b, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x15, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x40, 0x0a, 0x0c, 0x70, 0x72, - 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x10, - 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x12, 0x1b, 0x0a, - 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x2a, 0x43, 0x0a, 0x0d, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x66, - 0x72, 0x6f, 0x6d, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x66, - 0x72, 0x6f, 0x6d, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, - 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x10, 0x02, 0x2a, - 0x29, 0x0a, 0x0e, 0x50, 0x6f, 0x72, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x00, 0x12, 0x0a, - 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x10, 0x01, 0x2a, 0x65, 0x0a, 0x13, 0x4f, 0x6e, - 0x50, 0x6f, 0x72, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x10, 0x00, 0x12, 0x10, 0x0a, - 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, - 0x10, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x10, - 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x10, 0x03, 0x12, 0x12, 0x0a, - 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, - 0x04, 0x2a, 0x31, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, - 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x72, - 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x6f, 0x73, - 0x65, 0x64, 0x10, 0x02, 0x32, 0xcb, 0x06, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x10, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, - 0x69, 0x73, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x75, 0x70, - 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, - 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x70, - 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, - 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, - 0x69, 0x73, 0x6f, 0x72, 0x12, 0x83, 0x01, 0x0a, 0x09, 0x49, 0x44, 0x45, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, - 0x49, 0x44, 0x45, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x49, 0x44, - 0x45, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x2f, 0x69, 0x64, 0x65, 0x5a, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x69, 0x64, 0x65, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x2f, 0x7b, - 0x77, 0x61, 0x69, 0x74, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0d, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x73, + 0x73, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x70, 0x6f, + 0x73, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x74, 0x6f, + 0x45, 0x78, 0x70, 0x6f, 0x73, 0x75, 0x72, 0x65, 0x52, 0x0c, 0x61, 0x75, 0x74, 0x6f, 0x45, 0x78, + 0x70, 0x6f, 0x73, 0x75, 0x72, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, + 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x65, 0x64, 0x50, 0x6f, + 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x65, 0x64, + 0x22, 0x2e, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x22, 0x43, 0x0a, 0x13, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, + 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, + 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x40, 0x0a, + 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x5c, 0x0a, 0x10, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x2a, 0x43, 0x0a, + 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, + 0x0a, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0f, + 0x0a, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x10, 0x01, 0x12, + 0x11, 0x0a, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x10, 0x02, 0x2a, 0x29, 0x0a, 0x0e, 0x50, 0x6f, 0x72, 0x74, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x10, 0x01, 0x2a, 0x65, 0x0a, + 0x13, 0x4f, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x10, 0x00, + 0x12, 0x10, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, + 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x65, 0x77, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x10, 0x03, + 0x12, 0x12, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x10, 0x04, 0x2a, 0x39, 0x0a, 0x10, 0x50, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x74, 0x6f, + 0x45, 0x78, 0x70, 0x6f, 0x73, 0x75, 0x72, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x72, 0x79, 0x69, + 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x73, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, + 0x64, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x2a, + 0x31, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x72, 0x75, 0x6e, + 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, + 0x10, 0x02, 0x32, 0xcb, 0x06, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x10, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, + 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x53, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, + 0x6f, 0x72, 0x12, 0x83, 0x01, 0x0a, 0x09, 0x49, 0x44, 0x45, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1c, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x49, 0x44, + 0x45, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x49, 0x44, 0x45, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2f, 0x69, 0x64, 0x65, 0x5a, 0x21, 0x12, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2f, 0x69, 0x64, 0x65, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x2f, 0x7b, 0x77, 0x61, + 0x69, 0x74, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5a, 0x25, 0x12, - 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x2f, 0x7b, 0x77, 0x61, 0x69, 0x74, 0x3d, 0x74, - 0x72, 0x75, 0x65, 0x7d, 0x12, 0x6c, 0x0a, 0x0c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, - 0x72, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, - 0x6f, 0x72, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, - 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x12, 0x95, 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, - 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, - 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x10, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5a, 0x29, 0x12, - 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x7b, 0x6f, 0x62, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x30, 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0b, 0x54, - 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, - 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, - 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x3d, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, - 0x74, 0x61, 0x73, 0x6b, 0x73, 0x5a, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x2f, 0x7b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, - 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5a, 0x25, 0x12, 0x23, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x2f, 0x7b, 0x77, 0x61, 0x69, 0x74, 0x3d, 0x74, 0x72, 0x75, + 0x65, 0x7d, 0x12, 0x6c, 0x0a, 0x0c, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, + 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, + 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, + 0x12, 0x95, 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x50, 0x6f, + 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x50, 0x6f, + 0x72, 0x74, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5a, 0x29, 0x12, 0x27, 0x2f, + 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2f, + 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, 0x7b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x30, 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x73, + 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, + 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x3d, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x74, 0x61, + 0x73, 0x6b, 0x73, 0x5a, 0x29, 0x12, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x2f, + 0x7b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x30, 0x01, + 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1333,62 +1399,64 @@ func file_status_proto_rawDescGZIP() []byte { return file_status_proto_rawDescData } -var file_status_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_status_proto_enumTypes = make([]protoimpl.EnumInfo, 5) var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_status_proto_goTypes = []interface{}{ (ContentSource)(0), // 0: supervisor.ContentSource (PortVisibility)(0), // 1: supervisor.PortVisibility (OnPortExposedAction)(0), // 2: supervisor.OnPortExposedAction - (TaskState)(0), // 3: supervisor.TaskState - (*SupervisorStatusRequest)(nil), // 4: supervisor.SupervisorStatusRequest - (*SupervisorStatusResponse)(nil), // 5: supervisor.SupervisorStatusResponse - (*IDEStatusRequest)(nil), // 6: supervisor.IDEStatusRequest - (*IDEStatusResponse)(nil), // 7: supervisor.IDEStatusResponse - (*ContentStatusRequest)(nil), // 8: supervisor.ContentStatusRequest - (*ContentStatusResponse)(nil), // 9: supervisor.ContentStatusResponse - (*BackupStatusRequest)(nil), // 10: supervisor.BackupStatusRequest - (*BackupStatusResponse)(nil), // 11: supervisor.BackupStatusResponse - (*PortsStatusRequest)(nil), // 12: supervisor.PortsStatusRequest - (*PortsStatusResponse)(nil), // 13: supervisor.PortsStatusResponse - (*ExposedPortInfo)(nil), // 14: supervisor.ExposedPortInfo - (*TunneledPortInfo)(nil), // 15: supervisor.TunneledPortInfo - (*PortsStatus)(nil), // 16: supervisor.PortsStatus - (*TasksStatusRequest)(nil), // 17: supervisor.TasksStatusRequest - (*TasksStatusResponse)(nil), // 18: supervisor.TasksStatusResponse - (*TaskStatus)(nil), // 19: supervisor.TaskStatus - (*TaskPresentation)(nil), // 20: supervisor.TaskPresentation - nil, // 21: supervisor.TunneledPortInfo.ClientsEntry - (TunnelVisiblity)(0), // 22: supervisor.TunnelVisiblity + (PortAutoExposure)(0), // 3: supervisor.PortAutoExposure + (TaskState)(0), // 4: supervisor.TaskState + (*SupervisorStatusRequest)(nil), // 5: supervisor.SupervisorStatusRequest + (*SupervisorStatusResponse)(nil), // 6: supervisor.SupervisorStatusResponse + (*IDEStatusRequest)(nil), // 7: supervisor.IDEStatusRequest + (*IDEStatusResponse)(nil), // 8: supervisor.IDEStatusResponse + (*ContentStatusRequest)(nil), // 9: supervisor.ContentStatusRequest + (*ContentStatusResponse)(nil), // 10: supervisor.ContentStatusResponse + (*BackupStatusRequest)(nil), // 11: supervisor.BackupStatusRequest + (*BackupStatusResponse)(nil), // 12: supervisor.BackupStatusResponse + (*PortsStatusRequest)(nil), // 13: supervisor.PortsStatusRequest + (*PortsStatusResponse)(nil), // 14: supervisor.PortsStatusResponse + (*ExposedPortInfo)(nil), // 15: supervisor.ExposedPortInfo + (*TunneledPortInfo)(nil), // 16: supervisor.TunneledPortInfo + (*PortsStatus)(nil), // 17: supervisor.PortsStatus + (*TasksStatusRequest)(nil), // 18: supervisor.TasksStatusRequest + (*TasksStatusResponse)(nil), // 19: supervisor.TasksStatusResponse + (*TaskStatus)(nil), // 20: supervisor.TaskStatus + (*TaskPresentation)(nil), // 21: supervisor.TaskPresentation + nil, // 22: supervisor.TunneledPortInfo.ClientsEntry + (TunnelVisiblity)(0), // 23: supervisor.TunnelVisiblity } var file_status_proto_depIdxs = []int32{ 0, // 0: supervisor.ContentStatusResponse.source:type_name -> supervisor.ContentSource - 16, // 1: supervisor.PortsStatusResponse.ports:type_name -> supervisor.PortsStatus + 17, // 1: supervisor.PortsStatusResponse.ports:type_name -> supervisor.PortsStatus 1, // 2: supervisor.ExposedPortInfo.visibility:type_name -> supervisor.PortVisibility 2, // 3: supervisor.ExposedPortInfo.on_exposed:type_name -> supervisor.OnPortExposedAction - 22, // 4: supervisor.TunneledPortInfo.visibility:type_name -> supervisor.TunnelVisiblity - 21, // 5: supervisor.TunneledPortInfo.clients:type_name -> supervisor.TunneledPortInfo.ClientsEntry - 14, // 6: supervisor.PortsStatus.exposed:type_name -> supervisor.ExposedPortInfo - 15, // 7: supervisor.PortsStatus.tunneled:type_name -> supervisor.TunneledPortInfo - 19, // 8: supervisor.TasksStatusResponse.tasks:type_name -> supervisor.TaskStatus - 3, // 9: supervisor.TaskStatus.state:type_name -> supervisor.TaskState - 20, // 10: supervisor.TaskStatus.presentation:type_name -> supervisor.TaskPresentation - 4, // 11: supervisor.StatusService.SupervisorStatus:input_type -> supervisor.SupervisorStatusRequest - 6, // 12: supervisor.StatusService.IDEStatus:input_type -> supervisor.IDEStatusRequest - 8, // 13: supervisor.StatusService.ContentStatus:input_type -> supervisor.ContentStatusRequest - 10, // 14: supervisor.StatusService.BackupStatus:input_type -> supervisor.BackupStatusRequest - 12, // 15: supervisor.StatusService.PortsStatus:input_type -> supervisor.PortsStatusRequest - 17, // 16: supervisor.StatusService.TasksStatus:input_type -> supervisor.TasksStatusRequest - 5, // 17: supervisor.StatusService.SupervisorStatus:output_type -> supervisor.SupervisorStatusResponse - 7, // 18: supervisor.StatusService.IDEStatus:output_type -> supervisor.IDEStatusResponse - 9, // 19: supervisor.StatusService.ContentStatus:output_type -> supervisor.ContentStatusResponse - 11, // 20: supervisor.StatusService.BackupStatus:output_type -> supervisor.BackupStatusResponse - 13, // 21: supervisor.StatusService.PortsStatus:output_type -> supervisor.PortsStatusResponse - 18, // 22: supervisor.StatusService.TasksStatus:output_type -> supervisor.TasksStatusResponse - 17, // [17:23] is the sub-list for method output_type - 11, // [11:17] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 23, // 4: supervisor.TunneledPortInfo.visibility:type_name -> supervisor.TunnelVisiblity + 22, // 5: supervisor.TunneledPortInfo.clients:type_name -> supervisor.TunneledPortInfo.ClientsEntry + 15, // 6: supervisor.PortsStatus.exposed:type_name -> supervisor.ExposedPortInfo + 3, // 7: supervisor.PortsStatus.auto_exposure:type_name -> supervisor.PortAutoExposure + 16, // 8: supervisor.PortsStatus.tunneled:type_name -> supervisor.TunneledPortInfo + 20, // 9: supervisor.TasksStatusResponse.tasks:type_name -> supervisor.TaskStatus + 4, // 10: supervisor.TaskStatus.state:type_name -> supervisor.TaskState + 21, // 11: supervisor.TaskStatus.presentation:type_name -> supervisor.TaskPresentation + 5, // 12: supervisor.StatusService.SupervisorStatus:input_type -> supervisor.SupervisorStatusRequest + 7, // 13: supervisor.StatusService.IDEStatus:input_type -> supervisor.IDEStatusRequest + 9, // 14: supervisor.StatusService.ContentStatus:input_type -> supervisor.ContentStatusRequest + 11, // 15: supervisor.StatusService.BackupStatus:input_type -> supervisor.BackupStatusRequest + 13, // 16: supervisor.StatusService.PortsStatus:input_type -> supervisor.PortsStatusRequest + 18, // 17: supervisor.StatusService.TasksStatus:input_type -> supervisor.TasksStatusRequest + 6, // 18: supervisor.StatusService.SupervisorStatus:output_type -> supervisor.SupervisorStatusResponse + 8, // 19: supervisor.StatusService.IDEStatus:output_type -> supervisor.IDEStatusResponse + 10, // 20: supervisor.StatusService.ContentStatus:output_type -> supervisor.ContentStatusResponse + 12, // 21: supervisor.StatusService.BackupStatus:output_type -> supervisor.BackupStatusResponse + 14, // 22: supervisor.StatusService.PortsStatus:output_type -> supervisor.PortsStatusResponse + 19, // 23: supervisor.StatusService.TasksStatus:output_type -> supervisor.TasksStatusResponse + 18, // [18:24] is the sub-list for method output_type + 12, // [12:18] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_status_proto_init() } @@ -1608,7 +1676,7 @@ func file_status_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_status_proto_rawDesc, - NumEnums: 4, + NumEnums: 5, NumMessages: 18, NumExtensions: 0, NumServices: 1, diff --git a/components/supervisor-api/go/terminal.pb.go b/components/supervisor-api/go/terminal.pb.go index b697324fe93b73..7a45ff1af26a57 100644 --- a/components/supervisor-api/go/terminal.pb.go +++ b/components/supervisor-api/go/terminal.pb.go @@ -28,7 +28,7 @@ const ( type TerminalTitleSource int32 const ( - // From the process name property + // From the foreground process TerminalTitleSource_process TerminalTitleSource = 0 // From SetTitle API TerminalTitleSource_api TerminalTitleSource = 1 diff --git a/components/supervisor-api/port.proto b/components/supervisor-api/port.proto index e1b601d6ac73e4..f02cddd7221b6c 100644 --- a/components/supervisor-api/port.proto +++ b/components/supervisor-api/port.proto @@ -37,6 +37,13 @@ service PortService { post : "/v1/port/tunnel/auto/{enabled}" }; } + + // RetryAutoExpose retries auto exposing the give port + rpc RetryAutoExpose(RetryAutoExposeRequest) returns (RetryAutoExposeResponse) { + option (google.api.http) = { + post : "/v1/port/ports/exposed/retry/{port}" + }; + } } enum TunnelVisiblity { none = 0; @@ -65,3 +72,8 @@ message EstablishTunnelResponse { bytes data = 1; } message AutoTunnelRequest { bool enabled = 1; } message AutoTunnelResponse {} + +message RetryAutoExposeRequest { + uint32 port = 1; +} +message RetryAutoExposeResponse {} diff --git a/components/supervisor-api/status.proto b/components/supervisor-api/status.proto index 9f9924b2921fcd..344c7ff37267e6 100644 --- a/components/supervisor-api/status.proto +++ b/components/supervisor-api/status.proto @@ -149,6 +149,11 @@ message TunneledPortInfo { // map of remote clients indicates on which remote port each client is listening to map clients = 3; } +enum PortAutoExposure { + trying = 0; + succeeded = 1; + failed = 2; +} message PortsStatus { // local_port is the port a service actually bound to. Some services bind // to localhost:, in which case they cannot be made accessible from @@ -166,6 +171,9 @@ message PortsStatus { // the port is not available from outside the workspace (i.e. the internet). ExposedPortInfo exposed = 5; + // AutoExposure indicates the state of auto exposure + PortAutoExposure auto_exposure = 7; + // Tunneled provides information when a port is tunneled. If not present then // the port is not tunneled. TunneledPortInfo tunneled = 6; diff --git a/components/supervisor/pkg/ports/ports.go b/components/supervisor/pkg/ports/ports.go index bdb7ac79112eff..8c719edc541139 100644 --- a/components/supervisor/pkg/ports/ports.go +++ b/components/supervisor/pkg/ports/ports.go @@ -45,9 +45,11 @@ func NewManager(exposed ExposedPortsInterface, served ServedPortsObserver, confi C: config, T: tunneled, + forceUpdates: make(chan struct{}, 1), + internal: internal, proxies: make(map[uint32]*localhostProxy), - autoExposed: make(map[uint32]uint32), + autoExposed: make(map[uint32]*autoExposure), autoTunneled: make(map[uint32]struct{}), state: state, @@ -63,6 +65,13 @@ type localhostProxy struct { proxyPort uint32 } +type autoExposure struct { + state api.PortAutoExposure + ctx context.Context + globalPort uint32 + public bool +} + // Manager brings together served and exposed ports. It keeps track of which port is exposed, which one is served, // auto-exposes ports and proxies ports served on localhost only. type Manager struct { @@ -71,10 +80,12 @@ type Manager struct { C ConfigInterace T TunneledPortsInterface + forceUpdates chan struct{} + internal map[uint32]struct{} proxies map[uint32]*localhostProxy proxyStarter func(LocalhostPort uint32, GlobalPort uint32) (proxy io.Closer, err error) - autoExposed map[uint32]uint32 + autoExposed map[uint32]*autoExposure autoTunneled map[uint32]struct{} autoTunnelEnabled bool @@ -92,11 +103,12 @@ type Manager struct { } type managedPort struct { - Served bool - Exposed bool - Visibility api.PortVisibility - URL string - OnExposed api.OnPortExposedAction + Served bool + Exposed bool + Visibility api.PortVisibility + URL string + OnExposed api.OnPortExposedAction + AutoExposure api.PortAutoExposure LocalhostPort uint32 GlobalPort uint32 @@ -148,12 +160,15 @@ func (pm *Manager) Run(ctx context.Context, wg *sync.WaitGroup) { tunneledUpdates, tunneledErrors := pm.T.Observe(ctx) for { var ( - exposed []ExposedPort - served []ServedPort - configured *Configs - tunneled []PortTunnelState + exposed []ExposedPort + served []ServedPort + configured *Configs + tunneled []PortTunnelState + forceUpdate bool ) select { + case <-pm.forceUpdates: + forceUpdate = true case exposed = <-exposedUpdates: if exposed == nil { log.Error("exposed ports observer stopped") @@ -201,7 +216,7 @@ func (pm *Manager) Run(ctx context.Context, wg *sync.WaitGroup) { log.WithError(err).Warn("error while observing tunneled ports") } - if exposed == nil && served == nil && configured == nil && tunneled == nil { + if exposed == nil && served == nil && configured == nil && tunneled == nil && !forceUpdate { // we received just an error, but no update continue } @@ -332,12 +347,15 @@ func (pm *Manager) nextState(ctx context.Context) map[uint32]*managedPort { } mp.LocalhostPort = port + autoExpose, autoExposed := pm.autoExposed[port] + if autoExposed { + mp.AutoExposure = autoExpose.state + } if mp.Exposed { return } mp.OnExposed = getOnExposedAction(config, port) - _, autoExposed := pm.autoExposed[port] if autoExposed { return } @@ -347,7 +365,7 @@ func (pm *Manager) nextState(ctx context.Context) map[uint32]*managedPort { mp.Visibility = api.PortVisibility_public } public := mp.Visibility == api.PortVisibility_public - pm.autoExpose(ctx, mp, public) + mp.AutoExposure = pm.autoExpose(ctx, mp.LocalhostPort, mp.GlobalPort, public).state }) } @@ -369,8 +387,12 @@ func (pm *Manager) nextState(ctx context.Context) map[uint32]*managedPort { mp.LocalhostPort = port mp.Served = true - exposedGlobalPort, autoExposed := pm.autoExposed[port] - if !autoExposed && mp.Exposed { + var exposedGlobalPort uint32 + autoExposure, autoExposed := pm.autoExposed[port] + if autoExposed { + exposedGlobalPort = autoExposure.globalPort + mp.AutoExposure = autoExposure.state + } else if mp.Exposed { exposedGlobalPort = mp.GlobalPort } @@ -399,26 +421,53 @@ func (pm *Manager) nextState(ctx context.Context) map[uint32]*managedPort { public = exists && config.Visibility == "public" } - pm.autoExpose(ctx, mp, public) + mp.AutoExposure = pm.autoExpose(ctx, mp.LocalhostPort, mp.GlobalPort, public).state } return state } // clients should guard a call with check whether such port is already exposed or auto exposed -func (pm *Manager) autoExpose(ctx context.Context, mp *managedPort, public bool) { - exposing := pm.E.Expose(ctx, mp.LocalhostPort, mp.GlobalPort, public) +func (pm *Manager) autoExpose(ctx context.Context, localPort uint32, globalPort uint32, public bool) *autoExposure { + exposing := pm.E.Expose(ctx, localPort, globalPort, public) + autoExpose := &autoExposure{ + state: api.PortAutoExposure_trying, + ctx: ctx, + globalPort: globalPort, + public: public, + } go func() { err := <-exposing if err != nil { if err != context.Canceled { - log.WithError(err).WithField("port", *mp).Warn("cannot auto-expose port") + autoExpose.state = api.PortAutoExposure_failed + log.WithError(err).WithField("localPort", localPort).WithField("globalPort", globalPort).Warn("cannot auto-expose port") } return } - log.WithField("port", *mp).Info("auto-exposed port") + autoExpose.state = api.PortAutoExposure_succeeded + log.WithField("localPort", localPort).WithField("globalPort", globalPort).Info("auto-exposed port") }() - pm.autoExposed[mp.LocalhostPort] = mp.GlobalPort - log.WithField("port", *mp).Info("auto-exposing port") + pm.autoExposed[localPort] = autoExpose + log.WithField("localPort", localPort).WithField("globalPort", globalPort).Info("auto-exposing port") + return autoExpose +} + +// RetryAutoExpose retries auto exposing the give port +func (pm *Manager) RetryAutoExpose(ctx context.Context, localPort uint32) { + pm.mu.Lock() + defer pm.mu.Unlock() + autoExpose, autoExposed := pm.autoExposed[localPort] + if !autoExposed || autoExpose.state != api.PortAutoExposure_failed || autoExpose.ctx.Err() != nil { + return + } + pm.autoExpose(autoExpose.ctx, localPort, autoExpose.globalPort, autoExpose.public) + pm.forceUpdate() +} + +func (pm *Manager) forceUpdate() { + if len(pm.forceUpdates) == 0 { + pm.forceUpdates <- struct{}{} + } } func (pm *Manager) autoTunnel(ctx context.Context) { @@ -710,6 +759,7 @@ func (pm *Manager) getPortStatus(port uint32) *api.PortsStatus { OnExposed: mp.OnExposed, } } + ps.AutoExposure = mp.AutoExposure if mp.Tunneled { ps.Tunneled = &api.TunneledPortInfo{ TargetPort: mp.TunneledTargetPort, diff --git a/components/supervisor/pkg/supervisor/services.go b/components/supervisor/pkg/supervisor/services.go index 1eb34599e4aefc..baf5d3784e55ac 100644 --- a/components/supervisor/pkg/supervisor/services.go +++ b/components/supervisor/pkg/supervisor/services.go @@ -800,3 +800,9 @@ func (s *portService) AutoTunnel(ctx context.Context, req *api.AutoTunnelRequest s.portsManager.AutoTunnel(ctx, req.Enabled) return &api.AutoTunnelResponse{}, nil } + +// RetryAutoExpose retries auto exposing the give port +func (s *portService) RetryAutoExpose(ctx context.Context, req *api.RetryAutoExposeRequest) (*api.RetryAutoExposeResponse, error) { + s.portsManager.RetryAutoExpose(ctx, req.Port) + return &api.RetryAutoExposeResponse{}, nil +}