Skip to content

Commit 0f66faa

Browse files
authored
fix: revert "feat: epmdless deployments (#167)" (#180)
This reverts commit 9cfb5cc.
1 parent 78236ef commit 0f66faa

File tree

4 files changed

+23
-66
lines changed

4 files changed

+23
-66
lines changed

apps/expert/lib/expert/engine_node.ex

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,17 @@ defmodule Expert.EngineNode do
2929

3030
def start(%__MODULE__{} = state, paths, from) do
3131
this_node = inspect(Node.self())
32-
dist_port = Expert.EPMD.dist_port()
33-
34-
args =
35-
[
36-
"--erl",
37-
"-start_epmd false -erl_epmd_port #{dist_port} -dist_listen false",
38-
"--name",
39-
Project.node_name(state.project),
40-
"--cookie",
41-
state.cookie,
42-
"--no-halt",
43-
"-e",
44-
"Node.connect(#{this_node}); IO.puts(\"ok\")"
45-
| path_append_arguments(paths)
46-
]
32+
33+
args = [
34+
"--name",
35+
Project.node_name(state.project),
36+
"--cookie",
37+
state.cookie,
38+
"--no-halt",
39+
"-e",
40+
"Node.connect(#{this_node})"
41+
| path_append_arguments(paths)
42+
]
4743

4844
case Expert.Port.open_elixir(state.project, args: args) do
4945
{:error, :no_elixir, message} ->
@@ -121,6 +117,7 @@ defmodule Expert.EngineNode do
121117
use GenServer
122118

123119
def start(project) do
120+
:ok = ensure_epmd_started()
124121
start_net_kernel(project)
125122

126123
node_name = Project.node_name(project)
@@ -144,6 +141,16 @@ defmodule Expert.EngineNode do
144141
:rpc.call(node, Engine, :ensure_apps_started, [])
145142
end
146143

144+
defp ensure_epmd_started do
145+
case System.cmd("epmd", ~w(-daemon)) do
146+
{"", 0} ->
147+
:ok
148+
149+
_ ->
150+
{:error, :epmd_failed}
151+
end
152+
end
153+
147154
if Mix.env() == :test do
148155
# In test environment, Expert depends on the Engine app, so we look for it
149156
# in the expert build path.
@@ -284,7 +291,7 @@ defmodule Expert.EngineNode do
284291

285292
@impl true
286293
def handle_call({:start, paths}, from, %State{} = state) do
287-
:ok = :net_kernel.monitor_nodes(true, node_type: :all)
294+
:ok = :net_kernel.monitor_nodes(true, node_type: :visible)
288295
Process.send_after(self(), :maybe_start_timeout, @start_timeout)
289296

290297
case State.start(state, paths, from) do

apps/expert/lib/expert/epmd.ex

Lines changed: 0 additions & 26 deletions
This file was deleted.

apps/expert/rel/remote.vm.args.eex

Lines changed: 0 additions & 12 deletions
This file was deleted.

apps/expert/rel/vm.args.eex

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)