Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 0468bda

Browse files
committed
Various updates
- Add cbld and ID_LIKE support for install - Update Docker CE to 20.10.8 - Update GlusterFS to 9 - Update blobfuse to 1.4.1 - Refactor python ref
1 parent dc41a19 commit 0468bda

7 files changed

+52
-35
lines changed

install.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ else
121121
. /etc/os-release
122122
DISTRIB_ID=$ID
123123
DISTRIB_RELEASE=$VERSION_ID
124+
DISTRIB_LIKE=$ID_LIKE
124125
fi
125126
# check for OS X
126127
if [ -z "${DISTRIB_ID+x}" ] && [ "$(uname)" == "Darwin" ]; then
127128
DISTRIB_ID=$(uname)
128129
DISTRIB_RELEASE=$(uname -a | cut -d' ' -f3)
130+
DISTRIB_LIKE=$ID_LIKE
129131
fi
130132
fi
131133

@@ -141,11 +143,11 @@ if [ "$DISTRIB_ID" != "Darwin" ]; then
141143
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
142144
fi
143145

144-
echo "Detected OS: $DISTRIB_ID $DISTRIB_RELEASE"
146+
echo "Detected OS: $DISTRIB_ID $DISTRIB_RELEASE (ID_LIKE=$DISTRIB_LIKE)"
145147

146148
# install requisite packages from distro repo
147149
if [ -n "$SUDO" ] || [ "$(id -u)" -eq 0 ]; then
148-
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ]; then
150+
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_ID" == "cbld" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
149151
$SUDO apt-get update
150152
if [ $ANACONDA -eq 1 ]; then
151153
PYTHON_PKGS=
@@ -159,7 +161,7 @@ if [ -n "$SUDO" ] || [ "$(id -u)" -eq 0 ]; then
159161
$SUDO apt-get install -y --no-install-recommends \
160162
build-essential libssl-dev libffi-dev openssl \
161163
openssh-client rsync $PYTHON_PKGS
162-
elif [ "$DISTRIB_ID" == "centos" ] || [ "$DISTRIB_ID" == "rhel" ]; then
164+
elif [ "$DISTRIB_ID" == "centos" ] || [ "$DISTRIB_ID" == "rhel" ] || [ "$DISTRIB_LIKE" == "rhel" ]; then
163165
$SUDO yum makecache fast
164166
if [ $ANACONDA -eq 1 ]; then
165167
PYTHON_PKGS=

scripts/shipyard_federation_bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ if [ -e /etc/os-release ]; then
2727
. /etc/os-release
2828
DISTRIB_ID=$ID
2929
DISTRIB_RELEASE=$VERSION_ID
30+
DISTRIB_LIKE=$ID_LIKE
3031
DISTRIB_CODENAME=$VERSION_CODENAME
3132
if [ -z "$DISTRIB_CODENAME" ]; then
3233
if [ "$DISTRIB_ID" == "debian" ] && [ "$DISTRIB_RELEASE" == "9" ]; then
@@ -47,13 +48,12 @@ if [ -z "${DISTRIB_CODENAME}" ]; then
4748
fi
4849
DISTRIB_ID=${DISTRIB_ID,,}
4950
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
51+
DISTRIB_LIKE=${DISTRIB_LIKE,,}
5052
DISTRIB_CODENAME=${DISTRIB_CODENAME,,}
5153

5254
# set distribution specific vars
5355
PACKAGER=
54-
if [ "$DISTRIB_ID" == "ubuntu" ]; then
55-
PACKAGER=apt
56-
elif [ "$DISTRIB_ID" == "debian" ]; then
56+
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
5757
PACKAGER=apt
5858
elif [[ $DISTRIB_ID == centos* ]] || [ "$DISTRIB_ID" == "rhel" ]; then
5959
PACKAGER=yum

