From 4b62aef89b9490538815566d3b0f43f86afdbe89 Mon Sep 17 00:00:00 2001 From: Kyunggeun Lee Date: Mon, 18 Nov 2024 07:58:23 -0800 Subject: [PATCH 1/3] Add PYTHON_VERSION argument Signed-off-by: Kyunggeun Lee --- .../Dockerfile.torch-gpu-pt21-py310 | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 index 6d6096f690f..faae9f9f199 100644 --- a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 +++ b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 @@ -41,6 +41,7 @@ FROM ${REGISTRY}nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04 ARG DEBIAN_FRONTEND=noninteractive ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn +ARG PYTHON_VERSION # Please see here for more information on these steps: # https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu2004-x86-64/212904 @@ -59,6 +60,7 @@ RUN apt-get update > /dev/null && \ ca-certificates \ git \ ssh \ + software-properties-common \ sudo \ wget \ xterm \ @@ -78,12 +80,13 @@ RUN sudo update-ca-certificates # Add sudo support RUN echo "%users ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers -RUN apt-get update -y > /dev/null && \ +# Python +RUN add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update -y > /dev/null && \ apt-get install --no-install-recommends -y \ - # Python - python3.10 \ - python3.10-dev \ - python3.10-venv \ + python${PYTHON_VERSION} \ + python${PYTHON_VERSION}-dev \ + python${PYTHON_VERSION}-venv \ python3-pip \ python3-setuptools \ build-essential \ @@ -92,9 +95,9 @@ RUN apt-get update -y > /dev/null && \ rm -rf /var/lib/apt/lists/* # Register the version in alternatives -RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 -# Set python 3.10 as the default python -RUN update-alternatives --set python3 /usr/bin/python3.10 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 +# Set ${PYTHON_VERSION} as the default python +RUN update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} # Upgrade Python3 pip and install some more packages RUN python3 -m pip --no-cache-dir install --upgrade \ @@ -248,7 +251,7 @@ RUN apt-get update && apt-get install -y libjpeg8-dev && \ rm -rf /var/lib/apt/lists/* # Set up symlink to point to the correct python version -RUN ln -sf /usr/bin/python3.10 /usr/bin/python +RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python RUN ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ @@ -283,9 +286,9 @@ RUN apt-get update --fix-missing -y && apt upgrade -y && apt-get install -y clan RUN ln -s /usr/bin/run-clang-tidy-11.py /usr/bin/run-clang-tidy.py # Provide write permission to the python package folder in order to install AIMET in editable mode -RUN chmod o+w /usr/local/lib/python3.10/dist-packages +RUN chmod o+w /usr/local/lib/python${PYTHON_VERSION}/dist-packages -ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/nvidia/nvjitlink/lib +ENV LD_LIBRARY_PATH=/usr/local/lib/python${PYTHON_VERSION}/dist-packages/nvidia/nvjitlink/lib # Install cutlass 3.3.0 RUN cd /usr/local && \ From 26cd0e159519d1eaba4284edbadb1bdb0f381baa Mon Sep 17 00:00:00 2001 From: Kyunggeun Lee Date: Mon, 18 Nov 2024 09:23:14 -0800 Subject: [PATCH 2/3] Remove Ubuntu 22.04 default Python Signed-off-by: Kyunggeun Lee --- Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 index faae9f9f199..f3614a21169 100644 --- a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 +++ b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 @@ -83,6 +83,8 @@ RUN echo "%users ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers # Python RUN add-apt-repository ppa:deadsnakes/ppa && \ apt-get update -y > /dev/null && \ + apt-get remove -y python3.10 && \ + apt-get autoremove -y && \ apt-get install --no-install-recommends -y \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ From a82039b8612eb65344038c4c33e290f5e6f9778c Mon Sep 17 00:00:00 2001 From: Kyunggeun Lee Date: Mon, 18 Nov 2024 20:07:13 -0800 Subject: [PATCH 3/3] Set deafult value of PYTHON_VERSION to 3.10 Signed-off-by: Kyunggeun Lee --- Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 index f3614a21169..c479d78fe8d 100644 --- a/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 +++ b/Jenkins/fast-release/Dockerfile.torch-gpu-pt21-py310 @@ -41,7 +41,7 @@ FROM ${REGISTRY}nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04 ARG DEBIAN_FRONTEND=noninteractive ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn -ARG PYTHON_VERSION +ARG PYTHON_VERSION=3.10 # Please see here for more information on these steps: # https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu2004-x86-64/212904