mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-11 12:26:04 +03:00
Namespaces (#57)
This commit is contained in:
parent
b3f9b375b4
commit
b9ab7fb711
@ -70,11 +70,11 @@
|
|||||||
},
|
},
|
||||||
"process-compose-flake": {
|
"process-compose-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693927910,
|
"lastModified": 1695992918,
|
||||||
"narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=",
|
"narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=",
|
||||||
"owner": "Platonic-Systems",
|
"owner": "Platonic-Systems",
|
||||||
"repo": "process-compose-flake",
|
"repo": "process-compose-flake",
|
||||||
"rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255",
|
"rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -144,6 +144,7 @@ with lib;
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
};
|
};
|
||||||
|
@ -188,6 +188,7 @@ in
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
|
@ -260,12 +260,14 @@ in
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
};
|
};
|
||||||
"${name}-configure" = {
|
"${name}-configure" = {
|
||||||
command = "${configureScript}/bin/configure-mysql";
|
command = "${configureScript}/bin/configure-mysql";
|
||||||
|
namespace = name;
|
||||||
depends_on."${name}".condition = "process_healthy";
|
depends_on."${name}".condition = "process_healthy";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -269,7 +269,7 @@ in
|
|||||||
{
|
{
|
||||||
processes = {
|
processes = {
|
||||||
# DB initialization
|
# DB initialization
|
||||||
"${name}-init".command =
|
"${name}-init" =
|
||||||
let
|
let
|
||||||
setupInitialDatabases =
|
setupInitialDatabases =
|
||||||
if config.initialDatabases != [ ] then
|
if config.initialDatabases != [ ] then
|
||||||
@ -368,10 +368,13 @@ in
|
|||||||
cp ${configFile} "$PGDATA/postgresql.conf"
|
cp ${configFile} "$PGDATA/postgresql.conf"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
''
|
{
|
||||||
export PGDATA="${config.dataDir}"
|
command = ''
|
||||||
${lib.getExe setupScript}
|
export PGDATA="${config.dataDir}"
|
||||||
'';
|
${lib.getExe setupScript}
|
||||||
|
'';
|
||||||
|
namespace = name;
|
||||||
|
};
|
||||||
|
|
||||||
# DB process
|
# DB process
|
||||||
${name} =
|
${name} =
|
||||||
@ -405,6 +408,7 @@ in
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
};
|
};
|
||||||
|
@ -114,6 +114,7 @@ in
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
@ -125,6 +126,7 @@ in
|
|||||||
"${name}-cluster-create" = {
|
"${name}-cluster-create" = {
|
||||||
depends_on = lib.mapAttrs' (nodeName: cfg: lib.nameValuePair "${name}-${nodeName}" { condition = "process_healthy"; }) config.nodes;
|
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";
|
command = "${config.package}/bin/redis-cli --cluster create ${lib.concatStringsSep " " hosts} --cluster-replicas ${builtins.toString config.replicas} --cluster-yes";
|
||||||
|
namespace = name;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,7 @@ in
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
|
@ -144,6 +144,7 @@ with lib;
|
|||||||
success_threshold = 1;
|
success_threshold = 1;
|
||||||
failure_threshold = 5;
|
failure_threshold = 5;
|
||||||
};
|
};
|
||||||
|
namespace = name;
|
||||||
|
|
||||||
availability.restart = "on_failure";
|
availability.restart = "on_failure";
|
||||||
};
|
};
|
||||||
|
@ -54,11 +54,11 @@
|
|||||||
},
|
},
|
||||||
"process-compose-flake": {
|
"process-compose-flake": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693927910,
|
"lastModified": 1695992918,
|
||||||
"narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=",
|
"narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=",
|
||||||
"owner": "Platonic-Systems",
|
"owner": "Platonic-Systems",
|
||||||
"repo": "process-compose-flake",
|
"repo": "process-compose-flake",
|
||||||
"rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255",
|
"rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
Loading…
Reference in New Issue
Block a user