@@ -7,14 +7,74 @@ log_info() {
77 printf " \n\e[0;35m $1 \e[0m\n\n"
88}
99
10- TARGETARCH=${TARGETARCH:- amd64}
10+ ARCHTYPE=` uname -m`
11+ DEX_VERSION=${DEX_VERSION:- 2.31.1}
12+ DEX_PATCH_VERSION=${DEX_PATCH_VERSION:- 703e26bc109e86d00be22ef1803bdb96b2dc09e2}
1113
12- log_info " Installing required packages for Ondemand.."
14+ log_info " Installing required packages for Ondemand ${ARCHTYPE} .."
1315
14- dnf install -y \
15- netcat \
16- ondemand \
17- ondemand-dex
16+ if [[ " ${ARCHTYPE} " = " x86_64" ]]; then
17+ dnf install -y https://yum.osc.edu/ondemand/2.0/ondemand-release-web-2.0-1.noarch.rpm
18+ dnf install -y \
19+ netcat \
20+ ondemand \
21+ ondemand-dex
22+ elif [[ " ${ARCHTYPE} " = " aarch64" ]]; then
23+ # TODO: flesh out arm64 builds?
24+ dnf install -y golang-bin
25+ log_info " Install dex ${DEX_VERSION} ..."
26+ wget -O /tmp/dex-${DEX_VERSION} .tar.gz https://github.com/dexidp/dex/archive/v${DEX_VERSION} .tar.gz
27+ wget -O /tmp/dex-ood.patch https://github.com/OSC/dex/commit/${DEX_PATCH_VERSION} .patch
28+ pushd /tmp
29+ tar xvf dex-${DEX_VERSION} .tar.gz
30+ pushd dex-${DEX_VERSION}
31+ make build
32+ mv bin/dex bin/dex-orig
33+ patch -p1 < ../dex-ood.patch
34+ make build
35+ mv bin/dex /usr/sbin/ondemand-dex-session
36+ mv bin/dex-orig /usr/sbin/ondemand-dex
37+ popd
38+ rm -rf /tmp/dex*
39+ mkdir -p /usr/share/ondemand-dex/
40+ git clone https://github.com/OSC/ondemand-dex.git
41+ pushd ondemand-dex
42+ mv web /usr/share/ondemand-dex/
43+ popd
44+ rm -Rf ondemand-dex
45+ groupadd -r ondemand-dex
46+ useradd -r -d /var/lib/ondemand-dex -g ondemand-dex -s /sbin/nologin -c " OnDemand Dex" ondemand-dex
47+ mkdir -p /etc/ood/dex
48+ tee /etc/ood/dex/config.yaml << EOF
49+ ---
50+ issuer: http://eb8307ff82be:5556
51+ storage:
52+ type: sqlite3
53+ config:
54+ file: "/etc/ood/dex/dex.db"
55+ web:
56+ http: 0.0.0.0:5556
57+ telemetry:
58+ http: 0.0.0.0:5558
59+ staticClients:
60+ - id: eb8307ff82be
61+ redirectURIs:
62+ - http://eb8307ff82be/oidc
63+ name: OnDemand
64+ secret: 7c6c2f51-2f97-4866-886e-2fcf5b974224
65+ oauth2:
66+ skipApprovalScreen: true
67+ enablePasswordDB: true
68+ staticPasswords:
69+ - email: ood@localhost
70+ hash: "$2 a$1 0$2 b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W"
71+ username: ood
72+ userID: '08a8684b-db88-4b73-90a9-3cd1661f5466'
73+ frontend:
74+ dir: "/usr/share/ondemand-dex/web"
75+ theme: hpc-coop
76+ EOF
77+ fi
1878
1979log_info " Setting up Ondemand"
2080mkdir -p /etc/ood/config/clusters.d
@@ -81,15 +141,17 @@ dex:
81141 theme: ondemand
82142EOF
83143
84- log_info " Generating new httpd24 and dex configs.."
85- /opt/ood/ood-portal-generator/sbin/update_ood_portal
144+ if [[ ${ARCHTYPE} = " x86_64" ]]; then
145+ log_info " Generating new httpd24 and dex configs.."
146+ /opt/ood/ood-portal-generator/sbin/update_ood_portal
147+
148+ log_info " Adding new theme to dex"
149+ sed -i " s/theme: ondemand/theme: hpc-coop/g" /etc/ood/dex/config.yaml
150+ fi
86151
87152dnf clean all
88153rm -rf /var/cache/dnf
89154
90- log_info " Adding new theme to dex"
91- sed -i " s/theme: ondemand/theme: hpc-coop/g" /etc/ood/dex/config.yaml
92-
93155log_info " Cloning repos to assist with app development.."
94156mkdir -p /var/git
95157git clone https://github.com/OSC/bc_example_jupyter.git --bare /var/git/bc_example_jupyter
0 commit comments