Skip to content

Commit f1dcd6b

Browse files
authored
Merge pull request #6298 from IntersectMBO/bench-master
bench: maintenance
2 parents 5bf42d6 + 1f67c9a commit f1dcd6b

File tree

21 files changed

+2114
-138
lines changed

21 files changed

+2114
-138
lines changed

bench/cardano-profile/cardano-profile.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ library
7070
, Cardano.Benchmarking.Profile.Primitives
7171
, Cardano.Benchmarking.Profile.Vocabulary
7272
, Cardano.Benchmarking.Profile.Types
73+
, Cardano.Benchmarking.Profile.Workload.CGroupMemory
7374
, Cardano.Benchmarking.Profile.Workload.Latency
7475
, Cardano.Benchmarking.Profile.Workload.Voting
7576
build-depends: base >=4.12 && <5

bench/cardano-profile/data/all-profiles-coay.json

Lines changed: 1773 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import qualified Cardano.Benchmarking.Profile.Playground as Pl (calibrateLoopBlo
2323
import qualified Cardano.Benchmarking.Profile.Primitives as P
2424
import qualified Cardano.Benchmarking.Profile.Types as Types
2525
import qualified Cardano.Benchmarking.Profile.Vocabulary as V
26+
import qualified Cardano.Benchmarking.Profile.Workload.CGroupMemory as C
2627
import qualified Cardano.Benchmarking.Profile.Workload.Voting as W
2728
import qualified Cardano.Benchmarking.Profile.Workload.Latency as L
2829

@@ -145,11 +146,18 @@ profilesNoEraCloud =
145146
-- The name of the defined volume in the Nomad Client config and
146147
-- where to mount it inside the isolated chroot.
147148
-- If the volume is not present the deployment will fail!
148-
. P.nomadHostVolume (Types.ByNodeType {
149+
. P.appendNomadHostVolume (Types.ByNodeType {
149150
Types.producer = [Types.HostVolume "/ephemeral" False "ephemeral"]
150151
, Types.explorer = Nothing
151152
})
152153
. P.ssdDirectory "/ephemeral"
154+
-- Helper adding workload that takes periodic snapshots of cgroup's `memory.stat`.
155+
cgmem = -- Require the cgroup fs mounted by default.
156+
P.appendNomadHostVolume (Types.ByNodeType {
157+
Types.producer = [Types.HostVolume "/sys/fs/cgroup" True "cgroup"]
158+
, Types.explorer = Nothing
159+
})
160+
. P.workloadAppend C.cgroupMemoryWorkload
153161
in [
154162
-- Value (pre-Voltaire profiles)
155163
value & P.name "value-nomadperf" . P.dreps 0 . P.newTracing . P.p2pOn
@@ -163,6 +171,8 @@ profilesNoEraCloud =
163171
, valueVolt & P.name "value-volt-nomadperf" . P.dreps 10000 . P.newTracing . P.p2pOn
164172
, valueVolt & P.name "value-volt-rtsqg1-nomadperf" . P.dreps 10000 . P.newTracing . P.p2pOn . P.rtsGcParallel . P.rtsGcLoadBalance
165173
, valueVolt & P.name "value-volt-lmdb-nomadperf" . P.dreps 10000 . P.newTracing . P.p2pOn . lmdb
174+
, valueVolt & P.name "value-volt-cgmem-nomadperf" . P.dreps 10000 . P.newTracing . P.p2pOn . cgmem
175+
, valueVolt & P.name "value-volt-lmdb-cgmem-nomadperf" . P.dreps 10000 . P.newTracing . P.p2pOn . lmdb . cgmem
166176
-- Plutus (pre-Voltaire profiles)
167177
, loop & P.name "plutus-nomadperf" . P.dreps 0 . P.newTracing . P.p2pOn
168178
, loop & P.name "plutus-nomadperf-nop2p" . P.dreps 0 . P.newTracing . P.p2pOff
@@ -293,8 +303,8 @@ profilesNoEraCloud =
293303

294304
--------------------------------------------------------------------------------
295305

296-
nomadPerf :: Types.Profile -> Types.Profile
297-
nomadPerf =
306+
nomadPerfBase :: Types.Profile -> Types.Profile
307+
nomadPerfBase =
298308
-- Exact regions with availability zone (AZ) to match.
299309
P.regions
300310
[
@@ -306,20 +316,6 @@ nomadPerf =
306316
-- Logical cluster separation. To avoid conflicts with same-server machines.
307317
P.nomadNamespace "perf" . P.nomadClass "perf"
308318
.
309-
-- This will be used as constraints at the Task level.
310-
P.nomadResources (Types.ByNodeType {
311-
Types.producer = Types.Resources {
312-
Types.cores = 8
313-
, Types.memory = 15400
314-
, Types.memory_max = 16000
315-
}
316-
, Types.explorer = Just $ Types.Resources {
317-
Types.cores = 16
318-
, Types.memory = 32000
319-
, Types.memory_max = 64000
320-
}
321-
})
322-
.
323319
-- Instance types will be used as Group "constraints".
324320
P.awsInstanceTypes (Types.ByNodeType {
325321
Types.producer = "c5d.2xlarge"
@@ -340,3 +336,28 @@ nomadPerf =
340336
.
341337
-- Don't stop the Nomad Job when finished.
342338
P.clusterKeepRunningOn
339+
340+
nomadPerf :: Types.Profile -> Types.Profile
341+
nomadPerf =
342+
nomadPerfBase . nomadPerfResourcesAll
343+
344+
nomadPerfResourcesAll :: Types.Profile -> Types.Profile
345+
nomadPerfResourcesAll =
346+
-- This will be used as constraints at the Task level.
347+
P.nomadResources (Types.ByNodeType {
348+
Types.producer = Types.Resources {
349+
Types.cores = 8
350+
, Types.memory = 15400
351+
, Types.memory_max = 16000
352+
}
353+
-- Explorer is unchanged between cloud profiles.
354+
, Types.explorer = Just resourcesExplorer
355+
})
356+
357+
resourcesExplorer :: Types.Resources
358+
resourcesExplorer =
359+
Types.Resources {
360+
Types.cores = 16
361+
, Types.memory = 32000
362+
, Types.memory_max = 64000
363+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ clusterNomadSsdNoRegions =
100100
, Types.explorer = Just $ Types.Resources 16 120000 124000
101101
})
102102
.
103-
P.nomadHostVolume (
103+
P.appendNomadHostVolume (
104104
let hostVolumes =
105105
[ Types.HostVolume "/ssd1" False "ssd1"
106106
, Types.HostVolume "/ssd2" False "ssd2"

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ module Cardano.Benchmarking.Profile.Primitives (
9999

100100
-- Cluster params.
101101
, clusterMinimunStorage, ssdDirectory, clusterKeepRunningOn
102-
, nomadNamespace, nomadClass, nomadResources, nomadHostVolume, nomadSSHLogsOn
103-
, awsInstanceTypes, usePublicRouting
102+
, nomadNamespace, nomadClass, nomadResources, appendNomadHostVolume
103+
, nomadSSHLogsOn, awsInstanceTypes, usePublicRouting
104104

105105
-- Analysis params.
106106
, analysisOff, analysisStandard, analysisPerformance
@@ -877,8 +877,12 @@ nomadClass nc = nomad (\n -> n {Types.nomad_class = nc})
877877
nomadResources :: Types.ByNodeType Types.Resources -> Types.Profile -> Types.Profile
878878
nomadResources r = nomad (\n -> n {Types.resources = r})
879879

880-
nomadHostVolume :: Types.ByNodeType [Types.HostVolume] -> Types.Profile -> Types.Profile
881-
nomadHostVolume h = nomad (\n -> n {Types.host_volumes = Just h})
880+
appendNomadHostVolume :: Types.ByNodeType [Types.HostVolume] -> Types.Profile -> Types.Profile
881+
appendNomadHostVolume h = nomad (\n -> n {Types.host_volumes = Just $
882+
case Types.host_volumes n of
883+
Nothing -> h
884+
(Just bnt) -> bnt <> h
885+
})
882886

883887
nomadSSHLogsOn :: Types.Profile -> Types.Profile
884888
nomadSSHLogsOn = nomad (\n -> n {Types.fetch_logs_ssh = True})

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,12 @@ data ByNodeType a = ByNodeType
670670
}
671671
deriving (Eq, Show, Generic)
672672

673+
instance Semigroup a => Semigroup (ByNodeType a) where
674+
(ByNodeType p me) <> (ByNodeType p' me') = ByNodeType (p <> p') (me <> me')
675+
676+
instance Monoid a => Monoid (ByNodeType a) where
677+
mempty = ByNodeType mempty Nothing
678+
673679
instance Aeson.ToJSON a => Aeson.ToJSON (ByNodeType a)
674680

675681
instance Aeson.FromJSON a => Aeson.FromJSON (ByNodeType a)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{-# LANGUAGE Trustworthy #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
4+
--------------------------------------------------------------------------------
5+
6+
module Cardano.Benchmarking.Profile.Workload.CGroupMemory (
7+
cgroupMemoryWorkload
8+
) where
9+
10+
--------------------------------------------------------------------------------
11+
12+
import Prelude
13+
-- Package: self.
14+
import qualified Cardano.Benchmarking.Profile.Types as Types
15+
16+
--------------------------------------------------------------------------------
17+
18+
cgroupMemoryWorkload :: Types.Workload
19+
cgroupMemoryWorkload = Types.Workload {
20+
Types.workloadName = "cgroup_memory"
21+
, Types.parameters = mempty
22+
, Types.entrypoints = Types.Entrypoints {
23+
Types.pre_generator = Nothing
24+
, Types.producers = "cgroup_memory"
25+
}
26+
, Types.wait_pools = True
27+
}

cardano-tracer/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# General reviewers per PR
2-
# Denis Serge
3-
* @denisshevchenko @deepfire
2+
# Baldur Michael
3+
* @Icelandjack @mgmeier

nix/workbench/backend/nomad-job.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,12 @@ let
746746
;
747747
# Only for the node that will run the generator
748748
withGenerator = taskName == generatorTaskName;
749-
# Only for the tracer task or also nodes if oneTracerPerNode
750-
withTracer = oneTracerPerNode || taskName == "tracer";
749+
# Only if "tracer" was requested.
750+
# And, if tracer task or also nodes if oneTracerPerNode.
751+
withTracer =
752+
profile.node.tracer
753+
&& (oneTracerPerNode || taskName == "tracer")
754+
;
751755
inherit withSsh;
752756
# ''{{ env "NOMAD_TASK_DIR" }}/supervisor.sock''
753757
inherit unixHttpServerPort;

nix/workbench/backend/nomad.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ let
166166
};
167167
tx-generator = rec {
168168
# Local reference only used if not "cloud".
169-
nix-store-path = pkgs.cardanoNodePackages.tx-generator.passthru.noGitRev;
169+
nix-store-path = pkgs.cardanoNodePackages.tx-generator;
170170
flake-reference = "github:intersectmbo/cardano-node";
171-
flake-output = "cardanoNodePackages.tx-generator.passthru.noGitRev";
171+
flake-output = "cardanoNodePackages.tx-generator";
172172
};
173173
}
174174
;

0 commit comments

Comments
 (0)