Skip to content

Commit

Permalink
CAD-3257 bench: switch to cardano-node / drop cardano-benchmarking
Browse files Browse the repository at this point in the history
# Conflicts:
#	nix/sources.json
  • Loading branch information
deepfire committed Jul 29, 2021
1 parent 6e4d1f6 commit 2b8ecb3
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 51 deletions.
2 changes: 0 additions & 2 deletions bench/bench.sh
Expand Up @@ -620,8 +620,6 @@ fetch_run() {
oprint "run directory: ${dir}"
pushd "${dir}" >/dev/null || return 1

run_fetch_benchmarking 'tools'

local producers
producers=($(params producers))
oprint "fetching logs from: explorer ${producers[*]}"
Expand Down
1 change: 0 additions & 1 deletion bench/lib-analysis.sh
Expand Up @@ -58,7 +58,6 @@ analyse_run() {
then fail "run directory doesn't exist: $dir"; fi
if test ! -f "$dir/meta.json"
then fail "run directory doesn't has no metafile: $dir"; fi
run_fetch_benchmarking "$dir/tools"

machines=($(jq '.machine_info | keys | join(" ")
' --raw-output <"$dir/deployment-explorer.json"))
Expand Down
10 changes: 0 additions & 10 deletions bench/lib-benchrun.sh
Expand Up @@ -24,16 +24,6 @@ run_report_name() {
echo "$date.$batch.$prof${suffix:+.$suffix}"
}

run_fetch_benchmarking() {
local targetdir=$1
oprint "fetching tools from 'cardano-benchmarking' $(nix-instantiate --eval -E "(import $(dirname "${self}")/../nix/sources.nix).cardano-benchmarking.rev" | tr -d '"' | cut -c-8) .."
export nix_store_benchmarking=$(nix-instantiate --eval -E "(import $(dirname "${self}")/../nix/sources.nix).cardano-benchmarking.outPath" | tr -d '"' )
test -d "$nix_store_benchmarking" ||
fail "couldn't fetch 'cardano-benchmarking'"
mkdir -p "$targetdir"
cp -fa "$nix_store_benchmarking"/scripts/*.sh "$targetdir"
}

is_run_broken() {
local dir=${1:-}

Expand Down
4 changes: 1 addition & 3 deletions bench/lib-deploy.sh
Expand Up @@ -53,8 +53,7 @@ update_deployfiles() {
, genesis_hash: \"$(genesis_hash)\"
, profile_content: $(profjq "${prof}" .)
, pins:
{ \"cardano-benchmarking\": $(jq '.["cardano-benchmarking"].rev' nix/sources.json)
, \"cardano-node\": $(jq '.["cardano-node"].rev' nix/sources.bench.json)
{ \"cardano-node\": $(jq '.["cardano-node"].rev' nix/sources.bench.json)
, \"cardano-ops\": \"$(git rev-parse HEAD)\"
}
, ops_modified: $(if git diff --quiet --exit-code
Expand Down Expand Up @@ -113,7 +112,6 @@ deploystate_deploy_profile() {

era=$(get_era)
topology=$(parmetajq .topology)
benchmarking_rev=$(jq --raw-output '.["cardano-benchmarking"].rev' nix/sources.json)
node_rev=$(jq --raw-output '.["cardano-node"].rev' nix/sources.bench.json)
ops_rev=$(git rev-parse HEAD)
ops_branch=$(maybe_local_repo_branch . ${ops_rev})
Expand Down
14 changes: 2 additions & 12 deletions bench/sync-to.sh
Expand Up @@ -14,12 +14,7 @@ do case "$1" in
* ) break;; esac; shift; done
set -u

other_repo=${1:-$(realpath "$this_repo"/../cardano-benchmarking)}
other_project=$other_repo/cabal.project
other_name=$(basename "$other_repo")

repos=(
"$other_name"
cardano-node
)

Expand Down Expand Up @@ -59,8 +54,8 @@ fail() {
exit 1
}

test -r "$other_project" ||
fail "Usage: $(basename "$0") [SYNC-FROM-REPO=../${other_name}]"
# test -r "$other_project" ||
# fail "Usage: $(basename "$0") [SYNC-FROM-REPO=../${other_name}]"

declare -A repo_commit
declare -A repo_hash
Expand Down Expand Up @@ -101,11 +96,6 @@ EOF
fi
}

## Update sources.json
update_sources_pin "$this_repo" 'sources' "$other_name" \
"${repo_commit[$other_name]}" \
"${repo_hash[$other_name]}"

update_sources_pin "$this_repo" 'sources.bench' 'cardano-node' \
"${repo_commit['cardano-node']}" \
"${repo_hash['cardano-node']}"
Expand Down
2 changes: 1 addition & 1 deletion globals-bench.nix
Expand Up @@ -133,7 +133,7 @@ in (rec {
} // pkgs.iohkNix.cardanoLib.defaultExplorerLogConfig;

## This is overlaid atop the defaults in the tx-generator service,
## as specified in the 'cardano-benchmarking' repository.
## as specified in the 'cardano-node' repository.
generatorConfig = benchmarkingProfile.generator;
};

Expand Down
8 changes: 0 additions & 8 deletions nix/benchmarking.nix

This file was deleted.

2 changes: 2 additions & 0 deletions nix/cardano.nix
Expand Up @@ -11,6 +11,8 @@ in rec {
inherit (cardanoNodePkgs.cardanoNodeHaskellPackages.cardano-submit-api.components.exes) cardano-submit-api;
inherit (cardanoNodePkgs.cardanoNodeHaskellPackages.cardano-node.components.exes) cardano-node;
inherit (cardanoNodePkgs.cardanoNodeHaskellPackages.network-mux.components.exes) cardano-ping;
inherit (cardanoNodePkgs.cardanoNodeHaskellPackages.locli.components.exes) locli;
inherit (cardanoNodePkgs.cardanoNodeHaskellPackages.tx-generator.components.exes) tx-generator;
inherit (cardano-rosetta-pkgs) cardano-rosetta-server;

cardano-node-eventlogged = cardanoNodePkgs.cardanoNodeEventlogHaskellPackages.cardano-node.components.exes.cardano-node;
Expand Down
1 change: 0 additions & 1 deletion nix/default.nix
Expand Up @@ -88,7 +88,6 @@ let
# our own overlays:
local-overlays = [
(import ./cardano.nix)
(import ./benchmarking.nix)
(import ./packages.nix)
];

Expand Down
18 changes: 9 additions & 9 deletions nix/sources.json
Expand Up @@ -11,19 +11,19 @@
"url": "https://github.com/turnkeylinux/aws-datacenters/archive/a7106906e60969e917e555fd770454f72c78bb75.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cardano-benchmarking": {
"branch": "master",
"description": "Epic win",
"homepage": null,
"cardano-db-sync-10": {
"branch": "refs/tags/10.0.0",
"description": "A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL",
"homepage": "",
"owner": "input-output-hk",
"repo": "cardano-benchmarking",
"rev": "708ce37b4cf1ea74764c4f0d825a3a1b8212eafe",
"sha256": "0p3ikpsyla5qy1qxamvfrg2lv7zlz9fa524y8izxjd6xb2i8df90",
"repo": "cardano-db-sync",
"rev": "44ce5b94475c31a57a8d7a892f5e112f0cb4c012",
"sha256": "0kcfkkcx1sszz97d5gjb4bb0r1i2fx1njz35dx35d4fb5qfsmhym",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-benchmarking/archive/708ce37b4cf1ea74764c4f0d825a3a1b8212eafe.tar.gz",
"url": "https://github.com/input-output-hk/cardano-db-sync/archive/44ce5b94475c31a57a8d7a892f5e112f0cb4c012.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cardano-db-sync": {
"cardano-db-sync-9": {
"branch": "refs/tags/9.0.0",
"description": "A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL",
"homepage": "",
Expand Down
9 changes: 6 additions & 3 deletions roles/tx-generator.nix
Expand Up @@ -18,11 +18,14 @@ let
! (node.config.services.cardano-db-sync.enable or false))
nodes;

# benchmarking-src = ../../cardano-benchmarking;
benchmarking-src = sourcePaths.cardano-benchmarking;
node-src = sourcePaths.cardano-node;
in {
imports = [
(benchmarking-src + "/nix/nixos/tx-generator-service.nix")
(import (node-src + "/nix/nixos/tx-generator-service.nix")
## XXX: ugly -- svclib should really move to iohk-nix.
(pkgs
//
{ commonLib = import (node-src + "/nix/svclib.nix") { inherit pkgs; }; }))
];

services.tx-generator = {
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Expand Up @@ -23,7 +23,7 @@ in mkShell (rec {
cardano-cli
dnsutils
iohkNix.niv
locli.components.exes.locli
locli
nivOverrides
nix
nix-diff
Expand Down

0 comments on commit 2b8ecb3

Please sign in to comment.