-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3879: Workbench: integrate cardano-tracer r=deepfire a=deepfire 1. `cardano-node-service` -- a NixOS service 2. workbench integration -- with several profiles 3. a bunch of `Makefile` targets -- for the above profiles -- including the `-auto`, `-nix` and `-autonix` variants: - `startstop-tracer` - `10-tracer` - `forge-stress-tracer` - `chainsync-early-byron-tracer` - `chainsync-early-alonzo-tracer` Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io>
- Loading branch information
Showing
20 changed files
with
491 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
pkgs: | ||
let serviceConfigToJSON = | ||
cfg: | ||
{ | ||
networkMagic = 764824073; ## Mainnet | ||
# loRequestNum = 100; | ||
network = | ||
if cfg.acceptingSocket != null | ||
then { | ||
tag = "AcceptAt"; | ||
contents = cfg.acceptingSocket; | ||
} else if cfg.connectToSocket != null | ||
then { | ||
tag = "ConnectTo"; | ||
contents = cfg.connectToSocket; | ||
} else | ||
throw "cardano-tracer-service: either acceptingSocket or connectToSocket must be provided."; | ||
logging = [{ | ||
inherit (cfg) logRoot; | ||
|
||
logMode = "FileMode"; | ||
logFormat = "ForMachine"; | ||
}]; | ||
rotation = { | ||
rpFrequencySecs = 15; | ||
rpKeepFilesNum = 10; | ||
rpLogLimitBytes = 500000000; | ||
rpMaxAgeHours = 24; | ||
}; | ||
|
||
hasEKG = [ | ||
{ epHost = "127.0.0.1"; | ||
epPort = 3100; ## supervisord.portShiftPrometheus | ||
} | ||
{ epHost = "127.0.0.1"; | ||
epPort = 3101; ## supervisord.portShiftPrometheus | ||
} | ||
]; | ||
ekgRequestFreq = 1; | ||
hasPrometheus = { | ||
epHost = "127.0.0.1"; | ||
epPort = 3200; ## supervisord.portShiftPrometheus | ||
}; | ||
}; | ||
in pkgs.commonLib.defServiceModule | ||
(lib: with lib; | ||
{ svcName = "cardano-tracer"; | ||
svcDesc = "Cardano trace processor"; | ||
|
||
svcPackageSelector = | ||
pkgs: ## Local: | ||
pkgs.cardanoNodePackages.cardano-tracer | ||
## Imported by another repo, that adds an overlay: | ||
or pkgs.cardano-tracer; | ||
## TODO: that's actually a bit ugly and could be improved. | ||
## This exe has to be available in the selected package. | ||
exeName = "cardano-tracer"; | ||
|
||
extraOptionDecls = { | ||
### You can actually change those! | ||
acceptingSocket = mayOpt str "Socket path: as acceptor."; | ||
connectToSocket = mayOpt str "Socket path: connect to."; | ||
logRoot = opt str null "Log storage root directory."; | ||
|
||
### Here be dragons, on the other hand.. | ||
configFile = mayOpt str | ||
"Config file path override -- only set if you know what you're doing. Shudder. Your 'eminence'.."; | ||
configJSONfn = opt (functionTo attrs) serviceConfigToJSON | ||
"This is NOT meant to be overridden, at all -- we only expose it so it's externally accessible."; | ||
}; | ||
|
||
configExeArgsFn = cfg: [ | ||
"--config" (if cfg.configFile != null then cfg.configFile | ||
else "${pkgs.writeText "cardano-tracer-config.json" | ||
(__toJSON (serviceConfigToJSON cfg))}") | ||
]; | ||
|
||
configSystemdExtraConfig = _: {}; | ||
|
||
configSystemdExtraServiceConfig = | ||
cfg: with cfg; { | ||
Type = "exec"; | ||
User = "cardano-node"; | ||
Group = "cardano-node"; | ||
Restart = "yes"; | ||
# RuntimeDirectory = localNodeConf.runtimeDir; | ||
# WorkingDirectory = localNodeConf.stateDir; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.