13
13
# Intermediate / workbench-adhoc container specifications
14
14
let containerSpecs = rec {
15
15
##########################################################################
16
- # The actual commit. The one used when entering the workbench.
17
- gitrev = pkgs . gitrev ;
18
16
# Where to deploy inside the Task, needed to send commands (`nomad exec`).
19
17
diretories = rec {
20
18
work = "/local" ;
28
26
[ diretories . run "supervisor" "supervisord.conf" ]
29
27
;
30
28
} ;
31
- # Binaries. Flake references to the local nix store or remote repos.
32
- containerPkgs = installables { inherit gitrev ; } ;
33
29
# The Nomad Job description for the requested sub-backend.
34
- nomadJob = nomad-job { inherit profileBundle containerPkgs ; } ;
30
+ nomadJob = nomad-job { inherit profileBundle installables ; } ;
35
31
##########################################################################
36
32
} ;
37
33
in pkgs . runCommand "workbench-backend-data-${ profileBundle . profile . value . name } -nomad"
55
51
# The workbench will by default insert in the Nomad Job description the
56
52
# "installable" property as defined here while keeping the extra details as a
57
53
# `jq` friendly reference that are used to change it later.
58
- installables = { gitrev } :
59
- ############################################################################
60
- # The "default" / basic environment where the node will run. ###############
61
- # This pkgs rarely change and are almost always cached. ###############
62
- ############################################################################
63
- ( lib . attrsets . mapAttrs
64
- ( name : attr :
65
- # The installable property is always the same.
66
- let flakeReference = attr . flake-reference ;
67
- flakeOutput = attr . flake-output ;
68
- # The commit must come from `pkgs` because all script are using
69
- # this for the shebang and other basic tools ("coreutils") and are
70
- # also the dependencies used inside the workbench, like `jq`.
71
- commit = pkgs . gitrev ;
72
- in attr // { installable = "${ flakeReference } /${ commit } #${ flakeOutput } " ; }
73
- )
74
- {
75
- coreutils = {
76
- nix-store-path = pkgs . coreutils ;
77
- flake-reference = "github:intersectmbo/cardano-node" ;
78
- flake-output = "legacyPackages.x86_64-linux.coreutils" ;
79
- installable = null ;
80
- } ;
81
- bashInteractive = {
82
- nix-store-path = pkgs . bashInteractive ;
83
- flake-reference = "github:intersectmbo/cardano-node" ;
84
- flake-output = "legacyPackages.x86_64-linux.bashInteractive" ;
85
- installable = null ;
86
- } ;
87
- findutils = {
88
- nix-store-path = pkgs . findutils ;
89
- flake-reference = "github:intersectmbo/cardano-node" ;
90
- flake-output = "legacyPackages.x86_64-linux.findutils" ;
91
- installable = null ;
92
- } ;
93
- iputils = {
94
- nix-store-path = pkgs . iputils ;
95
- flake-reference = "github:intersectmbo/cardano-node" ;
96
- flake-output = "legacyPackages.x86_64-linux.iputils" ;
97
- installable = null ;
98
- } ;
99
- gnutar = {
100
- nix-store-path = pkgs . gnutar ;
101
- flake-reference = "github:intersectmbo/cardano-node" ;
102
- flake-output = "legacyPackages.x86_64-linux.gnutar" ;
103
- installable = null ;
104
- } ;
105
- zstd = {
106
- nix-store-path = pkgs . zstd ;
107
- flake-reference = "github:intersectmbo/cardano-node" ;
108
- flake-output = "legacyPackages.x86_64-linux.zstd" ;
109
- installable = null ;
110
- } ;
111
- wget = {
112
- nix-store-path = pkgs . wget ;
113
- flake-reference = "github:intersectmbo/cardano-node" ;
114
- flake-output = "legacyPackages.x86_64-linux.wget" ;
115
- installable = null ;
116
- } ;
117
- cacert = {
118
- nix-store-path = pkgs . cacert ;
119
- flake-reference = "github:intersectmbo/cardano-node" ;
120
- flake-output = "legacyPackages.x86_64-linux.cacert" ;
121
- installable = null ;
122
- } ;
123
- supervisor = {
124
- nix-store-path = pkgs . python3Packages . supervisor ;
125
- flake-reference = "github:intersectmbo/cardano-node" ;
126
- flake-output = "legacyPackages.x86_64-linux.python3Packages.supervisor" ;
127
- installable = null ;
128
- } ;
129
- gnugrep = {
130
- nix-store-path = pkgs . gnugrep ;
131
- flake-reference = "github:intersectmbo/cardano-node" ;
132
- flake-output = "legacyPackages.x86_64-linux.gnugrep" ;
133
- installable = null ;
134
- } ;
135
- jq = {
136
- nix-store-path = pkgs . jq ;
137
- flake-reference = "github:intersectmbo/cardano-node" ;
138
- flake-output = "legacyPackages.x86_64-linux.jq" ;
139
- installable = null ;
140
- } ;
141
- }
142
- )
54
+
55
+ # (lib.attrsets.mapAttrs
56
+ # (name: attr:
57
+ # # The installable property is always the same.
58
+ # let flakeReference = attr.flake-reference;
59
+ # flakeOutput = attr.flake-output;
60
+ # # The commit must come from `pkgs` because all script are using
61
+ # # this for the shebang and other basic tools ("coreutils") and are
62
+ # # also the dependencies used inside the workbench, like `jq`.
63
+ # commit = pkgs.gitrev;
64
+ # in attr // {installable="${flakeReference}/${commit}#${flakeOutput}";}
65
+ # )
66
+
67
+ installables =
68
+ {
69
+ ############################################################################
70
+ # The "default" / basic environment where the node will run. ###############
71
+ # This pkgs rarely change and are almost always cached. ###############
72
+ ############################################################################
73
+ coreutils = {
74
+ nix-store-path = pkgs . coreutils ;
75
+ flake-reference = "github:intersectmbo/cardano-node" ;
76
+ flake-output = "legacyPackages.x86_64-linux.coreutils" ;
77
+ } ;
78
+ bashInteractive = {
79
+ nix-store-path = pkgs . bashInteractive ;
80
+ flake-reference = "github:intersectmbo/cardano-node" ;
81
+ flake-output = "legacyPackages.x86_64-linux.bashInteractive" ;
82
+ } ;
83
+ findutils = {
84
+ nix-store-path = pkgs . findutils ;
85
+ flake-reference = "github:intersectmbo/cardano-node" ;
86
+ flake-output = "legacyPackages.x86_64-linux.findutils" ;
87
+ } ;
88
+ iputils = {
89
+ nix-store-path = pkgs . iputils ;
90
+ flake-reference = "github:intersectmbo/cardano-node" ;
91
+ flake-output = "legacyPackages.x86_64-linux.iputils" ;
92
+ } ;
93
+ gnutar = {
94
+ nix-store-path = pkgs . gnutar ;
95
+ flake-reference = "github:intersectmbo/cardano-node" ;
96
+ flake-output = "legacyPackages.x86_64-linux.gnutar" ;
97
+ } ;
98
+ zstd = {
99
+ nix-store-path = pkgs . zstd ;
100
+ flake-reference = "github:intersectmbo/cardano-node" ;
101
+ flake-output = "legacyPackages.x86_64-linux.zstd" ;
102
+ } ;
103
+ wget = {
104
+ nix-store-path = pkgs . wget ;
105
+ flake-reference = "github:intersectmbo/cardano-node" ;
106
+ flake-output = "legacyPackages.x86_64-linux.wget" ;
107
+ } ;
108
+ cacert = {
109
+ nix-store-path = pkgs . cacert ;
110
+ flake-reference = "github:intersectmbo/cardano-node" ;
111
+ flake-output = "legacyPackages.x86_64-linux.cacert" ;
112
+ } ;
113
+ supervisor = {
114
+ nix-store-path = pkgs . python3Packages . supervisor ;
115
+ flake-reference = "github:intersectmbo/cardano-node" ;
116
+ flake-output = "legacyPackages.x86_64-linux.python3Packages.supervisor" ;
117
+ } ;
118
+ gnugrep = {
119
+ nix-store-path = pkgs . gnugrep ;
120
+ flake-reference = "github:intersectmbo/cardano-node" ;
121
+ flake-output = "legacyPackages.x86_64-linux.gnugrep" ;
122
+ } ;
123
+ jq = {
124
+ nix-store-path = pkgs . jq ;
125
+ flake-reference = "github:intersectmbo/cardano-node" ;
126
+ flake-output = "legacyPackages.x86_64-linux.jq" ;
127
+ } ;
128
+ }
143
129
//
144
130
############################################################################
145
131
# Optional container enabled OpenSSH to properly fetch ~1TB cloud logs. ####
157
143
nix-store-path = pkgs . rsync ; # Not used locally.
158
144
flake-reference = "github:intersectmbo/cardano-node" ;
159
145
flake-output = "legacyPackages.x86_64-linux.rsync" ;
160
- # Same commit as the basic packages.
161
- installable = "${ flake-reference } /${ pkgs . gitrev } #${ flake-output } " ;
162
146
} ;
163
147
}
164
148
//
@@ -187,34 +171,30 @@ let
187
171
then "cardanoNodePackages.cardano-node.passthru.eventlogged"
188
172
else "cardanoNodePackages.cardano-node"
189
173
;
190
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
191
174
} ;
192
175
cardano-cli = rec {
193
176
# Local reference only used if not "cloud".
194
- nix-store-path = pkgs . cardanoNodePackages . cardano-cli ;
177
+ nix-store-path = pkgs . cardanoNodePackages . cardano-cli . passthru . noGitRev ;
195
178
flake-reference = "github:input-output-hk/cardano-cli" ;
196
- flake-output = "cardanoNodePackages.cardano-cli" ;
197
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
179
+ flake-output = "cardanoNodePackages.cardano-cli.passthru.noGitRev" ;
198
180
} ;
199
181
cardano-tracer = rec {
200
182
# Local reference only used if not "cloud".
201
183
nix-store-path = pkgs . cardanoNodePackages . cardano-tracer ;
202
184
flake-reference = "github:intersectmbo/cardano-node" ;
203
185
flake-output = "cardanoNodePackages.cardano-tracer" ;
204
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
205
186
} ;
206
187
tx-generator = rec {
207
188
# Local reference only used if not "cloud".
208
189
nix-store-path = pkgs . cardanoNodePackages . tx-generator ;
209
190
flake-reference = "github:intersectmbo/cardano-node" ;
210
191
flake-output = "cardanoNodePackages.tx-generator" ;
211
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
212
192
} ;
213
193
}
214
194
;
215
195
216
196
# The "exec" or "cloud" Nomad Job description.
217
- nomad-job = { profileBundle , containerPkgs } :
197
+ nomad-job = { profileBundle , installables } :
218
198
# TODO: Repeated code, add the generator's node name to profile.json
219
199
let generatorTaskName = if builtins . hasAttr "explorer" profileBundle . node-specs . value
220
200
then "explorer"
@@ -230,15 +210,15 @@ let
230
210
{ inherit pkgs lib stateDir ;
231
211
inherit profileBundle ;
232
212
inherit generatorTaskName ;
233
- inherit containerPkgs ;
213
+ inherit installables ;
234
214
oneTracerPerNode = false ;
235
215
withSsh = false ;
236
216
} ;
237
217
oneTracerPerNode = import ./nomad-job.nix
238
218
{ inherit pkgs lib stateDir ;
239
219
inherit profileBundle ;
240
220
inherit generatorTaskName ;
241
- inherit containerPkgs ;
221
+ inherit installables ;
242
222
oneTracerPerNode = true ;
243
223
withSsh = false ;
244
224
} ;
@@ -253,15 +233,15 @@ let
253
233
{ inherit pkgs lib stateDir ;
254
234
inherit profileBundle ;
255
235
inherit generatorTaskName ;
256
- inherit containerPkgs ;
236
+ inherit installables ;
257
237
oneTracerPerNode = true ;
258
238
withSsh = false ;
259
239
} ;
260
240
ssh = import ./nomad-job.nix
261
241
{ inherit pkgs lib stateDir ;
262
242
inherit profileBundle ;
263
243
inherit generatorTaskName ;
264
- inherit containerPkgs ;
244
+ inherit installables ;
265
245
oneTracerPerNode = true ;
266
246
withSsh = true ;
267
247
} ;
0 commit comments