Skip to content

Commit

Permalink
wb | flake output with cloud profiles data
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Sep 20, 2024
1 parent 6594c2d commit 5c35c24
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
17 changes: 16 additions & 1 deletion bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import qualified Cardano.Benchmarking.Profile.Types as Types

--------------------------------------------------------------------------------

data Cli = Names | All | ByName String | LibMK | ToJson String | FromJson String
data Cli =
Names
| NamesCloudNoEra
| All
| ByName String
| LibMK
| ToJson String
| FromJson String

--------------------------------------------------------------------------------

Expand All @@ -26,6 +33,8 @@ main = do
case cli of
-- Print all profile names.
Names -> BSL8.putStrLn $ Aeson.encode Profiles.names
-- Print all cloud profile (-nomadperf) names.
NamesCloudNoEra -> BSL8.putStrLn $ Aeson.encode Profiles.namesCloudNoEra
-- Print a map with all profiles, with an optional overlay.
All -> do
obj <- lookupOverlay
Expand Down Expand Up @@ -76,6 +85,12 @@ cliParser = OA.hsubparser $
(pure Names)
(OA.fullDesc <> OA.header "names" <> OA.progDesc "All profiles names")
)
<>
OA.command "names-cloud-noera"
(OA.info
(pure NamesCloudNoEra)
(OA.fullDesc <> OA.header "names" <> OA.progDesc "All cloud profiles names (no era suffix)")
)
<>
OA.command "all"
(OA.info
Expand Down
6 changes: 5 additions & 1 deletion bench/cardano-profile/src/Cardano/Benchmarking/Profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
--------------------------------------------------------------------------------

module Cardano.Benchmarking.Profile (
names, namesNoEra
names, namesNoEra, namesCloudNoEra
, byName
, profiles
, libMk
Expand Down Expand Up @@ -51,6 +51,10 @@ names :: [String]
-- Overlay not supported here, using an empty overlay.
names = Map.keys (profiles mempty)

namesCloudNoEra :: [String]
-- Overlay not supported here, using an empty overlay.
namesCloudNoEra = map Types.name profilesNoEraCloud

-- Names:
-- wb profile all-profiles | jq .[] | jq -r .name | sort | uniq | grep "\-bage"
namesNoEra :: [String]
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
workbenchStartArgs = [ "--create-testnet-data" "--trace" ];
};

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

system-tests = pkgs.writeShellApplication {
name = "system-tests";
Expand Down
45 changes: 45 additions & 0 deletions nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,51 @@ in with final;

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

# The profile data and backend data of the cloud / "*-nomadperf" profiles.
# Useful to mix workbench and cardano-node commits, mostly because of scripts.
profile-data-nomadperf = builtins.listToAttrs (
builtins.map
(cloudName:
# Only Conway era cloud profiles are flake outputs.
let profileName = "${cloudName}-coay";
in {
name = profileName;
value =
let
# Default values only ("run/current", 30000, profiling "none").
profile = workbench.profile {
inherit profileName;
inherit (customConfig) profiling;
};
backend = workbench.backend
{ backendName = "nomadcloud";
stateDir = customConfig.localCluster.stateDir;
basePort = customConfig.localCluster.basePort;
useCabalRun = customConfig.localCluster.useCabalRun;
}
;
profileData = profile.materialise-profile
{ inherit backend; }
;
backendData = backend.materialise-profile {inherit profileData;};
in pkgs.runCommand "workbench-data-${profileName}" {}
''
mkdir $out
ln -s ${profileData} $out/profileData
ln -s ${backendData} $out/backendData
''
;
}
)
# Fetch all "*-nomadperf" profiles.
(__fromJSON (__readFile
(pkgs.runCommand "cardano-profile-names-cloud-noera" {} ''
${cardanoNodePackages.cardano-profile}/bin/cardano-profile names-cloud-noera > $out
''
)
))
);

# Disable failing python uvloop tests
python39 = prev.python39.override {
packageOverrides = pythonFinal: pythonPrev: {
Expand Down

0 comments on commit 5c35c24

Please sign in to comment.