Skip to content

Commit 1a93b04

Browse files
fmastemgmeier
authored andcommitted
wb | remove validateNodeSpecs
1 parent df66d2a commit 1a93b04

File tree

5 files changed

+5
-55
lines changed

5 files changed

+5
-55
lines changed

nix/workbench/backend/nomad/cloud.nix

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,6 @@ let
2323
]
2424
;
2525

26-
validateNodeSpecs = { nodeSpecsValue }:
27-
let
28-
# There's a region mismatch between the workbench (specifically Haskell
29-
# code in cardano-topology) and Cardano World's Nomad cluster that both
30-
# use "us-east-2" while our dedicated Nomad cluster is using "us-east-1",
31-
# what SRE deployed.
32-
# - Cardano World cluster: "eu-central-1", "us-east-2"
33-
# - Workbench (Nix level): "eu-central-1", "us-east-2", and "ap-southeast-2"
34-
# - Dedicated P&T cluster: "eu-central-1", "us-east-1", and "ap-southeast-2"
35-
datacenters = [ "eu-central-1" "us-east-1" "us-east-2" "ap-southeast-2" ];
36-
regions = lib.attrsets.mapAttrsToList
37-
(name: value: value.region)
38-
nodeSpecsValue
39-
;
40-
in if builtins.all (r: builtins.elem r datacenters) regions
41-
then true
42-
else builtins.throw (
43-
"The only compatible regions for Nomad cloud are \"${toString datacenters}\" but found \"${toString regions}\""
44-
)
45-
;
46-
4726
# Nomad-generic "container-specs.json"
4827
# Build a Nomad Job specification for this Nomad "sub-backend".
4928
materialise-profile =
@@ -75,7 +54,7 @@ in
7554
inherit name;
7655

7756
inherit extraShellPkgs;
78-
inherit validateNodeSpecs materialise-profile;
57+
inherit materialise-profile;
7958
inherit overlay service-modules;
8059
inherit stateDir basePort;
8160

nix/workbench/backend/nomad/exec.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ let
2929
]
3030
;
3131

32-
validateNodeSpecs = { nodeSpecsValue }:
33-
builtins.all (r: r == "loopback")
34-
(lib.attrsets.mapAttrsToList
35-
(name: value: value.region)
36-
nodeSpecsValue
37-
)
38-
;
39-
4032
# Nomad-generic "container-specs.json"
4133
# Build a Nomad Job specification for this Nomad "sub-backend".
4234
materialise-profile =
@@ -68,7 +60,7 @@ in
6860
inherit name;
6961

7062
inherit extraShellPkgs;
71-
inherit validateNodeSpecs materialise-profile;
63+
inherit materialise-profile;
7264
inherit overlay service-modules;
7365
inherit stateDir basePort;
7466

nix/workbench/backend/nomad/podman.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ let
6262
]
6363
;
6464

65-
validateNodeSpecs = { nodeSpecsValue }:
66-
builtins.all (r: r == "loopback")
67-
(lib.attrsets.mapAttrsToList
68-
(name: value: value.region)
69-
nodeSpecsValue
70-
)
71-
;
72-
7365
# Nomad-generic "container-specs.json"
7466
# Build a Nomad Job specification for this Nomad "sub-backend".
7567
materialise-profile =
@@ -101,7 +93,7 @@ in
10193
inherit name;
10294

10395
inherit extraShellPkgs;
104-
inherit validateNodeSpecs materialise-profile;
96+
inherit materialise-profile;
10597
inherit overlay service-modules;
10698
inherit stateDir basePort;
10799

nix/workbench/backend/supervisor.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ let
2626
tx-generator
2727
]);
2828

29-
validateNodeSpecs = { nodeSpecsValue }:
30-
builtins.all (r: r == "loopback")
31-
(lib.attrsets.mapAttrsToList
32-
(name: value: value.region)
33-
nodeSpecsValue
34-
)
35-
;
36-
3729
# Backend-specific Nix bits:
3830
materialise-profile =
3931
{ profileData }:
@@ -75,7 +67,7 @@ in
7567
name = "supervisor";
7668

7769
inherit extraShellPkgs;
78-
inherit validateNodeSpecs materialise-profile;
70+
inherit materialise-profile;
7971
inherit overlay service-modules;
8072
inherit stateDir basePort;
8173

nix/workbench/profile/profile.nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,7 @@ let
136136
;
137137
nodeSpecsJson = mkNodeSpecsJson
138138
{ inherit profileName profileJson;};
139-
nodeSpecs =
140-
let nodeSpecsValue = __fromJSON (__readFile nodeSpecsJson);
141-
in if backend.validateNodeSpecs { inherit nodeSpecsValue; }
142-
then nodeSpecsValue
143-
else builtins.throw "Incompatible backend for the current profile"
144-
;
139+
nodeSpecs = __fromJSON (__readFile nodeSpecsJson);
145140
genesisFiles =
146141
mkGenesisFiles
147142
{ inherit profileName profileJson nodeSpecsJson; }

0 commit comments

Comments
 (0)