Skip to content

Commit

Permalink
Add postgres base image (#91)
Browse files Browse the repository at this point in the history
* add postgres base img
* debug cmake ver
  • Loading branch information
haobibo authored Mar 15, 2024
1 parent 22d87fe commit 621122f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ jobs:
- run: source ./tool.sh && build_image node latest docker_core/Dockerfile --build-arg "ARG_PROFILE_NODEJS=base" && push_image

qpod_jdk:
name: 'jdk,jdk8,jdk11,jdk17'
name: 'jdk,jdk-8,jdk-11,jdk-17'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image jdk17 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=17"
build_image jdk11 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=11"
build_image jdk8 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=8"
alias_image jdk11 latest jdk latest
build_image jdk-17 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=17"
build_image jdk-11 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=11"
build_image jdk-8 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=8"
alias_image jdk-11 latest jdk latest
push_image jdk
qpod_julia:
Expand Down Expand Up @@ -338,6 +338,20 @@ jobs:
--build-arg "ARG_PROFILE_LATEX=base,cjk"
alias_image full-cuda-11.8 latest core-cuda latest && push_image cuda
## Postgres
qpod_postgres:
name: 'postgres'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image postgres latest docker_atom/Dockerfile --build-arg "BASE_IMG=postgres:15"
build_image postgres latest docker_base/Dockerfile \
--build-arg "BASE_IMG=postgres" \
--build-arg "PYTHON_VERSION=3.11"
push_image postgres
## DockerKit - including image-syncer and docker-compsoe
qpod_docker_kit:
name: 'docker-kit'
Expand Down
5 changes: 5 additions & 0 deletions docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ setup_tini() {


setup_nvtop() {
# The compiliation requries CMake 3.18 or higher. default version in CUDA 11.2 images is 3.16.3
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 \
&& apt-get -qq update -yq --fix-missing && apt-get -qq install -yq --no-install-recommends cmake

# Install Utilities "nvtop" from source: libdrm-dev libsystemd-dev used by AMD/Intel GPU support, libudev-dev used by ubuntu18.04
LIB_PATH=$(find / -name "libnvidia-ml*" 2>/dev/null) \
&& DIRECTORY=$(pwd) && cd /tmp \
Expand Down
30 changes: 15 additions & 15 deletions docker_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ ENV CONDA_PREFIX=/opt/conda

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 \
&& install_apt /opt/utils/install_list_base.apt \
&& echo "Install tini:" && setup_tini \
&& export HAS_SYS_PY=$(which python && echo true || echo false) && echo "Detect OS sys path installed: $HAS_SYS_PY" \
&& echo "Install Mamba:" && setup_mamba \
&& echo "Install Python ${PYTHON_VERSION} and conda:" && setup_conda_with_mamba ${PYTHON_VERSION} \
&& echo "Replace system Python3 with conda Python - note that /bin and /sbin are symlinks of /usr/bin in docker image ubuntu" \
&& PYTHON_VERSION_DEFAULT=$(py3versions -v -i) \
&& sed -i "s/${PYTHON_VERSION_DEFAULT}/${PYTHON_VERSION}/g" /usr/share/python3/debian_defaults \
&& PYTHON_PTH_FILE=$("${CONDA_PREFIX}"/bin/python3 -c 'import sys;print(sys.path[-1]+"/usr_share.pth")') \
&& 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* /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 \
&& lsb_release -a && py3versions -d \
&& $($HAS_SYS_PY) && ( \
echo "Replace system Python3 with conda Python - note that /bin and /sbin are symlinks of /usr/bin in docker image ubuntu" \
&& PYTHON_VERSION_DEFAULT=$(py3versions -v -i) \
&& sed -i "s/${PYTHON_VERSION_DEFAULT}/${PYTHON_VERSION}/g" /usr/share/python3/debian_defaults \
&& PYTHON_PTH_FILE=$("${CONDA_PREFIX}"/bin/python3 -c 'import sys;print(sys.path[-1]+"/usr_share.pth")') \
&& 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* /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 \
&& lsb_release -a && py3versions -d \
) || true \
&& install__clean && fix_permission 0 /opt

0 comments on commit 621122f

Please sign in to comment.