Skip to content

Commit a1b0c35

Browse files
Switch what versions of python are supported (#5676)
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]>
1 parent 3beda32 commit a1b0c35

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

.github/workflows/python.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
unit-tests:
2222
strategy:
2323
matrix:
24-
pyVersion: ["3.7", "3.8", "3.9", "3.10"]
24+
pyVersion: ["3.8", "3.9", "3.10", "3.11", "3.12"]
2525
fail-fast: false
2626

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

docker/gh-builder/Dockerfile.py311

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Start with NGC container
2+
FROM nvcr.io/nvidia/pytorch:24.03-py3
3+
4+
# Set noninteractive mode for apt-get
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
7+
# Install necessary dependencies for building Python
8+
RUN apt-get update && apt-get install -y \
9+
wget \
10+
build-essential \
11+
libssl-dev \
12+
zlib1g-dev \
13+
libbz2-dev \
14+
libreadline-dev \
15+
libsqlite3-dev \
16+
curl \
17+
libncursesw5-dev \
18+
libgdbm-dev \
19+
libc6-dev \
20+
libffi-dev \
21+
tk-dev \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
# Download and install Python 3.11
25+
RUN wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz \
26+
&& tar xzf Python-3.11.9.tgz \
27+
&& cd Python-3.11.9 \
28+
&& ./configure --enable-optimizations \
29+
&& make altinstall \
30+
&& cd .. \
31+
&& rm -rf Python-3.11.9 Python-3.11.9.tgz
32+
33+
# Set Python 3.11 as the default Python version
34+
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.11 1 \
35+
&& update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.11 1

docker/gh-builder/Dockerfile.py312

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Start with NGC container
2+
FROM nvcr.io/nvidia/pytorch:24.03-py3
3+
4+
# Set noninteractive mode for apt-get
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
7+
# Install necessary dependencies for building Python
8+
RUN apt-get update && apt-get install -y \
9+
wget \
10+
build-essential \
11+
libssl-dev \
12+
zlib1g-dev \
13+
libbz2-dev \
14+
libreadline-dev \
15+
libsqlite3-dev \
16+
curl \
17+
libncursesw5-dev \
18+
libgdbm-dev \
19+
libc6-dev \
20+
libffi-dev \
21+
tk-dev \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
# Download and install Python 3.12
25+
RUN wget https://www.python.org/ftp/python/3.12.5/Python-3.12.5.tgz \
26+
&& tar xzf Python-3.12.5.tgz \
27+
&& cd Python-3.12.5 \
28+
&& ./configure --enable-optimizations \
29+
&& make altinstall \
30+
&& cd .. \
31+
&& rm -rf Python-3.12.5 Python-3.12.5.tgz
32+
33+
# Set Python 3.12 as the default Python version
34+
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.12 1 \
35+
&& update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 1
File renamed without changes.

0 commit comments

Comments
 (0)