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

Use the new deployments orchestrator by default #1922

Merged
merged 2 commits into from
Feb 26, 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
5 changes: 4 additions & 1 deletion lib/nerves_hub/deployments/deployment.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ defmodule NervesHub.Deployments.Deployment do
field(:device_count, :integer, virtual: true)

# temporary addition while we feature test a new deployment management strategy
field(:orchestrator_strategy, Ecto.Enum, values: [:multi, :distributed], default: :multi)
field(:orchestrator_strategy, Ecto.Enum,
values: [:multi, :distributed],
default: :distributed
)

timestamps()
end
Expand Down
4 changes: 3 additions & 1 deletion lib/nerves_hub/deployments/distributed/orchestrator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ defmodule NervesHub.Deployments.Distributed.Orchestrator do
def start_orchestrator(
%Deployment{is_active: true, orchestrator_strategy: :distributed} = deployment
) do
ProcessHub.start_child(:deployment_orchestrators, child_spec(deployment))
if Application.get_env(:nerves_hub, :deploy_env) != "test" do
ProcessHub.start_child(:deployment_orchestrators, child_spec(deployment))
end
end

def start_orchestrator(_) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ defmodule NervesHub.Repo.Migrations.SetDefaultDeploymentOrchestratorStrategy do
alias NervesHub.Repo

def change do
Repo.update_all(Deployment, set: [orchestrator_strategy: "multi"])
Repo.update_all(Deployment, set: [orchestrator_strategy: "distributed"])
end
end
2 changes: 1 addition & 1 deletion test/nerves_hub_web/channels/websocket_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule NervesHubWeb.WebsocketTest do
alias NervesHub.AuditLogs
alias NervesHub.AuditLogs.AuditLog
alias NervesHub.Deployments
alias NervesHub.Deployments.Orchestrator
alias NervesHub.Deployments.Distributed.Orchestrator
alias NervesHub.Devices
alias NervesHub.Devices.Connections
alias NervesHub.Devices.Device
Expand Down
Loading