Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
494f877
Start wip to reflect user function grpc server
sleipnir Mar 14, 2021
725ecb7
Add required false to use defaults if no value passed
sleipnir Mar 14, 2021
cb9055f
Refactor. Extract function
sleipnir Mar 14, 2021
4bdc3e2
Refactor
sleipnir Mar 17, 2021
b15eb54
Fix. Typo in world
sleipnir Mar 17, 2021
4a1bee9
Minor changes
sleipnir Mar 17, 2021
8f8ad9b
Update massa_proxy/apps/massa_proxy/lib/discovery/manager.ex
sleipnir Mar 17, 2021
b6f48e9
Add gRPC reflection server module
sleipnir Mar 17, 2021
d8ab7fe
Merge branch 'wip/expose-userfunc-grpc-contract' of https://github.co…
sleipnir Mar 17, 2021
d819720
Add Endpoint and Grpc server template
sleipnir Mar 17, 2021
6049307
Fix templating
sleipnir Mar 17, 2021
148f9f0
Template adjusts
sleipnir Mar 17, 2021
e3d93b4
Include more googleapis protos
sleipnir Mar 18, 2021
6db49b7
Add reflection stub
sleipnir Mar 18, 2021
a03e074
Add pre processing steps
sleipnir Mar 18, 2021
763f03a
Add credo static code analysis
sleipnir Mar 18, 2021
06cbe40
Fix. moduledoc
sleipnir Mar 18, 2021
daca686
Fix
sleipnir Mar 18, 2021
080b5ef
Feat. Generate gRPC server code
sleipnir Mar 23, 2021
8ab366d
Terrible code but works \0/
sleipnir Mar 24, 2021
f4578ed
Refactor. Minor changes
sleipnir Mar 24, 2021
3fee50b
Refactor. Rename modules
sleipnir Mar 24, 2021
67b33f4
Fix. Rename state handoff module
sleipnir Mar 24, 2021
892616f
Fix. deprecated property
sleipnir Mar 24, 2021
320c3ab
Feat. Implemented gRPC Server
sleipnir Mar 24, 2021
9089433
Refactor. Minor changes
sleipnir Mar 24, 2021
bd9b4a1
Refactor. Log about startup time
sleipnir Mar 24, 2021
f0c56a7
Add complete on grpc server implementation
sleipnir Mar 24, 2021
3218208
Merge remote-tracking branch 'upstream/master' into wip/expose-userfu…
sleipnir Mar 24, 2021
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
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Massa is a Massive Serverless Systems Architecture.

Relax this is just an internal joke. The name Massa is due to a river near the Eigr mountain in Switzerland.

