Skip to content

Commit

Permalink
Switch what versions of python are supported (#5676)
Browse files Browse the repository at this point in the history
Add support for testing compilation with python 3.11/3.12.  

Also add the dockerfiles used to build those images.

---------

Co-authored-by: Michael Wyatt <[email protected]>
  • Loading branch information
loadams and sfc-gh-mwyatt authored Nov 7, 2024
1 parent 3beda32 commit a1b0c35
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
unit-tests:
strategy:
matrix:
pyVersion: ["3.7", "3.8", "3.9", "3.10"]
pyVersion: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
image: deepspeed/gh-builder:py${{ matrix.pyVersion }}

Expand Down
35 changes: 35 additions & 0 deletions docker/gh-builder/Dockerfile.py311
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Start with NGC container
FROM nvcr.io/nvidia/pytorch:24.03-py3

# Set noninteractive mode for apt-get
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies for building Python
RUN apt-get update && apt-get install -y \
wget \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
curl \
libncursesw5-dev \
libgdbm-dev \
libc6-dev \
libffi-dev \
tk-dev \
&& rm -rf /var/lib/apt/lists/*

# Download and install Python 3.11
RUN wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz \
&& tar xzf Python-3.11.9.tgz \
&& cd Python-3.11.9 \
&& ./configure --enable-optimizations \
&& make altinstall \
&& cd .. \
&& rm -rf Python-3.11.9 Python-3.11.9.tgz

# Set Python 3.11 as the default Python version
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.11 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.11 1
35 changes: 35 additions & 0 deletions docker/gh-builder/Dockerfile.py312
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Start with NGC container
FROM nvcr.io/nvidia/pytorch:24.03-py3

# Set noninteractive mode for apt-get
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies for building Python
RUN apt-get update && apt-get install -y \
wget \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
curl \
libncursesw5-dev \
libgdbm-dev \
libc6-dev \
libffi-dev \
tk-dev \
&& rm -rf /var/lib/apt/lists/*

# Download and install Python 3.12
RUN wget https://www.python.org/ftp/python/3.12.5/Python-3.12.5.tgz \
&& tar xzf Python-3.12.5.tgz \
&& cd Python-3.12.5 \
&& ./configure --enable-optimizations \
&& make altinstall \
&& cd .. \
&& rm -rf Python-3.12.5 Python-3.12.5.tgz

# Set Python 3.12 as the default Python version
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.12 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 1
File renamed without changes.

0 comments on commit a1b0c35

Please sign in to comment.