Skip to content

Commit

Permalink
feat: attempt to enable verbose script logging
Browse files Browse the repository at this point in the history
feat: add some basic ssh tests
fix: attempt to log remote output and get ssh output
  • Loading branch information
cryptonemo committed Jul 15, 2020
1 parent d06cbcf commit 5ded29b
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions fil-proofs-tooling/scripts/run-remote.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/env bash

echo "Benchmark server: $2"
# First test if basic ssh to remote host is working
echo "ssh test1"
out=$(ssh $2 "echo Remote Host: $HOSTNAME")
echo $out
echo "ssh test2"
out=$(ssh $2 "ls /tmp")
echo $out
echo "ssh test3"
out=$(ssh $2 "which git")
echo $out
echo "ssh testing complete"

CMDS=$(cat <<EOF
set -x
set -e
# Creates a temporary directory in which we build rust-fil-proofs and capture
Expand All @@ -26,14 +37,16 @@ git clone -b $1 --single-branch https://github.com/filecoin-project/rust-fil-pro
cd \$_metrics_dir
cargo update
cargo fetch
./fil-proofs-tooling/scripts/retry.sh 42 10 60000 \
./fil-proofs-tooling/scripts/with-lock.sh 42 /tmp/metrics.lock \
./fil-proofs-tooling/scripts/with-dots.sh \
${@:3}
EOF
)

ssh -q $2 "$CMDS"
timestamp=$(date "+%s")
metrics_log="/tmp/metrics_capture-$timestamp.log"

ssh $2 "$CMDS" > $metrics_log 2>&1 && \
cat $metrics_log && \
rm $metrics_log

0 comments on commit 5ded29b

Please # to comment.