Skip to content

Commit 5edf3bc

Browse files
authored
Merge pull request #1687 from jiridanek/rhoai-3.2
Merge remote-tracking branch 'rhds/main' into rhoai-3.2
2 parents 3bf4654 + 548e212 commit 5edf3bc

File tree

8 files changed

+113
-2
lines changed

8 files changed

+113
-2
lines changed

codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ RUN touch /tmp/control
7070
# cpu-base #
7171
####################
7272
FROM ${BASE_IMAGE} AS cpu-base
73+
USER 0
74+
RUN subscription-manager refresh
7375

7476
WORKDIR /opt/app-root/bin
7577

jupyter/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ RUN arch="${TARGETARCH:-$(uname -m)}" && \
3737
# cpu-base #
3838
####################
3939
FROM ${BASE_IMAGE} AS cpu-base
40+
USER 0
41+
RUN subscription-manager refresh
4042

4143
WORKDIR /opt/app-root/bin
4244

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,40 @@
1+
#########################
2+
# configuration args #
3+
#########################
4+
ARG BASE_IMAGE
5+
16
# External image alias for UBI repository configuration
27
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
38

4-
FROM quay.io/aipcc/base-images/cpu:3.0-1761652019 AS cpu-base
9+
############################
10+
# Stage 1: PDF Tool Build #
11+
############################
12+
FROM registry.access.redhat.com/ubi9/python-312:latest AS pdf-builder
13+
14+
WORKDIR /opt/app-root/bin
515

616
# OS Packages needs to be installed as root
717
USER 0
818

9-
RUN subscription-manager register --org "$(cat /activation-key/org)" --activationkey "$(cat /activation-key/activationkey)"
19+
# Copy scripts
20+
COPY jupyter/utils/install_texlive.sh ./install_texlive.sh
21+
COPY jupyter/utils/install_pandoc.sh ./install_pandoc.sh
22+
RUN chmod +x install_texlive.sh install_pandoc.sh
23+
24+
RUN ./install_texlive.sh
25+
RUN ./install_pandoc.sh
26+
27+
####################
28+
# cpu-base #
29+
####################
30+
FROM ${BASE_IMAGE} AS cpu-base
31+
USER 0
32+
RUN subscription-manager refresh
33+
34+
WORKDIR /opt/app-root/bin
35+
36+
# OS Packages needs to be installed as root
37+
USER 0
1038

1139
# Inject the official UBI 9 repository configuration into the AIPCC base image.
1240
# The Quay-based AIPCC image is "repo-less" by default (https://gitlab.com/redhat/rhel-ai/core/base-images/app#repositories), so dnf cannot upgrade or install packages.
@@ -24,4 +52,73 @@ RUN dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setop
2452
# Install useful OS packages
2553
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum
2654

55+
# Other apps and tools installed as default user
2756
USER 1001
57+
58+
# Install micropipenv and uv to deploy packages from requirements.txt begin
59+
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
60+
# Install micropipenv and uv to deploy packages from requirements.txt end
61+
62+
# Install the oc client begin
63+
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
64+
-o /tmp/openshift-client-linux.tar.gz && \
65+
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \
66+
rm -f /tmp/openshift-client-linux.tar.gz
67+
# Install the oc client end
68+
69+
####################
70+
# jupyter-minimal #
71+
####################
72+
FROM cpu-base AS jupyter-minimal
73+
74+
ARG JUPYTER_REUSABLE_UTILS=jupyter/utils
75+
ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12
76+
77+
WORKDIR /opt/app-root/bin
78+
79+
COPY ${JUPYTER_REUSABLE_UTILS} utils/
80+
81+
USER 0
82+
83+
# Dependencies for PDF export begin
84+
RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \
85+
bash -c ' \
86+
if [[ "$(uname -m)" == "ppc64le" ]]; then \
87+
cp -r /pdf_builder/texlive /usr/local/; \
88+
cp -r /pdf_builder/pandoc /usr/local/; \
89+
else \
90+
./utils/install_pdf_deps.sh; \
91+
fi'
92+
93+
USER 1001
94+
95+
COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
96+
97+
# Install Python dependencies from requirements.txt file
98+
RUN echo "Installing softwares and packages" && \
99+
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
100+
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
101+
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
102+
# Disable announcement plugin of jupyterlab \
103+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
104+
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
105+
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
106+
# copy jupyter configuration
107+
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
108+
# Fix permissions to support pip in Openshift environments \
109+
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
110+
fix-permissions /opt/app-root -P && \
111+
# Apply JupyterLab addons \
112+
/opt/app-root/bin/utils/addons/apply.sh
113+
114+
WORKDIR /opt/app-root/src
115+
116+
ENTRYPOINT ["start-notebook.sh"]
117+
118+
LABEL name="rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
119+
com.redhat.component="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
120+
io.k8s.display-name="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
121+
summary="Minimal Jupyter CPU notebook image for ODH notebooks" \
122+
description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
123+
io.k8s.description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
124+
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cuda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
1212
# cuda-base #
1313
####################
1414
FROM ${BASE_IMAGE} AS cuda-base
15+
USER 0
16+
RUN subscription-manager refresh
1517

1618
WORKDIR /opt/app-root/bin
1719

jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.rocm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
1010
# rocm-base #
1111
####################
1212
FROM ${BASE_IMAGE} AS rocm-base
13+
USER 0
14+
RUN subscription-manager refresh
1315

1416
WORKDIR /opt/app-root/bin
1517

jupyter/trustyai/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
2323
# wheel-cache-base #
2424
####################
2525
FROM ${BASE_IMAGE} AS whl-cache
26+
USER 0
27+
RUN subscription-manager refresh
2628

2729
# hadolint ignore=DL3002
2830
USER root

runtimes/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
1010
# cpu-base #
1111
####################
1212
FROM ${BASE_IMAGE} AS cpu-base
13+
USER 0
14+
RUN subscription-manager refresh
1315

1416
ARG TARGETARCH
1517

runtimes/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
1010
# cpu-base #
1111
####################
1212
FROM ${BASE_IMAGE} AS cpu-base
13+
USER 0
14+
RUN subscription-manager refresh
1315

1416
WORKDIR /opt/app-root/bin
1517

0 commit comments

Comments
 (0)