-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapplication.ex
More file actions
46 lines (39 loc) · 1.36 KB
/
Copy pathapplication.ex
File metadata and controls
46 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
defmodule Ala.Application do
use Application
# start with:
# MIX_ENV=prod mix release
# _build/prod/rel/cns_app/bin/cns_app start
def start(_type, _args) do
# Shared infrastructure that must stay up no matter what a worker node does.
infra = [
{Task.Supervisor, name: Ala.TaskSupervisor},
{Registry, keys: :unique, name: Ala.AgentRegistry},
{DynamicSupervisor, name: Ala.NodeSupervisor, strategy: :one_for_one},
{MemoryBank, []},
{AnalysisNode, []},
{InteractiveSession, []}
]
# The agent/worker nodes run under their own supervisor with a more
# tolerant restart intensity. If one node crash-loops, only this
# sub-supervisor is torn down and restarted; the shared infrastructure
# above (TaskSupervisor, Registry, NodeSupervisor, MemoryBank) is untouched.
worker_nodes = [
{ImpulseNode, []},
{LearningNode, []},
{ScheduleNode, []},
{AdaptiveCodingNode, []},
{AdaptiveResearchNode, []},
{MasterAgent, []},
{ChatbotNode, []},
{AgentManager, []}
]
workers_sup = %{
id: Ala.WorkerNodesSupervisor,
type: :supervisor,
start: {Supervisor, :start_link, [worker_nodes, [strategy: :one_for_one, max_restarts: 15, max_seconds: 60, name: Ala.WorkerNodesSupervisor]]}
}
children = infra ++ [workers_sup]
IO.puts("ALA starting")
Supervisor.start_link(children, strategy: :one_for_one, name: Ala.Supervisor)
end
end