Skip to content

Commit

Permalink
Merge branch 'IntersectMBO:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
NanuIjaz authored Jan 19, 2025
2 parents 082661c + 9017d91 commit 5da7a01
Show file tree
Hide file tree
Showing 247 changed files with 485,158 additions and 5,872 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ configuration/cardano/mainnet-alonzo-genesis.json text eol=lf
configuration/cardano/mainnet-byron-genesis.json text eol=lf
configuration/cardano/mainnet-conway-genesis.json text eol=lf
configuration/cardano/mainnet-shelley-genesis.json text eol=lf
cardano-testnet/test/cardano-testnet-test/files/sample-proposal-anchor text eol=lf
cardano-testnet/test/cardano-testnet-test/files/sample-constitution-anchor text eol=lf
6 changes: 1 addition & 5 deletions .github/workflows/check-hlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ jobs:

steps:

- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get -y install libtinfo5
- uses: actions/checkout@v4

- name: 'Set up HLint'
uses: rwe/actions-hlint-setup@v1
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/release-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,37 @@ jobs:
- name: Uploading intersectmbo/cardano-node
run: |
echo "::group::Downloading from cache"
nix build --accept-flake-config --print-out-paths --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#dockerImage/node
nix build --accept-flake-config --print-out-paths --builders "" --max-jobs 0 --out-link ./result-node ${{ steps.flake-metadata.outputs.LOCKED_URL }}#dockerImage/node
echo "::endgroup::"
echo "::group::Uploading to registry"
skopeo copy docker-archive:./result docker://ghcr.io/intersectmbo/cardano-node:$GITHUB_REF_NAME
skopeo copy docker-archive:./result-node docker://ghcr.io/intersectmbo/cardano-node:$GITHUB_REF_NAME
echo "::endgroup::"
- name: Uploading intersectmbo/cardano-submit-api
run: |
echo "::group::Downloading from cache"
nix build --accept-flake-config --print-out-paths --builders "" --max-jobs 0 ${{ steps.flake-metadata.outputs.LOCKED_URL }}#dockerImage/submit-api
nix build --accept-flake-config --print-out-paths --builders "" --max-jobs 0 --out-link ./result-api ${{ steps.flake-metadata.outputs.LOCKED_URL }}#dockerImage/submit-api
echo "::endgroup::"
echo "::group::Uploading to registry"
skopeo copy docker-archive:./result docker://ghcr.io/intersectmbo/cardano-submit-api:$GITHUB_REF_NAME
skopeo copy docker-archive:./result-api docker://ghcr.io/intersectmbo/cardano-submit-api:$GITHUB_REF_NAME
echo "::endgroup::"
- name: Obtaining latest release tag
id: latest-tag
run: |
LATEST_TAG=$(gh api repos/$GITHUB_REPOSITORY/releases/latest --jq '.tag_name')
echo "LATEST_TAG=$LATEST_TAG" >> "$GITHUB_OUTPUT"
echo "Latest release tag is: $LATEST_TAG"
- name: Tagging intersectmbo container latest
if: ${{ github.event.release.tag_name == steps.latest-tag.outputs.LATEST_TAG }}
run: |
echo "::group::Tagging latest for intersectmbo/cardano-node"
skopeo copy docker-archive:./result-node docker://ghcr.io/intersectmbo/cardano-node:latest
echo "::endgroup::"
echo "::group::Tagging latest for intersectmbo/cardano-submit-api"
skopeo copy docker-archive:./result-api docker://ghcr.io/intersectmbo/cardano-submit-api:latest
echo "::endgroup::"
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ Changelogs for components can be found as follows:
- [cardano-tracer](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-tracer/CHANGELOG.md)
- [cardano-node-capi](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-node-capi/CHANGELOG.md)
- [bench/tx-generator](https://github.com/IntersectMBO/cardano-node/blob/master/bench/tx-generator/CHANGELOG.md)
- [bench/trace-analyzer](https://github.com/IntersectMBO/cardano-node/blob/master/bench/trace-analyzer/CHANGELOG.md)

49 changes: 45 additions & 4 deletions bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
--------------------------------------------------------------------------------

import Prelude

import Data.Function ((&))
import System.Environment (lookupEnv)
-- Package: aeson.
import qualified Data.Aeson as Aeson
-- Package: aeson-pretty
import Data.Aeson.Encode.Pretty as Aeson
-- Package: bytestring.
import qualified Data.ByteString.Lazy.Char8 as BSL8
-- Package: optparse-applicative-fork.
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 @@ -20,11 +25,16 @@ data Cli =
Names
| NamesCloudNoEra
| All
| ByName String
| ByName PrettyPrint String
| LibMK
| NodeSpecs FilePath FilePath
| ToJson String
| FromJson String

data PrettyPrint =
PrettyPrint
| SingleLine

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

main :: IO ()
Expand All @@ -40,15 +50,31 @@ main = do
obj <- lookupOverlay
BSL8.putStrLn $ Aeson.encode $ Profiles.profiles obj
-- Print a single profiles, with an optional overlay.
(ByName profileName) -> do
(ByName prettyPrint profileName) -> do
obj <- lookupOverlay
case Profiles.byName profileName obj of
Nothing -> error $ "No profile named \"" ++ profileName ++ "\""
(Just profile) ->
let aeson = Aeson.encode profile
let
prettyConf = defConfig { confCompare = compare, confTrailingNewline = True }
aeson = profile & case prettyPrint of
PrettyPrint -> Aeson.encodePretty' prettyConf
SingleLine -> Aeson.encode
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 @@ -100,15 +126,30 @@ cliParser = OA.hsubparser $
<>
OA.command "by-name"
(OA.info
(ByName <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
(ByName SingleLine <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
(OA.fullDesc <> OA.header "by-name" <> OA.progDesc "Create profile")
)
<>
OA.command "by-name-pretty"
(OA.info
(ByName PrettyPrint <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
(OA.fullDesc <> OA.header "by-name-pretty" <> OA.progDesc "Create profile (pretty-printed)")
)
<>
OA.command "lib-make"
(OA.info
(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
14 changes: 12 additions & 2 deletions bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-profile
version: 8.6.0
version: 8.7.0
synopsis: A Cardano benchmarking profile generator
description: A Cardano benchmarking profile generator.
category: Cardano,
Expand All @@ -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 All @@ -70,6 +78,7 @@ executable cardano-profile
hs-source-dirs: app/
main-is: cardano-profile.hs
build-depends: aeson
, aeson-pretty
, vector
, bytestring
, optparse-applicative-fork
Expand All @@ -81,7 +90,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
469,377 changes: 469,376 additions & 1 deletion bench/cardano-profile/data/all-profiles.json

Large diffs are not rendered by default.

Loading

0 comments on commit 5da7a01

Please sign in to comment.