Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added clustering for spawn monitor #415

Merged
merged 16 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ test-sdk:
elixir --name [email protected] -S mix test

test-operator:
cd spawn_operator/spawn_operator && MIX_ENV=test mix deps.get && MIX_ENV=test PROXY_DATABASE_TYPE=mysql PROXY_CLUSTER_STRATEGY=gossip PROXY_HTTP_PORT=9005 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= elixir --name [email protected] -S mix test
cd spawn_operator/spawn_operator && MIX_ENV=test mix deps.get && MIX_ENV=test PROXY_DATABASE_TYPE=mariadb PROXY_CLUSTER_STRATEGY=gossip PROXY_HTTP_PORT=9005 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= elixir --name [email protected] -S mix test

test-proxy:
cd spawn_proxy/proxy && MIX_ENV=test mix deps.get && MIX_ENV=test SPAWN_PROXY_LOGGER_LEVEL=debug PROXY_DATABASE_TYPE=mariadb PROXY_DATABASE_PORT=3307 PROXY_CLUSTER_STRATEGY=gossip PROXY_HTTP_PORT=9005 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= elixir --name [email protected] -S mix test
Expand Down Expand Up @@ -227,7 +227,7 @@ integration.yaml: ## Create a k3d cluster
test.integration: integration.yaml

test.integration: ## Run integration tests using k3d `make cluster`
cd spawn_operator/spawn_operator && PROXY_CLUSTER_STRATEGY=gossip PROXY_DATABASE_TYPE=mysql PROXY_DATABASE_POOL_SIZE=10 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= TEST_KUBECONFIG=${K3D_KUBECONFIG_PATH} mix test --only integration
cd spawn_operator/spawn_operator && PROXY_CLUSTER_STRATEGY=gossip PROXY_DATABASE_TYPE=mariadb PROXY_DATABASE_POOL_SIZE=10 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= TEST_KUBECONFIG=${K3D_KUBECONFIG_PATH} mix test --only integration

run-benchmark:
cd spawn_sdk/spawn_sdk_example && \
Expand Down Expand Up @@ -427,7 +427,7 @@ run-activator-sqs-local:

run-proxy-image:
docker run --rm --name=spawn-proxy \
-e PROXY_DATABASE_TYPE=mysql \
-e PROXY_DATABASE_TYPE=mariadb \
-e SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= \
--net=host ${proxy-image}

Expand Down
8 changes: 5 additions & 3 deletions lib/_generated/io/cloudevents/v1/spec.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Io.Cloudevents.V1.CloudEvent.AttributesEntry do
@moduledoc false
use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -46,6 +46,7 @@ defmodule Io.Cloudevents.V1.CloudEvent.AttributesEntry do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand All @@ -63,7 +64,7 @@ end

defmodule Io.Cloudevents.V1.CloudEvent.CloudEventAttributeValue do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -196,7 +197,7 @@ end

defmodule Io.Cloudevents.V1.CloudEvent do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -359,6 +360,7 @@ defmodule Io.Cloudevents.V1.CloudEvent do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand Down
46 changes: 26 additions & 20 deletions lib/_generated/spawn/actors/actor.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Spawn.Actors.Kind do
@moduledoc false
use Protobuf, enum: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -68,7 +68,7 @@ end

defmodule Spawn.Actors.Registry.ActorsEntry do
@moduledoc false
use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -114,6 +114,7 @@ defmodule Spawn.Actors.Registry.ActorsEntry do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand All @@ -131,7 +132,7 @@ end

defmodule Spawn.Actors.Registry do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -196,6 +197,7 @@ defmodule Spawn.Actors.Registry do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand All @@ -222,7 +224,7 @@ end

defmodule Spawn.Actors.ActorSystem do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -276,7 +278,7 @@ end

defmodule Spawn.Actors.ActorSnapshotStrategy do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -323,7 +325,7 @@ end

defmodule Spawn.Actors.ActorDeactivationStrategy do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -370,7 +372,7 @@ end

defmodule Spawn.Actors.TimeoutStrategy do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -409,7 +411,7 @@ end

defmodule Spawn.Actors.Action do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -448,7 +450,7 @@ end