scripts/shipyard_monitoring_bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if [ -e /etc/os-release ]; then
3131
. /etc/os-release
3232
DISTRIB_ID=$ID
3333
DISTRIB_RELEASE=$VERSION_ID
34+
DISTRIB_LIKE=$ID_LIKE
3435
DISTRIB_CODENAME=$VERSION_CODENAME
3536
if [ -z "$DISTRIB_CODENAME" ]; then
3637
if [ "$DISTRIB_ID" == "debian" ] && [ "$DISTRIB_RELEASE" == "9" ]; then
@@ -51,13 +52,12 @@ if [ -z "${DISTRIB_CODENAME}" ]; then
5152
fi
5253
DISTRIB_ID=${DISTRIB_ID,,}
5354
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
55+
DISTRIB_LIKE=${DISTRIB_LIKE,,}
5456
DISTRIB_CODENAME=${DISTRIB_CODENAME,,}
5557

5658
# set distribution specific vars
5759
PACKAGER=
58-
if [ "$DISTRIB_ID" == "ubuntu" ]; then
59-
PACKAGER=apt
60-
elif [ "$DISTRIB_ID" == "debian" ]; then
60+
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
6161
PACKAGER=apt
6262
elif [[ $DISTRIB_ID == centos* ]] || [ "$DISTRIB_ID" == "rhel" ]; then
6363
PACKAGER=yum

scripts/shipyard_nodeprep.sh

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ set -e
66
set -o pipefail
77

88
# version consts
9-
DOCKER_CE_VERSION_DEBIAN=19.03.5
10-
DOCKER_CE_VERSION_CENTOS=19.03.5
9+
DOCKER_CE_VERSION_DEBIAN=20.10.8
10+
DOCKER_CE_VERSION_CENTOS=20.10.8
1111
DOCKER_CE_VERSION_SLES=17.09.1
12-
GLUSTER_VERSION_DEBIAN=7
13-
GLUSTER_VERSION_CENTOS=6
14-
BLOBFUSE_VERSION=1.3.6
12+
GLUSTER_VERSION_DEBIAN=9
13+
GLUSTER_VERSION_CENTOS=9
14+
BLOBFUSE_VERSION=1.4.1
1515
IMDS_VERSION=2021-01-01
1616

1717
# consts
@@ -30,6 +30,7 @@ UCX_IB_PKEY_FILE=$AZ_BATCH_TASK_WORKING_DIR/UCX_IB_PKEY
3030
MCR_REPO=mcr.microsoft.com
3131
BLOBXFER_IMAGE_PREFIX=${MCR_REPO}/blobxfer
3232
SHIPYARD_IMAGE_PREFIX=${MCR_REPO}/azure-batch/shipyard
33+
SINGULARITY_IMAGE_PREFIX=${SHIPYARD_IMAGE_PREFIX}
3334

3435
# status file consts
3536
lisinstalled=${VOLATILE_PATH}/.batch_shipyard_lis_installed
@@ -50,6 +51,7 @@ if [ -e /etc/os-release ]; then
5051
. /etc/os-release
5152
DISTRIB_ID=$ID
5253
DISTRIB_RELEASE=$VERSION_ID
54+
DISTRIB_LIKE=$ID_LIKE
5355
DISTRIB_CODENAME=$VERSION_CODENAME
5456
if [ -z "$DISTRIB_CODENAME" ]; then
5557
if [ "$DISTRIB_ID" == "debian" ] && [ "$DISTRIB_RELEASE" == "10" ]; then
@@ -70,14 +72,13 @@ if [ -z "${DISTRIB_CODENAME}" ]; then
7072
fi
7173
DISTRIB_ID=${DISTRIB_ID,,}
7274
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
75+
DISTRIB_LIKE=${DISTRIB_LIKE,,}
7376
DISTRIB_CODENAME=${DISTRIB_CODENAME,,}
7477

7578
# set distribution specific vars
7679
PACKAGER=
7780
SYSTEMD_PATH=/lib/systemd/system
78-
if [ "$DISTRIB_ID" == "ubuntu" ]; then
79-
PACKAGER=apt
80-
elif [ "$DISTRIB_ID" == "debian" ]; then
81+
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
8182
PACKAGER=apt
8283
elif [[ $DISTRIB_ID == centos* ]] || [ "$DISTRIB_ID" == "rhel" ]; then
8384
PACKAGER=yum
@@ -89,6 +90,15 @@ if [ "$PACKAGER" == "apt" ]; then
8990
export DEBIAN_FRONTEND=noninteractive
9091
fi
9192

