-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArgcfile.sh
60 lines (54 loc) · 2.06 KB
/
Argcfile.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
#!/usr/bin/env bash
set -e
# @cmd Build MATLAB container in SIF format
# @meta require-tools apptainer
# @option --version![=r2024b|r2024a|r2023b]
# @option --proxy-version=0.23.1
# @option --os-version=ubuntu22.04
build-matlab-sif() {
apptainer build \
--build-arg "MATLAB_PROXY_VERSION=${argc_proxy_version}" \
"./containers/${argc_version}/${argc_os_version}/matlab.sif" \
"./containers/${argc_version}/${argc_os_version}/matlab.def"
}
# @cmd Build MATLAB container in OCI format
# @meta require-tools podman
# @option --version![=r2024b|r2024a|r2023b]
# @option --proxy-version=0.23.1
# @option --os-version=ubuntu22.04
build-matlab-oci() {
podman build \
--build-arg "MATLAB_PROXY_VERSION=${argc_proxy_version}" \
--tag "localhost/matlab:${argc_version}" \
--file "./containers/${argc_version}/${argc_os_version}/Dockerfile" \
"./containers/${argc_version}/${argc_os_version}"
}
# @cmd Install MATLAB container and modulefiles
# @meta require-tools ansible-playbook
# @option --system![puhti|lumi]
# @option --version![=r2024b|r2024a|r2023b]
install-matlab() {
ansible-playbook \
-i hosts.yaml \
-l "${argc_system}" \
-e "version=${argc_version}" \
"./system/${argc_system}/install.yaml" "$@"
}
# @cmd Install MathWorks ServiceHost
# @meta require-tools ansible-playbook
# @option --system![puhti|lumi]
# @option --version=2024.13.0.2
install-servicehost() {
local LATEST_VERSION
LATEST_VERSION=$(curl --silent https://raw.githubusercontent.com/mathworks-ref-arch/administer-mathworks-service-host/refs/heads/main/admin-scripts/linux/admin-controlled-installation/latest_release.txt)
if [ "${argc_version}" != "${LATEST_VERSION}" ]; then
echo "Latest version: ${LATEST_VERSION}. Currently using version: ${argc_version}."
fi
ansible-playbook \
-i hosts.yaml \
-l "${argc_system}" \
-e "version=${argc_version}" \
"./servicehost/install.yaml" "$@"
}
# See more details at https://github.com/sigoden/argc
eval "$(argc --argc-eval "$0" "$@")"