Skip to content

Commit 494f182

Browse files
ysokcursoragent
andcommitted
Update Dockerfile and Tekton to use requirements.<flavor>.txt
Align with the renamed requirements file (requirements.cpu.txt): - Dockerfile.cpu: COPY requirements.${PYLOCK_FLAVOR}.txt as requirements.txt (in both whl-cache and codeserver stages) - Dockerfile.vath: same COPY update - Tekton pull-request.yaml: requirements_files: ["requirements.cpu.txt"] - Tekton push.yaml: same update Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 797d901 commit 494f182

File tree

7 files changed

+19
-1081
lines changed

7 files changed

+19
-1081
lines changed

.tekton/odh-workbench-codeserver-datascience-cpu-py312-ubi9-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ spec:
6666
type: pip
6767
binary:
6868
arch: "x86_64,aarch64,ppc64le"
69-
requirements_files: ["requirements.txt"]
69+
requirements_files: ["requirements.cpu.txt"]
7070
- path: codeserver/ubi9-python-3.12/prefetch-input/code-server/lib/vscode/.vscode/extensions/vscode-selfhost-import-aid
7171
type: npm
7272
- path: codeserver/ubi9-python-3.12/prefetch-input/code-server/lib/vscode/.vscode/extensions/vscode-selfhost-test-provider

.tekton/odh-workbench-codeserver-datascience-cpu-py312-ubi9-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ spec:
5656
type: pip
5757
binary:
5858
arch: "x86_64,aarch64,ppc64le"
59-
requirements_files: ["requirements.txt"]
59+
requirements_files: ["requirements.cpu.txt"]
6060
- path: codeserver/ubi9-python-3.12/prefetch-input/code-server/lib/vscode/.vscode/extensions/vscode-selfhost-import-aid
6161
type: npm
6262
- path: codeserver/ubi9-python-3.12/prefetch-input/code-server/lib/vscode/.vscode/extensions/vscode-selfhost-test-provider

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ RUN rpm --import /cachi2/output/deps/generic/RPM-GPG-KEY-EPEL-9
6464
RUN rpm --import /cachi2/output/deps/generic/RPM-GPG-KEY-CentOS-Official
6565
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
6666

