forked from giovtorres/slurm-docker-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bosco_cluster-901.patch
94 lines (84 loc) · 4.95 KB
/
bosco_cluster-901.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
--- bosco_cluster 2021-05-20 16:00:29.529870976 -0700
+++ bosco_cluster-901.v1 2021-05-20 15:48:41.324587287 -0700
@@ -5,6 +5,11 @@
# as function exit code (by return) and this is modulo 256
# see cluster_list_iterator, list
+#set -x
+
+# BOSCO SSH PORT TO USE
+# added by vahi
+BOSCO_SSH_PORT=2222
# Bosco key location
bosco_key=$HOME/.ssh/bosco_key.rsa
@@ -170,7 +175,7 @@
bosco_ssh_start
if [ $? -eq 0 ]; then
# Make a master ssh connection
- ssh -o ControlMaster=auto -o "ControlPath=$ssh_control_path" -MNn $remote_host &
+ ssh -o ControlMaster=auto -o "ControlPath=$ssh_control_path" -p $BOSCO_SSH_PORT -MNn $remote_host &
ssh_master_connection=$!
return 0
else
@@ -193,12 +198,12 @@
# redirect stderr to /dev/null suppresses errors as well
if [ "x$start_dir" == "xDEFAULT" ]; then
# OS X mktemp requires a template
- start_dir=`ssh $remote_host "mktemp -d /tmp/tmp_bosco_probe.XXXXXXXX" 2>/dev/null`
+ start_dir=`ssh $remote_host -p $BOSCO_SSH_PORT "mktemp -d /tmp/tmp_bosco_probe.XXXXXXXX" 2>/dev/null`
else
- ssh $remote_host "mkdir -p $start_dir"
+ ssh $remote_host -p $BOSCO_SSH_PORT "mkdir -p $start_dir"
fi
- scp $local_script $remote_host:$start_dir/bosco_run
- cmd_out=`ssh -o ControlMaster=auto -o "ControlPath=$ssh_control_path" $remote_host "cd $start_dir; chmod +x bosco_run; ./bosco_run $@" 2>/dev/null`
+ scp -P $BOSCO_SSH_PORT $local_script $remote_host:$start_dir/bosco_run
+ cmd_out=`ssh -o ControlMaster=auto -o "ControlPath=$ssh_control_path" -p $BOSCO_SSH_PORT $remote_host "cd $start_dir; chmod +x bosco_run; ./bosco_run $@" 2>/dev/null`
#cmd_out=`ssh $remote_host "cd $start_dir; chmod +x bosco_run; ./bosco_run $4 $5 $6"`
cmd_ec=$?
if [ $cmd_ec -eq 0 ]; then
@@ -258,7 +263,7 @@
remote_host=$1
# Returns 'Darwin' for Mac OS X or 'Linux'
- detect_os=`ssh $remote_host "uname -s"`
+ detect_os=`ssh -p $BOSCO_SSH_PORT $remote_host "uname -s"`
[[ $? -eq 0 ]] || return 1
case "$detect_os" in
@@ -282,7 +287,7 @@
# 1. remote host
remote_host=$1
- os_release=`ssh $remote_host "cat /etc/os-release" 2> /dev/null`
+ os_release=`ssh -p $BOSCO_SSH_PORT $remote_host "cat /etc/os-release" 2> /dev/null`
[[ $? -eq 0 ]] || return 1
dist=`echo "$os_release" | awk -F '=' '/^ID=/ {print $2}' | tr -d '"'`
@@ -553,7 +558,7 @@
echo -n "Testing ssh to $remote_host..."
start_ssh
# Get the pwd from the remote cluster, for use later in the submission file
- default_pwd=`ssh -o "PasswordAuthentication=no" $remote_host "pwd"`
+ default_pwd=`ssh -p $BOSCO_SSH_PORT -o "PasswordAuthentication=no" $remote_host "pwd"`
ssh_exit=$?
stop_ssh
if [ $ssh_exit -ne 0 ]; then
@@ -869,7 +874,7 @@
# Transfer the public key to the remote host
echo "Enter the password to copy the ssh keys to $remote_host:"
-cat ${bosco_key}.pub | ssh $remote_host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys"
+cat ${bosco_key}.pub | ssh -p $BOSCO_SSH_PORT $remote_host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys"
if [ $? -ne 0 ]; then
echo "Error copying BOSCO key. Please make sure you password is correct."
exit 1
@@ -878,7 +883,7 @@
start_ssh
# Quickly test the ssh
-ssh_opts='-o PasswordAuthentication=no'
+ssh_opts="-o PasswordAuthentication=no -p $BOSCO_SSH_PORT"
[[ $debug = 1 ]] && ssh_opts="$ssh_opts -vvv"
qmgr_out=$(ssh $ssh_opts "$remote_host" "pwd" 2>&1)
if [ $? -ne 0 ]; then
@@ -1101,7 +1106,7 @@
fi
# Do the actual rsync
-show_progress "Installing on cluster $remote_host" rsync -aqK -e "ssh -o ControlMaster=auto -o ControlPath=$ssh_control_path" "$local_install_dir" $remote_host:
+show_progress "Installing on cluster $remote_host" rsync -aqK -e "ssh -o ControlMaster=auto -o ControlPath=$ssh_control_path -p $BOSCO_SSH_PORT" "$local_install_dir" $remote_host:
exit_code=$?
rm -rf $tmp_install_dir