Skip to content

Commit

Permalink
Refresh in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jul 13, 2018
1 parent effbf0b commit 54db379
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions ci/refresh-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,40 @@ while read -r vmName vmZone status; do
vmlist+=("$vmName:$vmZone")
done < <(gcloud compute instances list --filter="labels.testnet-mode=validator" --format 'value(name,zone,status)')


echo "--- Refreshing"
mode=leader+drone
for info in "${vmlist[@]}"; do
vmName=${info%:*}
vmZone=${info#*:}
echo "Starting refresh for $vmName"

echo "--- Processing $vmName in zone $vmZone as $mode"
cat > autogen-refresh.sh <<EOF
set -x
sudo snap remove solana
sudo snap install solana $SOLANA_SNAP_CHANNEL --devmode
sudo snap set solana mode=$mode metrics-config=$SOLANA_METRICS_CONFIG
snap info solana
sudo snap logs solana -n200
EOF
(
echo "--- Processing $vmName in zone $vmZone as $mode"
cat > "autogen-refresh-$vmName.sh" <<EOF
set -x
sudo snap remove solana
sudo snap install solana $SOLANA_SNAP_CHANNEL --devmode
sudo snap set solana mode=$mode metrics-config=$SOLANA_METRICS_CONFIG
snap info solana
sudo snap logs solana -n200
EOF
set -x
gcloud compute scp --zone "$vmZone" autogen-refresh.sh "$vmName":
gcloud compute scp --zone "$vmZone" "autogen-refresh-$vmName.sh" "$vmName":
gcloud compute ssh "$vmName" --zone "$vmZone" \
--ssh-flag="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -t" \
--command="bash ./autogen-refresh.sh"
)
--command="bash ./autogen-refresh-$vmName.sh"
) > "log-$vmName.txt" 2>&1 &
mode=validator
done

echo "Waiting..."
wait

for info in "${vmlist[@]}"; do
vmName=${info%:*}
cat "log-$vmName.txt"
done

echo "--- done"
exit 0

0 comments on commit 54db379

Please sign in to comment.