Skip to content

Commit 6f6c4a7

Browse files
authored
Merge pull request #352 from harshad16/rsync-2024a
[2024a] release-2024a from opendatahub-io:2024a
2 parents 728b2c3 + 2766696 commit 6f6c4a7

File tree

37 files changed

+772
-571
lines changed

37 files changed

+772
-571
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# GitHub image registry used for storing $(CONTAINER_ENGINE)'s cache
2424
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
2525
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
26-
TRIVY_SCAN_FS_JSON: '{"rocm-jupyter-pytorch-ubi9-python-3.9": "jupyter/rocm/pytorch/ubi9-python-3.9"}'
26+
TRIVY_SCAN_FS_JSON: '{}'
2727

2828
steps:
2929

@@ -123,24 +123,23 @@ jobs:
123123
env:
124124
IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}/workbench-images"
125125
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
126+
# dependent images were already built and pushed, so just let podman pull it
127+
BUILD_DEPENDENT_IMAGES: "no"
126128

127129
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
128130
- name: "pull_request: make ${{ inputs.target }}"
129131
run: |
130-
# start a black hole container registry as make target always does a push
131-
mkdir -p $HOME/.config/containers/registries.conf.d/
132-
cp ci/cached-builds/insecure_localhost_registry.conf $HOME/.config/containers/registries.conf.d/insecure_localhost_registry.conf
133-
go run ci/cached-builds/dev_null_container_registry.go &
134-
# build and push the image
135132
make ${{ inputs.target }}
136133
if: "${{ fromJson(inputs.github).event_name == 'pull_request' }}"
137134
env:
138135
IMAGE_TAG: "${{ github.sha }}"
139136
IMAGE_REGISTRY: "localhost:5000/workbench-images"
140137
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }}"
138+
# We don't have access to image registry, so disable pushing
139+
PUSH_IMAGES: "no"
141140

142141
- name: "Show podman images information"
143-
run: podman images
142+
run: podman images --digests
144143

145144
- name: "pull_request|schedule: resolve target if Trivy scan should run"
146145
id: resolve-target

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ IMAGE_REGISTRY ?= quay.io/opendatahub/workbench-images
22
RELEASE ?= 2024a
33
# additional user-specified caching parameters for $(CONTAINER_ENGINE) build
44
CONTAINER_BUILD_CACHE_ARGS ?= --no-cache
5+
# whether to build all dependent images or just the one specified
6+
BUILD_DEPENDENT_IMAGES ?= yes
7+
# whether to push the images to a registry as they are built
8+
PUSH_IMAGES ?= yes
59

610
# OS dependant: Generate date, select appropriate cmd to locate container engine
711
ifeq ($(OS), Windows_NT)
@@ -58,10 +62,19 @@ endef
5862
# ARG 1: Image tag name.
5963
# ARG 2: Path of image context we want to build.
6064
# ARG 3: Base image tag name (optional).
65+
#
66+
# BUILD_DEPENDENT_IMAGES: only build images that were explicitly given as a goal on command line
67+
# PUSH_IMAGES: allows skipping podman push
6168
define image
6269
$(info #*# Image build directory: <$(2)> #(MACHINE-PARSED LINE)#*#...)
63-
$(call build_image,$(1),$(2),$(3))
64-
$(call push_image,$(1))
70+
71+
$(if $(or $(BUILD_DEPENDENT_IMAGES:no=), $(filter $@,$(MAKECMDGOALS))),
72+
$(call build_image,$(1),$(2),$(3))
73+
74+
$(if $(PUSH_IMAGES:no=),
75+
$(call push_image,$(1))
76+
)
77+
)
6578
endef
6679

6780
####################################### Buildchain for Python 3.8 using ubi8 #######################################

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ To build a workbench image, you can execute the following command:
3737
make ${WORKBENCH_NAME} -e IMAGE_REGISTRY=quay.io/${YOUR_USER}/workbench-images -e RELEASE=2023x
3838
```
3939

40-
Using `IMAGE_REGISTRY` and `RELEASE` variables you can overwrite the default values and use a different registry or release tag
40+
Using `IMAGE_REGISTRY` and `RELEASE` variables you can overwrite the default values and use a different registry or release tag
41+
42+
Using `CONTAINER_BUILD_CACHE_ARGS` (default: `--no-cache`), `BUILD_DEPENDENT_IMAGES`, and `PUSH_IMAGES` variables you can further customize the build process.
4143

4244
### Local Execution
4345

ci/cached-builds/dev_null_container_registry.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/cached-builds/insecure_localhost_registry.conf

Lines changed: 0 additions & 3 deletions
This file was deleted.

jupyter/datascience/ubi9-python-3.9/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ COPY setup-elyra.sh ./utils/
2020

2121
RUN echo "Installing softwares and packages" && \
2222
micropipenv install && \
23-
rm -f ./Pipfile.lock
23+
rm -f ./Pipfile.lock && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
fix-permissions /opt/app-root -P
2427

2528
COPY utils ./utils/
2629

jupyter/minimal/ubi8-python-3.8/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ COPY utils utils/
1818
COPY Pipfile.lock start-notebook.sh ./
1919

2020
# Install Python dependencies from Pipfile.lock file
21-
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
22-
23-
# Disable announcement plugin of jupyterlab
24-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
25-
26-
# Fix permissions to support pip in Openshift environments
27-
RUN chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
28-
fix-permissions /opt/app-root -P
21+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
22+
# Disable announcement plugin of jupyterlab \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
26+
fix-permissions /opt/app-root -P
2927

3028
WORKDIR /opt/app-root/src
3129

jupyter/minimal/ubi9-python-3.9/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ COPY utils utils/
1818
COPY Pipfile.lock start-notebook.sh ./
1919

2020
# Install Python dependencies from Pipfile.lock file
21-
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock
22-
23-
# Disable announcement plugin of jupyterlab
24-
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
25-
26-
# Fix permissions to support pip in Openshift environments
27-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
28-
fix-permissions /opt/app-root -P
21+
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
22+
# Disable announcement plugin of jupyterlab \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
26+
fix-permissions /opt/app-root -P
2927

3028
WORKDIR /opt/app-root/src
3129

jupyter/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ RUN echo "Installing softwares and packages" && \
2020
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
2121
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
2222
# Disable announcement plugin of jupyterlab \
23-
jupyter labextension disable "@jupyterlab/apputils-extension:announcements"
24-
25-
# Fix permissions to support pip in Openshift environments
26-
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
23+
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
24+
# Fix permissions to support pip in Openshift environments \
25+
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
2726
fix-permissions /opt/app-root -P

jupyter/rocm/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ LABEL name="odh-notebook-jupyter-rocm-pytorch-ubi9-python-3.9" \
1313

1414
# Install Python packages and Jupyterlab extensions from Pipfile.lock
1515
COPY Pipfile.lock ./
16+
# Copy utility script
17+
COPY de-vendor-torch.sh ./
1618

1719
RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock && \
20+
# De-vendor the ROCm libs that are embedded in Pytorch \
21+
./de-vendor-torch.sh && \
22+
rm ./de-vendor-torch.sh && \
1823
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y
1924
sed -i -e "s/Python.*/$(python --version | cut -d '.' -f-2)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
20-
# Disable announcement plugin of jupyterlab
25+
# Disable announcement plugin of jupyterlab \
2126
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" && \
22-
# Fix permissions to support pip in Openshift environments
27+
# Fix permissions to support pip in Openshift environments \
2328
chmod -R g+w /opt/app-root/lib/python3.9/site-packages && fix-permissions /opt/app-root -P

0 commit comments

Comments
 (0)