Skip to content

Commit ea72172

Browse files
authored
Update nodejs and CDK version to latest (#315)
Deprecate Amazon Linux 2 because it can't run latest nodejs. Update installer to check OS version. Clean up the SlurmPlugin.py to remove legacy code that was causing an import error with python 3.12. Resolves #278 Resolves #279
1 parent d565601 commit ea72172

File tree

5 files changed

+57
-1888
lines changed

5 files changed

+57
-1888
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ security_scan/cfn_nag.log
1111
security_scan/ScoutSuite
1212

1313
__pycache__
14+
15+
.venv*

docs/deployment-prerequisites.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ This page shows common prerequisites that need to be done before deployment.
44

55
## Deployment Server/Instance Requirements
66

7-
The deployment process was developed and tested using Amazon Linux 2.
8-
It has also been tested on RHEL 8 and RHEL 9.
9-
An easy way to create a deployment instance is to use AWS CloudShell.
10-
This will give you a code editor IDE and shell environment that you can use to deploy the cluster.
7+
The deployment process was developed and tested using Mac OS and RHEL 8.
8+
Amazon Linux 2 doesn't support the current version of node.js so it cannot be used.
9+
It has also been tested on RHEL 9 and should work on Rocky Linux 8 and 9.
1110

1211
If the required packages aren't installed then you will need sudo or root access on the instance.
1312

setup.sh

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,50 @@ pushd $repodir
1010

1111
arch=$(uname -m)
1212
if [[ $arch == 'x86_64' ]]; then
13-
shortarch='x86'
13+
shortarch='x64'
1414
else
1515
shortarch=$arch
1616
fi
1717
if [[ $(uname -s) == 'Linux' ]]; then
1818
os=linux
1919
installer='sudo yum -y'
2020
shellrc='.bashrc'
21+
if [ -f /etc/os-release ]; then
22+
. /etc/os-release
23+
case "$ID-$VERSION_ID" in
24+
"amzn-2"*)
25+
echo "error: Unsupported OS $(uname -s)"
26+
return 1
27+
;;
28+
"centos-7"*)
29+
echo "error: Unsupported OS $(uname -s)"
30+
return 1
31+
;;
32+
"centos-8"*)
33+
echo "error: Unsupported OS $(uname -s)"
34+
return 1
35+
;;
36+
"rhel-7"*)
37+
echo "error: Unsupported OS $(uname -s)"
38+
return 1
39+
;;
40+
"rhel-8"*)
41+
distro="rhel8"
42+
;;
43+
"rhel-9"*)
44+
distro="rhel9"
45+
;;
46+
"rocky-8"*)
47+
distro="rocky8"
48+
;;
49+
"rocky-9"*)
50+
distro="rocky9"
51+
;;
52+
esac
53+
else
54+
echo "error: Unsupported OS $(uname -s)"
55+
return 1
56+
fi
2157
elif [[ $(uname -s) == 'Darwin' ]]; then
2258
os=macos
2359
installer='brew'
@@ -61,12 +97,7 @@ echo "Using python $python_version"
6197

6298
# Check nodejs version
6399
# https://nodejs.org/en/about/previous-releases
64-
if [[ $os == 'macos' ]]; then
65-
required_nodejs_version=20.19.0
66-
else
67-
# linux
68-
required_nodejs_version=16.20.2
69-
fi
100+
required_nodejs_version=20.19.0
70101
# required_nodejs_version=18.20.2
71102
# On Amazon Linux 2 and nodejs 18.20.2 I get the following errors:
72103
# node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
@@ -107,7 +138,10 @@ if [[ $nodejs_version != $required_nodejs_version ]]; then
107138
nodedir=node-v${required_nodejs_version}-darwin-${shortarch}
108139
fi
109140
tarball=${nodedir}.tar.xz
110-
wget https://nodejs.org/dist/v${required_nodejs_version}/$tarball
141+
if ! wget https://nodejs.org/dist/v${required_nodejs_version}/$tarball; then
142+
echo "error: Couldn't download nodejs from https://nodejs.org/dist/v${required_nodejs_version}/$tarball."
143+
return 1
144+
fi
111145
tar -xf $tarball
112146
rm $tarball
113147
cat >> ~/$shellrc << EOF
@@ -117,6 +151,7 @@ export PATH=$HOME/$nodedir/bin:\$PATH
117151
EOF
118152
source ~/$shellrc
119153
popd
154+
nodejs_version=$required_nodejs_version
120155
fi
121156

122157
echo "Using nodejs version $nodejs_version"
@@ -138,6 +173,7 @@ if [[ $cdk_version != $CDK_VERSION ]]; then
138173
if ! npm install -g --force aws-cdk@$CDK_VERSION; then
139174
sudo npm install -g --force aws-cdk@$CDK_VERSION
140175
fi
176+
cdk_version=$CDK_VERSION
141177
fi
142178
echo "Using CDK $cdk_version"
143179

0 commit comments

Comments
 (0)