Skip to content

Commit 5c35c24

Browse files
committed
wb | flake output with cloud profiles data
1 parent 6594c2d commit 5c35c24

File tree

4 files changed

+67
-3
lines changed

4 files changed

+67
-3
lines changed

bench/cardano-profile/app/cardano-profile.hs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ import qualified Cardano.Benchmarking.Profile.Types as Types
1616

1717
--------------------------------------------------------------------------------
1818

19-
data Cli = Names | All | ByName String | LibMK | ToJson String | FromJson String
19+
data Cli =
20+
Names
21+
| NamesCloudNoEra
22+
| All
23+
| ByName String
24+
| LibMK
25+
| ToJson String
26+
| FromJson String
2027

2128
--------------------------------------------------------------------------------
2229

@@ -26,6 +33,8 @@ main = do
2633
case cli of
2734
-- Print all profile names.
2835
Names -> BSL8.putStrLn $ Aeson.encode Profiles.names
36+
-- Print all cloud profile (-nomadperf) names.
37+
NamesCloudNoEra -> BSL8.putStrLn $ Aeson.encode Profiles.namesCloudNoEra
2938
-- Print a map with all profiles, with an optional overlay.
3039
All -> do
3140
obj <- lookupOverlay
@@ -76,6 +85,12 @@ cliParser = OA.hsubparser $
7685
(pure Names)
7786
(OA.fullDesc <> OA.header "names" <> OA.progDesc "All profiles names")
7887
)
88+
<>
89+
OA.command "names-cloud-noera"
90+
(OA.info
91+
(pure NamesCloudNoEra)
92+
(OA.fullDesc <> OA.header "names" <> OA.progDesc "All cloud profiles names (no era suffix)")
93+
)
7994
<>
8095
OA.command "all"
8196
(OA.info

bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--------------------------------------------------------------------------------
55

66
module Cardano.Benchmarking.Profile (
7-
names, namesNoEra
7+
names, namesNoEra, namesCloudNoEra
88
, byName
99
, profiles
1010
, libMk
@@ -51,6 +51,10 @@ names :: [String]
5151
-- Overlay not supported here, using an empty overlay.
5252
names = Map.keys (profiles mempty)
5353

54+
namesCloudNoEra :: [String]
55+
-- Overlay not supported here, using an empty overlay.
56+
namesCloudNoEra = map Types.name profilesNoEraCloud
57+
5458
-- Names:
5559
-- wb profile all-profiles | jq .[] | jq -r .name | sort | uniq | grep "\-bage"
5660
namesNoEra :: [String]

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
workbenchStartArgs = [ "--create-testnet-data" "--trace" ];
212212
};
213213

214-
inherit (pkgs) all-profiles-json;
214+
inherit (pkgs) all-profiles-json profile-data-nomadperf;
215215

216216
system-tests = pkgs.writeShellApplication {
217217
name = "system-tests";

nix/pkgs.nix

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,51 @@ in with final;
128128

129129
all-profiles-json = workbench.profile-names-json;
130130

131+
# The profile data and backend data of the cloud / "*-nomadperf" profiles.
132+
# Useful to mix workbench and cardano-node commits, mostly because of scripts.
133+
profile-data-nomadperf = builtins.listToAttrs (
134+
builtins.map
135+
(cloudName:
136+
# Only Conway era cloud profiles are flake outputs.
137+
let profileName = "${cloudName}-coay";
138+
in {
139+
name = profileName;
140+
value =
141+
let
142+
# Default values only ("run/current", 30000, profiling "none").
143+
profile = workbench.profile {
144+
inherit profileName;
145+
inherit (customConfig) profiling;
146+
};
147+
backend = workbench.backend
148+
{ backendName = "nomadcloud";
149+
stateDir = customConfig.localCluster.stateDir;
150+
basePort = customConfig.localCluster.basePort;
151+
useCabalRun = customConfig.localCluster.useCabalRun;
152+
}
153+
;
154+
profileData = profile.materialise-profile
155+
{ inherit backend; }
156+
;
157+
backendData = backend.materialise-profile {inherit profileData;};
158+
in pkgs.runCommand "workbench-data-${profileName}" {}
159+
''
160+
mkdir $out
161+
ln -s ${profileData} $out/profileData
162+
ln -s ${backendData} $out/backendData
163+
''
164+
;
165+
}
166+
)
167+
# Fetch all "*-nomadperf" profiles.
168+
(__fromJSON (__readFile
169+
(pkgs.runCommand "cardano-profile-names-cloud-noera" {} ''
170+
${cardanoNodePackages.cardano-profile}/bin/cardano-profile names-cloud-noera > $out
171+
''
172+
)
173+
))
174+
);
175+
131176
# Disable failing python uvloop tests
132177
python39 = prev.python39.override {
133178
packageOverrides = pythonFinal: pythonPrev: {

0 commit comments

Comments
 (0)