Skip to content

Commit 49d8a2f

Browse files
committed
Bump Ubuntu (24.04) and Python (3.12) versions.
1 parent b8e249b commit 49d8a2f

File tree

9 files changed

+77
-36
lines changed

9 files changed

+77
-36
lines changed

.github/workflows/pytorch.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
matrix:
6464
config:
6565
[
66-
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 },
67-
{ name: c8g, label: ah-ubuntu_22_04-c8g_8x }
66+
{ name: c7g, label: ah-ubuntu_24_04-c7g_8x-100 },
67+
{ name: c8g, label: ah-ubuntu_24_04-c8g_8x }
6868
]
6969
runs-on: ${{ matrix.config.label }}
7070
steps:
@@ -100,8 +100,8 @@ jobs:
100100
matrix:
101101
config:
102102
[
103-
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 },
104-
{ name: c8g, label: ah-ubuntu_22_04-c8g_8x }
103+
{ name: c7g, label: ah-ubuntu_24_04-c7g_8x-100 },
104+
{ name: c8g, label: ah-ubuntu_24_04-c8g_8x }
105105
]
106106
onednn_fpmath_mode: [FP32, BF16]
107107
runs-on: ${{ matrix.config.label }}

.github/workflows/tensorflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
strategy:
6363
matrix:
6464
config: [
65-
{ name: c7g, label: ah-ubuntu_22_04-c7g_8x-100 } # Metal instance required as 4x large is not big enough
65+
{ name: c7g, label: ah-ubuntu_24_04-c7g_8x-100 } # Metal instance required as 4x large is not big enough
6666
]
6767

6868
runs-on: ${{ matrix.config.label }}

ML-Frameworks/pytorch-aarch64/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ where `YY` is the year, and `MM` the month of the increment.
1010
### Added
1111

1212
### Changed
13+
- Updates Ubuntu and Python version to 24.04 and 3.12, respectively.
1314
- Updates hashes for:
1415
- `PYTORCH_HASH` to `93fef4bd1dd265588863929e35d9ac89328d5695`, 2.10.0.dev20251124 from viable/strict, Nov 24th.
1516
- `IDEEP_HASH` to `3724bec97a77ce990e8c6dc5e595bb3beee75257`, from ideep_pytorch, Nov 24th.

ML-Frameworks/pytorch-aarch64/Dockerfile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Specify DOCKER_IMAGE_MIRROR if you want to use a mirror of hub.docker.com
2020
ARG DOCKER_IMAGE_MIRROR=""
21-
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:22.04 AS workshop
21+
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:24.04 AS workshop
2222

2323
ARG USERNAME
2424

@@ -33,6 +33,8 @@ RUN if ! [ "$(arch)" = "aarch64" ] ; then exit 1; fi
3333
RUN apt-get update && apt-get install -y \
3434
# We need pip to install things, this will also bring in a minimal python3
3535
python3-pip \
36+
# So that we can create a virtual environment
37+
python3-venv \
3638
# So that we can call python instead of python3
3739
python-is-python3 \
3840
# To allow users to install new things if they want
@@ -42,8 +44,12 @@ RUN apt-get update && apt-get install -y \
4244
# DOCKER_USER for the Docker user
4345
ENV DOCKER_USER=${USERNAME}
4446

45-
# Setup default user
46-
RUN useradd --create-home -s /bin/bash -m $DOCKER_USER && echo "$DOCKER_USER:Portland" | chpasswd && adduser $DOCKER_USER sudo
47+
# Create user only if it doesn't already exist
48+
RUN id "$DOCKER_USER" >/dev/null 2>&1 || useradd --create-home -s /bin/bash -m "$DOCKER_USER"
49+
50+
# Set password and add to sudo group
51+
RUN echo "$DOCKER_USER:Portland" | chpasswd && adduser "$DOCKER_USER" sudo || true
52+
4753
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
4854
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
4955

