Skip to content

Commit

Permalink
Merge #2045
Browse files Browse the repository at this point in the history
2045: Fix restore bench and docker r=Anviking a=Anviking

# Issue Number

#1919, #2044 


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Fix broken restore bench  https://buildkite.com/input-output-hk/cardano-wallet-nightly/builds/608#f02f336b-c7be-4b3f-b86b-bc825c9b5ac2
- [ ] _Hope_ `docker` should be fixed, but can't easily test locally ⚠️ 


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Johannes Lund <johannes.lund@iohk.io>
  • Loading branch information
iohk-bors[bot] and Anviking committed Aug 18, 2020
2 parents 75b583a + 783f6f1 commit 1d7914c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
23 changes: 11 additions & 12 deletions .buildkite/bench-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@

set -euo pipefail

if [ "$#" -lt 2 ]; then
echo "usage: $0 TARGET NETWORK"
if [ "$#" -lt 1 ]; then
echo "usage: $0 NETWORK"
exit 1
fi

target=$1
network=$2
artifact_name=restore-$target-$network
network=$1
artifact_name=restore-$network
log=restore.log
results=restore-$target-$network.txt
results=restore-$network.txt
total_time=restore-time.txt

: "${NODE_DB:=$HOME/node-db-$target-$network}"
: "${NODE_DB:=$HOME/node-db-$network}"

echo "--- Build"

nix-build -A benchmarks.cardano-wallet-$target.restore -o bench-$target-restore
nix-build -A benchmarks.cardano-wallet.restore -o bench-restore

bench="./bench-$target-restore/bin/restore $network"
bench="./bench-restore/bin/restore $network"

echo "--- Run benchmarks - $target - $network"
echo "--- Run benchmarks - $network"

if [ -n "${SCRATCH_DIR:-}" ]; then
mkdir -p "$SCRATCH_DIR"
Expand All @@ -34,7 +33,7 @@ command time -o $total_time -v $bench +RTS -N2 -qg -A1m -I0 -T -M8G -h -RTS 2>&1

grep -v INFO $log | awk '/All results/,EOF { print $0 }' > $results

echo "+++ Results - $target - $network"
echo "+++ Results - $network"

cat $results

Expand All @@ -53,7 +52,7 @@ show ylabel;
set terminal svg dynamic size 1200,700 background rgb 'white';
set output "plot.svg";
set title "Restoring $target wallets on $network";
set title "Restoring wallets on $network";
set key left top;
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

steps:
- label: 'Restore benchmark - cardano mainnet'
command: "./.buildkite/bench-restore.sh shelley mainnet"
command: "./.buildkite/bench-restore.sh mainnet"
env:
HOME: "/cache/cardano-wallet.home"
timeout_in_minutes: 600
Expand All @@ -16,7 +16,7 @@ steps:
queue: benchmark

- label: 'Restore benchmark - cardano testnet'
command: "./.buildkite/bench-restore.sh shelley testnet"
command: "./.buildkite/bench-restore.sh testnet"
env:
HOME: "/cache/cardano-wallet.home"
timeout_in_minutes: 600
Expand Down
4 changes: 2 additions & 2 deletions .github/RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ the moment of releasing. -->
Pull from DockerHub and verify the version matches {{CABAL_VERSION}}.

```
$ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}-shelley
$ docker run --rm inputoutput/cardano-wallet:{{CABAL_VERSION}}-shelley version
$ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}
$ docker run --rm inputoutput/cardano-wallet:{{CABAL_VERSION}} version
```

### ITN (jormungandr)
Expand Down
8 changes: 5 additions & 3 deletions nix/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ let
defaultPort = "8090";
dataDir = "/data";

startScript = writeScriptBin "start-cardano-wallet-${backend}" ''
suffix = if backend == "shelley" then "" else "-" + backend;
walletExeName = "cardano-wallet" + suffix;
startScript = writeScriptBin "start-wallet" ''
#!${runtimeShell}
set -euo pipefail
Expand All @@ -37,7 +39,7 @@ let
ln -s ${dataDir} /cardano-wallet
export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
exec ${exe}/bin/cardano-wallet-${backend} "$@"
exec ${exe}/bin/${walletExeName} "$@"
'';

# Config file needed for container/host resolution.
Expand Down Expand Up @@ -68,7 +70,7 @@ in
startScript
];
config = {
EntryPoint = [ "start-cardano-wallet-${backend}" ];
EntryPoint = [ "start-wallet" ];
ExposedPorts = {
"${defaultPort}/tcp" = {}; # wallet api
};
Expand Down

0 comments on commit 1d7914c

Please sign in to comment.