Skip to content

Implement worker messages #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions azure-functions-language-worker-protobuf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ From within the Azure Functions language worker repo:

From within the Azure Functions language worker repo:
1. Define remote branch for cleaner git commands
- `git remote add proto-file https://github.com/mhoeger/azure-functions-language-worker-protobuf.git`
- `git remote add proto-file https://github.com/azure/azure-functions-language-worker-protobuf.git`
- `git fetch proto-file`
2. Merge updates
- `git merge -s subtree proto-file/<version branch> --squash --allow-unrelated-histories`
Expand All @@ -38,7 +38,7 @@ From within the Azure Functions language worker repo:

## CSharp
```
set NUGET_PATH=%UserProfile%\.nuget\packages
set NUGET_PATH="%UserProfile%\.nuget\packages"
set GRPC_TOOLS_PATH=%NUGET_PATH%\grpc.tools\<versionNumber>\tools\windows_x86
set PROTO_PATH=.\azure-functions-language-worker-protobuf\src\proto
set PROTO=.\azure-functions-language-worker-protobuf\src\proto\FunctionRpc.proto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ option java_multiple_files = true;
option java_package = "com.microsoft.azure.functions.rpc.messages";
option java_outer_classname = "FunctionProto";
option csharp_namespace = "Microsoft.Azure.WebJobs.Script.Grpc.Messages";
option go_package ="github.com/Azure/azure-functions-go-worker/internal/rpc";

package AzureFunctionsRpcMessages;

import "google/protobuf/duration.proto";
import "identity/ClaimsIdentityRpc.proto";

// Interface exported by the server.
service FunctionRpc {
Expand Down Expand Up @@ -64,6 +66,10 @@ message StreamingMessage {

// Worker logs a message back to the host
RpcLog rpc_log = 2;

FunctionEnvironmentReloadRequest function_environment_reload_request = 25;

FunctionEnvironmentReloadResponse function_environment_reload_response = 26;
}
}

Expand Down Expand Up @@ -179,13 +185,26 @@ message WorkerStatusRequest{
message WorkerStatusResponse {
}

message FunctionEnvironmentReloadRequest {
// Environment variables from the current process
map<string, string> environment_variables = 1;
}

message FunctionEnvironmentReloadResponse {
// Status of the response
StatusResult result = 3;
}

// Host tells the worker to load a Function
message FunctionLoadRequest {
// unique function identifier (avoid name collisions, facilitate reload case)
string function_id = 1;

// Metadata for the request
RpcFunctionMetadata metadata = 2;

// A flag indicating if managed dependency is enabled or not
bool managed_dependency_enabled = 3;
}

// Worker tells host result of reload
Expand All @@ -196,6 +215,9 @@ message FunctionLoadResponse {
// Result of load operation
StatusResult result = 2;
// TODO: return type expected?

// Result of load operation
bool is_dependency_downloaded = 3;
}

// Information on how a Function should be loaded and its bindings
Expand Down Expand Up @@ -286,11 +308,21 @@ message BindingInfo {
inout = 2;
}

// Indicates the type of the data for the binding
enum DataType {
undefined = 0;
string = 1;
binary = 2;
stream = 3;
}

// Type of binding (e.g. HttpTrigger)
string type = 2;

// Direction of the given binding
Direction direction = 3;

DataType data_type = 4;
}

// Used to send logs back to the Host
Expand Down Expand Up @@ -354,4 +386,5 @@ message RpcHttp {
map<string,string> query = 15;
bool enable_content_negotiation= 16;
TypedData rawBody = 17;
}
repeated RpcClaimsIdentity identities = 18;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3

import "shared/NullableString.proto";

// Light-weight representation of a .NET System.Security.Claims.ClaimsIdentity object.
// This is the same serialization as found in EasyAuth, and needs to be kept in sync with
// its ClaimsIdentitySlim definition, as seen in the WebJobs extension:
// https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.Http/ClaimsIdentitySlim.cs
message RpcClaimsIdentity {
NullableString authentication_type = 1;
NullableString name_claim_type = 2;
NullableString role_claim_type = 3;
repeated RpcClaim claims = 4;
}

// Light-weight representation of a .NET System.Security.Claims.Claim object.
// This is the same serialization as found in EasyAuth, and needs to be kept in sync with
// its ClaimSlim definition, as seen in the WebJobs extension:
// https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.Http/ClaimSlim.cs
message RpcClaim {
string value = 1;
string type = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
syntax = "proto3";
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3

message NullableString {
oneof string {
string value = 1;
}
}
Loading