@@ -3,14 +3,17 @@ source /opt/utils/script-utils.sh
33
44setup_mamba () {
55 # Notice: mamba use $CONDA_PREFIX to locate base env
6- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" 64" && MICROMAMBA_VERSION=" latest" \
7- && MAMBA_URL=" https://micromamba.snakepit.net/api/micromamba/${UNAME} -${ARCH} /${MICROMAMBA_VERSION} " \
6+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && MICROMAMBA_VERSION=" latest" \
7+ && ARCH=$( uname -m | sed -e ' s/x86_64/64/' ) \
8+ && URL_MICROMAMBA=" https://micromamba.snakepit.net/api/micromamba/${UNAME} -${ARCH} /${MICROMAMBA_VERSION} " \
9+ && echo " Downloading micromamba from ${URL_MICROMAMBA} " \
810 && mkdir -pv /opt/mamba /etc/conda \
9- && install_tar_bz $MAMBA_URL bin/micromamba && mv /opt/bin/micromamba /opt/mamba/mamba \
11+ && install_tar_bz $URL_MICROMAMBA bin/micromamba && mv /opt/bin/micromamba /opt/mamba/mamba \
1012 && ln -sf /opt/mamba/mamba /usr/bin/ \
11- && touch /etc/conda/.condarc \
13+ && touch /etc/conda/.condarc && ln -sf /etc/conda/.condarc /opt/conda/.condarc \
1214 && printf " channels:\n" >> /etc/conda/.condarc \
13- && printf " - conda-forge\n" >> /etc/conda/.condarc ;
15+ && printf " - conda-forge\n" >> /etc/conda/.condarc \
16+ && cat /etc/conda/.condarc ;
1417
1518 type mamba && echo " @ Version of mamba: $( mamba info) " || return -1 ;
1619}
@@ -98,7 +101,7 @@ setup_java_base() {
98101 # # 23, 21(LTS); 17, 11, 8
99102
100103 local VER_JDK=${VERSION_JDK:- " 11" }
101- ARCH=" x64"
104+ ARCH=$( uname -m | sed -e ' s/x86_64/ x64/ ' )
102105 IS_ALPINE=$( grep -q ' ID=alpine' /etc/os-release && echo true || echo false)
103106
104107 echo " Use env var VERSION_JDK to specify JDK major version. If not specified, will install version 11 by default."
@@ -137,7 +140,8 @@ setup_java_maven() {
137140
138141
139142setup_node_base () {
140- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" x64" \
143+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
144+ && ARCH=$( uname -m | sed -e ' s/x86_64/x64/' -e ' s/aarch64/arm64/' ) \
141145 && VER_NODEJS=$( curl -sL https://github.com/nodejs/node/releases.atom | grep ' releases/tag' | head -1 | grep -Po ' \d[.\d]+' ) \
142146 && VER_NODEJS_MAJOR=$( echo " ${VER_NODEJS} " | cut -d ' .' -f1 ) \
143147 && NODEJS_URL=" https://nodejs.org/download/release/latest-v${VER_NODEJS_MAJOR} .x/node-v${VER_NODEJS} -${UNAME} -${ARCH} .tar.gz" \
@@ -153,7 +157,8 @@ setup_node_base() {
153157}
154158
155159setup_node_pnpm () {
156- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" x64" \
160+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
161+ && ARCH=$( uname -m | sed -e ' s/x86_64/x64/' -e ' s/aarch64/arm64/' ) \
157162 && VER_PNPM=$( curl -sL https://github.com/pnpm/pnpm/releases.atom | grep ' releases/tag' | grep -v ' alpha' | head -1 | grep -Po ' \d[\d.]+' ) \
158163 && URL_PNPM=" https://github.com/pnpm/pnpm/releases/download/v${VER_PNPM} /pnpm-${UNAME} -${ARCH} " \
159164 && echo " Downloading pnpm version ${VER_PNPM} from: ${URL_PNPM} " \
@@ -166,7 +171,8 @@ setup_node_pnpm() {
166171}
167172
168173setup_node_bun () {
169- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" x64" \
174+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
175+ && ARCH=$( uname -m | sed -e ' s/x86_64/x64/' ) \
170176 && VER_BUN=$( curl -sL https://github.com/oven-sh/bun/releases.atom | grep ' releases/tag' | head -1 | grep -Po ' bun-v\K\d+\.\d+\.\d+' ) \
171177 && BUN_URL=" https://github.com/oven-sh/bun/releases/download/bun-v${VER_BUN} /bun-${UNAME} -${ARCH} .zip" \
172178 && echo " Downloading bun from: ${BUN_URL} " \
@@ -183,8 +189,9 @@ setup_node_bun() {
183189
184190setup_GO () {
185191 UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
192+ && ARCH=$( dpkg --print-architecture) \
186193 && VER_GO=$( curl -sL https://github.com/golang/go/releases.atom | grep ' releases/tag' | grep -v ' rc' | head -1 | grep -Po ' \d[\d.]+' ) \
187- && URL_GO=" https://dl.google.com/go/go${VER_GO} .${UNAME} -$( dpkg --print-architecture ) .tar.gz" \
194+ && URL_GO=" https://dl.google.com/go/go${VER_GO} .${UNAME} -${ARCH} .tar.gz" \
188195 && echo " Downloading golang version ${VER_GO} from: ${URL_GO} " \
189196 && install_tar_gz " ${URL_GO} " go \
190197 && ln -sf /opt/go/bin/go* /usr/bin/ \
@@ -226,8 +233,12 @@ setup_R_base() {
226233
227234
228235setup_julia () {
229- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" 64" \
230- && URL_JULIA=" https://julialangnightlies-s3.julialang.org/bin/${UNAME} /x64/julia-latest-${UNAME}${ARCH} .tar.gz" \
236+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
237+ && ARCH_1=$( uname -m) \
238+ && ARCH_2=$( uname -m | sed -e ' s/x86_64/x64/' ) \
239+ && VER_JULIA=$( curl -sL https://github.com/JuliaLang/julia/releases.atom | grep ' releases/tag' | grep -v ' rc' | head -1 | grep -Po ' \d[\d.]+' ) \
240+ && VER_JULIA_MAJOR=$( echo " ${VER_JULIA} " | cut -d ' .' -f1,2 ) \
241+ && URL_JULIA=" https://julialang-s3.julialang.org/bin/linux/${ARCH_2} /${VER_JULIA_MAJOR} /julia-${VER_JULIA} -linux-${ARCH_1} .tar.gz" \
231242 && install_tar_gz $URL_JULIA \
232243 && mv /opt/julia-* /opt/julia \
233244 && ln -fs /opt/julia/bin/julia /usr/bin/julia \
@@ -254,9 +265,9 @@ setup_lua_base() {
254265
255266setup_lua_rocks () {
256267 # # https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix
257- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH= " x86_64 " \
258- && VER_LUA_ROCKS=$( curl -sL https://luarocks.github.io/luarocks/releases/ | grep " ${UNAME} - ${ARCH} " | head -1 | grep -Po ' (\d[\d|.]+)' | head -1) \
259- && URL_LUA_ROCKS=" http ://luarocks.github.io/luarocks /releases/luarocks-${VER_LUA_ROCKS} .tar.gz" \
268+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
269+ && VER_LUA_ROCKS=$( curl -sL https://luarocks.github.io/luarocks/releases/ | grep " ${UNAME} " | head -1 | grep -Po ' (\d[\d|.]+)' | head -1) \
270+ && URL_LUA_ROCKS=" https ://luarocks.org /releases/luarocks-${VER_LUA_ROCKS} .tar.gz" \
260271 && echo " Downloading luarocks ${VER_LUA_ROCKS} from ${URL_LUA_ROCKS} " \
261272 && install_tar_gz $URL_LUA_ROCKS \
262273 && mv /opt/luarocks-* /tmp/luarocks && cd /tmp/luarocks \
@@ -269,7 +280,8 @@ setup_lua_rocks() {
269280
270281
271282setup_bazel () {
272- UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) && ARCH=" x64_64" \
283+ UNAME=$( uname | tr ' [:upper:]' ' [:lower:]' ) \
284+ && ARCH=$( uname -m | sed -e ' s/aarch64/arm64/' ) \
273285 && VER_BAZEL=$( curl -sL https://github.com/bazelbuild/bazel/releases.atom | grep ' releases/tag' | head -1 | grep -Po ' \d[\d.]+' ) \
274286 && URL_BAZEL=" https://github.com/bazelbuild/bazel/releases/download/${VER_BAZEL} /bazel-${VER_BAZEL} -installer-${UNAME} -${ARCH} .sh" \
275287 && curl -o /tmp/bazel.sh -sL " ${URL_BAZEL} " && chmod +x /tmp/bazel.sh \
0 commit comments