2
2
final : prev :
3
3
4
4
let
5
- inherit ( prev ) customConfig ;
6
- inherit ( final ) pkgs cardanoNodePackages cardanoNodeProject ;
5
+ inherit ( final ) pkgs ;
7
6
inherit ( prev . pkgs ) lib ;
7
+ inherit ( prev ) customConfig ;
8
8
9
- # A generic, fully parameteric version of the workbench development environment.
10
- workbench = pkgs . callPackage ./workbench { } ;
9
+ # A generic, fully parametric version of the workbench development environment.
10
+ workbench = import ./workbench
11
+ { inherit pkgs lib ; inherit ( final ) cardanoNodePackages cardanoNodeProject ; } ;
11
12
12
- # A conveniently-parametrisable workbench preset.
13
- # See https://input-output-hk.github.io/haskell.nix/user-guide/development/
14
- # The general idea is:
15
- # 1. backendName -> stateDir -> basePort -> useCabalRun -> backend
16
- # 2. batchName -> profileName -> profiling -> backend -> workbench -> runner
17
- # * `workbench` is in case a pinned version of the workbench is needed.
13
+ # Workbench runner instantiated by parameters from customConfig:
18
14
workbench-runner =
19
- let
20
- backendRegistry =
21
- {
22
- nomadcloud = params :
23
- import ./workbench/backend/nomad/cloud.nix params ;
24
- nomadexec = params :
25
- import ./workbench/backend/nomad/exec.nix params ;
26
- supervisor = params :
27
- import ./workbench/backend/supervisor.nix params ;
28
- }
29
- ;
30
- in
31
- { stateDir ? customConfig . localCluster . stateDir
32
- , batchName ? customConfig . localCluster . batchName
33
- , profileName ? customConfig . localCluster . profileName
15
+ { profileName ? customConfig . localCluster . profileName
16
+ , profiling ? customConfig . profiling
34
17
, backendName ? customConfig . localCluster . backendName
18
+ , stateDir ? customConfig . localCluster . stateDir
35
19
, basePort ? customConfig . localCluster . basePort
36
20
, useCabalRun ? customConfig . localCluster . useCabalRun
37
21
, workbenchDevMode ? customConfig . localCluster . workbenchDevMode
22
+ , batchName ? customConfig . localCluster . batchName
38
23
, workbenchStartArgs ? customConfig . localCluster . workbenchStartArgs
39
- , profiling ? customConfig . profiling
40
24
, cardano-node-rev ? null
41
- , workbench ? pkgs . workbench
42
25
} :
43
- let
44
- # The `useCabalRun` flag is set in the backend to allow the backend to
45
- # override its value. The runner uses the value of `useCabalRun` from
46
- # the backend to prevent a runner using a different value.
47
- backend = ( backendRegistry . "${ backendName } " )
48
- { inherit pkgs lib stateDir basePort useCabalRun ; } ;
49
- in import ./workbench/backend/runner.nix
50
- {
51
- inherit pkgs lib cardanoNodePackages ;
52
- inherit batchName profileName backend ;
53
- inherit cardano-node-rev ;
54
- inherit workbench workbenchDevMode workbenchStartArgs profiling ;
26
+ workbench . runner
27
+ { inherit profileName profiling backendName stateDir basePort useCabalRun ;
28
+ inherit batchName workbenchDevMode workbenchStartArgs cardano-node-rev ;
55
29
} ;
56
30
57
- # Workbench instantiated by parameters from customConfig:
58
- custom-config-workbench-runner = workbench-runner { } ;
59
-
60
31
in with final ;
61
32
{
62
33
inherit ( cardanoNodeProject . args ) compiler-nix-name ;
34
+
63
35
inherit workbench workbench-runner ;
64
36
65
37
cabal = haskell-nix . cabal-install . ${ compiler-nix-name } ;
@@ -156,6 +128,51 @@ in with final;
156
128
157
129
all-profiles-json = workbench . profile-names-json ;
158
130
131
+ # The profile data and backend data of the cloud / "*-nomadperf" profiles.
132
+ # Useful to mix workbench and cardano-node commits, mostly because of scripts.
133
+ profile-data-nomadperf = builtins . listToAttrs (
134
+ builtins . map
135
+ ( cloudName :
136
+ # Only Conway era cloud profiles are flake outputs.
137
+ let profileName = "${ cloudName } -coay" ;
138
+ in {
139
+ name = profileName ;
140
+ value =
141
+ let
142
+ # Default values only ("run/current", 30000, profiling "none").
143
+ profile = workbench . profile {
144
+ inherit profileName ;
145
+ inherit ( customConfig ) profiling ;
146
+ } ;
147
+ backend = workbench . backend
148
+ { backendName = "nomadcloud" ;
149
+ stateDir = customConfig . localCluster . stateDir ;
150
+ basePort = customConfig . localCluster . basePort ;
151
+ useCabalRun = customConfig . localCluster . useCabalRun ;
152
+ }
153
+ ;
154
+ profileData = profile . materialise-profile
155
+ { inherit backend ; }
156
+ ;
157
+ backendData = backend . materialise-profile { inherit profileData ; } ;
158
+ in pkgs . runCommand "workbench-data-${ profileName } " { }
159
+ ''
160
+ mkdir $out
161
+ ln -s ${ profileData } $out/profileData
162
+ ln -s ${ backendData } $out/backendData
163
+ ''
164
+ ;
165
+ }
166
+ )
167
+ # Fetch all "*-nomadperf" profiles.
168
+ ( __fromJSON ( __readFile
169
+ ( pkgs . runCommand "cardano-profile-names-cloud-noera" { } ''
170
+ ${ cardanoNodePackages . cardano-profile } /bin/cardano-profile names-cloud-noera > $out
171
+ ''
172
+ )
173
+ ) )
174
+ ) ;
175
+
159
176
# Disable failing python uvloop tests
160
177
python39 = prev . python39 . override {
161
178
packageOverrides = pythonFinal : pythonPrev : {
@@ -164,5 +181,4 @@ in with final;
164
181
} ) ;
165
182
} ;
166
183
} ;
167
- } //
168
- custom-config-workbench-runner . overlay final prev
184
+ }
0 commit comments