From 5730524cfc7ee91379e55582f5c45873a5b99c55 Mon Sep 17 00:00:00 2001 From: Cyril Scetbon Date: Fri, 19 Jan 2024 19:02:04 -0500 Subject: [PATCH 1/2] Update proto Signed-off-by: Cyril Scetbon --- dapr/proto/runtime/v1/dapr.proto | 101 ++++++++++++++++++++++--------- 1 file changed, 74 insertions(+), 27 deletions(-) diff --git a/dapr/proto/runtime/v1/dapr.proto b/dapr/proto/runtime/v1/dapr.proto index 00c3f8e9..7294fc82 100644 --- a/dapr/proto/runtime/v1/dapr.proto +++ b/dapr/proto/runtime/v1/dapr.proto @@ -79,9 +79,6 @@ service Dapr { // Unregister an actor reminder. rpc UnregisterActorReminder(UnregisterActorReminderRequest) returns (google.protobuf.Empty) {} - // Rename an actor reminder. - rpc RenameActorReminder(RenameActorReminderRequest) returns (google.protobuf.Empty) {} - // Gets the state for a specific actor. rpc GetActorState(GetActorStateRequest) returns (GetActorStateResponse) {} @@ -122,7 +119,7 @@ service Dapr { rpc DecryptAlpha1(stream DecryptRequest) returns (stream DecryptResponse); // Gets metadata of the sidecar - rpc GetMetadata (google.protobuf.Empty) returns (GetMetadataResponse) {} + rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {} // Sets value in extended metadata of the sidecar rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {} @@ -169,8 +166,28 @@ service Dapr { // Raise an event to a running workflow instance rpc RaiseEventWorkflowAlpha1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {} + // Starts a new instance of a workflow + rpc StartWorkflowBeta1 (StartWorkflowRequest) returns (StartWorkflowResponse) {} + + // Gets details about a started workflow instance + rpc GetWorkflowBeta1 (GetWorkflowRequest) returns (GetWorkflowResponse) {} + + // Purge Workflow + rpc PurgeWorkflowBeta1 (PurgeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Terminates a running workflow instance + rpc TerminateWorkflowBeta1 (TerminateWorkflowRequest) returns (google.protobuf.Empty) {} + + // Pauses a running workflow instance + rpc PauseWorkflowBeta1 (PauseWorkflowRequest) returns (google.protobuf.Empty) {} + + // Resumes a paused workflow instance + rpc ResumeWorkflowBeta1 (ResumeWorkflowRequest) returns (google.protobuf.Empty) {} + + // Raise an event to a running workflow instance + rpc RaiseEventWorkflowBeta1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {} // Shutdown the sidecar - rpc Shutdown (google.protobuf.Empty) returns (google.protobuf.Empty) {} + rpc Shutdown (ShutdownRequest) returns (google.protobuf.Empty) {} } // InvokeServiceRequest represents the request message for Service invocation. @@ -387,7 +404,6 @@ message BulkPublishResponse { // BulkPublishResponseFailedEntry is the message containing the entryID and error of a failed event in BulkPublishEvent call message BulkPublishResponseFailedEntry { - // The response scoped unique ID referring to this message string entry_id = 1; @@ -395,7 +411,6 @@ message BulkPublishResponseFailedEntry { string error = 2; } - // InvokeBindingRequest is the message to send data to output bindings message InvokeBindingRequest { // The name of the output binding to invoke. @@ -524,14 +539,6 @@ message UnregisterActorReminderRequest { string name = 3; } -// RenameActorReminderRequest is the message to rename an actor reminder. -message RenameActorReminderRequest { - string actor_type = 1; - string actor_id = 2; - string old_name = 3; - string new_name = 4; -} - // GetActorStateRequest is the message to get key-value states from specific actor. message GetActorStateRequest { string actor_type = 1; @@ -542,6 +549,9 @@ message GetActorStateRequest { // GetActorStateResponse is the response conveying the actor's state value. message GetActorStateResponse { bytes data = 1; + + // The metadata which will be sent to app. + map metadata = 2; } // ExecuteActorStateTransactionRequest is the message to execute multiple operations on a specified actor. @@ -577,10 +587,16 @@ message InvokeActorResponse { bytes data = 1; } -// GetMetadataResponse is a message that is returned on GetMetadata rpc call +// GetMetadataRequest is the message for the GetMetadata request. +message GetMetadataRequest { + // Empty +} + +// GetMetadataResponse is a message that is returned on GetMetadata rpc call. message GetMetadataResponse { string id = 1; - repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors"]; + // Deprecated alias for actor_runtime.active_actors. + repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors", deprecated = true]; repeated RegisteredComponents registered_components = 3 [json_name = "components"]; map extended_metadata = 4 [json_name = "extended"]; repeated PubsubSubscription subscriptions = 5 [json_name = "subscriptions"]; @@ -588,6 +604,28 @@ message GetMetadataResponse { AppConnectionProperties app_connection_properties = 7 [json_name = "appConnectionProperties"]; string runtime_version = 8 [json_name = "runtimeVersion"]; repeated string enabled_features = 9 [json_name = "enabledFeatures"]; + ActorRuntime actor_runtime = 10 [json_name = "actorRuntime"]; +} + +message ActorRuntime { + enum ActorRuntimeStatus { + // Indicates that the actor runtime is still being initialized. + INITIALIZING = 0; + // Indicates that the actor runtime is disabled. + // This normally happens when Dapr is started without "placement-host-address" + DISABLED = 1; + // Indicates the actor runtime is running, either as an actor host or client. + RUNNING = 2; + } + + // Contains an enum indicating whether the actor runtime has been initialized. + ActorRuntimeStatus runtime_status = 1 [json_name = "runtimeStatus"]; + // Count of active actors per type. + repeated ActiveActorsCount active_actors = 2 [json_name = "activeActors"]; + // Indicates whether the actor runtime is ready to host actors. + bool host_ready = 3 [json_name = "hostReady"]; + // Custom message from the placement provider. + string placement = 4 [json_name = "placement"]; } message ActiveActorsCount { @@ -978,7 +1016,7 @@ message DecryptResponse { common.v1.StreamPayload payload = 1; } -// GetWorkflowRequest is the request for GetWorkflowAlpha1. +// GetWorkflowRequest is the request for GetWorkflowBeta1. message GetWorkflowRequest { // ID of the workflow instance to query. string instance_id = 1 [json_name = "instanceID"]; @@ -986,7 +1024,7 @@ message GetWorkflowRequest { string workflow_component = 2 [json_name = "workflowComponent"]; } -// GetWorkflowResponse is the response for GetWorkflowAlpha1. +// GetWorkflowResponse is the response for GetWorkflowBeta1. message GetWorkflowResponse { // ID of the workflow instance. string instance_id = 1 [json_name = "instanceID"]; @@ -1002,7 +1040,7 @@ message GetWorkflowResponse { map properties = 6; } -// StartWorkflowRequest is the request for StartWorkflowAlpha1. +// StartWorkflowRequest is the request for StartWorkflowBeta1. message StartWorkflowRequest { // The ID to assign to the started workflow instance. If empty, a random ID is generated. string instance_id = 1 [json_name = "instanceID"]; @@ -1016,21 +1054,23 @@ message StartWorkflowRequest { bytes input = 5; } -// StartWorkflowResponse is the response for StartWorkflowAlpha1. +// StartWorkflowResponse is the response for StartWorkflowBeta1. message StartWorkflowResponse { // ID of the started workflow instance. string instance_id = 1 [json_name = "instanceID"]; } -// TerminateWorkflowRequest is the request for TerminateWorkflowAlpha1. +// TerminateWorkflowRequest is the request for TerminateWorkflowBeta1. message TerminateWorkflowRequest { // ID of the workflow instance to terminate. string instance_id = 1 [json_name = "instanceID"]; // Name of the workflow component. string workflow_component = 2 [json_name = "workflowComponent"]; + // Indicates whether this is a non_recursive terminate request + bool non_recursive = 3 [json_name = "non_recursive"]; } -// PauseWorkflowRequest is the request for PauseWorkflowAlpha1. +// PauseWorkflowRequest is the request for PauseWorkflowBeta1. message PauseWorkflowRequest { // ID of the workflow instance to pause. string instance_id = 1 [json_name = "instanceID"]; @@ -1038,7 +1078,7 @@ message PauseWorkflowRequest { string workflow_component = 2 [json_name = "workflowComponent"]; } -// ResumeWorkflowRequest is the request for ResumeWorkflowAlpha1. +// ResumeWorkflowRequest is the request for ResumeWorkflowBeta1. message ResumeWorkflowRequest { // ID of the workflow instance to resume. string instance_id = 1 [json_name = "instanceID"]; @@ -1046,7 +1086,7 @@ message ResumeWorkflowRequest { string workflow_component = 2 [json_name = "workflowComponent"]; } -// RaiseEventWorkflowRequest is the request for RaiseEventWorkflowAlpha1. +// RaiseEventWorkflowRequest is the request for RaiseEventWorkflowBeta1. message RaiseEventWorkflowRequest { // ID of the workflow instance to raise an event for. string instance_id = 1 [json_name = "instanceID"]; @@ -1058,10 +1098,17 @@ message RaiseEventWorkflowRequest { bytes event_data = 4; } -// PurgeWorkflowRequest is the request for PurgeWorkflowAlpha1. +// PurgeWorkflowRequest is the request for PurgeWorkflowBeta1. message PurgeWorkflowRequest { // ID of the workflow instance to purge. string instance_id = 1 [json_name = "instanceID"]; // Name of the workflow component. string workflow_component = 2 [json_name = "workflowComponent"]; -} \ No newline at end of file + // Indicates whether this is a non_recursive purge request + bool non_recursive = 3 [json_name = "non_recursive"]; +} + +// ShutdownRequest is the request for Shutdown. +message ShutdownRequest { + // Empty +} From 3527b9482ee48af6130111ed6b73bddcc0345cd0 Mon Sep 17 00:00:00 2001 From: Cyril Scetbon Date: Fri, 19 Jan 2024 19:09:20 -0500 Subject: [PATCH 2/2] Use v1.12.4 instead of master for now Signed-off-by: Cyril Scetbon --- dapr/proto/runtime/v1/dapr.proto | 58 ++++++++++---------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/dapr/proto/runtime/v1/dapr.proto b/dapr/proto/runtime/v1/dapr.proto index 7294fc82..eafb5452 100644 --- a/dapr/proto/runtime/v1/dapr.proto +++ b/dapr/proto/runtime/v1/dapr.proto @@ -79,6 +79,9 @@ service Dapr { // Unregister an actor reminder. rpc UnregisterActorReminder(UnregisterActorReminderRequest) returns (google.protobuf.Empty) {} + // Rename an actor reminder. + rpc RenameActorReminder(RenameActorReminderRequest) returns (google.protobuf.Empty) {} + // Gets the state for a specific actor. rpc GetActorState(GetActorStateRequest) returns (GetActorStateResponse) {} @@ -119,7 +122,7 @@ service Dapr { rpc DecryptAlpha1(stream DecryptRequest) returns (stream DecryptResponse); // Gets metadata of the sidecar - rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {} + rpc GetMetadata (google.protobuf.Empty) returns (GetMetadataResponse) {} // Sets value in extended metadata of the sidecar rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {} @@ -187,7 +190,7 @@ service Dapr { // Raise an event to a running workflow instance rpc RaiseEventWorkflowBeta1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {} // Shutdown the sidecar - rpc Shutdown (ShutdownRequest) returns (google.protobuf.Empty) {} + rpc Shutdown (google.protobuf.Empty) returns (google.protobuf.Empty) {} } // InvokeServiceRequest represents the request message for Service invocation. @@ -404,6 +407,7 @@ message BulkPublishResponse { // BulkPublishResponseFailedEntry is the message containing the entryID and error of a failed event in BulkPublishEvent call message BulkPublishResponseFailedEntry { + // The response scoped unique ID referring to this message string entry_id = 1; @@ -411,6 +415,7 @@ message BulkPublishResponseFailedEntry { string error = 2; } + // InvokeBindingRequest is the message to send data to output bindings message InvokeBindingRequest { // The name of the output binding to invoke. @@ -539,6 +544,14 @@ message UnregisterActorReminderRequest { string name = 3; } +// RenameActorReminderRequest is the message to rename an actor reminder. +message RenameActorReminderRequest { + string actor_type = 1; + string actor_id = 2; + string old_name = 3; + string new_name = 4; +} + // GetActorStateRequest is the message to get key-value states from specific actor. message GetActorStateRequest { string actor_type = 1; @@ -587,16 +600,10 @@ message InvokeActorResponse { bytes data = 1; } -// GetMetadataRequest is the message for the GetMetadata request. -message GetMetadataRequest { - // Empty -} - -// GetMetadataResponse is a message that is returned on GetMetadata rpc call. +// GetMetadataResponse is a message that is returned on GetMetadata rpc call message GetMetadataResponse { string id = 1; - // Deprecated alias for actor_runtime.active_actors. - repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors", deprecated = true]; + repeated ActiveActorsCount active_actors_count = 2 [json_name = "actors"]; repeated RegisteredComponents registered_components = 3 [json_name = "components"]; map extended_metadata = 4 [json_name = "extended"]; repeated PubsubSubscription subscriptions = 5 [json_name = "subscriptions"]; @@ -604,28 +611,6 @@ message GetMetadataResponse { AppConnectionProperties app_connection_properties = 7 [json_name = "appConnectionProperties"]; string runtime_version = 8 [json_name = "runtimeVersion"]; repeated string enabled_features = 9 [json_name = "enabledFeatures"]; - ActorRuntime actor_runtime = 10 [json_name = "actorRuntime"]; -} - -message ActorRuntime { - enum ActorRuntimeStatus { - // Indicates that the actor runtime is still being initialized. - INITIALIZING = 0; - // Indicates that the actor runtime is disabled. - // This normally happens when Dapr is started without "placement-host-address" - DISABLED = 1; - // Indicates the actor runtime is running, either as an actor host or client. - RUNNING = 2; - } - - // Contains an enum indicating whether the actor runtime has been initialized. - ActorRuntimeStatus runtime_status = 1 [json_name = "runtimeStatus"]; - // Count of active actors per type. - repeated ActiveActorsCount active_actors = 2 [json_name = "activeActors"]; - // Indicates whether the actor runtime is ready to host actors. - bool host_ready = 3 [json_name = "hostReady"]; - // Custom message from the placement provider. - string placement = 4 [json_name = "placement"]; } message ActiveActorsCount { @@ -1066,8 +1051,6 @@ message TerminateWorkflowRequest { string instance_id = 1 [json_name = "instanceID"]; // Name of the workflow component. string workflow_component = 2 [json_name = "workflowComponent"]; - // Indicates whether this is a non_recursive terminate request - bool non_recursive = 3 [json_name = "non_recursive"]; } // PauseWorkflowRequest is the request for PauseWorkflowBeta1. @@ -1104,11 +1087,4 @@ message PurgeWorkflowRequest { string instance_id = 1 [json_name = "instanceID"]; // Name of the workflow component. string workflow_component = 2 [json_name = "workflowComponent"]; - // Indicates whether this is a non_recursive purge request - bool non_recursive = 3 [json_name = "non_recursive"]; -} - -// ShutdownRequest is the request for Shutdown. -message ShutdownRequest { - // Empty }