Skip to content

Commit

Permalink
Update the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Oct 21, 2023
1 parent e7b9e82 commit 4d6ea3f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 84 deletions.
40 changes: 0 additions & 40 deletions .devnet/.ssh-install.sh

This file was deleted.

7 changes: 3 additions & 4 deletions .devnet/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ run_installation() {
# SSH into the node
ssh -o StrictHostKeyChecking=no aws-n$NODE_ID << EOF
# Commands to run on the remote instance
sudo -i # Switch to root user
WORKSPACE=~/snarkOS
if [ -d "\$WORKSPACE" ]; then
Expand All @@ -28,10 +29,8 @@ run_installation() {
git checkout $BRANCH # Checkout the specified branch
fi
./.devnet/.ssh-install.sh
# Exit the SSH session
exit
sudo ./build_ubuntu.sh
exit # Exit root user
EOF

# Check the exit status of the SSH command
Expand Down
52 changes: 12 additions & 40 deletions .devnet/monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,24 @@ for validator_index in "${validator_indices[@]}"; do
tmux new-window -t "devnet-aws:$validator_index" -n "window$validator_index"

# Define the SSH command to run on the remote instance
ssh_command="sudo -i && tmux attach-session -t 'snarkos-session'"
ssh_command="sudo -i tmux attach-session -t 'snarkos-session'"

# Send the SSH command to the new window
tmux send-keys -t "devnet-aws:window$validator_index" "ssh -o StrictHostKeyChecking=no aws-n$validator_index \"$ssh_command\"" C-m
tmux send-keys -t "devnet-aws:window$validator_index" "ssh -t -o StrictHostKeyChecking=no aws-n$validator_index \"$ssh_command\"" C-m
done

# Attach to the tmux session to view and interact with the windows
tmux attach-session -t "devnet-aws"






## Define a function to monitor SnarkOS in a tmux session on a node
#monitor_snarkos_in_tmux() {
# local NODE_ID=$1
# local LOCAL_WINDOW_INDEX=$2
#
# # Create a new local tmux window with a unique name
# tmux new-window -n "aws-n$NODE_ID" -t "$LOCAL_WINDOW_INDEX"
#
# # SSH into the node and attach to the SnarkOS tmux session
# ssh -o StrictHostKeyChecking=no aws-n$NODE_ID << EOF
# # Commands to run on the remote instance
# sudo -i # Switch to root user
# tmux attach-session -t "snarkos-session"
#EOF
## Read the node ID to query from the user
#read -p "Enter the node ID (default: 0): " NODE_ID
#NODE_ID="${NODE_ID:-0}"
#
# # Check the exit status of the SSH command
# if [ $? -eq 0 ]; then
# echo "Monitoring SnarkOS in a tmux session on aws-n$NODE_ID."
# else
# echo "Failed to monitor SnarkOS in a tmux session on aws-n$NODE_ID."
# fi
#}
#
## Create a new local tmux session named "aws-nodes"
#tmux new-session -d -s "aws-nodes"
#
## Loop through aws-n nodes and monitor SnarkOS tmux sessions in parallel
#for NODE_ID in $(seq 0 $((NUM_INSTANCES - 1))); do
# monitor_snarkos_in_tmux $NODE_ID $NODE_ID &
#done
#
## Attach to the local tmux session to view and interact with the windows
#tmux attach-session -t "aws-nodes"


## SSH into the node and attach to the SnarkOS tmux session
##ssh -o StrictHostKeyChecking=no aws-n$NODE_ID << EOF
## # Commands to run on the remote instance
## sudo -i # Switch to root user
## tmux attach-session -t "snarkos-session"
##EOF
#ssh -t -o StrictHostKeyChecking=no aws-n$NODE_ID "sudo -i tmux attach-session -t 'snarkos-session'"

0 comments on commit 4d6ea3f

Please sign in to comment.