Skip to content

Commit 8669352

Browse files
authored
1 parent a96fbb3 commit 8669352

File tree

3 files changed

+72
-30
lines changed

3 files changed

+72
-30
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://help.github.com/articles/about-codeowners/
2+
# for more info about CODEOWNERS file
3+
#
4+
# It uses the same pattern rule for gitignore file
5+
# https://git-scm.com/docs/gitignore#_pattern_format
6+
7+
8+
9+
# AZURE FUNCTIONS TEAM
10+
# For all file changes, github would automatically
11+
# include the following people in the PRs.
12+
# Language owners should get notified of any new changes to the proto file.
13+
14+
src/proto/FunctionRpc.proto @vrdmr @gavin-aguiar @YunchuWang @surgupta-msft @satvu @ejizba @alrod @anatolib @kaibocai @shreyas-gopalakrishna @amamounelsayed @Francisco-Gamino

azure-functions-language-worker-protobuf/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ From within the Azure Functions language worker repo:
3636
- `git commit -m "Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: <tag-name>. Commit: <commit hash>"`
3737
- `git push`
3838

39-
## Releasing a Language Worker Protobuf version
40-
41-
1. Draft a release in the GitHub UI
42-
- Be sure to include details of the release
43-
2. Create a release version, following semantic versioning guidelines ([semver.org](https://semver.org/))
44-
3. Tag the version with the pattern: `v<M>.<m>.<p>-protofile` (example: `v1.1.0-protofile`)
45-
3. Merge `dev` to `master`
46-
4739
## Consuming FunctionRPC.proto
4840
*Note: Update versionNumber before running following commands*
4941

azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ message StreamingMessage {
2626
oneof content {
2727

2828
// Worker initiates stream
29-
StartStream start_stream = 20;
29+
StartStream start_stream = 20;
3030

3131
// Host sends capabilities/init data to worker
3232
WorkerInitRequest worker_init_request = 17;
3333
// Worker responds after initializing with its capabilities & status
3434
WorkerInitResponse worker_init_response = 16;
35-
35+
3636
// Worker periodically sends empty heartbeat message to host
3737
WorkerHeartbeat worker_heartbeat = 15;
3838

3939
// Host sends terminate message to worker.
4040
// Worker terminates if it can, otherwise host terminates after a grace period
4141
WorkerTerminate worker_terminate = 14;
4242

43-
// Add any worker relevant status to response
43+
// Host periodically sends status request to the worker
4444
WorkerStatusRequest worker_status_request = 12;
4545
WorkerStatusResponse worker_status_response = 13;
4646

@@ -49,25 +49,25 @@ message StreamingMessage {
4949

5050
// Worker requests a desired action (restart worker, reload function)
5151
WorkerActionResponse worker_action_response = 7;
52-
52+
5353
// Host sends required metadata to worker to load function
5454
FunctionLoadRequest function_load_request = 8;
5555
// Worker responds after loading with the load result
5656
FunctionLoadResponse function_load_response = 9;
57-
57+
5858
// Host requests a given invocation
5959
InvocationRequest invocation_request = 4;
6060

6161
// Worker responds to a given invocation
6262
InvocationResponse invocation_response = 5;
6363

64-
// Host sends cancel message to attempt to cancel an invocation.
64+
// Host sends cancel message to attempt to cancel an invocation.
6565
// If an invocation is cancelled, host will receive an invocation response with status cancelled.
6666
InvocationCancel invocation_cancel = 21;
6767

6868
// Worker logs a message back to the host
6969
RpcLog rpc_log = 2;
70-
70+
7171
FunctionEnvironmentReloadRequest function_environment_reload_request = 25;
7272

7373
FunctionEnvironmentReloadResponse function_environment_reload_response = 26;
@@ -91,15 +91,15 @@ message StreamingMessage {
9191
// Process.Start required info
9292
// connection details
9393
// protocol type
94-
// protocol version
94+
// protocol version
9595

9696
// Worker sends the host information identifying itself
9797
message StartStream {
9898
// id of the worker
9999
string worker_id = 2;
100100
}
101101

102-
// Host requests the worker to initialize itself
102+
// Host requests the worker to initialize itself
103103
message WorkerInitRequest {
104104
// version of the host sending init request
105105
string host_version = 1;
@@ -120,13 +120,35 @@ message WorkerInitRequest {
120120

121121
// Worker responds with the result of initializing itself
122122
message WorkerInitResponse {
123-
// Version of worker
123+
// NOT USED
124+
// TODO: Remove from protobuf during next breaking change release
124125
string worker_version = 1;
126+
125127
// A map of worker supported features/capabilities
126128
map<string, string> capabilities = 2;
127129

128130
// Status of the response
129131
StatusResult result = 3;
132+
133+
// Worker metadata captured for telemetry purposes
134+
WorkerMetadata worker_metadata = 4;
135+
}
136+
137+
message WorkerMetadata {
138+
// The runtime/stack name
139+
string runtime_name = 1;
140+
141+
// The version of the runtime/stack
142+
string runtime_version = 2;
143+
144+
// The version of the worker
145+
string worker_version = 3;
146+
147+
// The worker bitness/architecture
148+
string worker_bitness = 4;
149+
150+
// Optional additional custom properties
151+
map<string, string> custom_properties = 5;
130152
}
131153

132154
// Used by the host to determine success/failure/cancellation
@@ -137,6 +159,7 @@ message StatusResult {
137159
Success = 1;
138160
Cancelled = 2;
139161
}
162+
140163
// Status for the given result
141164
Status status = 4;
142165

@@ -150,9 +173,8 @@ message StatusResult {
150173
repeated RpcLog logs = 3;
151174
}
152175

153-
// TODO: investigate grpc heartbeat - don't limit to grpc implemention
154-
155-
// Message is empty by design - Will add more fields in future if needed
176+
// NOT USED
177+
// TODO: Remove from protobuf during next breaking change release
156178
message WorkerHeartbeat {}
157179

158180
// Warning before killing the process after grace_period
@@ -185,24 +207,25 @@ message FileChangeEventRequest {
185207

186208
// Indicates whether worker reloaded successfully or needs a restart
187209
message WorkerActionResponse {
188-
// indicates whether a restart is needed, or reload succesfully
210+
// indicates whether a restart is needed, or reload successfully
189211
enum Action {
190212
Restart = 0;
191213
Reload = 1;
192214
}
193-
215+
194216
// action for this response
195217
Action action = 1;
196218

197219
// text reason for the response
198220
string reason = 2;
199221
}
200222

201-
// NOT USED
202-
message WorkerStatusRequest{
223+
// Used by the host to determine worker health
224+
message WorkerStatusRequest {
203225
}
204226

205-
// NOT USED
227+
// Worker responds with status message
228+
// TODO: Add any worker relevant status to response
206229
message WorkerStatusResponse {
207230
}
208231

@@ -271,7 +294,7 @@ message RpcFunctionMetadata {
271294

272295
// base directory for the Function
273296
string directory = 1;
274-
297+
275298
// Script file specified
276299
string script_file = 2;
277300

@@ -298,6 +321,11 @@ message RpcFunctionMetadata {
298321

299322
// A flag indicating if managed dependency is enabled or not
300323
bool managed_dependency_enabled = 14;
324+
325+
// Properties for function metadata
326+
// They're usually specific to a worker and largely passed along to the controller API for use
327+
// outside the host
328+
map<string,string> Properties = 16;
301329
}
302330

303331
// Host tells worker it is ready to receive metadata
@@ -492,7 +520,7 @@ message BindingInfo {
492520
DataType data_type = 4;
493521
}
494522

495-
// Used to send logs back to the Host
523+
// Used to send logs back to the Host
496524
message RpcLog {
497525
// Matching ILogger semantics
498526
// https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs
@@ -543,7 +571,7 @@ message RpcLog {
543571
map<string, TypedData> propertiesMap = 9;
544572
}
545573

546-
// Encapsulates an Exception
574+
// Encapsulates an Exception
547575
message RpcException {
548576
// Source of the exception
549577
string source = 3;
@@ -553,6 +581,14 @@ message RpcException {
553581

554582
// Textual message describing the exception
555583
string message = 2;
584+
585+
// Worker specifies whether exception is a user exception,
586+
// for purpose of application insights logging. Defaults to false.
587+
bool is_user_exception = 4;
588+
589+
// Type of exception. If it's a user exception, the type is passed along to app insights.
590+
// Otherwise, it's ignored for now.
591+
string type = 5;
556592
}
557593

558594
// Http cookie type. Note that only name and value are used for Http requests
@@ -597,7 +633,7 @@ message RpcHttpCookie {
597633
// TODO - solidify this or remove it
598634
message RpcHttp {
599635
string method = 1;
600-
string url = 2;
636+
string url = 2;
601637
map<string,string> headers = 3;
602638
TypedData body = 4;
603639
map<string,string> params = 10;

0 commit comments

Comments
 (0)