Skip to content

Commit 9dabd59

Browse files
feat(scripts): add dockerfile_fragments.py for managing Dockerfile blocks (#1588)
- Implements a utility script to handle block updates/inserts within Dockerfiles using markers. - Improves maintainability by clearly demarcating the `oc client` installation section across various Dockerfiles. - Includes tests for adding/updating blocks with `blockinfile` function. * fix(scripts): adjust `blockinfile` slicing for better readability and functionality * fix(scripts): update `blockinfile` function signature to align with `prefix` type hint adjustment * update README.md --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 967f895 commit 9dabd59

File tree

37 files changed

+180
-43
lines changed

37 files changed

+180
-43
lines changed

codeserver/ubi9-python-3.11/Dockerfile.cpu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627

2728
####################

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627

2728
####################

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ USER 1001
3030
# Install micropipenv to deploy packages from Pipfile.lock
3131
RUN pip install --no-cache-dir -U "micropipenv[toml]"
3232

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

3940
####################
4041
# jupyter-minimal #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ USER 1001
3030
# Install micropipenv to deploy packages from Pipfile.lock
3131
RUN pip install --no-cache-dir -U "micropipenv[toml]"
3232

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

3940
####################
4041
# jupyter-minimal #

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
####################
2728
# jupyter-minimal #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
####################
2728
# cuda-base #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
########################
2728
# rocm-base #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
####################
2728
# jupyter-minimal #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
####################
2728
# cuda-base #

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ USER 1001
1717
# Install micropipenv to deploy packages from Pipfile.lock
1818
RUN pip install --no-cache-dir -U "micropipenv[toml]"
1919

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

2627
########################
2728
# rocm-base #

0 commit comments

Comments
 (0)