Skip to content

Commit 1ce2846

Browse files
committed
RHAIENG-389: Change RStudio base-image to AIPCC
Begin by using the provided AIPCC base image and the copr of rstudio-server-dependencies to pass-through dnf upgrade. In the meantime, we are installing other dependencies using mirror.stream.centos.org while we await the final working AIPCC image.
1 parent 731c89f commit 1ce2846

File tree

2 files changed

+19
-50
lines changed

2 files changed

+19
-50
lines changed

rstudio/rhel9-python-3.12/Dockerfile.cpu

Lines changed: 18 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ ARG TARGETARCH
55
#########################
66
ARG BASE_IMAGE
77

8-
# External image alias for UBI repository configuration
9-
FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
10-
118
####################
129
# cpu-base #
1310
####################
@@ -18,10 +15,8 @@ WORKDIR /opt/app-root/bin
1815
# OS Packages needs to be installed as root
1916
USER root
2017

21-
# Inject the official UBI 9 repository configuration into the AIPCC base image.
22-
# 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.
23-
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
24-
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
18+
# Enable copr, so we can do dnf upgrade
19+
RUN dnf copr enable copr.devel.redhat.com/mcurlej/rstudio-server-dependencies rhel-9-x86_64 -y
2520

2621
# upgrade first to avoid fixable vulnerabilities begin
2722
# Problem: The operation would result in removing the following protected packages: systemd
@@ -33,15 +28,11 @@ RUN dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setop
3328

3429
# Install useful OS packages
3530
# remove skopeo, CVE-2025-4674
36-
RUN dnf install -y perl mesa-libGL && dnf clean all && rm -rf /var/cache/yum
31+
RUN dnf install -y mesa-libGL && dnf clean all && rm -rf /var/cache/yum
3732

3833
# Other apps and tools installed as default user
3934
USER 1001
4035

41-
# Install micropipenv and uv to deploy packages from requirements.txt begin
42-
RUN pip install --no-cache-dir -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
43-
# Install micropipenv and uv to deploy packages from requirements.txt end
44-
4536
WORKDIR /opt/app-root/src
4637

4738
#####################
@@ -54,13 +45,6 @@ ARG TARGETARCH
5445

5546
WORKDIR /opt/app-root/bin
5647

57-
# TODO THIS SHOULD BE REMOVED
58-
# Access the client's secret for the subscription manager from the environment variable
59-
ARG SECRET_DIR=/opt/app-root/src/.sec
60-
ARG SERVERURL_DEFAULT=""
61-
ARG BASEURL_DEFAULT=""
62-
# TILL HERE
63-
6448
LABEL name="odh-notebook-rstudio-server-rhel9-python-3.12" \
6549
summary="RStudio Server image with python 3.12 based on Red Hat Enterprise Linux 9" \
6650
description="RStudio Server image with python 3.12 based on Red Hat Enterprise Linux 9" \
@@ -73,32 +57,20 @@ LABEL name="odh-notebook-rstudio-server-rhel9-python-3.12" \
7357

7458
USER 0
7559

76-
# TODO THIS SHOULD BE REMOVED in favor of: https://issues.redhat.com/browse/RHOAIENG-32541
77-
# uncomment the below line if you fall on this error: subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.
78-
#RUN sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py
79-
80-
# If necessary, run the subscription manager command using the provided credentials. Only include --serverurl and --baseurl if they are provided
81-
RUN if [ -d "${SECRET_DIR}" ]; then \
82-
SERVERURL=$(cat ${SECRET_DIR}/SERVERURL 2>/dev/null || echo ${SERVERURL_DEFAULT}) && \
83-
BASEURL=$(cat ${SECRET_DIR}/BASEURL 2>/dev/null || echo ${BASEURL_DEFAULT}) && \
84-
USERNAME=$(cat ${SECRET_DIR}/USERNAME) && \
85-
PASSWORD=$(cat ${SECRET_DIR}/PASSWORD) && \
86-
subscription-manager register \
87-
${SERVERURL:+--serverurl=$SERVERURL} \
88-
${BASEURL:+--baseurl=$BASEURL} \
89-
--username=$USERNAME \
90-
--password=$PASSWORD \
91-
--force \
92-
--auto-attach; \
93-
fi
94-
# TILL HERE
95-
9660
ENV R_VERSION=4.5.1
9761

62+
# Use CentOS while we are still waiting on final AIPCC image
63+
RUN dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/
64+
RUN dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/
65+
RUN dnf config-manager --add-repo https://mirror.stream.centos.org/9-stream/CRB/x86_64/os/
66+
RUN dnf makecache
67+
RUN rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
68+
69+
# This package causes issues with openssl installation
70+
RUN rpm -e openssl-fips-provider-so --nodeps
71+
9872
# Install R
99-
RUN dnf install -y dnf-plugins-core && \
100-
subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms && \
101-
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
73+
RUN dnf install -y https://download.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
10274
INSTALL_PKGS="R-core R-core-devel R-java R-Rcpp R-highlight \
10375
R-littler R-littler-examples openssl-libs compat-openssl11" && \
10476
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
@@ -118,6 +90,10 @@ RUN chmod -R a+w ${LIBLOC} && \
11890
WORKDIR /tmp/
11991
COPY /rstudio/utils /tmp/utils
12092

93+
# npm required by ./cve_remediation.sh
94+
RUN dnf module enable nodejs:22 -y
95+
RUN dnf install npm -y
96+
12197
# Install RStudio
12298
ARG RSTUDIO_RPM=rstudio-server-rhel-2025.09.0-387-x86_64.rpm
12399
RUN wget --progress=dot:giga https://download2.rstudio.org/server/rhel9/x86_64/${RSTUDIO_RPM} && \
@@ -217,13 +193,6 @@ WORKDIR /opt/app-root/bin
217193
COPY ${RSTUDIO_SOURCE_CODE}/utils utils/
218194
COPY ${RSTUDIO_SOURCE_CODE}/run-rstudio.sh ${RSTUDIO_SOURCE_CODE}/setup_rstudio.py ${RSTUDIO_SOURCE_CODE}/rsession.sh ${RSTUDIO_SOURCE_CODE}/run-nginx.sh ./
219195

220-
# TODO THIS SHOULD BE REMOVED in favor of: https://issues.redhat.com/browse/RHOAIENG-32541
221-
# Unregister the system
222-
RUN if [ -d "${SECRET_DIR}" ]; then \
223-
subscription-manager remove --all && subscription-manager unregister && subscription-manager clean; \
224-
fi
225-
# TILL HERE
226-
227196
USER 1001
228197

229198
COPY ${RSTUDIO_SOURCE_CODE}/pylock.toml ./
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Base Image : UBI 9 with Python 3.12
22
# Architectures: linux/arm64, linux/x86_64
3-
BASE_IMAGE=registry.redhat.io/rhel9/python-312:latest
3+
BASE_IMAGE=quay.io/aipcc/base-images/cpu:3.0

0 commit comments

Comments
 (0)