Skip to content

Commit 3d1833c

Browse files
authored
RHAIENG-1965: chore(cli): implement the AIPCC replace-markers.sh functionality, as a start (opendatahub-io#2682) (#1709)
* document the new behavior * migrate existing files to new marker format * apply the migration * and remove the migration code * stop adding missing block at the end of file * remove the exclusions that I needed before * restructure around a dictionary of replacements * implement rabbit suggestion
1 parent 31d6b12 commit 3d1833c

File tree

23 files changed

+217
-200
lines changed

23 files changed

+217
-200
lines changed

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ USER 0
8383
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
8484
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
8585

86-
# upgrade first to avoid fixable vulnerabilities begin
86+
### BEGIN upgrade first to avoid fixable vulnerabilities
8787
# Problem: The operation would result in removing the following protected packages: systemd
8888
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
8989
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -93,7 +93,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
9393
dnf clean all -y
9494
EOF
9595

96-
# upgrade first to avoid fixable vulnerabilities end
96+
### END upgrade first to avoid fixable vulnerabilities
9797

9898
# Install useful OS packages
9999
RUN /bin/bash <<'EOF'
@@ -114,11 +114,11 @@ EOF
114114
# Other apps and tools installed as default user
115115
USER 1001
116116

117-
# Install micropipenv and uv to deploy packages from requirements.txt begin
117+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
118118
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
119-
# Install micropipenv and uv to deploy packages from requirements.txt end
119+
### END Install micropipenv and uv to deploy packages from requirements.txt
120120

121-
# Install the oc client begin
121+
### BEGIN Install the oc client
122122
RUN /bin/bash <<'EOF'
123123
set -Eeuxo pipefail
124124
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -127,7 +127,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
127127
rm -f /tmp/openshift-client-linux.tar.gz
128128
EOF
129129

130-
# Install the oc client end
130+
### END Install the oc client
131131

132132
####################
133133
# codeserver #

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ARG TARGETARCH
5959
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
6060
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
6161

62-
# upgrade first to avoid fixable vulnerabilities begin
62+
### BEGIN upgrade first to avoid fixable vulnerabilities
6363
# Problem: The operation would result in removing the following protected packages: systemd
6464
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
6565
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -69,7 +69,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
6969
dnf clean all -y
7070
EOF
7171

72-
# upgrade first to avoid fixable vulnerabilities end
72+
### END upgrade first to avoid fixable vulnerabilities
7373

7474
# Install useful OS packages
7575
RUN --mount=type=cache,target=/var/cache/dnf /bin/bash <<'EOF'
@@ -119,11 +119,11 @@ EOF
119119
# Other apps and tools installed as default user
120120
USER 1001
121121

122-
# Install micropipenv and uv to deploy packages from requirements.txt begin
122+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
123123
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
124-
# Install micropipenv and uv to deploy packages from requirements.txt end
124+
### END Install micropipenv and uv to deploy packages from requirements.txt
125125

126-
# Install the oc client begin
126+
### BEGIN Install the oc client
127127
RUN /bin/bash <<'EOF'
128128
set -Eeuxo pipefail
129129
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -132,7 +132,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
132132
rm -f /tmp/openshift-client-linux.tar.gz
133133
EOF
134134

135-
# Install the oc client end
135+
### END Install the oc client
136136

137137
##############################
138138
# wheel-builder stage #
@@ -285,11 +285,11 @@ COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
285285

286286
USER 0
287287

288-
# Dependencies for PDF export begin
288+
### BEGIN Dependencies for PDF export
289289
RUN ./utils/install_pdf_deps.sh
290290
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
291291

292-
# Dependencies for PDF export end
292+
### END Dependencies for PDF export
293293

294294
USER 1001
295295

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ USER 0
3939
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

42-
# upgrade first to avoid fixable vulnerabilities begin
42+
### BEGIN upgrade first to avoid fixable vulnerabilities
4343
# Problem: The operation would result in removing the following protected packages: systemd
4444
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4545
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -49,7 +49,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
4949
dnf clean all -y
5050
EOF
5151

52-
# upgrade first to avoid fixable vulnerabilities end
52+
### END upgrade first to avoid fixable vulnerabilities
5353

5454
# Install useful OS packages
5555
RUN /bin/bash <<'EOF'
@@ -62,11 +62,11 @@ EOF
6262
# Other apps and tools installed as default user
6363
USER 1001
6464

65-
# Install micropipenv and uv to deploy packages from requirements.txt begin
65+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
6666
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
67-
# Install micropipenv and uv to deploy packages from requirements.txt end
67+
### END Install micropipenv and uv to deploy packages from requirements.txt
6868

69-
# Install the oc client begin
69+
### BEGIN Install the oc client
7070
RUN /bin/bash <<'EOF'
7171
set -Eeuxo pipefail
7272
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -75,7 +75,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
7575
rm -f /tmp/openshift-client-linux.tar.gz
7676
EOF
7777

78-
# Install the oc client end
78+
### END Install the oc client
7979

8080
####################
8181
# jupyter-minimal #

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ USER 0
2323
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
2424
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2525

26-
# upgrade first to avoid fixable vulnerabilities begin
26+
### BEGIN upgrade first to avoid fixable vulnerabilities
2727
# Problem: The operation would result in removing the following protected packages: systemd
2828
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
2929
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -33,7 +33,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
3333
dnf clean all -y
3434
EOF
3535

36-
# upgrade first to avoid fixable vulnerabilities end
36+
### END upgrade first to avoid fixable vulnerabilities
3737

3838
# Install useful OS packages
3939
RUN /bin/bash <<'EOF'
@@ -46,11 +46,11 @@ EOF
4646
# Other apps and tools installed as default user
4747
USER 1001
4848

49-
# Install micropipenv and uv to deploy packages from requirements.txt begin
49+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
5050
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
51-
# Install micropipenv and uv to deploy packages from requirements.txt end
51+
### END Install micropipenv and uv to deploy packages from requirements.txt
5252

53-
# Install the oc client begin
53+
### BEGIN Install the oc client
5454
RUN /bin/bash <<'EOF'
5555
set -Eeuxo pipefail
5656
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -59,7 +59,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
5959
rm -f /tmp/openshift-client-linux.tar.gz
6060
EOF
6161

62-
# Install the oc client end
62+
### END Install the oc client
6363

6464
#########################
6565
# cuda-jupyter-minimal #
@@ -85,11 +85,11 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/
8585

8686
USER 0
8787

88-
# Dependencies for PDF export begin
88+
### BEGIN Dependencies for PDF export
8989
RUN ./utils/install_pdf_deps.sh
9090
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
9191

92-
# Dependencies for PDF export end
92+
### END Dependencies for PDF export
9393

9494
USER 1001
9595

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ USER 0
2121
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
2222
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2323

24-
# upgrade first to avoid fixable vulnerabilities begin
24+
### BEGIN upgrade first to avoid fixable vulnerabilities
2525
# Problem: The operation would result in removing the following protected packages: systemd
2626
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
2727
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -31,7 +31,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
3131
dnf clean all -y
3232
EOF
3333

34-
# upgrade first to avoid fixable vulnerabilities end
34+
### END upgrade first to avoid fixable vulnerabilities
3535

3636
# Install useful OS packages
3737
RUN /bin/bash <<'EOF'
@@ -44,11 +44,11 @@ EOF
4444
# Other apps and tools installed as default user
4545
USER 1001
4646

47-
# Install micropipenv and uv to deploy packages from requirements.txt begin
47+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
4848
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
49-
# Install micropipenv and uv to deploy packages from requirements.txt end
49+
### END Install micropipenv and uv to deploy packages from requirements.txt
5050

51-
# Install the oc client begin
51+
### BEGIN Install the oc client
5252
RUN /bin/bash <<'EOF'
5353
set -Eeuxo pipefail
5454
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -57,7 +57,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
5757
rm -f /tmp/openshift-client-linux.tar.gz
5858
EOF
5959

60-
# Install the oc client end
60+
### END Install the oc client
6161

6262
########################
6363
# rocm-jupyter-minimal #
@@ -83,11 +83,11 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/
8383

8484
USER 0
8585

86-
# Dependencies for PDF export begin
86+
### BEGIN Dependencies for PDF export
8787
RUN ./utils/install_pdf_deps.sh
8888
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
8989

90-
# Dependencies for PDF export end
90+
### END Dependencies for PDF export
9191

9292
USER 1001
9393

jupyter/pytorch+llmcompressor/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ USER 0
3939
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

42-
# upgrade first to avoid fixable vulnerabilities begin
42+
### BEGIN upgrade first to avoid fixable vulnerabilities
4343
# Problem: The operation would result in removing the following protected packages: systemd
4444
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4545
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -49,7 +49,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
4949
dnf clean all -y
5050
EOF
5151

52-
# upgrade first to avoid fixable vulnerabilities end
52+
### END upgrade first to avoid fixable vulnerabilities
5353

5454
# Install useful OS packages
5555
RUN /bin/bash <<'EOF'
@@ -62,11 +62,11 @@ EOF
6262
# Other apps and tools installed as default user
6363
USER 1001
6464

65-
# Install micropipenv and uv to deploy packages from requirements.txt begin
65+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
6666
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
67-
# Install micropipenv and uv to deploy packages from requirements.txt end
67+
### END Install micropipenv and uv to deploy packages from requirements.txt
6868

69-
# Install the oc client begin
69+
### BEGIN Install the oc client
7070
RUN /bin/bash <<'EOF'
7171
set -Eeuxo pipefail
7272
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -75,7 +75,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
7575
rm -f /tmp/openshift-client-linux.tar.gz
7676
EOF
7777

78-
# Install the oc client end
78+
### END Install the oc client
7979

8080
#########################
8181
# cuda-jupyter-minimal #
@@ -93,11 +93,11 @@ COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
9393

9494
USER 0
9595

96-
# Dependencies for PDF export begin
96+
### BEGIN Dependencies for PDF export
9797
RUN ./utils/install_pdf_deps.sh
9898
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
9999

100-
# Dependencies for PDF export end
100+
### END Dependencies for PDF export
101101

102102
USER 1001
103103

jupyter/pytorch/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ USER 0
3939
# By copying ubi.repo from the public UBI 9 image, we enable package management for upgrades and installations.
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

42-
# upgrade first to avoid fixable vulnerabilities begin
42+
### BEGIN upgrade first to avoid fixable vulnerabilities
4343
# Problem: The operation would result in removing the following protected packages: systemd
4444
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4545
# Solution: --best --skip-broken does not work either, so use --nobest
@@ -49,7 +49,7 @@ dnf -y upgrade --refresh --nobest --skip-broken --nodocs --noplugins --setopt=in
4949
dnf clean all -y
5050
EOF
5151

52-
# upgrade first to avoid fixable vulnerabilities end
52+
### END upgrade first to avoid fixable vulnerabilities
5353

5454
# Install useful OS packages
5555
RUN /bin/bash <<'EOF'
@@ -62,11 +62,11 @@ EOF
6262
# Other apps and tools installed as default user
6363
USER 1001
6464

65-
# Install micropipenv and uv to deploy packages from requirements.txt begin
65+
### BEGIN Install micropipenv and uv to deploy packages from requirements.txt
6666
RUN pip install --no-cache-dir --extra-index-url https://pypi.org/simple -U "micropipenv[toml]==1.9.0" "uv==0.8.12"
67-
# Install micropipenv and uv to deploy packages from requirements.txt end
67+
### END Install micropipenv and uv to deploy packages from requirements.txt
6868

69-
# Install the oc client begin
69+
### BEGIN Install the oc client
7070
RUN /bin/bash <<'EOF'
7171
set -Eeuxo pipefail
7272
curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable/openshift-client-linux.tar.gz \
@@ -75,7 +75,7 @@ tar -xzvf /tmp/openshift-client-linux.tar.gz oc
7575
rm -f /tmp/openshift-client-linux.tar.gz
7676
EOF
7777

78-
# Install the oc client end
78+
### END Install the oc client
7979

8080
#########################
8181
# cuda-jupyter-minimal #
@@ -93,11 +93,11 @@ COPY ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
9393

9494
USER 0
9595

96-
# Dependencies for PDF export begin
96+
### BEGIN Dependencies for PDF export
9797
RUN ./utils/install_pdf_deps.sh
9898
ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
9999

100-
# Dependencies for PDF export end
100+
### END Dependencies for PDF export
101101

102102
USER 1001
103103

0 commit comments

Comments
 (0)