Skip to content

Commit da70984

Browse files
committed
in progress for adding silent mode
1 parent 9b88a41 commit da70984

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

autoscaling/crontab/autoscale_slurm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ try:
364364
initial_nodes=[]
365365
unreachable_nodes=[]
366366
if cluster_name == "NOCLUSTERFOUND":
367-
subprocess.Popen([script_path+'/resize.sh','remove_unreachable','--nodes']+nodes_to_destroy[cluster_name])
367+
subprocess.Popen([script_path+'/resize.sh','remove_unreachable','--nodes']+nodes_to_destroy[cluster_name],'--quiet')
368368
continue
369369
for node in nodes_to_destroy[cluster_name]:
370370
try:
@@ -376,9 +376,9 @@ try:
376376
except:
377377
unreachable_nodes.append(node)
378378
if len(initial_nodes) > 0:
379-
subprocess.Popen([script_path+'/resize.sh','--force','--cluster_name',cluster_name,'remove','--remove_unreachable','--nodes']+initial_nodes)
379+
subprocess.Popen([script_path+'/resize.sh','--force','--cluster_name',cluster_name,'remove','--remove_unreachable','--nodes']+initial_nodes,'--quiet')
380380
if len(unreachable_nodes) > 0:
381-
subprocess.Popen([script_path+'/resize.sh','--cluster_name',cluster_name,'remove_unreachable','--nodes']+unreachable_nodes)
381+
subprocess.Popen([script_path+'/resize.sh','--cluster_name',cluster_name,'remove_unreachable','--nodes']+unreachable_nodes,'--quiet')
382382
time.sleep(1)
383383

384384
for index,cluster in enumerate(cluster_to_build):

bin/delete_cluster.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ else
103103
for node in `scontrol show hostname $nodes 2>&1`
104104
do
105105
echo "Cleaning up node " $node
106-
/opt/oci-hpc/bin/resize.sh remove_unreachable --nodes $node
106+
/opt/oci-hpc/bin/resize.sh remove_unreachable --nodes $node --quiet
107107
done
108108
fi
109109
cd

bin/resize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ def getLaunchInstanceDetails(instance,comp_ocid,cn_ocid,max_previous_index,index
577577
parser.add_argument('--force', help='If present. Nodes will be removed even if the destroy playbook failed',action='store_true',default=False)
578578
parser.add_argument('--ansible_crucial', help='If present during reconfiguration, only crucial ansible playbooks will be executed on the live nodes. Non live nodes will be removed',action='store_true',default=False)
579579
parser.add_argument('--remove_unreachable', help='If present, nodes that are not sshable will be terminated before running the action that was requested (Example Adding a node) ',action='store_true',default=False)
580+
parser.add_argument('--quiet', help='If present, the script will not prompt for a response when removing nodes and will not give a reminder to save data from nodes that are being removed ',action='store_true',default=False)
580581

581582
args = parser.parse_args()
582583

bin/resize.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ permanent=1
3232
controllerName=`hostname`
3333
cluster_name=${controllerName/-controller/}
3434
nodes=NULL
35+
quietMode=False
3536
for (( i=1; i<=$#; i++)); do
3637
if [ ${!i} == "--cluster_name" ]
3738
then
@@ -54,10 +55,13 @@ for (( i=1; i<=$#; i++)); do
5455
then
5556
j=$((i+1))
5657
nodes=${@:j}
58+
elif [ ${!i} == "--quiet" ]
59+
then
60+
quietMode=True
5761
fi
5862
done
5963

60-
if [ $resize_type == "remove" ] || [ $resize_type == "remove_unreachable" ]
64+
if [ $resize_type == "remove" ] || [ $resize_type == "remove_unreachable" ] && [ $quietMode == "False" ]
6165
then
6266
echo "$(cat $folder/remove_nodes_prompt.txt)"
6367
echo "Do you confirm you have done all of the above steps and wish to proceed for the termination of the nodes? Enter 1 for Yes and 2 for No (to exit)."

0 commit comments

Comments
 (0)