67-
# [HERMETIC] Configure package repos: local cachi2 repo for testing, or enable nodejs:22 module for Konflux.
67+
# [HERMETIC] Configure package repos: local hermeto repos for testing, or enable nodejs:22 module for Konflux.
68+
# Hermeto organises RPMs into per-arch sub-repos (baseos, epel, crb, ubi-*, …), each with
69+
# its own repodata/. The generated hermeto.repo already points at the correct file:// paths.
6870
RUN if [ "${LOCAL_BUILD}" = "true" ]; then \
6971
rm -f /etc/yum.repos.d/* && \
70-
dnf config-manager --add-repo file:///cachi2/output/deps/rpm/; \
72+
cp /cachi2/output/deps/rpm/"$(uname -m)"/repos.d/*.repo /etc/yum.repos.d/ && \
73+
dnf module reset nodejs -y; \
7174
else \
7275
dnf module enable nodejs:22 -y; \
7376
fi;
@@ -174,11 +177,11 @@ RUN rpm --import /cachi2/output/deps/generic/RPM-GPG-KEY-CentOS-Official
174177
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
175178

176179
# [HERMETIC] Configure package repos for local testing (same pattern as rpm-base and cpu-base).
177-
# In Konflux, cachi2 injects repos automatically. In LOCAL_BUILD mode, we point dnf
178-
# at the local cachi2 repo so it can find openblas-threads (from codeready-builder).
180+
# In Konflux, cachi2 injects repos automatically. In LOCAL_BUILD mode, we copy the
181+
# hermeto-generated repo config so dnf can find openblas-threads (from codeready-builder).
179182
RUN if [ "${LOCAL_BUILD}" = "true" ]; then \
180183
rm -f /etc/yum.repos.d/* && \
181-
dnf config-manager --add-repo file:///cachi2/output/deps/rpm/; \
184+
cp /cachi2/output/deps/rpm/"$(uname -m)"/repos.d/*.repo /etc/yum.repos.d/; \
182185
fi;
183186

184187
# [HERMETIC] ppc64le/s390x: install system-level deps.
@@ -198,15 +201,13 @@ EOF
198201

199202
# [HERMETIC] Git metadata (may be needed by setuptools-scm for version detection in sdist builds).
200203
COPY .git /root/.git
201-
# All arches: requirements and devel script (script is a no-op on all arches; kept for WHEEL_DIR setup)
202-
COPY ${CODESERVER_SOURCE_CODE}/pylock.toml ./
203204

204205
# copy requirements and scripts
205206
COPY ${CODESERVER_SOURCE_CODE}/uv.lock.d/pylock.${PYLOCK_FLAVOR}.toml ./pylock.toml
206207

207-
# [HERMETIC] requirements.txt is generated by cachi2 from pyproject.toml with pinned hashes.
208+
# [HERMETIC] requirements.<flavor>.txt is generated by create-requirements-lockfile.sh with pinned hashes.
208209
# Previously we used pylock.toml directly; now cachi2 needs requirements.txt format.
209-
COPY ${CODESERVER_SOURCE_CODE}/requirements.txt ./
210+
COPY ${CODESERVER_SOURCE_CODE}/requirements.${PYLOCK_FLAVOR}.txt ./requirements.txt
210211
COPY ${CODESERVER_SOURCE_CODE}/devel_env_setup.sh ./
211212

212213
# [HERMETIC] Install uv + install all Python packages from cachi2 pip cache.
@@ -272,7 +273,8 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
272273
# Node.js is needed at runtime for code-server.
273274
RUN if [ "${LOCAL_BUILD}" = "true" ]; then \
274275
rm -f /etc/yum.repos.d/* && \
275-
dnf config-manager --add-repo file:///cachi2/output/deps/rpm/; \
276+
cp /cachi2/output/deps/rpm/"$(uname -m)"/repos.d/*.repo /etc/yum.repos.d/ && \
277+
dnf module reset nodejs -y; \
276278
else \
277279
dnf module enable nodejs:22 -y; \
278280
fi;
@@ -484,9 +486,9 @@ ENV PYTHONPATH=/opt/app-root/bin/python3
484486
# Install useful packages from pylock file
485487
COPY ${CODESERVER_SOURCE_CODE}/uv.lock.d/pylock.${PYLOCK_FLAVOR}.toml ./pylock.toml
486488

487-
# [HERMETIC] Install Python packages from cachi2 pip cache (requirements.txt format).
489+
# [HERMETIC] Install Python packages from cachi2 pip cache (requirements.<flavor>.txt format).
488490
# Previously used pylock.toml; cachi2 prefetch generates requirements.txt with hashes.
489-
COPY ${CODESERVER_SOURCE_CODE}/requirements.txt ./
491+
COPY ${CODESERVER_SOURCE_CODE}/requirements.${PYLOCK_FLAVOR}.txt ./requirements.txt
490492

491493
# Wait for whl-cache stage (builds/caches Python wheels).
492494
COPY --from=whl-cache /tmp/control /dev/null

codeserver/ubi9-python-3.12/Dockerfile.vath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ COPY ${CODESERVER_SOURCE_CODE}/pylock.toml ./
4949
# copy requirements and scripts
5050
COPY ${CODESERVER_SOURCE_CODE}/uv.lock.d/pylock.${PYLOCK_FLAVOR}.toml ./pylock.toml
5151

52-
# [HERMETIC] requirements.txt is generated by cachi2 from pyproject.toml with pinned hashes.
52+
# [HERMETIC] requirements.<flavor>.txt is generated by create-requirements-lockfile.sh with pinned hashes.
5353
# Previously we used pylock.toml directly; now cachi2 needs requirements.txt format.
54-
COPY ${CODESERVER_SOURCE_CODE}/requirements.txt ./
54+
COPY ${CODESERVER_SOURCE_CODE}/requirements.${PYLOCK_FLAVOR}.txt ./requirements.txt
5555
COPY ${CODESERVER_SOURCE_CODE}/devel_env_setup.sh ./
5656

5757
# [HERMETIC] Install uv + install all Python packages (--network=none).

0 commit comments

Comments
 (0)