Skip to content

Commit 8c03015

Browse files
Updating training images for konflux build
1 parent ae001d6 commit 8c03015

File tree

2 files changed

+19
-31
lines changed

2 files changed

+19
-31
lines changed

images/runtime/training/cuda/Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Global Args ######################################################
2-
ARG BASE_UBI_IMAGE_TAG=latest
3-
ARG PYTHON_VERSION=3.11
2+
ARG IMAGE_TAG=1-77.1729776556
3+
ARG PYTHON_VERSION=311
44

55
# use UBI9 latest
6-
FROM registry.access.redhat.com/ubi9/ubi:${BASE_UBI_IMAGE_TAG} AS base
6+
FROM registry.access.redhat.com/ubi9/python-${PYTHON_VERSION}:${IMAGE_TAG} AS base
77

88
LABEL name="training:py311-cuda121-torch241" \
99
summary="CUDA 12.1 Python 3.11 PyTorch 2.4.1 image based on UBI9 for Training" \
@@ -16,24 +16,18 @@ LABEL name="training:py311-cuda121-torch241" \
1616
COPY LICENSE.md /licenses/cuda-license.md
1717

1818
# Set the working directory in the container
19+
USER 0
1920
WORKDIR /app
2021

21-
# remove subscription-manager and install python3.11
22-
RUN dnf remove -y --disableplugin=subscription-manager \
23-
subscription-manager \
24-
&& dnf install -y python${PYTHON_VERSION} procps g++ python${PYTHON_VERSION}-devel \
25-
&& python -m ensurepip --upgrade \
26-
&& python -m pip install --upgrade pip \
27-
&& python -m pip install --upgrade setuptools \
28-
&& dnf update -y \
29-
&& dnf clean all
30-
31-
RUN dnf remove -y python3-requests && \
32-
pip install --no-cache-dir requests==2.32.3
22+
# upgrade requests package
23+
RUN pip install --no-cache-dir --upgrade requests==2.32.3
3324

3425
## CUDA Base ###################################################################
3526
FROM base AS cuda-base
3627

28+
# Install CUDA
29+
WORKDIR /opt/app-root/bin
30+
3731
# Ref: https://docs.nvidia.com/cuda/archive/12.1.0/cuda-toolkit-release-notes/
3832
ENV CUDA_VERSION=12.1.0 \
3933
NV_CUDA_LIB_VERSION=12.1.0-1 \
@@ -106,3 +100,7 @@ RUN pip install --no-cache-dir -U "micropipenv[toml]"
106100
COPY Pipfile.lock ./
107101

108102
RUN micropipenv install && rm -f ./Pipfile.lock
103+
104+
# Restore user workspace
105+
USER 1001
106+
WORKDIR /opt/app-root/src

images/runtime/training/rocm/Dockerfile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Global Args ######################################################
2-
ARG BASE_UBI_IMAGE_TAG=latest
3-
ARG PYTHON_VERSION=3.11
2+
ARG IMAGE_TAG=1-77.1729776556
3+
ARG PYTHON_VERSION=311
44

55
# use UBI9 latest
6-
FROM registry.access.redhat.com/ubi9/ubi:${BASE_UBI_IMAGE_TAG} AS base
6+
FROM registry.access.redhat.com/ubi9/python-${PYTHON_VERSION}:${IMAGE_TAG} AS base
77

88
LABEL name="training:py311-rocm61-torch241" \
99
summary="ROCm 6.1 Python 3.11 PyTorch 2.4.1 image based on UBI9 for Training" \
@@ -16,23 +16,13 @@ LABEL name="training:py311-rocm61-torch241" \
1616
COPY LICENSE.md /licenses/rocm-license.md
1717

1818
# Set the working directory in the container
19+
USER 0
1920
WORKDIR /app
2021

21-
# remove subscription-manager and install python3.11
22-
RUN dnf remove -y --disableplugin=subscription-manager \
23-
subscription-manager \
24-
&& dnf install -y python${PYTHON_VERSION} procps g++ python${PYTHON_VERSION}-devel \
25-
&& python -m ensurepip --upgrade \
26-
&& python -m pip install --upgrade pip \
27-
&& python -m pip install --upgrade setuptools \
28-
&& dnf update -y \
29-
&& dnf clean all
30-
31-
RUN dnf remove -y python3-requests && \
32-
pip install --no-cache-dir requests==2.32.3
22+
# upgrade requests package
23+
RUN pip install --no-cache-dir --upgrade requests==2.32.3
3324

3425
# Install ROCm
35-
USER 0
3626
WORKDIR /opt/app-root/bin
3727

3828
ARG ROCM_VERSION=6.1.2

0 commit comments

Comments
 (0)