Skip to content

Commit

Permalink
Merge pull request #711 from mv1388/fix_aws_instance_termination
Browse files Browse the repository at this point in the history
Switch to source-ing from executing the prepare_instance.sh script
  • Loading branch information
mv1388 committed Jul 22, 2022
2 parents ba6b6f7 + 1a2c683 commit 7c55462
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions bin/AWS/prepare_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,12 @@ export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export AWS_DEFAULT_REGION=$aws_region
cd project
source activate $py_env
pip install 'typer[all]'
if [ $pypi_install == false ]; then
pip install aitoolbox-$AIToolbox_version.tar.gz
pip install ~/project/aitoolbox-$AIToolbox_version.tar.gz
else
pip install aitoolbox==$AIToolbox_version
fi
Expand Down
4 changes: 2 additions & 2 deletions bin/AWS/submit_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ printf "\n========================================================\n"
echo "Running the job"
if [ "$run_with_scheduler" == true ]; then
ssh -i $key_path $username@$ec2_instance_address \
"source activate $py_env ; tmux new-session -d -s 'training' './finish_prepare_instance.sh ; cd project ; python ~/training_job_scheduler.py add-job --experiment-script $experiment_script_file ; python ~/training_job_scheduler.py run $terminate_setting $log_upload_setting --aws-region $aws_region' \; pipe-pane 'cat > $logging_path'"
"source activate $py_env ; tmux new-session -d -s 'training' 'source finish_prepare_instance.sh ; cd project ; python ~/training_job_scheduler.py add-job --experiment-script $experiment_script_file ; python ~/training_job_scheduler.py run $terminate_setting $log_upload_setting --aws-region $aws_region' \; pipe-pane 'cat > $logging_path'"

else
ssh -i $key_path $username@$ec2_instance_address \
"source activate $py_env ; tmux new-session -d -s 'training' './finish_prepare_instance.sh ; cd project ; ./run_experiment.sh $terminate_setting --experiment-script $experiment_script_file $log_upload_setting --cleanup-script --aws-region $aws_region' \; pipe-pane 'cat > $logging_path'"
"source activate $py_env ; tmux new-session -d -s 'training' 'source finish_prepare_instance.sh ; cd project ; ./run_experiment.sh $terminate_setting --experiment-script $experiment_script_file $log_upload_setting --cleanup-script --aws-region $aws_region' \; pipe-pane 'cat > $logging_path'"
fi

echo "Instance IP: $ec2_instance_address"
Expand Down
2 changes: 1 addition & 1 deletion bin/AWS/test_core_pytorch_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ scp -i $key_path -r ../../tests_gpu $username@$ec2_instance_address:~/package_te
scp -i $key_path ../../requirements.txt $username@$ec2_instance_address:~/package_test

terminate_setting=""
if [ "$debug_mode" == true ]; then
if [ "$debug_mode" == false ]; then
terminate_setting="aws ec2 terminate-instances --instance-ids $instance_id"
fi

Expand Down

0 comments on commit 7c55462

Please sign in to comment.