Skip to content

Commit e095e83

Browse files
committed
Add rocmless docker image
1 parent 1e43cb8 commit e095e83

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

.github/workflows/build_hermetic_ubu24_docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
paths:
88
- 'docker/Dockerfile.rocm'
99
- 'docker/Dockerfile.theRock'
10+
- 'docker/Dockerfile.rocmless'
1011
- 'docker/python_requirements.txt'
1112
- 'docker/patches/**'
1213
- '.github/workflows/build_hermetic_ub22_docker.yml'
1314
pull_request:
1415
paths:
1516
- 'docker/Dockerfile.rocm'
1617
- 'docker/Dockerfile.theRock'
18+
- 'docker/Dockerfile.rocmless'
1719
- 'docker/python_requirements.txt'
1820
- '.github/workflows/build_hermetic_ub22_docker.yml'
1921
workflow_dispatch:
@@ -46,6 +48,8 @@ jobs:
4648
image-name: jax-build-ubu24.rocm
4749
- dockerfile: Dockerfile.theRock
4850
image-name: jax-build-ubu24.therock
51+
- dockerfile: Dockerfile.rocmless
52+
image-name: jax-build-ubu24.rocmless
4953
steps:
5054
- name: Print system info
5155
run: |

docker/Dockerfile.rocmless

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM ubuntu:24.04
2+
3+
# Prevent apt install tzinfo from asking our location (assumes UTC)
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
# Setup apt sources and install builder packages
7+
RUN apt-get update && \
8+
apt-get install -y software-properties-common && \
9+
add-apt-repository ppa:deadsnakes/ppa && \
10+
apt-get update && \
11+
apt-get install -y --no-install-recommends \
12+
autoconf \
13+
automake \
14+
build-essential \
15+
curl \
16+
file \
17+
git \
18+
libatomic1 \
19+
libquadmath0 \
20+
libtool \
21+
unzip \
22+
vim \
23+
wget \
24+
zip \
25+
zlib1g-dev && \
26+
rm -rf /var/lib/apt/lists/*
27+
28+
# Setup Python 3.12
29+
COPY python_requirements.txt /python_requirements.txt
30+
31+
RUN apt-get update && \
32+
apt-get install -y --no-install-recommends \
33+
python3.12 \
34+
python3.12-dev \
35+
python3.12-venv && \
36+
rm -rf /var/lib/apt/lists/* && \
37+
rm -f /usr/lib/python3.12/EXTERNALLY-MANAGED && \
38+
ln -sf /usr/include/python3.12 /usr/local/include/python3.12 && \
39+
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5 https://bootstrap.pypa.io/get-pip.py && \
40+
python3.12 get-pip.py && \
41+
python3.12 -m pip install --no-cache-dir --upgrade pip && \
42+
python3.12 -m pip install --no-cache-dir -U setuptools && \
43+
python3.12 -m pip install --no-cache-dir -r /python_requirements.txt && \
44+
rm -f get-pip.py
45+
46+
# bazelisk
47+
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.21.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel
48+
49+
# Install AWS CLI v2
50+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
51+
unzip awscliv2.zip && \
52+
./aws/install && \
53+
rm -rf awscliv2.zip aws
54+
55+
# Install Google Cloud CLI
56+
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
57+
tee /etc/apt/sources.list.d/google-cloud-sdk.list && \
58+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
59+
gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
60+
apt-get update && \
61+
apt-get install -y google-cloud-cli && \
62+
rm -rf /var/lib/apt/lists/*
63+
64+
# Install ROCm packages
65+
ARG GPU_DEVICE_TARGETS="gfx908,gfx90a,gfx942,gfx950,gfx1030,gfx1100,gfx1101,gfx1102,gfx1200,gfx1201"
66+
ENV GPU_DEVICE_TARGETS=${GPU_DEVICE_TARGETS}
67+
ENV TF_ROCM_AMDGPU_TARGETS=${GPU_DEVICE_TARGETS}
68+
69+
# Setup links for TensorFlow to compile.
70+
# Referenced in devel.usertools/*.bazelrc.
71+
# Set python3.12 as the default python version.
72+
# TF does not support python3.13.
73+
RUN ln -sf /usr/bin/python3.12 /usr/bin/python3
74+
RUN ln -sf /usr/bin/python3.12 /usr/bin/python
75+
RUN ln -sf /usr/lib/python3.12 /usr/lib/tf_python
76+
77+
# Don't use the bazel cache when a new docker image is created.
78+
RUN echo build --action_env=DOCKER_CACHEBUSTER=$(date +%s%N)$RANDOM >> /etc/bazel.bazelrc
79+
RUN echo build --host_action_env=DOCKER_HOST_CACHEBUSTER=$(date +%s%N)$RANDOM >> /etc/bazel.bazelrc

0 commit comments

Comments
 (0)