1313 # Intermediate / workbench-adhoc container specifications
1414 let containerSpecs = rec {
1515 ##########################################################################
16- # The actual commit. The one used when entering the workbench.
17- gitrev = pkgs . gitrev ;
1816 # Where to deploy inside the Task, needed to send commands (`nomad exec`).
1917 diretories = rec {
2018 work = "/local" ;
2927 ;
3028 } ;
3129 # Binaries. Flake references to the local nix store or remote repos.
32- containerPkgs = installables { inherit gitrev ; } ;
30+ containerPkgs = installables ;
3331 # The Nomad Job description for the requested sub-backend.
34- nomadJob = nomad-job { inherit profileBundle containerPkgs ; } ;
32+ nomadJob = nomad-job { inherit profileBundle installables ; } ;
3533 ##########################################################################
3634 } ;
3735 in pkgs . runCommand "workbench-backend-data-${ profileBundle . profile . value . name } -nomad"
4543 ''
4644 ;
4745
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+ }
143121 //
144122 ############################################################################
145123 # Optional container enabled OpenSSH to properly fetch ~1TB cloud logs. ####
157135 nix-store-path = pkgs . rsync ; # Not used locally.
158136 flake-reference = "github:intersectmbo/cardano-node" ;
159137 flake-output = "legacyPackages.x86_64-linux.rsync" ;
160- # Same commit as the basic packages.
161- installable = "${ flake-reference } /${ pkgs . gitrev } #${ flake-output } " ;
162138 } ;
163139 }
164140 //
@@ -172,49 +148,40 @@ let
172148 cardano-node = rec {
173149 # Local reference only used if not "cloud".
174150 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
180151 if eventlogged
181152 then cardanoNodePackages . cardano-node . passthru . eventlogged
182- else cardanoNodePackages . cardano-node
153+ else cardanoNodePackages . cardano-node . passthru . noGitRev
183154 ;
184155 flake-reference = "github:intersectmbo/cardano-node" ;
185156 flake-output =
186157 if eventlogged
187158 then "cardanoNodePackages.cardano-node.passthru.eventlogged"
188- else "cardanoNodePackages.cardano-node"
159+ else "cardanoNodePackages.cardano-node.passthru.noGitRev "
189160 ;
190- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
191161 } ;
192162 cardano-cli = rec {
193163 # 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 ;
195165 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" ;
198167 } ;
199168 cardano-tracer = rec {
200169 # Local reference only used if not "cloud".
201170 nix-store-path = pkgs . cardanoNodePackages . cardano-tracer ;
202171 flake-reference = "github:intersectmbo/cardano-node" ;
203172 flake-output = "cardanoNodePackages.cardano-tracer" ;
204- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
205173 } ;
206174 tx-generator = rec {
207175 # Local reference only used if not "cloud".
208176 nix-store-path = pkgs . cardanoNodePackages . tx-generator ;
209177 flake-reference = "github:intersectmbo/cardano-node" ;
210178 flake-output = "cardanoNodePackages.tx-generator" ;
211- installable = "${ flake-reference } /${ gitrev } #${ flake-output } " ;
212179 } ;
213180 }
214181 ;
215182
216183 # The "exec" or "cloud" Nomad Job description.
217- nomad-job = { profileBundle , containerPkgs } :
184+ nomad-job = { profileBundle , installables } :
218185 # TODO: Repeated code, add the generator's node name to profile.json
219186 let generatorTaskName = if builtins . hasAttr "explorer" profileBundle . node-specs . value
220187 then "explorer"
@@ -230,15 +197,15 @@ let
230197 { inherit pkgs lib stateDir ;
231198 inherit profileBundle ;
232199 inherit generatorTaskName ;
233- inherit containerPkgs ;
200+ inherit installables ;
234201 oneTracerPerNode = false ;
235202 withSsh = false ;
236203 } ;
237204 oneTracerPerNode = import ./nomad-job.nix
238205 { inherit pkgs lib stateDir ;
239206 inherit profileBundle ;
240207 inherit generatorTaskName ;
241- inherit containerPkgs ;
208+ inherit installables ;
242209 oneTracerPerNode = true ;
243210 withSsh = false ;
244211 } ;
@@ -253,15 +220,15 @@ let
253220 { inherit pkgs lib stateDir ;
254221 inherit profileBundle ;
255222 inherit generatorTaskName ;
256- inherit containerPkgs ;
223+ inherit installables ;
257224 oneTracerPerNode = true ;
258225 withSsh = false ;
259226 } ;
260227 ssh = import ./nomad-job.nix
261228 { inherit pkgs lib stateDir ;
262229 inherit profileBundle ;
263230 inherit generatorTaskName ;
264- inherit containerPkgs ;
231+ inherit installables ;
265232 oneTracerPerNode = true ;
266233 withSsh = true ;
267234 } ;
0 commit comments