Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ RUN touch /tmp/control
# cpu-base #
####################
FROM ${BASE_IMAGE} AS cpu-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

Expand Down
2 changes: 2 additions & 0 deletions jupyter/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ RUN arch="${TARGETARCH:-$(uname -m)}" && \
# cpu-base #
####################
FROM ${BASE_IMAGE} AS cpu-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

Expand Down
101 changes: 99 additions & 2 deletions jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
#########################
# configuration args #
#########################
ARG BASE_IMAGE

# External image alias for UBI repository configuration
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos

FROM quay.io/aipcc/base-images/cpu:3.0-1761652019 AS cpu-base
############################
# Stage 1: PDF Tool Build #
############################
FROM registry.access.redhat.com/ubi9/python-312:latest AS pdf-builder

WORKDIR /opt/app-root/bin

# OS Packages needs to be installed as root
USER 0

RUN subscription-manager register --org "$(cat /activation-key/org)" --activationkey "$(cat /activation-key/activationkey)"
# Copy scripts
COPY jupyter/utils/install_texlive.sh ./install_texlive.sh
COPY jupyter/utils/install_pandoc.sh ./install_pandoc.sh
RUN chmod +x install_texlive.sh install_pandoc.sh

RUN ./install_texlive.sh
RUN ./install_pandoc.sh

####################
# cpu-base #
####################
FROM ${BASE_IMAGE} AS cpu-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

# OS Packages needs to be installed as root
USER 0

# Inject the official UBI 9 repository configuration into the AIPCC base image.
# 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.
Expand All @@ -24,4 +52,73 @@ RUN dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setop
# Install useful OS packages
RUN dnf install -y perl mesa-libGL skopeo && dnf clean all && rm -rf /var/cache/yum

# Other apps and tools installed as default user
USER 1001

# Install micropipenv and uv to deploy packages from requirements.txt begin
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
# Install micropipenv and uv to deploy packages from requirements.txt end

# Install the oc client begin
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
-o /tmp/openshift-client-linux.tar.gz && \
tar -xzvf /tmp/openshift-client-linux.tar.gz oc && \
rm -f /tmp/openshift-client-linux.tar.gz
# Install the oc client end

####################
# jupyter-minimal #
####################
FROM cpu-base AS jupyter-minimal

ARG JUPYTER_REUSABLE_UTILS=jupyter/utils
ARG MINIMAL_SOURCE_CODE=jupyter/minimal/ubi9-python-3.12

WORKDIR /opt/app-root/bin

COPY ${JUPYTER_REUSABLE_UTILS} utils/

USER 0

# Dependencies for PDF export begin
RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \
bash -c ' \
if [[ "$(uname -m)" == "ppc64le" ]]; then \
cp -r /pdf_builder/texlive /usr/local/; \
cp -r /pdf_builder/pandoc /usr/local/; \
else \
./utils/install_pdf_deps.sh; \
fi'

USER 1001

COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./

# Install Python dependencies from requirements.txt file
RUN echo "Installing softwares and packages" && \
# This may have to download and compile some dependencies, and as we don't lock requirements from `build-system.requires`,
# we often don't know the correct hashes and `--require-hashes` would therefore fail on non amd64, where building is common.
uv pip install --strict --no-deps --no-cache --no-config --no-progress --verify-hashes --compile-bytecode --index-strategy=unsafe-best-match --requirements=./pylock.toml && \
# Disable announcement plugin of jupyterlab \
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
# copy jupyter configuration
cp /opt/app-root/bin/utils/jupyter_server_config.py /opt/app-root/etc/jupyter && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.12/site-packages && \
fix-permissions /opt/app-root -P && \
# Apply JupyterLab addons \
/opt/app-root/bin/utils/addons/apply.sh

WORKDIR /opt/app-root/src

ENTRYPOINT ["start-notebook.sh"]

LABEL name="rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
com.redhat.component="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
io.k8s.display-name="odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
summary="Minimal Jupyter CPU notebook image for ODH notebooks" \
description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
io.k8s.description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
2 changes: 2 additions & 0 deletions jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
# cuda-base #
####################
FROM ${BASE_IMAGE} AS cuda-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

Expand Down
2 changes: 2 additions & 0 deletions jupyter/minimal/ubi9-python-3.12/Dockerfile.konflux.rocm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
# rocm-base #
####################
FROM ${BASE_IMAGE} AS rocm-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

Expand Down
2 changes: 2 additions & 0 deletions jupyter/trustyai/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
# wheel-cache-base #
####################
FROM ${BASE_IMAGE} AS whl-cache
USER 0
RUN subscription-manager refresh

# hadolint ignore=DL3002
USER root
Expand Down
2 changes: 2 additions & 0 deletions runtimes/datascience/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
# cpu-base #
####################
FROM ${BASE_IMAGE} AS cpu-base
USER 0
RUN subscription-manager refresh

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions runtimes/minimal/ubi9-python-3.12/Dockerfile.konflux.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
# cpu-base #
####################
FROM ${BASE_IMAGE} AS cpu-base
USER 0
RUN subscription-manager refresh

WORKDIR /opt/app-root/bin

Expand Down
Loading