@@ -59,11 +65,6 @@ RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> /etc/bash.bashrc
5965
# Grab the SECURITY.md from the root directory
6066
COPY --from=rootdir SECURITY.md /home/$DOCKER_USER/
6167

62-
# Update to newer pip/setuptools/wheel (setuptools >= 70.0.0 due to CVE-2024-6345
63-
# and CVE-2025-47273, wheel >= 0.38.0 due to CVE-2022-40898) and delete old system
64-
# version (we essentially use apt:python3-pip to bootstrap pip)
65-
RUN pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
66-
6768
# Remove system Python stuff. Should be safe to wipe after the line above, because
6869
# python3 -m pip now uses the /usr/local install
6970
RUN apt-get update && apt-get purge -y \
@@ -74,14 +75,25 @@ RUN apt-get update && apt-get purge -y \
7475
python3-distutils \
7576
python3-lib2to3 \
7677
python3-dev \
77-
python3.10-dev \
78+
python3.12-dev \
7879
&& apt-get autoremove -y \
7980
&& rm -rf /var/lib/apt/lists/*
8081

8182
# Move to userland
8283
WORKDIR /home/$DOCKER_USER
8384
USER $DOCKER_USER
8485

86+
# Create a per-user virtualenv and use that for everything Python
87+
RUN python -m venv /home/$DOCKER_USER/.venv
88+
89+
# Make the venv python/pip first on PATH for all subsequent layers and at runtime
90+
ENV PATH="/home/$DOCKER_USER/.venv/bin:$PATH"
91+
92+
# Update to newer pip/setuptools/wheel (setuptools >= 70.0.0 due to CVE-2024-6345
93+
# and CVE-2025-47273, wheel >= 0.38.0 due to CVE-2022-40898) and delete old system
94+
# version (we essentially use apt:python3-pip to bootstrap pip)
95+
RUN pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
96+
8597
# Base requirements for examples, excluding torch and torch*
8698
COPY requirements.txt ./
8799
RUN pip install -r requirements.txt
@@ -117,7 +129,7 @@ COPY examples/ /home/$DOCKER_USER/
117129
COPY pytorch/test /home/$DOCKER_USER/pytorch/test
118130

119131
# Move build into final image as a single layer.
120-
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:22.04
132+
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:24.04
121133

122134
ARG USERNAME
123135

@@ -128,4 +140,8 @@ RUN chown $DOCKER_USER:$DOCKER_USER /home/$DOCKER_USER
128140

129141
USER $DOCKER_USER
130142
WORKDIR /home/$DOCKER_USER
143+
144+
# Ensure the venv is on PATH in the final image as well
145+
ENV PATH="/home/$DOCKER_USER/.venv/bin:$PATH"
146+
131147
CMD ["bash", "-l"]

ML-Frameworks/pytorch-aarch64/build-torch-ao-wheel.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
set -eux -o pipefail
2424

25-
PYTHON_VERSION="3.10"
25+
PYTHON_VERSION="3.12"
2626

2727
# Specify DOCKER_IMAGE_MIRROR if you want to use a mirror of hub.docker.com
2828
IMAGE_NAME="${DOCKER_IMAGE_MIRROR:-}pytorch/manylinux2_28_aarch64-builder:cpu-aarch64-a040006da76a51c4f660331e9abd3affe5a4bd81"
@@ -52,9 +52,9 @@ if ! docker container inspect $TORCH_BUILD_CONTAINER >/dev/null 2>&1 ; then
5252
-e GITHUB_ACTIONS=0 \
5353
-e GPU_ARCH_TYPE=cpu-aarch64 \
5454
-e PACKAGE_TYPE=manywheel \
55-
-e TORCH_AO_ROOT=$TORCH_AO_ROOT \
55+
-e TORCH_AO_ROOT="${TORCH_AO_ROOT}" \
5656
-e SKIP_ALL_TESTS=1 \
57-
-e TEST_VENV=$TEST_VENV \
57+
-e TEST_VENV="${TEST_VENV}" \
5858
-v "${TORCH_AO_HOST_DIR}:${TORCH_AO_ROOT}" \
5959
-w / \
6060
"${IMAGE_NAME}")
@@ -68,7 +68,15 @@ else
6868
docker restart $TORCH_BUILD_CONTAINER
6969
fi
7070

71+
# Clean up any old builds
7172
docker exec -t $TORCH_BUILD_CONTAINER bash -c "rm -rf ${TORCH_AO_ROOT}/build ${TORCH_AO_ROOT}/dist"
72-
docker exec -t $TORCH_BUILD_CONTAINER bash -c "source $TEST_VENV/bin/activate && cd $TORCH_AO_ROOT && python${PYTHON_VERSION} setup.py bdist_wheel"
73+
74+
# Build
75+
docker exec -t $TORCH_BUILD_CONTAINER bash -c \
76+
"source ${TEST_VENV}/bin/activate && \
77+
cd ${TORCH_AO_ROOT} && \
78+
python${PYTHON_VERSION} -m pip install setuptools build && \
79+
python${PYTHON_VERSION} -m build --wheel --no-isolation"
80+
7381
# directories generated by the docker container are owned by root, so transfer ownership to user
74-
docker exec $TORCH_BUILD_CONTAINER chown -R $(id -u):$(id -g) $TORCH_AO_ROOT
82+
docker exec $TORCH_BUILD_CONTAINER chown -R "$(id -u)":"$(id -g)" "${TORCH_AO_ROOT}"

ML-Frameworks/pytorch-aarch64/build-wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
set -eux -o pipefail
3232

33-
PYTHON_VERSION="3.10"
33+
PYTHON_VERSION="3.12"
3434
OPENBLAS_VERSION="v0.3.30"
3535
ACL_VERSION="v52.6.0"
3636

ML-Frameworks/tensorflow-aarch64/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ where `YY` is the year, and `MM` the month of the increment.
1010
### Added
1111

1212
### Changed
13+
- Updates Ubuntu and Python version to 24.04 and 3.12, respectively.
1314
- Updates TensorFlow hash to 5d46b65af45d5694cb1676bc872d24a4a64a6b57, from nightly, Nov 25th
1415

1516
### Removed

ML-Frameworks/tensorflow-aarch64/Dockerfile

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Specify DOCKER_IMAGE_MIRROR if you want to use a mirror of hub.docker.com
1919
ARG DOCKER_IMAGE_MIRROR=""
20-
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:22.04 AS workshop
20+
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:24.04 AS workshop
2121

2222
ARG USERNAME
2323

@@ -29,6 +29,8 @@ RUN if ! [ "$(arch)" = "aarch64" ] ; then exit 1; fi
2929
RUN apt-get update && apt-get install -y \
3030
# We need pip to install things, this will also bring in a minimal python3
3131
python3-pip \
32+
# So that we can create a virtual environment
33+
python3-venv \
3234
# So that we can call python instead of python3
3335
python-is-python3 \
3436
# To allow users to install new things if they want
@@ -43,8 +45,12 @@ RUN apt-get install -y wget
4345
# DOCKER_USER for the Docker user
4446
ENV DOCKER_USER=${USERNAME}
4547

46-
# Setup default user
47-
RUN useradd --create-home -s /bin/bash -m $DOCKER_USER && echo "$DOCKER_USER:Portland" | chpasswd && adduser $DOCKER_USER sudo
48+
# Create user only if it doesn't already exist
49+
RUN id "$DOCKER_USER" >/dev/null 2>&1 || useradd --create-home -s /bin/bash -m "$DOCKER_USER"
50+
51+
# Set password and add to sudo group
52+
RUN echo "$DOCKER_USER:Portland" | chpasswd && adduser "$DOCKER_USER" sudo || true
53+
4854
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
4955
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
5056

@@ -60,12 +66,6 @@ RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> /etc/bash.bashrc
6066
# Grab the SECURITY.md from the root directory
6167
COPY --from=rootdir SECURITY.md /home/$DOCKER_USER/
6268

63-
# Update to newer pip/setuptools/wheel (setuptools >= 78.1.1 due to CVE-2024-6345,
64-
# CVE-2022-40897 and CVE-2025-47273, wheel >= 0.38.0 due to CVE-2022-40898 and
65-
# pip >= 25.2 due to CVE-2025-8869 and CVE-2023-5752) and delete old system
66-
# version (we essentially use apt:python3-pip to bootstrap pip)
67-
RUN pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
68-
6969
# Remove system Python stuff. Should be safe to wipe after the line above, because
7070
# python3 -m pip now uses the /usr/local install. Also removes unused protobuf
7171
# packages to resolve CVE-2025-4565.
@@ -77,10 +77,10 @@ RUN apt-get update && apt-get purge -y \
7777
python3-distutils \
7878
python3-lib2to3 \
7979
python3-dev \
80-
python3.10-dev \
81-
libprotobuf23 \
82-
libprotobuf-lite23 \
83-
libprotoc23 \
80+
python3.12-dev \
81+
libprotobuf32t64 \
82+
libprotobuf-lite32t64 \
83+
libprotoc32t64 \
8484
protobuf-compiler \
8585
&& apt-get autoremove -y \
8686
&& rm -rf /var/lib/apt/lists/*
@@ -89,6 +89,17 @@ RUN apt-get update && apt-get purge -y \
8989
WORKDIR /home/$DOCKER_USER
9090
USER $DOCKER_USER
9191

92+
# Create a per-user virtualenv and use that for everything Python
93+
RUN python -m venv /home/$DOCKER_USER/.venv
94+
95+
# Make the venv python/pip first on PATH for all subsequent layers and at runtime
96+
ENV PATH="/home/$DOCKER_USER/.venv/bin:$PATH"
97+
98+
# Update to newer pip/setuptools/wheel (setuptools >= 70.0.0 due to CVE-2024-6345
99+
# and CVE-2025-47273, wheel >= 0.38.0 due to CVE-2022-40898) and delete old system
100+
# version (we essentially use apt:python3-pip to bootstrap pip)
101+
RUN pip install --upgrade pip~=25.2 setuptools~=78.1.1 wheel~=0.45.1
102+
92103
# Check TENSORFLOW_WHEEL was set and copy
93104
RUN test -n "$TENSORFLOW_WHEEL"
94105
COPY $TENSORFLOW_WHEEL /home/$DOCKER_USER/
@@ -106,7 +117,7 @@ COPY --chown=$DOCKER_USER examples/ /home/$DOCKER_USER/
106117
COPY --chown=$DOCKER_USER tensorflow/ /home/$DOCKER_USER/tensorflow
107118

108119
# Move build into final image as a single layer.
109-
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:22.04
120+
FROM ${DOCKER_IMAGE_MIRROR}ubuntu:24.04
110121

111122
ARG USERNAME
112123

@@ -117,4 +128,8 @@ RUN chown $DOCKER_USER:$DOCKER_USER /home/$DOCKER_USER
117128

118129
USER $DOCKER_USER
119130
WORKDIR /home/$DOCKER_USER
131+
132+
# Ensure the venv is on PATH in the final image as well
133+
ENV PATH="/home/$DOCKER_USER/.venv/bin:$PATH"
134+
120135
CMD ["bash", "-l"]

ML-Frameworks/tensorflow-aarch64/build-wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
set -eux -o pipefail
3030

31-
DEFAULT_PYTHON_VERSION=3.10
31+
DEFAULT_PYTHON_VERSION=3.12
3232
PYTHON_VERSION=${PYTHON_VERSION:-$DEFAULT_PYTHON_VERSION}
3333
# TensorFlow's upstream build scripts expect python version to be in format e.g. py311 not 3.11
3434
TF_PY_VERSION="py${PYTHON_VERSION//./}"

0 commit comments

Comments
 (0)