Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wb | enable cardano-profile #5994

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import qualified Data.ByteString.Lazy.Char8 as BSL8
import qualified Options.Applicative as OA
-- Package: self.
import qualified Cardano.Benchmarking.Profile as Profiles
import qualified Cardano.Benchmarking.Profile.NodeSpecs as NodeSpecs
import qualified Cardano.Benchmarking.Profile.Types as Types

--------------------------------------------------------------------------------
Expand All @@ -22,6 +23,7 @@ data Cli =
| All
| ByName String
| LibMK
| NodeSpecs FilePath FilePath
| ToJson String
| FromJson String

Expand Down Expand Up @@ -49,6 +51,18 @@ main = do
in BSL8.putStrLn aeson
LibMK -> do
mapM_ putStrLn Profiles.libMk
(NodeSpecs profilePath topologyPath) -> do
eitherProfile <- Aeson.eitherDecodeFileStrict profilePath
let profile = case eitherProfile of
(Left errorMsg) ->
error $ "Not a valid profile: " ++ errorMsg
(Right value) -> value
eitherTopology <- Aeson.eitherDecodeFileStrict topologyPath
let topology = case eitherTopology of
(Left errorMsg) ->
error $ "Not a valid topology: " ++ errorMsg
(Right value) -> value
BSL8.putStrLn $ Aeson.encode $ NodeSpecs.nodeSpecs profile topology
-- Print a single profiles, with an optional overlay.
(ToJson filePath) -> print filePath
-- str <- readFile filePath
Expand Down Expand Up @@ -109,6 +123,15 @@ cliParser = OA.hsubparser $
(pure LibMK)
(OA.fullDesc <> OA.header "lib-make" <> OA.progDesc "Makefile include")
)
<>
OA.command "node-specs"
(OA.info
( NodeSpecs
<$> OA.argument OA.str (OA.metavar "PROFILE-JSON-FILEPATH" )
<*> OA.argument OA.str (OA.metavar "TOPOLOGY-JSON-FILEPATH")
)
(OA.fullDesc <> OA.header "node-specs" <> OA.progDesc "Create the profile's node-specs.json file")
)
<>
OA.command "to-json"
(OA.info
Expand Down
11 changes: 10 additions & 1 deletion bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ data-files: data/all-profiles.json
data/ci-test-bage.json
data/genesis/epoch-timeline.json
data/genesis/overlays/*.json
data/test/default-coay/*.json
data/test/chainsync-early-alonzo-coay/*.json
data/test/chainsync-early-byron-coay/*.json
data/test/ci-test-coay/*.json
data/test/ci-test-dense10-coay/*.json
data/test/fast-nomadperf-coay/*.json

common project-config
build-depends: base >= 4.14 && < 5
Expand All @@ -37,6 +43,7 @@ library
other-modules: Paths_cardano_profile
autogen-modules: Paths_cardano_profile
exposed-modules: Cardano.Benchmarking.Profile
-- Profile definitions.
, Cardano.Benchmarking.Profile.Builtin.Cloud
, Cardano.Benchmarking.Profile.Builtin.Empty
, Cardano.Benchmarking.Profile.Builtin.ForgeStress
Expand All @@ -52,6 +59,7 @@ library
, Cardano.Benchmarking.Profile.Builtin.Scenario.Idle
, Cardano.Benchmarking.Profile.Builtin.Scenario.TracerOnly
, Cardano.Benchmarking.Profile.Extra.Scaling
, Cardano.Benchmarking.Profile.NodeSpecs
, Cardano.Benchmarking.Profile.Primitives
, Cardano.Benchmarking.Profile.Vocabulary
, Cardano.Benchmarking.Profile.Types
Expand Down Expand Up @@ -81,7 +89,8 @@ test-suite cardano-profile-test
hs-source-dirs: test/
main-is: Main.hs
type: exitcode-stdio-1.0
other-modules: Paths_cardano_profile
other-modules: Cardano.Benchmarking.Profile.NodeSpecs.Tests
, Paths_cardano_profile
autogen-modules: Paths_cardano_profile
build-depends: base
, aeson
Expand Down
444,057 changes: 444,056 additions & 1 deletion bench/cardano-profile/data/all-profiles.json

Large diffs are not rendered by default.

696 changes: 348 additions & 348 deletions bench/cardano-profile/data/genesis/epoch-timeline.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"node-0": {
"i": 0,
"kind": "chaindb-server",
"pools": 0,
"autostart": true,
"name": "node-0",
"isProducer": false,
"port": 30000,
"region": null,
"shutdown_on_slot_synced": 38901589,
"shutdown_on_block_synced": null
},
"explorer": {
"i": 1,
"kind": "explorer",
"pools": 0,
"autostart": false,
"name": "explorer",
"isProducer": false,
"port": 30001,
"region": null,
"shutdown_on_slot_synced": 38901589,
"shutdown_on_block_synced": null
}
}
Loading
Loading