Skip to content

Commit

Permalink
Dapr runtime and .NET reference updates. (#1323)
Browse files Browse the repository at this point in the history
* Dapr runtime and .NET reference updates.

Signed-off-by: Phillip Hoff <[email protected]>

* Update protos.

Signed-off-by: Phillip Hoff <[email protected]>

---------

Signed-off-by: Phillip Hoff <[email protected]>
  • Loading branch information
philliphoff authored Jul 9, 2024
1 parent 3768a98 commit 205f45f
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/localinit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ az extension add --name containerapp --yes
nvm install v18.12.1

# initialize Dapr
dapr init --runtime-version=1.10.0-rc.2
dapr init --runtime-version=1.14.0-rc.2
6 changes: 3 additions & 3 deletions .github/workflows/itests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
GOOS: linux
GOARCH: amd64
GOPROXY: https://proxy.golang.org
DAPR_CLI_VER: 1.13.0
DAPR_RUNTIME_VER: 1.13.2
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/release-1.12/install/install.sh
DAPR_CLI_VER: 1.14.0-rc.2
DAPR_RUNTIME_VER: 1.14.0-rc.2
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/release-1.14/install/install.sh
DAPR_CLI_REF: ''
steps:
- name: Set up Dapr CLI
Expand Down
2 changes: 1 addition & 1 deletion daprdocs/content/en/dotnet-sdk-docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Dapr offers a variety of packages to help with the development of .NET applicati

- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
- [.NET Core 3.1 or .NET 5+](https://dotnet.microsoft.com/download) installed
- [.NET 6+](https://dotnet.microsoft.com/download) installed

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This project contains the implementation of the actor client which calls MyActor

- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed.
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}).
- [.NET Core 3.1 or .NET 6+](https://dotnet.microsoft.com/download) installed. Dapr .NET SDK uses [ASP.NET Core](https://docs.microsoft.com/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-6.0).
- [.NET 6+](https://dotnet.microsoft.com/download) installed. Dapr .NET SDK uses [ASP.NET Core](https://docs.microsoft.com/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-6.0).

## Step 0: Prepare

Expand Down
4 changes: 2 additions & 2 deletions examples/Actor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Actor example shows how to create a virtual actor (`DemoActor`) and invoke i

## Prerequisites

- [.NET Core 3.1 or .NET 5+](https://dotnet.microsoft.com/download) installed
- [.NET 6+](https://dotnet.microsoft.com/download) installed
- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
- [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
- [Dapr .NET SDK](https://github.com/dapr/dotnet-sdk/)
Expand Down Expand Up @@ -102,7 +102,7 @@ docker push <your-docker-registry>/demo-actor:latest
### Deploy the Actor service to Kubernetes
#### Prerequisites
- A Kubernetes cluster with `kubectl` configured to access it.
- Dapr v1.13+ installed on the Kubernetes cluster. Follow the instructions [here](https://docs.dapr.io/getting-started/install-dapr-kubernetes/).
- Dapr v1.14+ installed on the Kubernetes cluster. Follow the instructions [here](https://docs.dapr.io/getting-started/install-dapr-kubernetes/).
- A Docker registry where you pushed the `DemoActor` image.

#### Deploy the Actor service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

- [.NET Core 3.1 or .NET 5+](https://dotnet.microsoft.com/download) installed
- [.NET 6+](https://dotnet.microsoft.com/download) installed
- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
- [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
- [Dapr .NET SDK](https://docs.dapr.io/developing-applications/sdks/dotnet/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

- [.NET Core 3.1 or .NET 5+](https://dotnet.microsoft.com/download) installed
- [.NET 6+](https://dotnet.microsoft.com/download) installed
- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
- [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
- [Dapr .NET SDK](https://docs.dapr.io/developing-applications/sdks/dotnet/)
Expand Down
2 changes: 1 addition & 1 deletion samples/Client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The following examples will show you how to:

## Prerequisites

* [.Net Core 3.1 or .NET 5+](https://dotnet.microsoft.com/download)
* [.NET 6+](https://dotnet.microsoft.com/download)
* [Dapr CLI](https://github.com/dapr/cli)
* [Dapr DotNet SDK](https://github.com/dapr/dotnet-sdk)

Expand Down
2 changes: 1 addition & 1 deletion src/Dapr.Client/Protos/dapr/proto/common/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ message ConfigurationItem {

// the metadata which will be passed to/from configuration store component.
map<string,string> metadata = 3;
}
}
32 changes: 31 additions & 1 deletion src/Dapr.Client/Protos/dapr/proto/dapr/v1/appcallback.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ syntax = "proto3";

package dapr.proto.runtime.v1;

import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "dapr/proto/common/v1/common.proto";
import "google/protobuf/struct.proto";
Expand Down Expand Up @@ -59,8 +60,37 @@ service AppCallbackHealthCheck {
service AppCallbackAlpha {
// Subscribes bulk events from Pubsub
rpc OnBulkTopicEventAlpha1(TopicEventBulkRequest) returns (TopicEventBulkResponse) {}

// Sends job back to the app's endpoint at trigger time.
rpc OnJobEventAlpha1 (JobEventRequest) returns (JobEventResponse);
}

message JobEventRequest {
// Job name.
string name = 1;

// Job data to be sent back to app.
google.protobuf.Any data = 2;

// Required. method is a method name which will be invoked by caller.
string method = 3;

// The type of data content.
//
// This field is required if data delivers http request body
// Otherwise, this is optional.
string content_type = 4;

// HTTP specific fields if request conveys http-compatible request.
//
// This field is required for http-compatible request. Otherwise,
// this field is optional.
common.v1.HTTPExtension http_extension = 5;
}

// JobEventResponse is the response from the app when a job is triggered.
message JobEventResponse {}

// TopicEventRequest message is compatible with CloudEvent spec v1.0
// https://github.com/cloudevents/spec/blob/v1.0/spec.md
message TopicEventRequest {
Expand Down Expand Up @@ -310,4 +340,4 @@ message ListInputBindingsResponse {

// HealthCheckResponse is the message with the response to the health check.
// This message is currently empty as used as placeholder.
message HealthCheckResponse {}
message HealthCheckResponse {}
160 changes: 142 additions & 18 deletions src/Dapr.Client/Protos/dapr/proto/dapr/v1/dapr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "dapr/proto/common/v1/common.proto";
import "dapr/proto/dapr/v1/appcallback.proto";

option csharp_namespace = "Dapr.Client.Autogen.Grpc.v1";
option java_outer_classname = "DaprProtos";
Expand Down Expand Up @@ -58,6 +59,10 @@ service Dapr {
// Bulk Publishes multiple events to the specified topic.
rpc BulkPublishEventAlpha1(BulkPublishRequest) returns (BulkPublishResponse) {}

// SubscribeTopicEventsAlpha1 subscribes to a PubSub topic and receives topic
// events from it.
rpc SubscribeTopicEventsAlpha1(stream SubscribeTopicEventsRequestAlpha1) returns (stream TopicEventRequest) {}

// Invokes binding data to specific output bindings
rpc InvokeBinding(InvokeBindingRequest) returns (InvokeBindingResponse) {}

Expand Down Expand Up @@ -188,6 +193,15 @@ service Dapr {
rpc RaiseEventWorkflowBeta1 (RaiseEventWorkflowRequest) returns (google.protobuf.Empty) {}
// Shutdown the sidecar
rpc Shutdown (ShutdownRequest) returns (google.protobuf.Empty) {}

// Create and schedule a job
rpc ScheduleJobAlpha1(ScheduleJobRequest) returns (ScheduleJobResponse) {}

// Gets a scheduled job
rpc GetJobAlpha1(GetJobRequest) returns (GetJobResponse) {}

// Delete a job
rpc DeleteJobAlpha1(DeleteJobRequest) returns (DeleteJobResponse) {}
}

// InvokeServiceRequest represents the request message for Service invocation.
Expand Down Expand Up @@ -411,6 +425,47 @@ message BulkPublishResponseFailedEntry {
string error = 2;
}

// SubscribeTopicEventsRequestAlpha1 is a message containing the details for
// subscribing to a topic via streaming.
// The first message must always be the initial request. All subsequent
// messages must be event responses.
message SubscribeTopicEventsRequestAlpha1 {
oneof subscribe_topic_events_request_type {
SubscribeTopicEventsInitialRequestAlpha1 initial_request = 1;
SubscribeTopicEventsResponseAlpha1 event_response = 2;
}
}

// SubscribeTopicEventsInitialRequestAlpha1 is the initial message containing the
// details for subscribing to a topic via streaming.
message SubscribeTopicEventsInitialRequestAlpha1 {
// The name of the pubsub component
string pubsub_name = 1;

// The pubsub topic
string topic = 2;

// The metadata passing to pub components
//
// metadata property:
// - key : the key of the message.
map<string, string> metadata = 3;

// dead_letter_topic is the topic to which messages that fail to be processed
// are sent.
optional string dead_letter_topic = 4;
}

// SubscribeTopicEventsResponseAlpha1 is a message containing the result of a
// subscription to a topic.
message SubscribeTopicEventsResponseAlpha1 {
// id is the unique identifier for the subscription request.
string id = 1;

// status is the result of the subscription request.
TopicEventResponse status = 2;
}

// InvokeBindingRequest is the message to send data to output bindings
message InvokeBindingRequest {
// The name of the output binding to invoke.
Expand Down Expand Up @@ -504,45 +559,45 @@ message ExecuteStateTransactionRequest {

// RegisterActorTimerRequest is the message to register a timer for an actor of a given type and id.
message RegisterActorTimerRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string name = 3;
string due_time = 4;
string due_time = 4 [json_name = "dueTime"];
string period = 5;
string callback = 6;
bytes data = 7;
bytes data = 7;
string ttl = 8;
}

// UnregisterActorTimerRequest is the message to unregister an actor timer
message UnregisterActorTimerRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string name = 3;
}

// RegisterActorReminderRequest is the message to register a reminder for an actor of a given type and id.
message RegisterActorReminderRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string name = 3;
string due_time = 4;
string due_time = 4 [json_name = "dueTime"];
string period = 5;
bytes data = 6;
bytes data = 6;
string ttl = 7;
}

// UnregisterActorReminderRequest is the message to unregister an actor reminder.
message UnregisterActorReminderRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string name = 3;
}

// GetActorStateRequest is the message to get key-value states from specific actor.
message GetActorStateRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string key = 3;
}

Expand All @@ -556,8 +611,8 @@ message GetActorStateResponse {

// ExecuteActorStateTransactionRequest is the message to execute multiple operations on a specified actor.
message ExecuteActorStateTransactionRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
repeated TransactionalActorStateOperation operations = 3;
}

Expand All @@ -575,8 +630,8 @@ message TransactionalActorStateOperation {

// InvokeActorRequest is the message to call an actor.
message InvokeActorRequest {
string actor_type = 1;
string actor_id = 2;
string actor_type = 1 [json_name = "actorType"];
string actor_id = 2 [json_name = "actorId"];
string method = 3;
bytes data = 4;
map<string, string> metadata = 5;
Expand Down Expand Up @@ -605,6 +660,7 @@ message GetMetadataResponse {
string runtime_version = 8 [json_name = "runtimeVersion"];
repeated string enabled_features = 9 [json_name = "enabledFeatures"];
ActorRuntime actor_runtime = 10 [json_name = "actorRuntime"];
//TODO: Cassie: probably add scheduler runtime status
}

message ActorRuntime {
Expand Down Expand Up @@ -665,6 +721,19 @@ message PubsubSubscription {
map<string,string> metadata = 3 [json_name = "metadata"];
PubsubSubscriptionRules rules = 4 [json_name = "rules"];
string dead_letter_topic = 5 [json_name = "deadLetterTopic"];
PubsubSubscriptionType type = 6 [json_name = "type"];
}

// PubsubSubscriptionType indicates the type of subscription
enum PubsubSubscriptionType {
// UNKNOWN is the default value for the subscription type.
UNKNOWN = 0;
// Declarative subscription (k8s CRD)
DECLARATIVE = 1;
// Programmatically created subscription
PROGRAMMATIC = 2;
// Bidirectional Streaming subscription
STREAMING = 3;
}

message PubsubSubscriptionRules {
Expand Down Expand Up @@ -1108,3 +1177,58 @@ message PurgeWorkflowRequest {
message ShutdownRequest {
// Empty
}

// Job is the definition of a job.
message Job {
// The unique name for the job.
string name = 1;

// The schedule for the job.
optional string schedule = 2;

// Optional: jobs with fixed repeat counts (accounting for Actor Reminders).
optional uint32 repeats = 3;

// Optional: sets time at which or time interval before the callback is invoked for the first time.
optional string due_time = 4;

// Optional: Time To Live to allow for auto deletes (accounting for Actor Reminders).
optional string ttl = 5;

// Job data.
google.protobuf.Any data = 6;
}

// ScheduleJobRequest is the message to create/schedule the job.
message ScheduleJobRequest {
// The job details.
Job job = 1;
}

// ScheduleJobResponse is the message response to create/schedule the job.
message ScheduleJobResponse {
// Empty
}

// GetJobRequest is the message to retrieve a job.
message GetJobRequest {
// The name of the job.
string name = 1;
}

// GetJobResponse is the message's response for a job retrieved.
message GetJobResponse {
// The job details.
Job job = 1;
}

// DeleteJobRequest is the message to delete the job by name.
message DeleteJobRequest {
// The name of the job.
string name = 1;
}

// DeleteJobResponse is the message response to delete the job by name.
message DeleteJobResponse {
// Empty
}

0 comments on commit 205f45f

Please sign in to comment.