diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index d0978c49..790f70ed 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -88,16 +88,16 @@ defmodule Sidecar.GRPC.CodeGenerator do svcs = :persistent_term.get(:proto_file_descriptors, []) current_services = :persistent_term.get(:grpc_services, []) - dispatchers = - current_services - |> Enum.reduce("", fn svc, acc -> "#{svc}.ActorDispatcher,\n#{acc}" end) - - reflections = - current_services - |> Enum.reduce("", fn svc, acc -> "#{svc}.Service,\n#{acc}" end) - - compile_proxy_endpoint(dispatchers) - compile_reflections(reflections) + # dispatchers = + # current_services + # |> Enum.reduce("", fn svc, acc -> "#{svc}.ActorDispatcher,\n#{acc}" end) + # + # reflections = + # current_services + # |> Enum.reduce("", fn svc, acc -> "#{svc}.Service,\n#{acc}" end) + + # compile_proxy_endpoint(dispatchers) + # compile_reflections(reflections) put_actor_definition_settings(svcs) :persistent_term.erase(:proto_file_descriptors) diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index 13cf0310..f33b44eb 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -46,7 +46,7 @@ defmodule Sidecar.GRPC.Supervisor do defp maybe_start_reflection(children, true) do Logger.info("Starting gRPC Reflection...") - (children ++ [{GrpcReflection, []}]) |> List.flatten() + children |> List.flatten() end defp maybe_start_grpc_server(children, false), do: children @@ -55,11 +55,12 @@ defmodule Sidecar.GRPC.Supervisor do port = Config.get(:grpc_port) Logger.debug("Starting gRPC Server on port #{inspect(port)}...") - (children ++ - [ - {GRPC.Server.Supervisor, - endpoint: Sidecar.GRPC.ProxyEndpoint, port: port, start_server: true} - ]) + # ++ + children + # [ + # {GRPC.Server.Supervisor, + # endpoint: Sidecar.GRPC.ProxyEndpoint, port: port, start_server: true} + # ]) |> List.flatten() end diff --git a/lib/spawn/cluster/cluster_resolver.ex b/lib/spawn/cluster/cluster_resolver.ex index 9b6fcc7b..0f27c96d 100644 --- a/lib/spawn/cluster/cluster_resolver.ex +++ b/lib/spawn/cluster/cluster_resolver.ex @@ -89,7 +89,7 @@ defmodule Spawn.Cluster.ClusterResolver do IO.inspect(app_name, label: "Using application name ---------------------") IO.inspect(service, label: "Using service ---------------------") - IO.inspect(resolver, label: "Using resolver ---------------------") + IO.inspect(resolver, label: "Using resolver ---------------------") IO.inspect(Node.get_cookie(), label: "Using node cookie ---------------------") cond do diff --git a/mix.exs b/mix.exs index 4ea5c19b..d337e5e5 100644 --- a/mix.exs +++ b/mix.exs @@ -78,7 +78,6 @@ defmodule Spawn.MixProject do {:protobuf, "~> 0.14"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.8"}, - {:grpc_reflection, "~> 0.1"}, {:finch, "~> 0.18"}, {:flame_k8s_backend, "~> 0.5"}, {:retry, "~> 0.17"}, @@ -106,12 +105,9 @@ defmodule Spawn.MixProject do {:opentelemetry_ecto, "~> 1.2"}, {:opentelemetry_exporter, "~> 1.0"}, # Statestores deps - {:spawn_statestores_mariadb, - path: "./spawn_statestores/statestores_mariadb", optional: false}, - {:spawn_statestores_postgres, - path: "./spawn_statestores/statestores_postgres", optional: false}, - {:spawn_statestores_native, - path: "./spawn_statestores/statestores_native", optional: false}, + {:spawn_statestores_mariadb, "2.0.0-RC9", optional: true}, + {:spawn_statestores_postgres, "2.0.0-RC9", optional: true}, + {:spawn_statestores_native, "2.0.0-RC9", optional: true}, {:pluggable, "~> 1.0"}, # Non runtime deps {:credo, "~> 1.6", only: [:dev, :test], runtime: false}, diff --git a/mix.lock b/mix.lock index 324b9dea..77155794 100644 --- a/mix.lock +++ b/mix.lock @@ -35,10 +35,8 @@ "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.9.1", "7fd16d40ba927cc88256fae2a8a96089d4e017f3bf7fb83e2e6f5093893b7461", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e49eb63c2bbc57b099dd2a5ef602963d395fa2790968054ba9d24dd1390e0ab5"}, - "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.9.0", "1b930a57272d4356ea65969b984c2eb04f3dab81420e1e28f0e6ec04b8f88515", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7c059698248738fcf7ad551f1d78f4a3d2e0642a72a5834f2a0b0db4b9f3d2b5"}, - "grpc_reflection": {:hex, :grpc_reflection, "0.1.4", "0b3542801ff7078e53dc5dee3d79205f3b8d1fec391c6e890926a182f83d09e0", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "74a6148335305926b166a58c8e040f64501410d744be55ebe343a704003e994a"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, @@ -89,6 +87,10 @@ "salsa20": {:hex, :salsa20, "1.0.4", "404cbea1fa8e68a41bcc834c0a2571ac175580fec01cc38cc70c0fb9ffc87e9b", [:mix], [], "hexpm", "745ddcd8cfa563ddb0fd61e7ce48d5146279a2cf7834e1da8441b369fdc58ac6"}, "shards": {:hex, :shards, "1.1.1", "8b42323457d185b26b15d05187784ce6c5d1e181b35c46fca36c45f661defe02", [:make, :rebar3], [], "hexpm", "169a045dae6668cda15fbf86d31bf433d0dbbaec42c8c23ca4f8f2d405ea8eda"}, "sobelow": {:hex, :sobelow, "0.13.0", "218afe9075904793f5c64b8837cc356e493d88fddde126a463839351870b8d1e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cd6e9026b85fc35d7529da14f95e85a078d9dd1907a9097b3ba6ac7ebbe34a0d"}, + "spawn_statestores": {:hex, :spawn_statestores, "2.0.0-RC9", "426206b79aa855fb5a696afdc72708e63be07a99dcc01a43cfd5ede82f8aaaa5", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:cloak_ecto, "~> 1.2", [hex: :cloak_ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.14", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "fc3277e9f3c2135c843382e2df0180881edb4301783f71ab3d4b28a6be18ec64"}, + "spawn_statestores_mariadb": {:hex, :spawn_statestores_mariadb, "2.0.0-RC9", "ac426e191ec4f1dad5d1583902779ab58014af2ad0f316b480be6851dd192311", [:mix], [{:cloak_ecto, "~> 1.2", [hex: :cloak_ecto, repo: "hexpm", optional: false]}, {:ecto_mysql_extras, "~> 0.6.3", [hex: :ecto_mysql_extras, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6", [hex: :myxql, repo: "hexpm", optional: false]}, {:spawn_statestores, "2.0.0-RC9", [hex: :spawn_statestores, repo: "hexpm", optional: false]}], "hexpm", "34a3f93b1edff1c069d2cff0571b964428a628e44fae1b1bae06781728e65d9e"}, + "spawn_statestores_native": {:hex, :spawn_statestores_native, "2.0.0-RC9", "92fa03eb0dcd6648551e3de66118302c92d775a3d90881fb2179cc4b00441eac", [:mix], [{:mnesiac, "~> 0.3", [hex: :mnesiac, repo: "hexpm", optional: false]}, {:spawn_statestores, "2.0.0-RC9", [hex: :spawn_statestores, repo: "hexpm", optional: false]}], "hexpm", "784c4b5f69f7fed5396a8806a4bfb3bbb06e5417cb49f059f7b0f2cbbd747b8e"}, + "spawn_statestores_postgres": {:hex, :spawn_statestores_postgres, "2.0.0-RC9", "13f9db8f6d3fcc756ac92c5e7f93ad8be269ca95370e6bd474bfc0fcd55bbe2d", [:mix], [{:cloak_ecto, "~> 1.2", [hex: :cloak_ecto, repo: "hexpm", optional: false]}, {:ecto_psql_extras, "~> 0.8", [hex: :ecto_psql_extras, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.12", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.17", [hex: :postgrex, repo: "hexpm", optional: false]}, {:spawn_statestores, "2.0.0-RC9", [hex: :spawn_statestores, repo: "hexpm", optional: false]}], "hexpm", "0c7a02576a419d1733aa6b3dcd38315b758696890a9492fd346234782451113d"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "table_rex": {:hex, :table_rex, "4.0.0", "3c613a68ebdc6d4d1e731bc973c233500974ec3993c99fcdabb210407b90959b", [:mix], [], "hexpm", "c35c4d5612ca49ebb0344ea10387da4d2afe278387d4019e4d8111e815df8f55"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, diff --git a/spawn_operator/spawn_operator/lib/spawn_operator/k8s_conn.ex b/spawn_operator/spawn_operator/lib/spawn_operator/k8s_conn.ex index b1c78661..3718e5f2 100644 --- a/spawn_operator/spawn_operator/lib/spawn_operator/k8s_conn.ex +++ b/spawn_operator/spawn_operator/lib/spawn_operator/k8s_conn.ex @@ -11,7 +11,7 @@ defmodule SpawnOperator.K8sConn do @spec get(atom()) :: K8s.Conn.t() def get(:dev) do - {:ok, conn} = K8s.Conn.from_file("~/.kube/config", context: "minikube") + {:ok, conn} = K8s.Conn.from_file("~/.kube/config", context: "k3d-k3s-default") struct!(conn, insecure_skip_tls_verify: true) end diff --git a/spawn_sdk/spawn_sdk/test/actor/actor_test.exs b/spawn_sdk/spawn_sdk/test/actor/actor_test.exs index 28ce8839..9c1ce6a7 100644 --- a/spawn_sdk/spawn_sdk/test/actor/actor_test.exs +++ b/spawn_sdk/spawn_sdk/test/actor/actor_test.exs @@ -420,14 +420,12 @@ defmodule Actor.ActorTest do dynamic_actor_name = "#{inspect(make_ref())}" <> "simple_error" - assert {:ok, response} = + assert {:error, _response} = SpawnSdk.invoke(dynamic_actor_name, ref: "my_actor_ref", system: system, action: "test_error" ) - - assert {:error, _} = response end test "simple call that goes through 3 actors piping each other", ctx do