From bd6a9452888233cc8c65a2372340179ab41ead9d Mon Sep 17 00:00:00 2001 From: anjana_nandagopal Date: Mon, 19 Jul 2021 16:22:49 -0400 Subject: [PATCH 1/3] Update FunctionRpc.proto Added messages to handle worker indexing pipeline WorkerFunctionMetadata includes all information necessary to populate FunctionMetadata and convey the indexing status for each function (ie. success, failure, etc.). Each of these messages corresponds to a single function. WorkerFunctionMetadataRequest sends the function app directory to the worker. WorkerFunctionMetadataResponse includes a list of WorkerFunctionMetadata messages and an overall StatusResult attribute. --- src/proto/FunctionRpc.proto | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/proto/FunctionRpc.proto b/src/proto/FunctionRpc.proto index 92fc0c7..c3be85a 100644 --- a/src/proto/FunctionRpc.proto +++ b/src/proto/FunctionRpc.proto @@ -75,6 +75,11 @@ message StreamingMessage { // Ask the worker to close any open shared memory resources for a given invocation CloseSharedMemoryResourcesRequest close_shared_memory_resources_request = 27; CloseSharedMemoryResourcesResponse close_shared_memory_resources_response = 28; + + // Worker indexing message types + WorkerFunctionMetadataRequest worker_function_metadata_request = 29; + WorkerFunctionMetadataResponse worker_function_metadata_response = 30; + WorkerFunctionMetadata worker_function_metadata = 31; } } @@ -262,6 +267,51 @@ message RpcFunctionMetadata { bool is_proxy = 7; } +// Host tells worker it is ready to receive metadata +message WorkerFunctionMetadataRequest { + // base directory for function app + string directory = 1; +} + +// Worker sends function metadata back to host +message WorkerFunctionMetadataResponse { + // list of function indexing responses + repeated WorkerFunctionMetadata results = 1; + + // status of overall metadata request + StatusResult overall_status = 2; +} + +// Message type that holds function metadata information +message WorkerFunctionMetadata { + // function name + string name = 4; + + // base directory for the Function + string directory = 1; + + // Script file specified + string script_file = 2; + + // Entry point specified + string entry_point = 3; + + // Function id + string id = 11; + + // Bindings info + repeated string bindings = 6; + + // Is set to true for proxy + bool is_proxy = 7; + + // Function indexing status + StatusResult status = 8; + + // Function language + string language = 9; +} + // Host requests worker to invoke a Function message InvocationRequest { // Unique id for each invocation From 0b63de4406e5686c01ac4a84428069586c41d5ce Mon Sep 17 00:00:00 2001 From: anjana_nandagopal Date: Wed, 28 Jul 2021 22:24:36 -0400 Subject: [PATCH 2/3] Update FunctionRpc.proto Removed WorkerFunctionMetadata message type and added some necessary fields to RpcFunctionMetadata Renamed request and response messages to be more bi-directional friendly --- src/proto/FunctionRpc.proto | 50 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/src/proto/FunctionRpc.proto b/src/proto/FunctionRpc.proto index c3be85a..c9bacc3 100644 --- a/src/proto/FunctionRpc.proto +++ b/src/proto/FunctionRpc.proto @@ -77,9 +77,8 @@ message StreamingMessage { CloseSharedMemoryResourcesResponse close_shared_memory_resources_response = 28; // Worker indexing message types - WorkerFunctionMetadataRequest worker_function_metadata_request = 29; - WorkerFunctionMetadataResponse worker_function_metadata_response = 30; - WorkerFunctionMetadata worker_function_metadata = 31; + FunctionsMetadataRequest functions_metadata_request = 29; + FunctionMetadataResponses function_metadata_responses = 30; } } @@ -265,53 +264,32 @@ message RpcFunctionMetadata { // Is set to true for proxy bool is_proxy = 7; + + // Function indexing status + StatusResult status = 8; + + // Function language + string language = 9; + + // Raw binding info + repeated string raw_bindings = 10; } // Host tells worker it is ready to receive metadata -message WorkerFunctionMetadataRequest { +message FunctionsMetadataRequest { // base directory for function app string directory = 1; } // Worker sends function metadata back to host -message WorkerFunctionMetadataResponse { +message FunctionMetadataResponses { // list of function indexing responses - repeated WorkerFunctionMetadata results = 1; + repeated FunctionLoadRequest results = 1; // status of overall metadata request StatusResult overall_status = 2; } -// Message type that holds function metadata information -message WorkerFunctionMetadata { - // function name - string name = 4; - - // base directory for the Function - string directory = 1; - - // Script file specified - string script_file = 2; - - // Entry point specified - string entry_point = 3; - - // Function id - string id = 11; - - // Bindings info - repeated string bindings = 6; - - // Is set to true for proxy - bool is_proxy = 7; - - // Function indexing status - StatusResult status = 8; - - // Function language - string language = 9; -} - // Host requests worker to invoke a Function message InvocationRequest { // Unique id for each invocation From ce4b2ddb532490bd379a7b99bdc2fa9d6f3920c6 Mon Sep 17 00:00:00 2001 From: anjana_nandagopal Date: Fri, 30 Jul 2021 19:30:19 -0400 Subject: [PATCH 3/3] Update FunctionRpc.proto Rename directory variable for consistency and clarity --- src/proto/FunctionRpc.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto/FunctionRpc.proto b/src/proto/FunctionRpc.proto index c9bacc3..14e5899 100644 --- a/src/proto/FunctionRpc.proto +++ b/src/proto/FunctionRpc.proto @@ -278,7 +278,7 @@ message RpcFunctionMetadata { // Host tells worker it is ready to receive metadata message FunctionsMetadataRequest { // base directory for function app - string directory = 1; + string function_app_directory = 1; } // Worker sends function metadata back to host