Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $SEASON to the node job name to be selectively killed in restarts #1312

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions start_node_genesis_onprem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,13 @@ fi

printf '\n'
printf 'Killing old jobs..\n'
sudo killall node
sudo killall 'client/ain-blockchain-${SEASON}-index.js'
if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then
printf '\n'
printf 'Setting up new working directory..\n'
sudo rm -rf /home/${SEASON}-ain-blockchain*
CODE_CMD="cd ~; sudo mv ${SEASON}-ain-blockchain /home; sudo chmod -R 777 /home/${SEASON}-ain-blockchain; sudo chown -R $GCP_USER:$GCP_USER /home/${SEASON}-ain-blockchain; cd /home/${SEASON}-ain-blockchain"
# NOTE(platfowner): Add $SEASON to the node job name to be selectively killed in restarts.
CODE_CMD="cd ~; sudo mv ${SEASON}-ain-blockchain /home; sudo chmod -R 777 /home/${SEASON}-ain-blockchain; sudo chown -R $GCP_USER:$GCP_USER /home/${SEASON}-ain-blockchain; cd /home/${SEASON}-ain-blockchain; mv client/index.js client/ain-blockchain-${SEASON}-index.js"
printf "\nCODE_CMD=$CODE_CMD\n"
eval $CODE_CMD
else
Expand Down Expand Up @@ -338,7 +339,7 @@ else
fi

printf "\nStarting up Blockchain Node server..\n\n"
START_CMD="nohup node --async-stack-traces --max-old-space-size=$MAX_OLD_SPACE_SIZE_MB client/index.js >/dev/null 2>error_logs.txt &"
START_CMD="nohup node --async-stack-traces --max-old-space-size=$MAX_OLD_SPACE_SIZE_MB client/ain-blockchain-${SEASON}-index.js >/dev/null 2>error_logs.txt &"
printf "\nSTART_CMD=$START_CMD\n"
printf "START_CMD=$START_CMD\n" >> start_commands.txt
eval $START_CMD
Expand Down
Loading