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" ;
29
27
;
30
28
} ;
31
29
# Binaries. Flake references to the local nix store or remote repos.
32
- containerPkgs = installables { inherit gitrev ; } ;
30
+ containerPkgs = installables ;
33
31
# The Nomad Job description for the requested sub-backend.
34
- nomadJob = nomad-job { inherit profileBundle containerPkgs ; } ;
32
+ nomadJob = nomad-job { inherit profileBundle installables ; } ;
35
33
##########################################################################
36
34
} ;
37
35
in pkgs . runCommand "workbench-backend-data-${ profileBundle . profile . value . name } -nomad"
45
43
''
46
44
;
47
45
48
- # The installables are all the Nix packages that will be avaiable inside the
49
- # Nomad Task. This dependencies are defined inside the Nomad Job as strings
50
- # that can be either a path to the local nix store or a flake reference to
51
- # fetch from some repo.
52
- # In the case of cloud deployment the "installable" must always reference
53
- # a commit accesible from every Nomad client machine and for local / "exec"
54
- # the "nix-store-path" property is used to allow to run with local changes.
55
- # The workbench will by default insert in the Nomad Job description the
56
- # "installable" property as defined here while keeping the extra details as a
57
- # `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
- )
46
+ # The installables are all the Nix packages that are needed inside the Nomad
47
+ # Task. These dependencies are defined inside the Nomad Job as strings that
48
+ # can either be a path to the local nix store or a flake reference to fetch
49
+ # from a repo.
50
+ # In the case of cloud deployment the installables must always reference a
51
+ # commit accessible from every Nomad client machine, for local / "exec" the
52
+ # "nix-store-path" property is used for simplicity.
53
+ # The workbench will by default insert in the Nomad Job description the local
54
+ # path of this packages while keeping the extra details as a `jq` friendly
55
+ # reference that are used to change it later appending the desired commit
56
+ # (interchanging commits it's still an untested feature).
57
+ # For cloud runs references:
58
+ # installable="${flakeReference}/${commit}#${flakeOutput}"
59
+ installables =
60
+ {
61
+ ############################################################################
62
+ # The "default" / basic environment where the node will run. ###############
63
+ # This pkgs rarely change and are almost always cached. ###############
64
+ ############################################################################
65
+ coreutils = {
66
+ nix-store-path = pkgs . coreutils ;
67
+ flake-reference = "github:intersectmbo/cardano-node" ;
68
+ flake-output = "legacyPackages.x86_64-linux.coreutils" ;
69
+ } ;
70
+ bashInteractive = {
71
+ nix-store-path = pkgs . bashInteractive ;
72
+ flake-reference = "github:intersectmbo/cardano-node" ;
73
+ flake-output = "legacyPackages.x86_64-linux.bashInteractive" ;
74
+ } ;
75
+ findutils = {
76
+ nix-store-path = pkgs . findutils ;
77
+ flake-reference = "github:intersectmbo/cardano-node" ;
78
+ flake-output = "legacyPackages.x86_64-linux.findutils" ;
79
+ } ;
80
+ iputils = {
81
+ nix-store-path = pkgs . iputils ;
82
+ flake-reference = "github:intersectmbo/cardano-node" ;
83
+ flake-output = "legacyPackages.x86_64-linux.iputils" ;
84
+ } ;
85
+ gnutar = {
86
+ nix-store-path = pkgs . gnutar ;
87
+ flake-reference = "github:intersectmbo/cardano-node" ;
88
+ flake-output = "legacyPackages.x86_64-linux.gnutar" ;
89
+ } ;
90
+ zstd = {
91
+ nix-store-path = pkgs . zstd ;
92
+ flake-reference = "github:intersectmbo/cardano-node" ;
93
+ flake-output = "legacyPackages.x86_64-linux.zstd" ;
94
+ } ;
95
+ wget = {
96
+ nix-store-path = pkgs . wget ;
97
+ flake-reference = "github:intersectmbo/cardano-node" ;
98
+ flake-output = "legacyPackages.x86_64-linux.wget" ;
99
+ } ;
100
+ cacert = {
101
+ nix-store-path = pkgs . cacert ;
102
+ flake-reference = "github:intersectmbo/cardano-node" ;
103
+ flake-output = "legacyPackages.x86_64-linux.cacert" ;
104
+ } ;
105
+ supervisor = {
106
+ nix-store-path = pkgs . python3Packages . supervisor ;
107
+ flake-reference = "github:intersectmbo/cardano-node" ;
108
+ flake-output = "legacyPackages.x86_64-linux.python3Packages.supervisor" ;
109
+ } ;
110
+ gnugrep = {
111
+ nix-store-path = pkgs . gnugrep ;
112
+ flake-reference = "github:intersectmbo/cardano-node" ;
113
+ flake-output = "legacyPackages.x86_64-linux.gnugrep" ;
114
+ } ;
115
+ jq = {
116
+ nix-store-path = pkgs . jq ;
117
+ flake-reference = "github:intersectmbo/cardano-node" ;
118
+ flake-output = "legacyPackages.x86_64-linux.jq" ;
119
+ } ;
120
+ }
143
121
//
144
122
############################################################################
145
123
# Optional container enabled OpenSSH to properly fetch ~1TB cloud logs. ####
157
135
nix-store-path = pkgs . rsync ; # Not used locally.
158
136
flake-reference = "github:intersectmbo/cardano-node" ;
159
137
flake-output = "legacyPackages.x86_64-linux.rsync" ;
160
- # Same commit as the basic packages.
161
- installable = "${ flake-reference } /${ pkgs . gitrev } #${ flake-output } " ;
162
138
} ;
163
139
}
164
140
//
@@ -172,49 +148,40 @@ let
172
148
cardano-node = rec {
173
149
# Local reference only used if not "cloud".
174
150
nix-store-path = with pkgs ;
175
- # TODO: - cardano-node.passthru.profiled
176
- # - cardano-node.passthru.eventlogged
177
- # - cardano-node.passthru.asserted
178
- # profileBundle.node-services."node-0".serviceConfig.value.eventlog
179
- # builtins.trace (builtins.attrNames profileBundle.node-services."node-0".serviceConfig.value.eventlog) XXXX
180
151
if eventlogged
181
152
then cardanoNodePackages . cardano-node . passthru . eventlogged
182
- else cardanoNodePackages . cardano-node
153
+ else cardanoNodePackages . cardano-node . passthru . noGitRev
183
154
;
184
155
flake-reference = "github:intersectmbo/cardano-node" ;
185
156
flake-output =
186
157
if eventlogged
187
158
then "cardanoNodePackages.cardano-node.passthru.eventlogged"
188
- else "cardanoNodePackages.cardano-node"
159
+ else "cardanoNodePackages.cardano-node.passthru.noGitRev "
189
160
;
190
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
191
161
} ;
192
162
cardano-cli = rec {
193
163
# Local reference only used if not "cloud".
194
- nix-store-path = pkgs . cardanoNodePackages . cardano-cli ;
164
+ nix-store-path = pkgs . cardanoNodePackages . cardano-cli . passthru . noGitRev ;
195
165
flake-reference = "github:input-output-hk/cardano-cli" ;
196
- flake-output = "cardanoNodePackages.cardano-cli" ;
197
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
166
+ flake-output = "cardanoNodePackages.cardano-cli.passthru.noGitRev" ;
198
167
} ;
199
168
cardano-tracer = rec {
200
169
# Local reference only used if not "cloud".
201
170
nix-store-path = pkgs . cardanoNodePackages . cardano-tracer ;
202
171
flake-reference = "github:intersectmbo/cardano-node" ;
203
172
flake-output = "cardanoNodePackages.cardano-tracer" ;
204
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
205
173
} ;
206
174
tx-generator = rec {
207
175
# Local reference only used if not "cloud".
208
176
nix-store-path = pkgs . cardanoNodePackages . tx-generator ;
209
177
flake-reference = "github:intersectmbo/cardano-node" ;
210
178
flake-output = "cardanoNodePackages.tx-generator" ;
211
- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
212
179
} ;
213
180
}
214
181
;
215
182
216
183
# The "exec" or "cloud" Nomad Job description.
217
- nomad-job = { profileBundle , containerPkgs } :
184
+ nomad-job = { profileBundle , installables } :
218
185
# TODO: Repeated code, add the generator's node name to profile.json
219
186
let generatorTaskName = if builtins . hasAttr "explorer" profileBundle . node-specs . value
220
187
then "explorer"
@@ -230,15 +197,15 @@ let
230
197
{ inherit pkgs lib stateDir ;
231
198
inherit profileBundle ;
232
199
inherit generatorTaskName ;
233
- inherit containerPkgs ;
200
+ inherit installables ;
234
201
oneTracerPerNode = false ;
235
202
withSsh = false ;
236
203
} ;
237
204
oneTracerPerNode = import ./nomad-job.nix
238
205
{ inherit pkgs lib stateDir ;
239
206
inherit profileBundle ;
240
207
inherit generatorTaskName ;
241
- inherit containerPkgs ;
208
+ inherit installables ;
242
209
oneTracerPerNode = true ;
243
210
withSsh = false ;
244
211
} ;
@@ -253,15 +220,15 @@ let
253
220
{ inherit pkgs lib stateDir ;
254
221
inherit profileBundle ;
255
222
inherit generatorTaskName ;
256
- inherit containerPkgs ;
223
+ inherit installables ;
257
224
oneTracerPerNode = true ;
258
225
withSsh = false ;
259
226
} ;
260
227
ssh = import ./nomad-job.nix
261
228
{ inherit pkgs lib stateDir ;
262
229
inherit profileBundle ;
263
230
inherit generatorTaskName ;
264
- inherit containerPkgs ;
231
+ inherit installables ;
265
232
oneTracerPerNode = true ;
266
233
withSsh = true ;
267
234
} ;
0 commit comments