Now seriously Massa is just a [CloudState](https://github.com/cloudstateio/cloudstate) proxy implementation
Now seriously Massa is just [CloudState](https://github.com/cloudstateio/cloudstate) proxy implementation build on top of BEAM/Elixir

## Overview

Expand All @@ -21,41 +21,29 @@ Massa takes advantage of Elixir's simplicity and elegance, mainly because we kno
- [ ] KV
- [x] Cluster transparent
- [x] Discovery Support
- [ ] Eventing:
- [ ] Apache Kafka
- [ ] Amazon SQS
- [ ] Event Log
- [ ] Google Cloud Pub/Sub
- [ ] RabbitMQ
- [ ] Redis
- [ ] Interoperability with Cloudstate reference implementation
- [ ] Eventing
- [x] Interoperability with Cloudstate reference implementation
- [ ] Metadata Support
- [x] Observability:
- [x] Health Checks
- [x] Metrics
- [x] Open Tracing
- [ ] State Store:
- [ ] Cassandra
- [ ] In Memory
- [ ] Mnesia
- [ ] Cassandra
- [ ] MongoDB
- [ ] MSSQL
- [ ] MySql
- [ ] Postgres
- [ ] Redis
- [ ] Riak
- [ ] TCK
- [x] Transports and Protocols
- [x] GRPC
- [x] Client TCP
- [x] Client Unix Domain Sockets
- [ ] Reflection
- [ ] Server TCP
- [ ] HTTP
- [ ] Grpc-Web
- [ ] SSE
- [ ] Websockets
- [x] Very Fast
- [x] Server TCP
- [ ] HTTP

## Main Concepts

Expand Down
7 changes: 6 additions & 1 deletion massa_proxy/apps/massa_proxy/compile-pb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ set -o pipefail

# CloudState Protocol

protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/annotations.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/proxy/ priv/protos/proxy/grpc/reflection/v1alpha/reflection.proto

protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/http.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/annotations.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/httpbody.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/auth.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/google/api/source_info.proto

protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/frontend/ priv/protos/frontend/cloudstate/entity_key.proto
protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib --proto_path=priv/protos/protocol/ priv/protos/protocol/cloudstate/entity.proto
Expand Down
181 changes: 181 additions & 0 deletions massa_proxy/apps/massa_proxy/lib/google/api/auth.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
defmodule Google.Api.Authentication do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
rules: [Google.Api.AuthenticationRule.t()],
providers: [Google.Api.AuthProvider.t()]
}

defstruct [:rules, :providers]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 14, 65, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110, 18, 52, 10, 5,
114, 117, 108, 101, 115, 24, 3, 32, 3, 40, 11, 50, 30, 46, 103, 111, 111, 103, 108, 101,
46, 97, 112, 105, 46, 65, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110,
82, 117, 108, 101, 82, 5, 114, 117, 108, 101, 115, 18, 54, 10, 9, 112, 114, 111, 118, 105,
100, 101, 114, 115, 24, 4, 32, 3, 40, 11, 50, 24, 46, 103, 111, 111, 103, 108, 101, 46,
97, 112, 105, 46, 65, 117, 116, 104, 80, 114, 111, 118, 105, 100, 101, 114, 82, 9, 112,
114, 111, 118, 105, 100, 101, 114, 115>>
)
end

field(:rules, 3, repeated: true, type: Google.Api.AuthenticationRule)
field(:providers, 4, repeated: true, type: Google.Api.AuthProvider)
end

defmodule Google.Api.AuthenticationRule do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
selector: String.t(),
oauth: Google.Api.OAuthRequirements.t() | nil,
allow_without_credential: boolean,
requirements: [Google.Api.AuthRequirement.t()]
}

defstruct [:selector, :oauth, :allow_without_credential, :requirements]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 18, 65, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 105, 111, 110, 82, 117, 108,
101, 18, 26, 10, 8, 115, 101, 108, 101, 99, 116, 111, 114, 24, 1, 32, 1, 40, 9, 82, 8,
115, 101, 108, 101, 99, 116, 111, 114, 18, 51, 10, 5, 111, 97, 117, 116, 104, 24, 2, 32,
1, 40, 11, 50, 29, 46, 103, 111, 111, 103, 108, 101, 46, 97, 112, 105, 46, 79, 65, 117,
116, 104, 82, 101, 113, 117, 105, 114, 101, 109, 101, 110, 116, 115, 82, 5, 111, 97, 117,
116, 104, 18, 56, 10, 24, 97, 108, 108, 111, 119, 95, 119, 105, 116, 104, 111, 117, 116,
95, 99, 114, 101, 100, 101, 110, 116, 105, 97, 108, 24, 5, 32, 1, 40, 8, 82, 22, 97, 108,
108, 111, 119, 87, 105, 116, 104, 111, 117, 116, 67, 114, 101, 100, 101, 110, 116, 105,
97, 108, 18, 63, 10, 12, 114, 101, 113, 117, 105, 114, 101, 109, 101, 110, 116, 115, 24,
7, 32, 3, 40, 11, 50, 27, 46, 103, 111, 111, 103, 108, 101, 46, 97, 112, 105, 46, 65, 117,
116, 104, 82, 101, 113, 117, 105, 114, 101, 109, 101, 110, 116, 82, 12, 114, 101, 113,
117, 105, 114, 101, 109, 101, 110, 116, 115>>
)
end