93+
# set python and pip
94+
if command -v python3 > /dev/null 2>&1; then
95+
PYTHON=python3
96+
PIP=pip3
97+
else
98+
PYTHON=python
99+
PIP=pip
100+
fi
101+
92102
# globals
93103
azureblob=0
94104
azurefile=0
@@ -249,6 +259,14 @@ if [ -z "$blobxferversion" ]; then
249259
exit 1
250260
fi
251261

262+
get_current_timestamp() {
263+
if [ $PYTHON == "python3" ]; then
264+
$PYTHON -c 'import datetime;print(datetime.datetime.utcnow().timestamp())'
265+
else
266+
$PYTHON -c 'import datetime;import time;print(time.mktime(datetime.datetime.utcnow().timetuple()))'
267+
fi
268+
}
269+
252270
save_startup_to_volatile() {
253271
set +e
254272
touch "${VOLATILE_PATH}"/startup/.save
@@ -383,7 +401,7 @@ get_vm_size_from_imds() {
383401
return
384402
fi
385403
curl -fSsL -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=${IMDS_VERSION}" > imd.json
386-
vm_size=$(python -c "import json;f=open('imd.json','r');a=json.load(f);print(a['compute']['vmSize']).lower()")
404+
vm_size=$(${PYTHON} -c "import json;f=open('imd.json','r');a=json.load(f);print(a['compute']['vmSize']).lower()")
387405
if [[ "$vm_size" =~ ^standard_(((hb|hc)[0-9]+m?rs?(_v[1-9])?)|(nc[0-9]+rs_v3)|(nd[0-9]+rs_v2))$ ]]; then
388406
# SR-IOV RDMA
389407
vm_rdma_type=1
@@ -1069,7 +1087,7 @@ install_singularity() {
10691087
fi
10701088
install_packages squashfs-tools $cryptpkg
10711089
# fetch docker image for singularity bits
1072-
local di="${SHIPYARD_IMAGE_PREFIX}:${singularityversion}-${disuffix}"
1090+
local di="${SINGULARITY_IMAGE_PREFIX}:${singularityversion}-${disuffix}"
10731091
log DEBUG "Image=${di} basedir=${singularity_basedir}"
10741092
docker_pull_image "$di"
10751093
mkdir -p /opt/singularity
@@ -1852,14 +1870,15 @@ install_and_start_batch_insights() {
18521870
log INFO "Prep start"
18531871
echo "Configuration:"
18541872
echo "--------------"
1873+
echo "Batch Shipyard version: $shipyardversion"
1874+
echo "OS Distribution: $DISTRIB_ID $DISTRIB_RELEASE"
1875+
echo "Python=$PYTHON pip=$PIP"
1876+
echo "User mountpoint: $USER_MOUNTPOINT"
1877+
echo "Mount path: $MOUNTS_PATH"
18551878
echo "Custom image: $custom_image"
18561879
echo "Native mode: $native_mode"
1857-
echo "OS Distribution: $DISTRIB_ID $DISTRIB_RELEASE"
1858-
echo "Batch Shipyard version: $shipyardversion"
18591880
echo "Blobxfer version: $blobxferversion"
18601881
echo "Singularity version: $singularityversion"
1861-
echo "User mountpoint: $USER_MOUNTPOINT"
1862-
echo "Mount path: $MOUNTS_PATH"
18631882
echo "Batch Insights: $batch_insights"
18641883
echo "Prometheus: NE=$PROM_NODE_EXPORTER_PORT,$PROM_NODE_EXPORTER_OPTIONS CA=$PROM_CADVISOR_PORT,$PROM_CADVISOR_OPTIONS"
18651884
echo "Network optimization: $networkopt"
@@ -1896,11 +1915,7 @@ localectl
18961915
set -e
18971916

18981917
# store node prep start
1899-
if command -v python3 > /dev/null 2>&1; then
1900-
npstart=$(python3 -c 'import datetime;print(datetime.datetime.utcnow().timestamp())')
1901-
else
1902-
npstart=$(python -c 'import datetime;import time;print(time.mktime(datetime.datetime.utcnow().timetuple()))')
1903-
fi
1918+
npstart=$(get_current_timestamp)
19041919

19051920
# get ephemeral device/disk
19061921
get_ephemeral_device

scripts/shipyard_remotefs_bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -o pipefail
66
export DEBIAN_FRONTEND=noninteractive
77

88
# constants
9-
GLUSTER_VERSION=7
9+
GLUSTER_VERSION=9
1010
gluster_brick_mountpath=/gluster/brick
1111
gluster_brick_location=$gluster_brick_mountpath/brick0
1212
ipaddress=$(ip addr list eth0 | grep "inet " | cut -d' ' -f6 | cut -d/ -f1)

scripts/shipyard_slurm_computenode_nodeprep.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if [ -e /etc/os-release ]; then
3636
. /etc/os-release
3737
DISTRIB_ID=$ID
3838
DISTRIB_RELEASE=$VERSION_ID
39+
DISTRIB_LIKE=$ID_LIKE
3940
DISTRIB_CODENAME=$VERSION_CODENAME
4041
if [ -z "$DISTRIB_CODENAME" ]; then
4142
if [ "$DISTRIB_ID" == "debian" ] && [ "$DISTRIB_RELEASE" == "9" ]; then
@@ -56,17 +57,14 @@ if [ -z "${DISTRIB_CODENAME}" ]; then
5657
fi
5758
DISTRIB_ID=${DISTRIB_ID,,}
5859
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
60+
DISTRIB_LIKE=${DISTRIB_LIKE,,}
5961
DISTRIB_CODENAME=${DISTRIB_CODENAME,,}
6062

6163
# set distribution specific vars
6264
PACKAGER=
6365
PACKAGE_SUFFIX=
6466
SLURM_PACKAGE=
65-
if [ "$DISTRIB_ID" == "ubuntu" ]; then
66-
PACKAGER=apt
67-
PACKAGE_SUFFIX=deb
68-
SLURM_PACKAGE="${SLURM_PACKAGE_DEBIAN}.${PACKAGE_SUFFIX}"
69-
elif [ "$DISTRIB_ID" == "debian" ]; then
67+
if [ "$DISTRIB_ID" == "ubuntu" ] || [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
7068
PACKAGER=apt
7169
PACKAGE_SUFFIX=deb
7270
SLURM_PACKAGE="${SLURM_PACKAGE_DEBIAN}.${PACKAGE_SUFFIX}"

scripts/shipyard_slurm_master_bootstrap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if [ -e /etc/os-release ]; then
3636
. /etc/os-release
3737
DISTRIB_ID=$ID
3838
DISTRIB_RELEASE=$VERSION_ID
39+
DISTRIB_LIKE=$ID_LIKE
3940
DISTRIB_CODENAME=$VERSION_CODENAME
4041
if [ -z "$DISTRIB_CODENAME" ]; then
4142
if [ "$DISTRIB_ID" == "debian" ] && [ "$DISTRIB_RELEASE" == "9" ]; then
@@ -56,6 +57,7 @@ if [ -z "${DISTRIB_CODENAME}" ]; then
5657
fi
5758
DISTRIB_ID=${DISTRIB_ID,,}
5859
DISTRIB_RELEASE=${DISTRIB_RELEASE,,}
60+
DISTRIB_LIKE=${DISTRIB_LIKE,,}
5961
DISTRIB_CODENAME=${DISTRIB_CODENAME,,}
6062

6163
# set distribution specific vars
@@ -65,7 +67,7 @@ SYSTEMD_PATH=/lib/systemd/system
6567
if [ "$DISTRIB_ID" == "ubuntu" ]; then
6668
PACKAGER=apt
6769
USER_MOUNTPOINT=/mnt
68-
elif [ "$DISTRIB_ID" == "debian" ]; then
70+
elif [ "$DISTRIB_ID" == "debian" ] || [ "$DISTRIB_LIKE" == "debian" ]; then
6971
PACKAGER=apt
7072
elif [[ $DISTRIB_ID == centos* ]] || [ "$DISTRIB_ID" == "rhel" ]; then
7173
PACKAGER=yum

0 commit comments

Comments
 (0)