10
10
, ociImages
11
11
# Needs unix_http_server.file
12
12
, supervisorConf
13
+ , oneTracerPerNode ? false
13
14
} :
14
15
15
16
let
202
203
SUPERVISORD_URL = container_supervisord_url ;
203
204
SUPERVISORD_CONFIG = container_supervisord_conf ;
204
205
SUPERVISORD_LOGLEVEL = container_supervisord_loglevel ;
206
+ ONE_TRACER_PER_NODE = oneTracerPerNode ;
205
207
} ;
206
208
207
209
# TODO:
272
274
change_mode = "noop" ;
273
275
error_on_missing_key = true ;
274
276
}
275
- # supervisord configuration file.
277
+ # supervisord
278
+ ## supervisord configuration file.
276
279
{
277
280
env = false ;
278
281
destination = "${ container_supervisord_conf } " ;
281
284
change_mode = "noop" ;
282
285
error_on_missing_key = true ;
283
286
}
284
- # Generator start.sh script.
287
+ # Generator
288
+ ## Generator start.sh script.
285
289
{
286
290
env = false ;
287
291
destination = "${ container_statedir } /generator/start.sh" ;
290
294
change_mode = "noop" ;
291
295
error_on_missing_key = true ;
292
296
}
293
- # Generator configuration file.
297
+ ## Generator configuration file.
294
298
{
295
299
env = false ;
296
300
destination = "${ container_statedir } /generator/run-script.json" ;
299
303
change_mode = "noop" ;
300
304
error_on_missing_key = true ;
301
305
}
302
- /* TODO: Tracer still needs to use volumes because tracer.socket is shared.
303
- # Tracer start.sh script.
306
+ ]
307
+ ++
308
+ # Tracer
309
+ ## If using oneTracerPerNode no "tracer volumes" need to be mounted
310
+ ## (because of no socket sharing between tasks), and tracer files are
311
+ ## created using templates.
312
+ ( lib . optionals ( profileNix . value . node . tracer && oneTracerPerNode ) [
313
+ ## Tracer start.sh script.
304
314
{
305
315
env = false ;
306
316
destination = "${ container_statedir } /tracer/start.sh" ;
@@ -309,21 +319,28 @@ let
309
319
change_mode = "noop" ;
310
320
error_on_missing_key = true ;
311
321
}
312
- # Tracer configuration file.
322
+ ## Tracer configuration file.
313
323
{
314
324
env = false ;
315
325
destination = "${ container_statedir } /tracer/config.json" ;
316
326
data = escapeTemplate ( lib . generators . toJSON { }
317
- profileNix.tracer-service.config.value);
327
+ # TODO / FIXME: Ugly!
328
+ # When running locally every tracer has a 127.0.0.1 address
329
+ # and EKG and prometheus ports clash!
330
+ ( builtins . removeAttrs
331
+ profileNix . tracer-service . config . value
332
+ [ "hasEKG" "hasPrometheus" "hasRTView" ]
333
+ )
334
+ ) ;
318
335
change_mode = "noop" ;
319
336
error_on_missing_key = true ;
320
337
}
321
- */
322
- ]
338
+ ] )
323
339
++
340
+ # Nodes
324
341
( lib . lists . flatten ( lib . mapAttrsToList
325
342
( _ : nodeSpec : [
326
- # Node start.sh script.
343
+ ## Node start.sh script.
327
344
{
328
345
env = false ;
329
346
destination = "${ container_statedir } /${ nodeSpec . name } /start.sh" ;
332
349
change_mode = "noop" ;
333
350
error_on_missing_key = true ;
334
351
}
335
- # Node configuration file.
352
+ ## Node configuration file.
336
353
{
337
354
env = false ;
338
355
destination = "${ container_statedir } /${ nodeSpec . name } /config.json" ;
341
358
change_mode = "noop" ;
342
359
error_on_missing_key = true ;
343
360
}
344
- # Node topology file.
361
+ ## Node topology file.
345
362
{
346
363
env = false ;
347
364
destination = "${ container_statedir } /${ nodeSpec . name } /topology.json" ;
438
455
439
456
} ) ) ;
440
457
in lib . listToAttrs (
441
- lib . optionals profileNix . value . node . tracer [
458
+ # If not oneTracerPerNode, an individual tracer task is needed (instead
459
+ # of running a tracer alongside a node with supervisor)
460
+ lib . optionals ( profileNix . value . node . tracer && ! oneTracerPerNode ) [
442
461
{ name = "tracer" ; value = valueF "tracer" [ ] ; }
443
462
]
444
463
++
0 commit comments