field(:selector, 1, type: :string)
field(:oauth, 2, type: Google.Api.OAuthRequirements)
field(:allow_without_credential, 5, type: :bool)
field(:requirements, 7, repeated: true, type: Google.Api.AuthRequirement)
end

defmodule Google.Api.JwtLocation do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
in: {atom, any},
value_prefix: String.t()
}

defstruct [:in, :value_prefix]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 11, 74, 119, 116, 76, 111, 99, 97, 116, 105, 111, 110, 18, 24, 10, 6, 104, 101, 97,
100, 101, 114, 24, 1, 32, 1, 40, 9, 72, 0, 82, 6, 104, 101, 97, 100, 101, 114, 18, 22, 10,
5, 113, 117, 101, 114, 121, 24, 2, 32, 1, 40, 9, 72, 0, 82, 5, 113, 117, 101, 114, 121,
18, 33, 10, 12, 118, 97, 108, 117, 101, 95, 112, 114, 101, 102, 105, 120, 24, 3, 32, 1,
40, 9, 82, 11, 118, 97, 108, 117, 101, 80, 114, 101, 102, 105, 120, 66, 4, 10, 2, 105,
110>>
)
end

oneof(:in, 0)
field(:header, 1, type: :string, oneof: 0)
field(:query, 2, type: :string, oneof: 0)
field(:value_prefix, 3, type: :string)
end

defmodule Google.Api.AuthProvider do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
id: String.t(),
issuer: String.t(),
jwks_uri: String.t(),
audiences: String.t(),
authorization_url: String.t(),
jwt_locations: [Google.Api.JwtLocation.t()]
}

defstruct [:id, :issuer, :jwks_uri, :audiences, :authorization_url, :jwt_locations]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 12, 65, 117, 116, 104, 80, 114, 111, 118, 105, 100, 101, 114, 18, 14, 10, 2, 105, 100,
24, 1, 32, 1, 40, 9, 82, 2, 105, 100, 18, 22, 10, 6, 105, 115, 115, 117, 101, 114, 24, 2,
32, 1, 40, 9, 82, 6, 105, 115, 115, 117, 101, 114, 18, 25, 10, 8, 106, 119, 107, 115, 95,
117, 114, 105, 24, 3, 32, 1, 40, 9, 82, 7, 106, 119, 107, 115, 85, 114, 105, 18, 28, 10,
9, 97, 117, 100, 105, 101, 110, 99, 101, 115, 24, 4, 32, 1, 40, 9, 82, 9, 97, 117, 100,
105, 101, 110, 99, 101, 115, 18, 43, 10, 17, 97, 117, 116, 104, 111, 114, 105, 122, 97,
116, 105, 111, 110, 95, 117, 114, 108, 24, 5, 32, 1, 40, 9, 82, 16, 97, 117, 116, 104,
111, 114, 105, 122, 97, 116, 105, 111, 110, 85, 114, 108, 18, 60, 10, 13, 106, 119, 116,
95, 108, 111, 99, 97, 116, 105, 111, 110, 115, 24, 6, 32, 3, 40, 11, 50, 23, 46, 103, 111,
111, 103, 108, 101, 46, 97, 112, 105, 46, 74, 119, 116, 76, 111, 99, 97, 116, 105, 111,
110, 82, 12, 106, 119, 116, 76, 111, 99, 97, 116, 105, 111, 110, 115>>
)
end

field(:id, 1, type: :string)
field(:issuer, 2, type: :string)
field(:jwks_uri, 3, type: :string)
field(:audiences, 4, type: :string)
field(:authorization_url, 5, type: :string)
field(:jwt_locations, 6, repeated: true, type: Google.Api.JwtLocation)
end

