From e88a52640d21cf5ecbd3b1fd3c1e79dd94ba4f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Herrera=20de=20la=20Garza?= Date: Tue, 4 Feb 2020 20:29:39 -0600 Subject: [PATCH 1/3] Get Proto files from the DAPR repository. --- .gitignore | 2 + pom.xml | 2 + proto/dapr/dapr.proto | 109 ------------------------------ proto/daprclient/daprclient.proto | 76 --------------------- sdk-autogen/pom.xml | 35 ++++++++++ 5 files changed, 39 insertions(+), 185 deletions(-) delete mode 100644 proto/dapr/dapr.proto delete mode 100644 proto/daprclient/daprclient.proto diff --git a/.gitignore b/.gitignore index ae28bb52db..4b8984c161 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,5 @@ hs_err_pid* /docs/dapr-sdk-actors /docs/dapr-sdk-autogen /docs/dapr-sdk +/proto/dapr +/proto/daprclient diff --git a/pom.xml b/pom.xml index 2379ca22f5..42d8ff8945 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,8 @@ 1.25.0 3.11.0 3.10.0 + https://raw.githubusercontent.com/dapr/dapr/master/pkg/proto/dapr/dapr.proto + https://raw.githubusercontent.com/dapr/dapr/master/pkg/proto/daprclient/daprclient.proto 1.6.2 3.1.1 1.8 diff --git a/proto/dapr/dapr.proto b/proto/dapr/dapr.proto deleted file mode 100644 index ac451710a9..0000000000 --- a/proto/dapr/dapr.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; - -package dapr; - -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/duration.proto"; - -option java_outer_classname = "DaprProtos"; -option java_package = "io.dapr"; - -option csharp_namespace = "Dapr.Client.Grpc"; - - -// Dapr definitions -service Dapr { - rpc PublishEvent(PublishEventEnvelope) returns (google.protobuf.Empty) {} - rpc InvokeService(InvokeServiceEnvelope) returns (InvokeServiceResponseEnvelope) {} - rpc InvokeBinding(InvokeBindingEnvelope) returns (google.protobuf.Empty) {} - rpc GetState(GetStateEnvelope) returns (GetStateResponseEnvelope) {} - rpc SaveState(SaveStateEnvelope) returns (google.protobuf.Empty) {} - rpc DeleteState(DeleteStateEnvelope) returns (google.protobuf.Empty) {} -} - -message InvokeServiceResponseEnvelope { - google.protobuf.Any data = 1; - map metadata = 2; -} - -message DeleteStateEnvelope { - string storeName = 1; - string key = 2; - string etag = 3; - StateOptions options = 4; -} - -message SaveStateEnvelope { - string storeName = 1; - repeated StateRequest requests = 2; -} - -message GetStateEnvelope { - string storeName = 1; - string key = 2; - string consistency = 3; -} - -message GetStateResponseEnvelope { - google.protobuf.Any data = 1; - string etag = 2; -} - -message InvokeBindingEnvelope { - string name = 1; - google.protobuf.Any data = 2; - map metadata = 3; -} - -message InvokeServiceEnvelope { - string id = 1; - string method = 2; - google.protobuf.Any data = 3; - map metadata = 4; -} - -message PublishEventEnvelope { - string topic = 1; - google.protobuf.Any data = 2; -} - -message State { - string key = 1; - google.protobuf.Any value = 2; - string etag = 3; - map metadata = 4; - StateOptions options = 5; -} - -message StateOptions { - string concurrency = 1; - string consistency = 2; - RetryPolicy retryPolicy = 3; -} - -message RetryPolicy { - int32 threshold = 1; - string pattern = 2; - google.protobuf.Duration interval = 3; -} - -message StateRequest { - string key = 1; - google.protobuf.Any value = 2; - string etag = 3; - map metadata = 4; - StateRequestOptions options = 5; -} - -message StateRequestOptions { - string concurrency = 1; - string consistency = 2; - StateRetryPolicy retryPolicy = 3; -} - -message StateRetryPolicy { - int32 threshold = 1; - string pattern = 2; - google.protobuf.Duration interval = 3; -} diff --git a/proto/daprclient/daprclient.proto b/proto/daprclient/daprclient.proto deleted file mode 100644 index a383ba16c5..0000000000 --- a/proto/daprclient/daprclient.proto +++ /dev/null @@ -1,76 +0,0 @@ -syntax = "proto3"; - -package daprclient; - -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/duration.proto"; - -option java_outer_classname = "DaprClientProtos"; -option java_package = "io.dapr"; - -// User Code definitions -service DaprClient { - rpc OnInvoke (InvokeEnvelope) returns (google.protobuf.Any) {} - rpc GetTopicSubscriptions(google.protobuf.Empty) returns (GetTopicSubscriptionsEnvelope) {} - rpc GetBindingsSubscriptions(google.protobuf.Empty) returns (GetBindingsSubscriptionsEnvelope) {} - rpc OnBindingEvent(BindingEventEnvelope) returns (BindingResponseEnvelope) {} - rpc OnTopicEvent(CloudEventEnvelope) returns (google.protobuf.Empty) {} -} - -message CloudEventEnvelope { - string id = 1; - string source = 2; - string type = 3; - string specVersion = 4; - string dataContentType = 5; - string topic = 6; - google.protobuf.Any data = 7; -} - -message BindingEventEnvelope { - string name = 1; - google.protobuf.Any data = 2; - map metadata = 3; -} - -message BindingResponseEnvelope { - google.protobuf.Any data = 1; - repeated string to = 2; - repeated State state = 3; - string concurrency = 4; -} - -message InvokeEnvelope { - string method = 1; - google.protobuf.Any data = 2; - map metadata = 3; -} - -message GetTopicSubscriptionsEnvelope { - repeated string topics = 1; -} - -message GetBindingsSubscriptionsEnvelope { - repeated string bindings = 1; -} - -message State { - string key = 1; - google.protobuf.Any value = 2; - string etag = 3; - map metadata = 4; - StateOptions options = 5; -} - -message StateOptions { - string concurrency = 1; - string consistency = 2; - RetryPolicy retryPolicy = 3; -} - -message RetryPolicy { - int32 threshold = 1; - string pattern = 2; - google.protobuf.Duration interval = 3; -} diff --git a/sdk-autogen/pom.xml b/sdk-autogen/pom.xml index 6d9bfe4355..56fbf91f2a 100644 --- a/sdk-autogen/pom.xml +++ b/sdk-autogen/pom.xml @@ -56,6 +56,41 @@ + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.3.0 + + + getDaprProto + + initialize + + wget + + + ${dapr.proto.url} + dapr.proto + + ${protobuf.input.directory}/dapr + + + + getDaprClientProto + + initialize + + wget + + + ${dapr.client.proto.url} + daprclient.proto + + ${protobuf.input.directory}/daprclient + + + + com.github.os72 protoc-jar-maven-plugin From 6a217ed217d2aeddf362d732c6ea6195adf3bfd9 Mon Sep 17 00:00:00 2001 From: Artur Souza Date: Fri, 7 Feb 2020 12:35:35 -0800 Subject: [PATCH 2/3] Change proto to a fixed ref + download in target dir. --- README.md | 17 +++++++++++++++++ pom.xml | 4 ++-- sdk-autogen/pom.xml | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96f66f7490..316fcdab51 100644 --- a/README.md +++ b/README.md @@ -177,3 +177,20 @@ When releasing a new version of this SDK you must increase the version of all mo mvn versions:set -DnewVersion="0.1.0-preview02" mvn versions:commit ``` + +#### Update proto files + +Change the properties below in [pom.xml](./pom.xml) to point to the desired reference URL in Git. Avoid pointing to master branch since it can change over time and create unpredictable behavior in the build. + +```xml + + ... + + ... + https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/dapr/dapr.proto + https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/daprclient/daprclient.proto + ... + + ... + +``` diff --git a/pom.xml b/pom.xml index 42d8ff8945..781817bd06 100644 --- a/pom.xml +++ b/pom.xml @@ -17,8 +17,8 @@ 1.25.0 3.11.0 3.10.0 - https://raw.githubusercontent.com/dapr/dapr/master/pkg/proto/dapr/dapr.proto - https://raw.githubusercontent.com/dapr/dapr/master/pkg/proto/daprclient/daprclient.proto + https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/dapr/dapr.proto + https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/daprclient/daprclient.proto 1.6.2 3.1.1 1.8 diff --git a/sdk-autogen/pom.xml b/sdk-autogen/pom.xml index 56fbf91f2a..ef9dd88fcc 100644 --- a/sdk-autogen/pom.xml +++ b/sdk-autogen/pom.xml @@ -18,7 +18,7 @@ ${project.build.directory}/generated-sources - ${project.parent.basedir}/proto + ${project.build.directory}/proto false From 4fe709bb9a843c6cdaa8f15e177a0e1a1f707d4f Mon Sep 17 00:00:00 2001 From: Artur Souza Date: Thu, 13 Feb 2020 12:38:43 -0800 Subject: [PATCH 3/3] Changing proto URLs to use v0.4.0 --- README.md | 4 ++-- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 284bfb67c1..2c23abf4cd 100644 --- a/README.md +++ b/README.md @@ -242,8 +242,8 @@ Change the properties below in [pom.xml](./pom.xml) to point to the desired refe ... ... - https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/dapr/dapr.proto - https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/daprclient/daprclient.proto + https://raw.githubusercontent.com/dapr/dapr/v0.4.0/pkg/proto/dapr/dapr.proto + https://raw.githubusercontent.com/dapr/dapr/v0.4.0/pkg/proto/daprclient/daprclient.proto ... ... diff --git a/pom.xml b/pom.xml index 19bd65ea4a..6c463d7a85 100644 --- a/pom.xml +++ b/pom.xml @@ -17,8 +17,8 @@ 1.25.0 3.11.0 3.10.0 - https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/dapr/dapr.proto - https://raw.githubusercontent.com/dapr/dapr/e540a7166aeaf115773ccc4c7a1056ae7eed073b/pkg/proto/daprclient/daprclient.proto + https://raw.githubusercontent.com/dapr/dapr/v0.4.0/pkg/proto/dapr/dapr.proto + https://raw.githubusercontent.com/dapr/dapr/v0.4.0/pkg/proto/daprclient/daprclient.proto 1.6.2 3.1.1 1.8