Allow requesting a specific Egress Cluster Id (#1342)

This commit is contained in:
Benjamin Pracht
2023-01-30 17:04:26 -08:00
committed by GitHub
parent b023c531c2
commit c6e8887ab8
7 changed files with 67 additions and 57 deletions
+24 -24
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.21.5
// protoc v3.21.9
// source: pkg/service/rpc/egress.proto
package rpc
@@ -121,32 +121,32 @@ var file_pkg_service_rpc_egress_proto_rawDesc = []byte{
0x39, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x67, 0x72,
0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65,
0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
0x09, 0x65, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x73, 0x32, 0xb2, 0x01, 0x0a, 0x0e, 0x45,
0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x47, 0x0a,
0x09, 0x65, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x73, 0x32, 0xb8, 0x01, 0x0a, 0x0e, 0x45,
0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x4d, 0x0a,
0x0b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x2e, 0x6c,
0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x67, 0x72, 0x65,
0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65,
0x6b, 0x69, 0x74, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x06,
0xb2, 0x89, 0x01, 0x02, 0x20, 0x01, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63,
0x74, 0x69, 0x76, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xb2, 0x89, 0x01, 0x02, 0x08, 0x01, 0x32,
0xa1, 0x01, 0x0a, 0x0d, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65,
0x72, 0x12, 0x49, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73,
0x49, 0x6e, 0x66, 0x6f, 0x22, 0x06, 0xb2, 0x89, 0x01, 0x02, 0x18, 0x01, 0x12, 0x45, 0x0a, 0x0a,
0x53, 0x74, 0x6f, 0x70, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x2e, 0x6c, 0x69, 0x76,
0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74,
0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x06, 0xb2, 0x89, 0x01,
0x02, 0x18, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69,
0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x70,
0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6b, 0x69, 0x74, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x0c,
0xb2, 0x89, 0x01, 0x02, 0x20, 0x01, 0xb2, 0x89, 0x01, 0x02, 0x18, 0x01, 0x12, 0x57, 0x0a, 0x10,
0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73,
0x12, 0x1c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76,
0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45,
0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0xb2,
0x89, 0x01, 0x02, 0x08, 0x01, 0x32, 0xa1, 0x01, 0x0a, 0x0d, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73,
0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69,
0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e,
0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x06, 0xb2, 0x89, 0x01, 0x02,
0x18, 0x01, 0x12, 0x45, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73,
0x12, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45,
0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c,
0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66,
0x6f, 0x22, 0x06, 0xb2, 0x89, 0x01, 0x02, 0x18, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f,
0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
+1
View File
@@ -11,6 +11,7 @@ import "livekit_egress.proto";
service EgressInternal {
rpc StartEgress(livekit.StartEgressRequest) returns (livekit.EgressInfo) {
option (psrpc.options).affinity_func = true;
option (psrpc.options).topics = true;
};
rpc ListActiveEgress(ListActiveEgressRequest) returns (ListActiveEgressResponse) {
option (psrpc.options).multi = true;
+35 -30
View File
@@ -16,7 +16,7 @@ var _ = version.PsrpcVersion_0_2_4
// ===============================
type EgressInternalClient interface {
StartEgress(context.Context, *livekit3.StartEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
StartEgress(context.Context, string, *livekit3.StartEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
ListActiveEgress(context.Context, *ListActiveEgressRequest, ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error)
}
@@ -37,6 +37,9 @@ type EgressInternalServerImpl interface {
// ===============================
type EgressInternalServer interface {
RegisterStartEgressTopic(string) error
DeregisterStartEgressTopic(string)
// Close and wait for pending RPCs to complete
Shutdown()
@@ -64,8 +67,8 @@ func NewEgressInternalClient(clientID string, bus psrpc.MessageBus, opts ...psrp
}, nil
}
func (c *egressInternalClient) StartEgress(ctx context.Context, req *livekit3.StartEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StartEgress", "", req, opts...)
func (c *egressInternalClient) StartEgress(ctx context.Context, topic string, req *livekit3.StartEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StartEgress", topic, req, opts...)
}
func (c *egressInternalClient) ListActiveEgress(ctx context.Context, req *ListActiveEgressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error) {
@@ -87,12 +90,6 @@ func NewEgressInternalServer(serverID string, svc EgressInternalServerImpl, bus
s := psrpc.NewRPCServer("EgressInternal", serverID, bus, opts...)
var err error
err = psrpc.RegisterHandler(s, "StartEgress", "", svc.StartEgress, svc.StartEgressAffinity)
if err != nil {
s.Close(false)
return nil, err
}
err = psrpc.RegisterHandler(s, "ListActiveEgress", "", svc.ListActiveEgress, nil)
if err != nil {
s.Close(false)
@@ -105,6 +102,14 @@ func NewEgressInternalServer(serverID string, svc EgressInternalServerImpl, bus
}, nil
}
func (s *egressInternalServer) RegisterStartEgressTopic(topic string) error {
return psrpc.RegisterHandler(s.rpc, "StartEgress", topic, s.svc.StartEgress, s.svc.StartEgressAffinity)
}
func (s *egressInternalServer) DeregisterStartEgressTopic(topic string) {
s.rpc.DeregisterHandler("StartEgress", topic)
}
func (s *egressInternalServer) Shutdown() {
s.rpc.Close(false)
}
@@ -224,25 +229,25 @@ func (s *egressHandlerServer) Kill() {
}
var psrpcFileDescriptor0 = []byte{
// 305 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4a, 0x2b, 0x31,
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0x27, 0xfb, 0xd7, 0x65, 0xfc, 0x05, 0x8e, 0x77,
0xb5, 0x78, 0x5b, 0x3a, 0xab, 0xe4, 0x9e, 0x41, 0x44, 0x67, 0x0f, 0x0d, 0xb3, 0x84, 0xe2, 0xff,
0xac, 0xff, 0xc5, 0xa0, 0x19, 0xd0, 0x63, 0x9a, 0x67, 0x0b, 0x74, 0x7c, 0x08, 0x87, 0xcf, 0x36,
0x4b, 0x09, 0xc7, 0xe4, 0x30, 0x5d, 0xf2, 0x76, 0xe9, 0x55, 0x8d, 0x7f, 0xb7, 0x6e, 0x31, 0x3e,
0x00, 0x18, 0x93, 0xb1, 0xd1, 0x57, 0x54, 0xa6, 0x2f, 0xc2, 0xbf, 0xd4, 0xdc, 0x5f, 0xbf, 0x5e,
0xcd, 0x34, 0xbd, 0xaf, 0xa6, 0x52, 0x99, 0x65, 0x12, 0x37, 0x96, 0xeb, 0xce, 0x7f, 0x99, 0xd6,
0xb7, 0x6f, 0x7c, 0xf3, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x58, 0x8f, 0x8d, 0xdd, 0x49, 0x02, 0x00,
0x00,
// 312 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0x4a, 0xc3, 0x30,
0x14, 0x86, 0x89, 0x93, 0xb1, 0x1d, 0x9d, 0x48, 0x14, 0xac, 0x75, 0x83, 0xd1, 0x2b, 0x11, 0x69,
0x61, 0x5e, 0x79, 0xa9, 0x30, 0xb0, 0xe0, 0xd5, 0x86, 0x08, 0xde, 0x8c, 0x2e, 0x3d, 0xce, 0xb0,
0xad, 0x89, 0xc9, 0xd9, 0xde, 0x61, 0x8f, 0xe1, 0x2b, 0x0c, 0x1f, 0x50, 0x58, 0xb2, 0x52, 0x26,
0x13, 0xaf, 0x02, 0xff, 0x97, 0xfc, 0xf9, 0x0e, 0x09, 0xb4, 0xf5, 0x74, 0x92, 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x1f, 0x60, 0x48, 0x4a, 0x7b, 0xdf, 0xb0, 0x32, 0xff, 0x36,
0xfc, 0x4f, 0xcd, 0xe3, 0xed, 0xdb, 0xcd, 0x44, 0xd2, 0xc7, 0x62, 0x1c, 0x0b, 0x35, 0x4f, 0xfc,
0xc6, 0x72, 0xdd, 0xf9, 0x31, 0xe3, 0xfa, 0xe6, 0x95, 0xef, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff,
0xb8, 0xd5, 0x8e, 0x13, 0x4b, 0x02, 0x00, 0x00,
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.21.5
// protoc v3.21.9
// source: pkg/service/rpc/ingress.proto
package rpc
+1 -1
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.21.5
// protoc v3.21.9
// source: pkg/service/rpc/io.proto
package rpc