defmodule Google.Api.OAuthRequirements do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
canonical_scopes: String.t()
}

defstruct [:canonical_scopes]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 17, 79, 65, 117, 116, 104, 82, 101, 113, 117, 105, 114, 101, 109, 101, 110, 116, 115,
18, 41, 10, 16, 99, 97, 110, 111, 110, 105, 99, 97, 108, 95, 115, 99, 111, 112, 101, 115,
24, 1, 32, 1, 40, 9, 82, 15, 99, 97, 110, 111, 110, 105, 99, 97, 108, 83, 99, 111, 112,
101, 115>>
)
end

field(:canonical_scopes, 1, type: :string)
end

defmodule Google.Api.AuthRequirement do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
provider_id: String.t(),
audiences: String.t()
}

defstruct [:provider_id, :audiences]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 15, 65, 117, 116, 104, 82, 101, 113, 117, 105, 114, 101, 109, 101, 110, 116, 18, 31,
10, 11, 112, 114, 111, 118, 105, 100, 101, 114, 95, 105, 100, 24, 1, 32, 1, 40, 9, 82, 10,
112, 114, 111, 118, 105, 100, 101, 114, 73, 100, 18, 28, 10, 9, 97, 117, 100, 105, 101,
110, 99, 101, 115, 24, 2, 32, 1, 40, 9, 82, 9, 97, 117, 100, 105, 101, 110, 99, 101, 115>>
)
end

field(:provider_id, 1, type: :string)
field(:audiences, 2, type: :string)
end
28 changes: 28 additions & 0 deletions massa_proxy/apps/massa_proxy/lib/google/api/httpbody.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
defmodule Google.Api.HttpBody do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
content_type: String.t(),
data: binary,
extensions: [Google.Protobuf.Any.t()]
}

defstruct [:content_type, :data, :extensions]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 8, 72, 116, 116, 112, 66, 111, 100, 121, 18, 33, 10, 12, 99, 111, 110, 116, 101, 110,
116, 95, 116, 121, 112, 101, 24, 1, 32, 1, 40, 9, 82, 11, 99, 111, 110, 116, 101, 110,
116, 84, 121, 112, 101, 18, 18, 10, 4, 100, 97, 116, 97, 24, 2, 32, 1, 40, 12, 82, 4, 100,
97, 116, 97, 18, 52, 10, 10, 101, 120, 116, 101, 110, 115, 105, 111, 110, 115, 24, 3, 32,
3, 40, 11, 50, 20, 46, 103, 111, 111, 103, 108, 101, 46, 112, 114, 111, 116, 111, 98, 117,
102, 46, 65, 110, 121, 82, 10, 101, 120, 116, 101, 110, 115, 105, 111, 110, 115>>
)
end

field(:content_type, 1, type: :string)
field(:data, 2, type: :bytes)
field(:extensions, 3, repeated: true, type: Google.Protobuf.Any)
end
22 changes: 22 additions & 0 deletions massa_proxy/apps/massa_proxy/lib/google/api/source_info.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
defmodule Google.Api.SourceInfo do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
source_files: [Google.Protobuf.Any.t()]
}

defstruct [:source_files]

def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.DescriptorProto.decode(
<<10, 10, 83, 111, 117, 114, 99, 101, 73, 110, 102, 111, 18, 55, 10, 12, 115, 111, 117, 114,
99, 101, 95, 102, 105, 108, 101, 115, 24, 1, 32, 3, 40, 11, 50, 20, 46, 103, 111, 111,
103, 108, 101, 46, 112, 114, 111, 116, 111, 98, 117, 102, 46, 65, 110, 121, 82, 11, 115,
111, 117, 114, 99, 101, 70, 105, 108, 101, 115>>
)
end

field(:source_files, 1, repeated: true, type: Google.Protobuf.Any)
end
Loading