Skip to content

Commit

Permalink
debug base py (#92)
Browse files Browse the repository at this point in the history
* debug base py
* debug detection var
  • Loading branch information
haobibo authored Mar 15, 2024
1 parent 621122f commit 4a6144b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@ jobs:
--env-file /tmp/docker.env \
-v $(pwd):/tmp \
-w /tmp \
${DOCKER_IMG_PREFIX:-qpod}/docker-kit python /opt/utils/image-syncer/run_jobs.py
${IMG_NAMESPACE:-qpod}/docker-kit python /opt/utils/image-syncer/run_jobs.py
4 changes: 2 additions & 2 deletions docker_atom/work/script-setup-db-clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ setup_postgresql_client() {
local VER_PG=${PG_MAJOR:-"15"}
# from: https://www.postgresql.org/download/linux/ubuntu/
echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
curl "https://www.postgresql.org/media/keys/ACCC4CF8.asc" | sudo sudo tee /etc/apt/trusted.gpg.d/postgresql.asc
curl "https://www.postgresql.org/media/keys/ACCC4CF8.asc" | sudo tee /etc/apt/trusted.gpg.d/postgresql.asc
sudo apt-get update
# will download ~9MB files and use ~55MB disk after installation
sudo apt-get -y install "postgresql-client-${VER_PG}"
Expand All @@ -24,7 +24,7 @@ setup_mysql_client() {
setup_mongosh_client() {
# from: https://www.mongodb.com/docs/mongodb-shell/install/
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-6.0.list
curl -sL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo sudo tee /etc/apt/trusted.gpg.d/mongodb.asc
curl -sL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo tee /etc/apt/trusted.gpg.d/mongodb.asc
sudo apt-get update
# will download ~38MB files and use ~218MB disk after installation
sudo apt-get -y install mongodb-mongosh
Expand Down
2 changes: 1 addition & 1 deletion docker_atom/work/script-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ 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 \
curl -sL https://apt.kitware.com/keys/kitware-archive-latest.asc | 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

Expand Down
17 changes: 10 additions & 7 deletions docker_base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,24 @@ RUN set -x && source /opt/utils/script-setup.sh \
&& export PATH=$PATH:${CONDA_PREFIX}/bin \
&& 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" \
&& export HAS_SYS_PY3=$( [ -x "$(command -v python3)" ] && echo 'true' || echo 'false' ) && echo "@ Detect OS Py3 installed: $HAS_SYS_PY3" \
&& echo "Install Mamba:" && setup_mamba \
&& echo "Install Python ${PYTHON_VERSION} and conda:" && setup_conda_with_mamba ${PYTHON_VERSION} \
&& $($HAS_SYS_PY) && ( \
&& $($HAS_SYS_PY3) && ( \
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 \
&& ln -sf "${CONDA_PREFIX}"/lib/python${PYTHON_VERSION} /usr/lib/ \
&& ln -sf "${CONDA_PREFIX}"/bin/python3.* /usr/bin/ \
&& ln -sf "${CONDA_PREFIX}"/bin/python${PYTHON_VERSION} /usr/bin/python \
&& ln -sf "${CONDA_PREFIX}"/bin/python${PYTHON_VERSION} /usr/bin/python3 \
&& ls -alh /usr/bin/python* \
&& $($HAS_SYS_PY3) && ( py3versions -d ) || true \
&& lsb_release -a \
&& which python && python --version \
&& install__clean && fix_permission 0 /opt

0 comments on commit 4a6144b

Please sign in to comment.