Skip to content

Commit

Permalink
Fix default version of Python (CMake may require different one)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Apr 22, 2024
1 parent 6acb6cd commit 41ac7e5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@ FROM opensuse/tumbleweed:latest

LABEL maintainer="code@yanwk.fun"

# Note: GCC for InsightFace,
# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled)
# Note: GCC for InsightFace;
# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled).
# Note: CMake may use different version of Python. Using 'update-alternatives' to ensure default version.
RUN --mount=type=cache,target=/var/cache/zypp \
set -eu \
&& zypper addrepo --check --refresh --priority 90 \
'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/Essentials/' packman-essentials \
&& zypper --gpg-auto-import-keys \
install --no-confirm \
python311 python311-pip python311-wheel python311-setuptools \
python311-devel python311-Cython gcc-c++ cmake \
python311-devel python311-Cython gcc-c++ python311-py-build-cmake \
python311-numpy python311-opencv \
python311-ffmpeg-python ffmpeg x264 x265 \
python311-dbm \
google-noto-sans-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts \
shadow git aria2 \
Mesa-libGL1 libgthread-2_0-0 \
&& rm /usr/lib64/python3.11/EXTERNALLY-MANAGED
&& rm /usr/lib64/python3.11/EXTERNALLY-MANAGED \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100

RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
Expand Down
5 changes: 3 additions & 2 deletions megapak/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ python311-pip \
python311-wheel \
python311-setuptools \
python311-Cython \
python311-py-build-cmake \
python311-aiohttp \
python311-dbm \
python311-ffmpeg-python \
Expand All @@ -88,7 +89,6 @@ python311-tqdm \
Mesa-libGL1 \
libgthread-2_0-0 \
make \
cmake \
ninja \
git \
aria2 \
Expand All @@ -103,7 +103,8 @@ x265 \
google-noto-sans-fonts \
google-noto-sans-cjk-fonts \
google-noto-coloremoji-fonts \
&& rm /usr/lib64/python3.11/EXTERNALLY-MANAGED
&& rm /usr/lib64/python3.11/EXTERNALLY-MANAGED \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100

################################################################################
# GCC 12
Expand Down
15 changes: 7 additions & 8 deletions rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ FROM opensuse/tumbleweed:latest

LABEL maintainer="code@yanwk.fun"

# Note: GCC for InsightFace,
# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled),
# 'half' for ORT on ROCm
# Note: GCC for InsightFace;
# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled);
# 'half' for ORT on ROCm.
# Note: CMake may use different version of Python. Using 'update-alternatives' to ensure default version.
RUN --mount=type=cache,target=/var/cache/zypp \
set -eu \
&& zypper addrepo --check --refresh --priority 90 \
'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/Essentials/' packman-essentials \
&& zypper --gpg-auto-import-keys \
install --no-confirm \
python310 python310-pip python310-wheel python310-setuptools \
python310-devel python310-Cython gcc-c++ cmake \
python310-devel python310-Cython gcc-c++ python310-py-build-cmake \
python310-numpy python310-opencv \
python310-ffmpeg-python ffmpeg x264 x265 \
python310-dbm \
ghc-half \
google-noto-sans-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts \
shadow git aria2 \
Mesa-libGL1 libgthread-2_0-0 \
&& rm -f /usr/lib64/python3.10/EXTERNALLY-MANAGED
&& rm -f /usr/lib64/python3.10/EXTERNALLY-MANAGED \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 10

RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
Expand Down Expand Up @@ -84,9 +86,6 @@ RUN --mount=type=cache,target=/root/.cache/pip \
mediapipe \
&& pip list

# Everything is built with Python 3.10 but SuSE default is now 3.11. Switch back
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 10

RUN du -ah /root \
&& rm -rf /root/* /root/.*

Expand Down

0 comments on commit 41ac7e5

Please sign in to comment.