defmodule Spawn.Actors.FixedTimerAction do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -502,7 +504,7 @@ end

defmodule Spawn.Actors.ActorState.TagsEntry do
@moduledoc false
use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -548,6 +550,7 @@ defmodule Spawn.Actors.ActorState.TagsEntry do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand All @@ -565,7 +568,7 @@ end

defmodule Spawn.Actors.ActorState do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -644,6 +647,7 @@ defmodule Spawn.Actors.ActorState do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand Down Expand Up @@ -671,7 +675,7 @@ end

defmodule Spawn.Actors.Metadata.TagsEntry do
@moduledoc false
use Protobuf, map: true, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -717,6 +721,7 @@ defmodule Spawn.Actors.Metadata.TagsEntry do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand All @@ -734,7 +739,7 @@ end

defmodule Spawn.Actors.Metadata do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -813,6 +818,7 @@ defmodule Spawn.Actors.Metadata do
deprecated: false,
map_entry: true,
deprecated_legacy_json_field_conflicts: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand Down Expand Up @@ -840,7 +846,7 @@ end

defmodule Spawn.Actors.Channel do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -894,7 +900,7 @@ end

defmodule Spawn.Actors.ProjectionSubject do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -978,7 +984,7 @@ end

defmodule Spawn.Actors.EventsRetentionStrategy do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -1040,7 +1046,7 @@ end

defmodule Spawn.Actors.ProjectionSettings do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -1129,7 +1135,7 @@ end

defmodule Spawn.Actors.ActorSettings do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -1287,7 +1293,7 @@ end

defmodule Spawn.Actors.ActorId do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -1356,7 +1362,7 @@ end

defmodule Spawn.Actors.Actor do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down
6 changes: 3 additions & 3 deletions lib/_generated/spawn/actors/extensions.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Spawn.Actors.PbExtension do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

extend(Google.Protobuf.FieldOptions, :actor_id, 9999,
optional: true,
Expand All @@ -23,7 +23,7 @@ end

defmodule Spawn.Actors.ActorOpts do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -187,7 +187,7 @@ end

defmodule Spawn.Actors.ActorViewOption do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down
12 changes: 8 additions & 4 deletions lib/_generated/spawn/actors/healthcheck.pb.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Spawn.Actors.Healthcheck.Status do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -69,7 +69,7 @@ end

defmodule Spawn.Actors.Healthcheck.HealthCheckReply do
@moduledoc false
use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -109,7 +109,7 @@ end
defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
use GRPC.Service,
name: "spawn.actors.healthcheck.HealthCheckActor",
protoc_gen_elixir_version: "0.13.0"
protoc_gen_elixir_version: "0.14.0"

def descriptor do
# credo:disable-for-next-line
Expand Down Expand Up @@ -220,6 +220,7 @@ defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
options: %Google.Protobuf.MethodOptions{
deprecated: false,
idempotency_level: :IDEMPOTENCY_UNKNOWN,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{
{Google.Api.PbExtension, :http} => %Google.Api.HttpRule{
Expand All @@ -244,6 +245,7 @@ defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
options: %Google.Protobuf.MethodOptions{
deprecated: false,
idempotency_level: :IDEMPOTENCY_UNKNOWN,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{
{Google.Api.PbExtension, :http} => %Google.Api.HttpRule{
Expand All @@ -264,6 +266,7 @@ defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
],
options: %Google.Protobuf.ServiceOptions{
deprecated: false,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{
{Spawn.Actors.PbExtension, :actor} => %Spawn.Actors.ActorOpts{
Expand Down Expand Up @@ -303,9 +306,9 @@ defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
swift_prefix: nil,
php_class_prefix: nil,
php_namespace: nil,
php_generic_services: false,
php_metadata_namespace: nil,
ruby_package: nil,
features: nil,
uninterpreted_option: [],
__pb_extensions__: %{},
__unknown_fields__: []
Expand Down Expand Up @@ -673,6 +676,7 @@ defmodule Spawn.Actors.Healthcheck.HealthCheckActor.Service do
__unknown_fields__: []
}
],
__pb_extensions__: %{},
__unknown_fields__: []
},
public_dependency: [],
Expand Down
Loading
Loading