Skip to content

Commit

Permalink
feat: Add max_restarts to all services to avoid restarting indefini…
Browse files Browse the repository at this point in the history
…tely (#311)

resolves #309
  • Loading branch information
shivaraj-bh authored Sep 4, 2024
1 parent 113f8cb commit e88a852
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 19 deletions.
5 changes: 4 additions & 1 deletion nix/services/apache-kafka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ with lib;
failure_threshold = 5;
};

availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/cassandra.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/clickhouse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ in
};
depends_on."${name}-init".condition = "process_completed_successfully";
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/elasticsearch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/grafana.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/mysql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
"${name}-configure" = {
command = configureScript;
Expand Down
5 changes: 4 additions & 1 deletion nix/services/nginx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ in
failure_threshold = 5;
};
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/ollama.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ in
success_threshold = 1;
failure_threshold = 5;
};
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};

"${name}-models" = {
Expand Down
5 changes: 4 additions & 1 deletion nix/services/open-webui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ in
success_threshold = 1;
failure_threshold = 5;
};
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/pgadmin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ in
};
depends_on."${name}-init".condition = "process_completed_successfully";
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/postgres/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ in
};
depends_on."${name}-init".condition = "process_completed_successfully";
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/prometheus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/redis-cluster.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
hosts = lib.mapAttrsToList (_: cfg: "${config.bind}:${builtins.toString cfg.port}") config.nodes;
clusterCreateScript = pkgs.writeShellApplication {
Expand Down
5 changes: 4 additions & 1 deletion nix/services/redis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/searxng.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ in
)}";
};
command = lib.getExe config.package;
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
readiness_probe = {
http_get = {
host = config.host;
Expand Down
5 changes: 4 additions & 1 deletion nix/services/tempo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ in
success_threshold = 1;
failure_threshold = 5;
};
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/tika.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ in
in
{
command = "${lib.getExe tikaPackage} --host ${config.host} --port ${toString config.port} ${lib.optionalString (config.configFile != null) "--config ${config.configFile}"}";
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
readiness_probe = {
http_get = {
host = config.host;
Expand Down
5 changes: 4 additions & 1 deletion nix/services/weaviate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ in
};

# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion nix/services/zookeeper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ with lib;
failure_threshold = 5;
};

availability.restart = "on_failure";
availability = {
restart = "on_failure";
max_restarts = 5;
};
};
};
};
Expand Down

0 comments on commit e88a852

Please sign in to comment.