Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docker_atom/work/script-setup-net.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ setup_traefik() {
}

setup_caddy() {
OS="linux" && ARCH="amd64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') \
&& VER_CADDY=$(curl -sL https://github.com/caddyserver/caddy/releases.atom | grep "releases/tag" | grep -v 'beta' | head -1 | grep -Po '(\d[\d|.]+)') \
&& URL_CADDY="https://github.com/caddyserver/caddy/releases/download/v${VER_CADDY}/caddy_${VER_CADDY}_${OS}_${ARCH}.tar.gz" \
&& URL_CADDY="https://github.com/caddyserver/caddy/releases/download/v${VER_CADDY}/caddy_${VER_CADDY}_${UNAME}_${ARCH}.tar.gz" \
&& echo "Downloading Caddy ${VER_CADDY} from ${URL_CADDY}" \
&& curl -o /tmp/TMP.tgz -sL "${URL_CADDY}" && tar -C /tmp/ -xzf /tmp/TMP.tgz && rm /tmp/TMP.tgz \
&& mkdir -pv /opt/bin/ && mv /tmp/caddy /opt/bin/ && ln -sf /opt/bin/caddy /usr/local/bin/ ;
Expand Down
16 changes: 10 additions & 6 deletions docker_atom/work/script-setup-sys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ source /opt/utils/script-utils.sh


setup_tini() {
cd /tmp \
&& TINI_VERSION=$(curl -sL https://github.com/krallin/tini/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+' ) \
&& curl -o tini.zip -sL "https://github.com/krallin/tini/archive/v${TINI_VERSION}.zip" && unzip -q /tmp/tini.zip \
&& cmake /tmp/tini-* && make install && mv /tmp/tini /usr/bin/tini && chmod +x /usr/bin/tini && rm -rf /tmp/tini-*
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') \
&& VER_TINI=$(curl -sL https://github.com/krallin/tini/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+' ) \
&& URL_TINI="https://github.com/krallin/tini/releases/download/v${VER_TINI}/tini-${ARCH}" \
&& echo "Downloading Tini ${VER_TINI} from ${URL_TINI}" \
&& curl -o /usr/bin/tini -sL $URL_TINI && chmod +x /usr/bin/tini ;

type tini && echo "@ Version of tini: $(tini --version)" || return -1 ;
# ref: https://cloud-atlas.readthedocs.io/zh-cn/latest/docker/init/docker_tini.html
# to run multi-proces with tini: use a bash script ends with the following code
# main() { *other code* /bin/bash -c "while true; do (echo 'Hello from tini'; date; sleep 120); done" } main
}


setup_supervisord() {
OS="linux" && ARCH="amd64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') \
&& VER_SUPERVISORD=$(curl -sL https://github.com/LabNow-ai/supervisord/releases.atom | grep "releases/tag" | head -1 | grep -Po '(\d[\d|.]+)') \
&& URL_SUPERVISORD="https://github.com/LabNow-ai/supervisord/releases/download/v${VER_SUPERVISORD}/supervisord_${VER_SUPERVISORD}_${OS}_${ARCH}.tar.gz" \
&& URL_SUPERVISORD="https://github.com/LabNow-ai/supervisord/releases/download/v${VER_SUPERVISORD}/supervisord_${VER_SUPERVISORD}_${UNAME}_${ARCH}.tar.gz" \
&& echo "Downloading Supervisord ${VER_SUPERVISORD} from ${URL_SUPERVISORD}" \
&& curl -o /tmp/TMP.tgz -sL $URL_SUPERVISORD && tar -C /tmp/ -xzf /tmp/TMP.tgz && rm /tmp/TMP.tgz \
&& mkdir -pv /opt/bin/ && mv /tmp/supervisord /opt/bin/ && ln -sf /opt/bin/supervisord /usr/local/bin/ ;
Expand Down
44 changes: 28 additions & 16 deletions docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ source /opt/utils/script-utils.sh

setup_mamba() {
# Notice: mamba use $CONDA_PREFIX to locate base env
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="64" && MICROMAMBA_VERSION="latest" \
&& MAMBA_URL="https://micromamba.snakepit.net/api/micromamba/${UNAME}-${ARCH}/${MICROMAMBA_VERSION}" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && MICROMAMBA_VERSION="latest" \
&& ARCH=$(uname -m | sed -e 's/x86_64/64/') \
&& URL_MICROMAMBA="https://micromamba.snakepit.net/api/micromamba/${UNAME}-${ARCH}/${MICROMAMBA_VERSION}" \
&& echo "Downloading micromamba from ${URL_MICROMAMBA}" \
&& mkdir -pv /opt/mamba /etc/conda \
&& install_tar_bz $MAMBA_URL bin/micromamba && mv /opt/bin/micromamba /opt/mamba/mamba \
&& install_tar_bz $URL_MICROMAMBA bin/micromamba && mv /opt/bin/micromamba /opt/mamba/mamba \
&& ln -sf /opt/mamba/mamba /usr/bin/ \
&& touch /etc/conda/.condarc \
&& touch /etc/conda/.condarc && ln -sf /etc/conda/.condarc /opt/conda/.condarc \
&& printf "channels:\n" >> /etc/conda/.condarc \
&& printf " - conda-forge\n" >> /etc/conda/.condarc ;
&& printf " - conda-forge\n" >> /etc/conda/.condarc \
&& cat /etc/conda/.condarc ;

type mamba && echo "@ Version of mamba: $(mamba info)" || return -1 ;
}
Expand Down Expand Up @@ -98,7 +101,7 @@ setup_java_base() {
## 23, 21(LTS); 17, 11, 8

local VER_JDK=${VERSION_JDK:-"11"}
ARCH="x64"
ARCH=$(uname -m | sed -e 's/x86_64/x64/')
IS_ALPINE=$(grep -q 'ID=alpine' /etc/os-release && echo true || echo false)

echo "Use env var VERSION_JDK to specify JDK major version. If not specified, will install version 11 by default."
Expand Down Expand Up @@ -137,7 +140,8 @@ setup_java_maven() {


setup_node_base() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="x64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/aarch64/arm64/') \
&& VER_NODEJS=$(curl -sL https://github.com/nodejs/node/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[.\d]+') \
&& VER_NODEJS_MAJOR=$(echo "${VER_NODEJS}" | cut -d '.' -f1 ) \
&& NODEJS_URL="https://nodejs.org/download/release/latest-v${VER_NODEJS_MAJOR}.x/node-v${VER_NODEJS}-${UNAME}-${ARCH}.tar.gz" \
Expand All @@ -153,7 +157,8 @@ setup_node_base() {
}

setup_node_pnpm() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="x64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/x86_64/x64/' -e 's/aarch64/arm64/') \
&& VER_PNPM=$(curl -sL https://github.com/pnpm/pnpm/releases.atom | grep 'releases/tag' | grep -v 'alpha' | head -1 | grep -Po '\d[\d.]+') \
&& URL_PNPM="https://github.com/pnpm/pnpm/releases/download/v${VER_PNPM}/pnpm-${UNAME}-${ARCH}" \
&& echo "Downloading pnpm version ${VER_PNPM} from: ${URL_PNPM}" \
Expand All @@ -166,7 +171,8 @@ setup_node_pnpm() {
}

setup_node_bun() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="x64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/x86_64/x64/' ) \
&& 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+') \
&& BUN_URL="https://github.com/oven-sh/bun/releases/download/bun-v${VER_BUN}/bun-${UNAME}-${ARCH}.zip" \
&& echo "Downloading bun from: ${BUN_URL}" \
Expand All @@ -183,8 +189,9 @@ setup_node_bun() {

setup_GO() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(dpkg --print-architecture) \
&& VER_GO=$(curl -sL https://github.com/golang/go/releases.atom | grep 'releases/tag' | grep -v 'rc' | head -1 | grep -Po '\d[\d.]+') \
&& URL_GO="https://dl.google.com/go/go${VER_GO}.${UNAME}-$(dpkg --print-architecture).tar.gz" \
&& URL_GO="https://dl.google.com/go/go${VER_GO}.${UNAME}-${ARCH}.tar.gz" \
&& echo "Downloading golang version ${VER_GO} from: ${URL_GO}" \
&& install_tar_gz "${URL_GO}" go \
&& ln -sf /opt/go/bin/go* /usr/bin/ \
Expand Down Expand Up @@ -226,8 +233,12 @@ setup_R_base() {


setup_julia() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="64" \
&& URL_JULIA="https://julialangnightlies-s3.julialang.org/bin/${UNAME}/x64/julia-latest-${UNAME}${ARCH}.tar.gz" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH_1=$(uname -m) \
&& ARCH_2=$(uname -m | sed -e 's/x86_64/x64/') \
&& VER_JULIA=$(curl -sL https://github.com/JuliaLang/julia/releases.atom | grep 'releases/tag' | grep -v 'rc' | head -1 | grep -Po '\d[\d.]+') \
&& VER_JULIA_MAJOR=$(echo "${VER_JULIA}" | cut -d '.' -f1,2 ) \
&& URL_JULIA="https://julialang-s3.julialang.org/bin/linux/${ARCH_2}/${VER_JULIA_MAJOR}/julia-${VER_JULIA}-linux-${ARCH_1}.tar.gz" \
&& install_tar_gz $URL_JULIA \
&& mv /opt/julia-* /opt/julia \
&& ln -fs /opt/julia/bin/julia /usr/bin/julia \
Expand All @@ -254,9 +265,9 @@ setup_lua_base() {

setup_lua_rocks() {
## https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Unix
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="x86_64" \
&& VER_LUA_ROCKS=$(curl -sL https://luarocks.github.io/luarocks/releases/ | grep "${UNAME}-${ARCH}" | head -1 | grep -Po '(\d[\d|.]+)' | head -1) \
&& URL_LUA_ROCKS="http://luarocks.github.io/luarocks/releases/luarocks-${VER_LUA_ROCKS}.tar.gz" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& VER_LUA_ROCKS=$(curl -sL https://luarocks.github.io/luarocks/releases/ | grep "${UNAME}" | head -1 | grep -Po '(\d[\d|.]+)' | head -1) \
&& URL_LUA_ROCKS="https://luarocks.org/releases/luarocks-${VER_LUA_ROCKS}.tar.gz" \
&& echo "Downloading luarocks ${VER_LUA_ROCKS} from ${URL_LUA_ROCKS}" \
&& install_tar_gz $URL_LUA_ROCKS \
&& mv /opt/luarocks-* /tmp/luarocks && cd /tmp/luarocks \
Expand All @@ -269,7 +280,8 @@ setup_lua_rocks() {


setup_bazel() {
UNAME=$(uname | tr '[:upper:]' '[:lower:]') && ARCH="x64_64" \
UNAME=$(uname | tr '[:upper:]' '[:lower:]') \
&& ARCH=$(uname -m | sed -e 's/aarch64/arm64/') \
&& VER_BAZEL=$(curl -sL https://github.com/bazelbuild/bazel/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+' ) \
&& URL_BAZEL="https://github.com/bazelbuild/bazel/releases/download/${VER_BAZEL}/bazel-${VER_BAZEL}-installer-${UNAME}-${ARCH}.sh" \
&& curl -o /tmp/bazel.sh -sL "${URL_BAZEL}" && chmod +x /tmp/bazel.sh \
Expand Down
2 changes: 1 addition & 1 deletion docker_cuda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document and docker image helps you to install `nvidia-ctk` (NVIDIA Contain

## Step 1. Install container engine

Make sure you have installed your container engine (e.g. docker-ce) properly.
Ensure you have installed your container engine (e.g. docker-ce) properly.

## Step 2. Install NVIDIA driver

Expand Down
4 changes: 2 additions & 2 deletions docker_docker_kit/work/script-setup-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source /opt/utils/script-utils.sh


setup_docker_compose() {
ARCH="x86_64" \
ARCH=$(uname -m) \
&& VER_COMPOSE=$(curl -sL https://github.com/docker/compose/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[.\d]+') \
&& URL_COMPOSE="https://github.com/docker/compose/releases/download/v${VER_COMPOSE}/docker-compose-linux-${ARCH}" \
&& echo "Downloading Compose from: ${URL_COMPOSE}" \
Expand All @@ -13,7 +13,7 @@ setup_docker_compose() {
}

setup_docker_syncer() {
ARCH="amd64" \
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') \
&& VER_SYNCER="$(curl -sL https://github.com/AliyunContainerService/image-syncer/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[.\d]+')" \
&& URL_SYNCER="https://github.com/AliyunContainerService/image-syncer/releases/download/v${VER_SYNCER}/image-syncer-v${VER_SYNCER}-linux-${ARCH}.tar.gz" \
&& echo "Downloading image-syncer from: ${URL_SYNCER}" \
Expand Down
Loading