Skip to content

Commit cfca6f8

Browse files
committed
fixup! RHOAIENG-21668: chore(gha): implement the rhel building on pull_request_trigger workflow
1 parent 457aecb commit cfca6f8

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

rstudio/rhel9-python-3.11/Dockerfile.cpu

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,11 @@ LABEL name="odh-notebook-rstudio-server-rhel9-python-3.11" \
4848

4949
USER 0
5050

51-
# Check if we are already entitled
52-
RUN subscription-manager status || touch /var/tmp/.subscription-initially-not-present
53-
5451
# 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.
5552
#RUN sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py
5653

5754
# If necessary, run the subscription manager command using the provided credentials. Only include --serverurl and --baseurl if they are provided
58-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || \
55+
RUN [ -d "${SECRET_DIR}" ] && \
5956
(SERVERURL=$(cat ${SECRET_DIR}/SERVERURL 2>/dev/null || echo ${SERVERURL_DEFAULT}) && \
6057
BASEURL=$(cat ${SECRET_DIR}/BASEURL 2>/dev/null || echo ${BASEURL_DEFAULT}) && \
6158
USERNAME=$(cat ${SECRET_DIR}/USERNAME) && \
@@ -173,7 +170,7 @@ COPY ${RSTUDIO_SOURCE_CODE}/utils utils/
173170
COPY ${RSTUDIO_SOURCE_CODE}/run-rstudio.sh ${RSTUDIO_SOURCE_CODE}/setup_rstudio.py ${RSTUDIO_SOURCE_CODE}/rsession.sh ${RSTUDIO_SOURCE_CODE}/run-nginx.sh ./
174171

175172
# Unregister the system
176-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
173+
RUN [ -d "${SECRET_DIR}" ] && (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
177174

178175
USER 1001
179176

rstudio/rhel9-python-3.11/Dockerfile.cuda

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ ARG BASEURL_DEFAULT=""
4141
USER 0
4242
WORKDIR /opt/app-root/bin
4343

44-
# Check if we are already entitled
45-
RUN subscription-manager status || touch /var/tmp/.subscription-initially-not-present
46-
4744
# If necessary, run the subscription manager command using the provided credentials. Only include --serverurl and --baseurl if they are provided
48-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || \
45+
RUN [ -d "${SECRET_DIR}" ] && \
4946
(SERVERURL=$(cat ${SECRET_DIR}/SERVERURL 2>/dev/null || echo ${SERVERURL_DEFAULT}) && \
5047
BASEURL=$(cat ${SECRET_DIR}/BASEURL 2>/dev/null || echo ${BASEURL_DEFAULT}) && \
5148
USERNAME=$(cat ${SECRET_DIR}/USERNAME) && \
@@ -169,7 +166,7 @@ RUN yum -y install cuda-toolkit-12-4 && \
169166
yum -y clean all --enablerepo="*"
170167

171168
# Unregister the system
172-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
169+
RUN [ -d "${SECRET_DIR}" ] && (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
173170

174171
# Restore notebook user workspace
175172
USER 1001
@@ -198,14 +195,11 @@ LABEL name="odh-notebook-rstudio-server-rhel9-python-3.11" \
198195

199196
USER 0
200197

201-
# Check if we are already entitled
202-
RUN subscription-manager status || touch /var/tmp/.subscription-initially-not-present
203-
204198
# 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.
205199
#RUN sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py
206200

207201
# If necessary, run the subscription manager command using the provided credentials. Only include --serverurl and --baseurl if they are provided
208-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || \
202+
RUN [ -d "${SECRET_DIR}" ] && \
209203
(SERVERURL=$(cat ${SECRET_DIR}/SERVERURL 2>/dev/null || echo ${SERVERURL_DEFAULT}) && \
210204
BASEURL=$(cat ${SECRET_DIR}/BASEURL 2>/dev/null || echo ${BASEURL_DEFAULT}) && \
211205
USERNAME=$(cat ${SECRET_DIR}/USERNAME) && \
@@ -323,7 +317,7 @@ COPY ${RSTUDIO_SOURCE_CODE}/utils utils/
323317
COPY ${RSTUDIO_SOURCE_CODE}/run-rstudio.sh ${RSTUDIO_SOURCE_CODE}/setup_rstudio.py ${RSTUDIO_SOURCE_CODE}/rsession.sh ${RSTUDIO_SOURCE_CODE}/run-nginx.sh ./
324318

325319
# Unregister the system
326-
RUN [ ! -f '/var/tmp/.subscription-initially-not-present' ] || (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
320+
RUN [ -d "${SECRET_DIR}" ] && (subscription-manager remove --all && subscription-manager unregister && subscription-manager clean)
327321

328322
USER 1001
329323

0 commit comments

Comments
 (0)