Namespaces (#57)

This commit is contained in:
Shivaraj B H 2023-10-04 22:50:59 +05:30 committed by GitHub
parent b3f9b375b4
commit b9ab7fb711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 11 deletions

View File

@ -70,11 +70,11 @@
},
"process-compose-flake": {
"locked": {
"lastModified": 1693927910,
"narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=",
"lastModified": 1695992918,
"narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=",
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255",
"rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da",
"type": "github"
},
"original": {

View File

@ -144,6 +144,7 @@ with lib;
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
availability.restart = "on_failure";
};

View File

@ -188,6 +188,7 @@ in
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";

View File

@ -260,12 +260,14 @@ in
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
};
"${name}-configure" = {
command = "${configureScript}/bin/configure-mysql";
namespace = name;
depends_on."${name}".condition = "process_healthy";
};
};

View File

@ -269,7 +269,7 @@ in
{
processes = {
# DB initialization
"${name}-init".command =
"${name}-init" =
let
setupInitialDatabases =
if config.initialDatabases != [ ] then
@ -368,10 +368,13 @@ in
cp ${configFile} "$PGDATA/postgresql.conf"
'';
in
''
export PGDATA="${config.dataDir}"
${lib.getExe setupScript}
'';
{
command = ''
export PGDATA="${config.dataDir}"
${lib.getExe setupScript}
'';
namespace = name;
};
# DB process
${name} =
@ -405,6 +408,7 @@ in
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
};

View File

@ -114,6 +114,7 @@ in
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
@ -125,6 +126,7 @@ in
"${name}-cluster-create" = {
depends_on = lib.mapAttrs' (nodeName: cfg: lib.nameValuePair "${name}-${nodeName}" { condition = "process_healthy"; }) config.nodes;
command = "${config.package}/bin/redis-cli --cluster create ${lib.concatStringsSep " " hosts} --cluster-replicas ${builtins.toString config.replicas} --cluster-yes";
namespace = name;
};
};
};

View File

@ -78,6 +78,7 @@ in
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";

View File

@ -144,6 +144,7 @@ with lib;
success_threshold = 1;
failure_threshold = 5;
};
namespace = name;
availability.restart = "on_failure";
};

View File

@ -54,11 +54,11 @@
},
"process-compose-flake": {
"locked": {
"lastModified": 1693927910,
"narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=",
"lastModified": 1695992918,
"narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=",
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255",
"rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da",
"type": "github"
},
"original": {