-
Notifications
You must be signed in to change notification settings - Fork 9
/
user_data.sh
64 lines (49 loc) · 1.76 KB
/
user_data.sh
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
#!/bin/bash
set -x
LSF_TOP_LOCAL=/grid/lsf
LSF_CONF=$LSF_TOP_LOCAL/conf/lsf.conf
## Changing kmaster host string
#MASTER_HOSTS_STRING=" ip-0A05000B ip-0A05000D "
#sed -i "s/LSF_SERVER_HOSTS=.*/LSF_SERVER_HOSTS=\"${MASTER_HOSTS_STRING}\"/g" ${LSF_CONF}
set +e
source $LSF_TOP_LOCAL/conf/profile.lsf
set -e
# Default LSF Environment Variables
# rc_account
# template_id
# providerName (default: cyclecloud)
# clustername cyclecloud
# cyclecloud_nodeid
# Custom LSF Environment Variables
# placement_group_id
# nodearray_name
# set LSF_LOCAL_RESOURCES
sed -i '/LSF_LOCAL_RESOURCES/d' $LSF_CONF
TEMP_LOCAL_RESOURCES=" [resource cyclecloudhost] "
if [ -n "${rc_account}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${rc_account}*rc_account]"
fi
if [ -n "${cyclecloud_nodeid}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${cyclecloud_nodeid}*instanceID]"
fi
if [ -n "${nodearray_name}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${nodearray_name}*nodearray]"
if [[ $nodearray_name == *"mpi" ]]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resource cyclecloudmpi]"
elif [[ $nodearray_name == "lowprio" ]]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resource cyclecloudlowprio]"
fi
fi
if [ -n "${template_id}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${template_id}*template]"
fi
if [ -n "${clustername}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${clustername}*clusterName]"
fi
if [ -n "${placement_group_id}" ]; then
TEMP_LOCAL_RESOURCES="$TEMP_LOCAL_RESOURCES [resourcemap ${placement_group_id}*placementgroup]"
fi
echo "LSF_LOCAL_RESOURCES=\"${TEMP_LOCAL_RESOURCES}\"" >> $LSF_CONF
lsadmin limstartup
lsadmin resstartup
badmin hstartup