Skip to content

Commit

Permalink
add components: Caddy & Supervisord & CRAN (#108)
Browse files Browse the repository at this point in the history
* add components: Caddy & Supervisord & CRAN
* update pip alias
* chmod +x perm to scripts
  • Loading branch information
haobibo authored Nov 7, 2024
1 parent ba99187 commit d0e9286
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 9 deletions.
1 change: 1 addition & 0 deletions docker_atom/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN set -eux && cd /tmp \
# if /etc/profile haven't been executed, execute it.
&& echo -e "${LINE_CHK_FLAG} \n$(cat /etc/bash.bashrc)" > /etc/bash.bashrc \
&& echo '[ $BASH ] && [ -f /root/.bashrc ] && . /root/.bashrc' >> /etc/bash.bashrc \
&& chmod +x /opt/utils/*.sh /opt/utils/localize/*.sh \
# Clean up and display components version information...
&& source /opt/utils/script-utils.sh && install__clean

Expand Down
6 changes: 6 additions & 0 deletions docker_atom/work/localize/run-config-mirror-aliyun-pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if [ -f "$(which go)" ]; then
export GOPROXY=https://mirrors.aliyun.com/goproxy/
go env | grep 'PROXY'
fi

if [ -f "$(which R)" ]; then
echo "Found R, setting CRAN mirror"
echo "options(repos=structure(c(CRAN=\"https://mirrors.aliyun.com/CRAN/\")))" >> /etc/R/Rprofile.site
R -e "options('repos');"
fi
6 changes: 6 additions & 0 deletions docker_atom/work/localize/run-config-mirror-aliyun-vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if [ -f "$(which go)" ]; then
export GOPROXY=https://mirrors.cloud.aliyuncs.com/goproxy/
go env | grep 'PROXY'
fi

if [ -f "$(which R)" ]; then
echo "Found R, setting CRAN mirror"
echo "options(repos=structure(c(CRAN=\"http://mirrors.cloud.aliyuncs.com/CRAN/\")))" >> /etc/R/Rprofile.site
R -e "options('repos');"
fi
5 changes: 5 additions & 0 deletions docker_atom/work/localize/run-config-mirror-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ if [ -f "$(which go)" ]; then
echo "Found golang, getting GO env:"
go env | sort
fi

if [ -f "$(which R)" ]; then
echo "Found R, getting CRAN mirror"
R -e "options('repos');"
fi
6 changes: 6 additions & 0 deletions docker_atom/work/localize/run-config-mirror-tencent-pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if [ -f "$(which go)" ]; then
export GOPROXY=https://mirrors.tencent.com/go/
go env | grep 'PROXY'
fi

if [ -f "$(which R)" ]; then
echo "Found R, setting CRAN mirror"
echo "options(repos=structure(c(CRAN=\"http://mirrors.tencent.com/CRAN/\")))" >> /etc/R/Rprofile.site
R -e "options('repos');"
fi
6 changes: 6 additions & 0 deletions docker_atom/work/localize/run-config-mirror-tencent-vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if [ -f "$(which go)" ]; then
export GOPROXY=https://mirrors.tencentyun.com/go/
go env | grep 'PROXY'
fi

if [ -f "$(which R)" ]; then
echo "Found R, setting CRAN mirror"
echo "options(repos=structure(c(CRAN=\"http://mirrors.tencentyun.com/CRAN/\")))" >> /etc/R/Rprofile.site
R -e "options('repos');"
fi
6 changes: 6 additions & 0 deletions docker_atom/work/localize/run-config-mirror-tsinghua.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if [ -f "$(which go)" ]; then
export GOPROXY=https://goproxy.cn
go env | grep 'PROXY'
fi

if [ -f "$(which R)" ]; then
echo "Found R, setting CRAN mirror"
echo "options(repos=structure(c(CRAN=\"https://mirrors.tuna.tsinghua.edu.cn/CRAN/\")))" >> /etc/R/Rprofile.site
R -e "options('repos');"
fi
22 changes: 22 additions & 0 deletions docker_atom/work/script-setup-net.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
source /opt/utils/script-utils.sh


setup_traefik() {
TRAEFIK_VERSION=$(curl -sL https://github.com/traefik/traefik/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+') \
&& TRAEFIK_URL="https://github.com/traefik/traefik/releases/download/v${TRAEFIK_VERSION}/traefik_v${TRAEFIK_VERSION}_linux_$(dpkg --print-architecture).tar.gz" \
&& install_tar_gz "${TRAEFIK_URL}" traefik \
&& ln -sf /opt/traefik /usr/bin/ ;

type traefik && echo "@ Version of traefik: $(traefik version)" || return -1 ;
}

setup_caddy() {
OS="linux" && ARCH="amd64" \
&& 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" \
&& 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/ ;

type caddy && echo "@ Version of caddy: $(caddy version)" || return -1 ;
}
12 changes: 12 additions & 0 deletions docker_atom/work/script-setup-sys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ setup_tini() {
}


setup_supervisord() {
OS="linux" && ARCH="amd64" \
&& VER_SUPERVISORD=$(curl -sL https://github.com/QPod/supervisord/releases.atom | grep "releases/tag" | head -1 | grep -Po '(\d[\d|.]+)') \
&& URL_SUPERVISORD="https://github.com/QPod/supervisord/releases/download/v${VER_SUPERVISORD}/supervisord_${VER_SUPERVISORD}_${OS}_${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/ ;

type supervisord && echo "@ Version of supervisord: $(supervisord version)" || return -1 ;
}


setup_systemd() {
apt-get -qq update -yq --fix-missing \
&& apt-get -qq install -yq --no-install-recommends systemd systemd-cron \
Expand Down
9 changes: 0 additions & 9 deletions docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ setup_lua_rocks() {
type luarocks && echo "@ Version of luarocks: $(luarocks --version)" || return -1 ;
}

setup_traefik() {
TRAEFIK_VERSION=$(curl -sL https://github.com/traefik/traefik/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+') \
&& TRAEFIK_URL="https://github.com/traefik/traefik/releases/download/v${TRAEFIK_VERSION}/traefik_v${TRAEFIK_VERSION}_linux_$(dpkg --print-architecture).tar.gz" \
&& install_tar_gz "${TRAEFIK_URL}" traefik \
&& ln -sf /opt/traefik /usr/bin/ ;

type traefik && echo "@ Version of traefik: $(traefik version)" || return -1 ;
}


setup_bazel() {
VER_BAZEL=$(curl -sL https://github.com/bazelbuild/bazel/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+' ) \
Expand Down
1 change: 1 addition & 0 deletions docker_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN set -eux && source /opt/utils/script-setup.sh && source /opt/utils/script-se
echo "No default python found in OS." ; \
fi \
&& ln -sf "${CONDA_PREFIX}"/bin/python3.* /usr/bin/ \
&& ln -sf "${CONDA_PREFIX}"/bin/pip /usr/bin/ \
&& ln -sf "/usr/bin/python${PYTHON_VERSION}" /usr/bin/python \
&& ln -sf "/usr/bin/python${PYTHON_VERSION}" /usr/bin/python3 \
&& lsb_release -a \
Expand Down

0 comments on commit d0e9286

Please sign in to comment.