Skip to content

Commit

Permalink
update OS version (#88)
Browse files Browse the repository at this point in the history
* update os ver
* debug var in profile
  • Loading branch information
haobibo committed Mar 12, 2024
1 parent ef0709c commit f28983e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 39 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,27 @@ env:

jobs:
qpod_base:
name: 'atom,base,python-3.7,python-3.11,python-3.12'
name: 'atom,base,python-3.11'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image atom latest docker_atom/Dockerfile && push_image
build_image python-3.7 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.7" && push_image
build_image python-3.11 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.11" && alias_image python-3.11 latest base latest && push_image
qpod_python:
name: 'python-3.7,python-3.12'
needs: 'qpod_base'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image python-3.7 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.7" && push_image
build_image python-3.12 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.12" && push_image
qpod_core:
name: 'core'
needs: qpod_base
Expand Down
13 changes: 9 additions & 4 deletions docker_atom/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Distributed under the terms of the Modified BSD License.

# latest # default value: Latest LTS version of Ubuntu (https://hub.docker.com/_/ubuntu)
ARG BASE_IMG="ubuntu:focal"
ARG BASE_IMG="ubuntu:jammy"
FROM ${BASE_IMG}

LABEL maintainer="haobibo@gmail.com"
Expand Down Expand Up @@ -33,9 +33,14 @@ RUN set -x && cd /tmp \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \
&& echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mv /root/.bashrc /etc/bash_profile \
&& echo '[ $BASH ] && [ -f /etc/bash_profile ] && . /etc/bash_profile' >> /etc/bash.bashrc \
&& echo '[ $BASH ] && [ -f /root/.bashrc ] && . /root/.bashrc' >> /etc/bash.bashrc \
&& mv /root/.bashrc /etc/profile.d/bash.bashrc \
&& LINE_SET_FLAG='export ENTER_PROFILE=$(date +%Y.%m%d.%H%M)' \
&& LINE_CHK_FLAG='[ $BASH ] && [ -f /etc/profile ] && [ -z $ENTER_PROFILE ] && . /etc/profile' \
# Add a check variable `ENTER_PROFILE` to see if /etc/profile is executed or not
&& echo -e "${LINE_SET_FLAG} \n$(cat /etc/profile)" > /etc/profile \
# 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 \
# Clean up and display components version information...
&& source /opt/utils/script-utils.sh && install__clean

Expand Down
38 changes: 19 additions & 19 deletions docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trusted-host=pypi.python.org pypi.org files.pythonhosted.org
EOF
fi

echo 'export PATH=${PATH}:${CONDA_PREFIX:-"/opt/conda"}/bin' >> /etc/profile
echo 'export PATH=${PATH}:${CONDA_PREFIX:-"/opt/conda"}/bin' >> /etc/profile.d/path-conda.sh
ln -sf "${CONDA_PREFIX}/bin/conda" /usr/bin/

conda config --system --prepend channels conda-forge \
Expand Down Expand Up @@ -141,7 +141,7 @@ setup_node() {
&& install_tar_gz ${NODEJS_URL} \
&& mv /opt/node* /opt/node \
&& ln -sf /opt/node/bin/n* /usr/bin/ \
&& echo 'export PATH=${PATH}:/opt/node/bin' >> /etc/profile \
&& echo 'export PATH=${PATH}:/opt/node/bin' >> /etc/profile.d/path-node.sh \
&& npm install -g npm \
&& echo "@ Version of Node and npm: $(node -v) $(npm -v)" \
&& corepack enable && yarn set version stable \
Expand Down Expand Up @@ -178,14 +178,27 @@ setup_GO() {
&& GO_URL="https://dl.google.com/go/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \
&& install_tar_gz "${GO_URL}" go \
&& ln -sf /opt/go/bin/go* /usr/bin/ \
&& echo 'export GOROOT="/opt/go"' >> /etc/profile \
&& echo 'export GOBIN="$GOROOT/bin"' >> /etc/profile \
&& echo 'export GOPATH="$GOROOT/path"' >> /etc/profile \
&& echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /etc/profile \
&& echo 'export GOROOT="/opt/go"' >> /etc/profile.d/path-go.sh \
&& echo 'export GOBIN="$GOROOT/bin"' >> /etc/profile.d/path-go.sh \
&& echo 'export GOPATH="$GOROOT/path"' >> /etc/profile.d/path-go.sh \
&& echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /etc/profile.d/path-go.sh \
&& echo "@ Version of golang: $(go version)"
}


setup_rust() {
export CARGO_HOME=/opt/cargo \
&& export RUSTUP_HOME=/opt/rust \
&& export PATH=$PATH:${CARGO_HOME}/bin \
&& curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable \
&& echo 'export CARGO_HOME="/opt/cargo"' >> /etc/profile.d/path-rust.sh \
&& echo 'export RUSTUP_HOME="/opt/rust"' >> /etc/profile.d/path-rust.sh \
&& echo 'export PATH=$PATH:/opt/cargo/bin' >> /etc/profile.d/path-rust.sh \
&& echo "@ Version of rustup: $(rustup --version)" \
&& echo "@ Version of rustc: $(rustc --version)"
}


setup_julia() {
JULIA_URL="https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz" \
&& install_tar_gz $JULIA_URL \
Expand All @@ -207,19 +220,6 @@ setup_traefik() {
}


setup_rust() {
export CARGO_HOME=/opt/cargo \
&& export RUSTUP_HOME=/opt/rust \
&& export PATH=$PATH:${CARGO_HOME}/bin \
&& curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable \
&& echo 'export CARGO_HOME="/opt/cargo"' >> /etc/profile \
&& echo 'export RUSTUP_HOME="/opt/rust"' >> /etc/profile \
&& echo 'export PATH=$PATH:/opt/cargo/bin' >> /etc/profile \
&& echo "@ Version of rustup: $(rustup --version)" \
&& echo "@ Version of rustc: $(rustc --version)"
}


setup_bazel() {
BAZEL_VERSION=$(curl -sL https://github.com/bazelbuild/bazel/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[\d.]+' ) \
&& BAZEL_URL="https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" \
Expand Down
4 changes: 3 additions & 1 deletion docker_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ LABEL maintainer="haobibo@gmail.com"
ARG PYTHON_VERSION="3.11"

ENV CONDA_PREFIX=/opt/conda
ENV PATH=$PATH:${CONDA_PREFIX}/bin

RUN set -x && source /opt/utils/script-setup.sh \
&& export PATH=$PATH:${CONDA_PREFIX}/bin \
# update source for CMake
&& curl -sL https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo sudo tee /etc/apt/trusted.gpg.d/kitware.asc \
&& echo "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/kitware.list \
Expand All @@ -25,6 +25,8 @@ RUN set -x && source /opt/utils/script-setup.sh \
&& echo "/usr/share/pyshared/" >> "${PYTHON_PTH_FILE}" \
&& echo "/usr/share/python3/" >> "${PYTHON_PTH_FILE}" \
&& rm -rf $(/usr/bin/python3 -c 'import sys; print(" ".join(i for i in sys.path if "python" in i))') /usr/bin/python3* \
&& rm -rf "${CONDA_PREFIX}"/lib/python3.1 /usr/lib/python${PYTHON_VERSION} \
&& ln -sf "${CONDA_PREFIX}"/lib/python${PYTHON_VERSION} /usr/lib/ \
&& ln -sf "${CONDA_PREFIX}"/bin/python3.* /usr/bin/ \
&& ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python \
&& ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 \
Expand Down
13 changes: 0 additions & 13 deletions tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,6 @@ clear_images() {
docker image prune --force && docker images ;
}

setup_docker_syncer() {
ARCH="amd64" \
&& SYNCER_VERSION="$(curl -sL https://github.com/AliyunContainerService/image-syncer/releases.atom | grep 'releases/tag' | head -1 | grep -Po '\d[.\d]+')" \
&& SYNCER_URL="https://github.com/AliyunContainerService/image-syncer/releases/download/v${SYNCER_VERSION}/image-syncer-v${SYNCER_VERSION}-linux-${ARCH}.tar.gz" \
&& echo "Downloading image-syncer from: ${SYNCER_URL}" \
&& curl -o /tmp/image_syncer.tgz -sL ${SYNCER_URL} \
&& mkdir -pv /tmp/image_syncer && tar -zxvf /tmp/image_syncer.tgz -C /tmp/image_syncer \
&& sudo chmod +x /tmp/image_syncer/image-syncer \
&& sudo mv /tmp/image_syncer/image-syncer /usr/bin/ \
&& rm -rf /tmp/image_syncer* \
&& echo "@ image-syncer installed to: $(which image-syncer)"
}


remove_folder() {
sudo du -h -d1 "$1" || true ;
Expand Down

0 comments on commit f28983e

Please sign in to comment.