Skip to content

Commit

Permalink
Sync 2023a branch with main branch (#81)
Browse files Browse the repository at this point in the history
* Include as a reviewer for workbench images (#52)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Include elyra package in all data science workbenches (#58)

* Include elyra package in all data science workbenches

- Filter out Pipeline plugin only for local and kfp
- Pre-set the kfp-tekton for kfp pipeline support

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Point all images label at opendatahub/workbench-images repo

Signed-off-by: Harshad Reddy Nalla <[email protected]>

---------

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Add documentation for notebooks image update process (#61)

* updated trustyai to 0.2.10

* Update Owners file (#66)

* updated trustyai to 0.2.11

* Include runtime images into workbench images

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Included the validation test for runtime images

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* updated trustyai to 0.2.12

* Wait for the runtime pod readiness for e2e tests (#76)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Remove the default Pipeline runtime config (#70)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Provide runtimes image in workbench images (#64)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Allow elyra pipeline config mount on ~/runtimes dir (#65)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

* Set default env vars for ssl_sa_certs and sa_token path (#77)

Signed-off-by: Harshad Reddy Nalla <[email protected]>

---------

Signed-off-by: Harshad Reddy Nalla <[email protected]>
Co-authored-by: aTheo <[email protected]>
Co-authored-by: Tommaso Teofili <[email protected]>
Co-authored-by: Vaishnavi Hire <[email protected]>
  • Loading branch information
4 people authored May 9, 2023
1 parent 38b394b commit 1c40b68
Show file tree
Hide file tree
Showing 96 changed files with 6,628 additions and 153 deletions.
78 changes: 76 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DATE ?= $(shell date +'%Y%m%d')
IMAGE_TAG ?= $(RELEASE)_$(DATE)
KUBECTL_BIN ?= bin/kubectl
KUBECTL_VERSION ?= v1.23.11

REQUIRED_RUNTIME_IMAGE_COMMANDS="curl python3"
# Build function for the notebok image:
# ARG 1: Image tag name.
# ARG 2: Path of image context we want to build.
Expand Down Expand Up @@ -79,6 +79,21 @@ cuda-jupyter-datascience-ubi8-python-3.8: cuda-jupyter-minimal-ubi8-python-3.8
cuda-jupyter-tensorflow-ubi8-python-3.8: cuda-jupyter-datascience-ubi8-python-3.8
$(call image,$@,jupyter/tensorflow/ubi8-python-3.8,$<)

# Build and push runtime-datascience-ubi8-python-3.8 image to the registry
.PHONY: runtime-datascience-ubi8-python-3.8
runtime-datascience-ubi8-python-3.8: base-ubi8-python-3.8
$(call image,$@,runtimes/datascience/ubi8-python-3.8,$<)

# Build and push runtime-pytorch-ubi8-python-3.8 image to the registry
.PHONY: runtime-pytorch-ubi8-python-3.8
runtime-pytorch-ubi8-python-3.8: base-ubi8-python-3.8
$(call image,$@,runtimes/pytorch/ubi8-python-3.8,$<)

# Build and push runtime-cuda-tensorflow-ubi8-python-3.8 image to the registry
.PHONY: runtime-cuda-tensorflow-ubi8-python-3.8
runtime-cuda-tensorflow-ubi8-python-3.8: cuda-ubi8-python-3.8
$(call image,$@,runtimes/tensorflow/ubi8-python-3.8,$<)

####################################### Buildchain for Python 3.9 using ubi9 #######################################

# Build and push base-ubi9-python-3.9 image to the registry
Expand Down Expand Up @@ -126,6 +141,22 @@ cuda-jupyter-tensorflow-ubi9-python-3.9: cuda-jupyter-datascience-ubi9-python-3.
jupyter-trustyai-ubi9-python-3.9: jupyter-datascience-ubi9-python-3.9
$(call image,$@,jupyter/trustyai/ubi9-python-3.9,$<)

# Build and push runtime-datascience-ubi9-python-3.9 image to the registry
.PHONY: runtime-datascience-ubi9-python-3.9
runtime-datascience-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,runtimes/datascience/ubi9-python-3.9,$<)

# Build and push runtime-pytorch-ubi9-python-3.9 image to the registry
.PHONY: runtime-pytorch-ubi9-python-3.9
runtime-pytorch-ubi9-python-3.9: base-ubi9-python-3.9
$(call image,$@,runtimes/pytorch/ubi9-python-3.9,$<)

# Build and push runtime-cuda-tensorflow-ubi9-python-3.9 image to the registry
.PHONY: runtime-cuda-tensorflow-ubi9-python-3.9
runtime-cuda-tensorflow-ubi9-python-3.9: cuda-ubi9-python-3.9
$(call image,$@,runtimes/tensorflow/ubi9-python-3.9,$<)


# Download kubectl binary
.PHONY: bin/kubectl
bin/kubectl:
Expand Down Expand Up @@ -184,6 +215,44 @@ test-%: bin/kubectl
pkill --full "^$(KUBECTL_BIN).*port-forward.*"; \
exit $${EXIT_CODE}

# Validate that runtime image meets minimum criteria
# This validation is created from subset of https://github.com/elyra-ai/elyra/blob/9c417d2adc9d9f972de5f98fd37f6945e0357ab9/Makefile#L325
.PHONY: validate-runtime-image
validate-runtime-image: bin/kubectl
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$*)))
$(info # Running tests for $(NOTEBOOK_NAME) runtime...)
$(KUBECTL_BIN) wait --for=condition=ready pod runtime-pod --timeout=300s
@required_commands=$(REQUIRED_RUNTIME_IMAGE_COMMANDS) ; \
if [[ $$image == "" ]] ; then \
echo "Usage: make validate-runtime-image image=<container-image-name>" ; \
exit 1 ; \
fi ; \
for cmd in $$required_commands ; do \
echo "=> Checking container image $$image for $$cmd..." ; \
$(KUBECTL_BIN) exec runtime-pod which $$cmd > /dev/null 2>&1 ; \
if [ $$? -ne 0 ]; then \
echo "ERROR: Container image $$image does not meet criteria for command: $$cmd" ; \
fail=1; \
continue; \
fi; \
if [ $$cmd == "python3" ]; then \
echo "=> Checking notebook execution..." ; \
$(KUBECTL_BIN) exec runtime-pod -- /bin/sh -c "python3 -m pip install -r /opt/app-root/elyra/requirements-elyra.txt && \
curl https://raw.githubusercontent.com/nteract/papermill/main/papermill/tests/notebooks/simple_execute.ipynb --output simple_execute.ipynb && \
python3 -m papermill simple_execute.ipynb output.ipynb > /dev/null" ; \
if [ $$? -ne 0 ]; then \
echo "ERROR: Image does not meet Python requirements criteria in requirements-elyra.txt" ; \
fail=1; \
fi; \
fi; \
done ; \
if [ $$fail -eq 1 ]; then \
echo "=> ERROR: Container image $$image is not a suitable Elyra runtime image" ; \
exit 1 ; \
else \
echo "=> Container image $$image is a suitable Elyra runtime image" ; \
fi;

# This is only for the workflow action
.PHONY: refresh-pipfilelock-files
refresh-pipfilelock-files:
Expand All @@ -198,4 +267,9 @@ refresh-pipfilelock-files:
cd jupyter/tensorflow/ubi8-python-3.8 && pipenv lock
cd jupyter/tensorflow/ubi9-python-3.9 && pipenv lock
cd jupyter/trustyai/ubi9-python-3.9 && pipenv lock

cd runtimes/datascience/ubi8-python-3.8 && pipenv lock
cd runtimes/datascience/ubi9-python-3.9 && pipenv lock
cd runtimes/pytorch/ubi9-python-3.9 && pipenv lock
cd runtimes/pytorch/ubi8-python-3.8 && pipenv lock
cd runtimes/tensorflow/ubi8-python-3.8 && pipenv lock
cd runtimes/tensorflow/ubi9-python-3.9 && pipenv lock
8 changes: 5 additions & 3 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
reviewers:
- atheo89
- VaishnaviHire
approvers:
- atheo89
- harshad16

reviewers:
- atheo89
- harshad16
- VaishnaviHire
66 changes: 60 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ graph TB
cuda-jupyter-minimal-ubi8-python-3.8 --> cuda-jupyter-datascience-ubi8-python-3.8;
cuda-jupyter-datascience-ubi8-python-3.8 --> cuda-jupyter-tensorflow-ubi8-python-3.8;
end
subgraph Runtimes
%% Nodes
runtimes-datascience-ubi8-python-3.8("CUDA Data Science Notebook<br/>(cuda-jupyter-datascience-ubi8-python-3.8)");
runtimes-pytorch-ubi8-python-3.8("PyTorch Notebook<br/>(jupyter-pytorch-ubi8-python-3.8)");
cuda-runtimes-tensorflow-ubi8-python-3.8("CUDA TensorFlow Notebook<br/>(cuda-jupyter-tensorflow-ubi8-python-3.8)");
%% Edges
base-ubi8-python-3.8 --> runtimes-datascience-ubi8-python-3.8;
base-ubi8-python-3.8 --> runtimes-pytorch-ubi8-python-3.8;
cuda-ubi8-python-3.8 --> cuda-runtimes-tensorflow-ubi8-python-3.8;
end
```

**Based on Python 3.9**
Expand Down Expand Up @@ -75,11 +87,23 @@ graph TB
cuda-jupyter-datascience-ubi9-python-3.9 --> cuda-jupyter-tensorflow-ubi9-python-3.9;
end
subgraph Runtimes
%% Nodes
runtimes-datascience-ubi8-python-3.9("CUDA Data Science Notebook<br/>(cuda-jupyter-datascience-ubi8-python-3.9)");
runtimes-pytorch-ubi8-python-3.9("PyTorch Notebook<br/>(jupyter-pytorch-ubi8-python-3.9)");
cuda-runtimes-tensorflow-ubi8-python-3.9("CUDA TensorFlow Notebook<br/>(cuda-jupyter-tensorflow-ubi8-python-3.9)");
%% Edges
base-ubi8-python-3.9 --> runtimes-datascience-ubi8-python-3.9;
base-ubi8-python-3.9 --> runtimes-pytorch-ubi8-python-3.9;
cuda-ubi8-python-3.9 --> cuda-runtimes-tensorflow-ubi8-python-3.9;
end
```

## Building

The following notebook images are available:
The following workbench images are available:

### Python 3.8
- jupyter-minimal-ubi8-python-3.8
Expand All @@ -88,6 +112,9 @@ The following notebook images are available:
- cuda-jupyter-minimal-ubi8-python-3.8
- cuda-jupyter-datascience-ubi8-python-3.8
- cuda-jupyter-tensorflow-ubi8-python-3.8
- runtime-datascience-ubi8-python-3.8
- runtime-pytorch-ubi8-python-3.8
- cuda-runtime-tensorflow-ubi8-python-3.8

### Python 3.9
- jupyter-minimal-ubi9-python-3.9
Expand All @@ -97,12 +124,15 @@ The following notebook images are available:
- cuda-jupyter-minimal-ubi9-python-3.9
- cuda-jupyter-datascience-ubi9-python-3.9
- cuda-jupyter-tensorflow-ubi9-python-3.9
- runtime-datascience-ubi8-python-3.9
- runtime-pytorch-ubi8-python-3.9
- cuda-runtime-tensorflow-ubi8-python-3.9

If you want to manually build a notebook image, you can use the following
If you want to manually build a workbench image, you can use the following
command:

```shell
make ${NOTEBOOK_NAME}
make ${WORKBENCH_NAME}
```

The image will be built and pushed to the
Expand All @@ -112,10 +142,10 @@ repository.
You can overwrite `IMAGE_REGISTRY` and `RELEASE` variables to use a different registry or release tag:

```shell
make ${NOTEBOOK_NAME} -e IMAGE_REGISTRY=quay.io/${YOUR_USER}/workbench-images -e RELEASE=2023x
make ${WORKBENCH_NAME} -e IMAGE_REGISTRY=quay.io/${YOUR_USER}/workbench-images -e RELEASE=2023x
```

## Testing
## Testing Notebooks

Deploy the notebook images in your Kubernetes environment using deploy8-${NOTEBOOK_NAME} for ubi8 or deploy9-${NOTEBOOK_NAME} for ubi9:

Expand All @@ -135,4 +165,28 @@ Clean up the environment when the tests are finished:
make undeployX-${NOTEBOOK_NAME}
```

For further information please see [CONTRIBUTING.md](CONTRIBUTING.md) file.
## Validating Runtimes

The runtimes image requires to have curl and python installed,
so that on runtime additional packages can be installed.

Deploy the runtime images in your Kubernetes environment using deploy8-${WORKBENCH_NAME} for ubi8 or deploy9-${WORKBENCH_NAME} for ubi9:

```shell
make deployX-${WORKBENCH_NAME}
```

Run the validate test suit for checking compatabilty of runtime images:

```shell
make validate-runtime-image image=<runtime-image>
```

Clean up the environment when the tests are finished:

```shell
make undeployX-${WORKBENCH_NAME}
```

## Contributions
Please refer [CONTRIBUTING.md](CONTRIBUTING.md) file.
31 changes: 31 additions & 0 deletions UPDATES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Workbench Images Updates

## Overview
This document aims to provide an overview of the rebuilding plan for the notebook images. There are two types of updates that are implemented:

1. *Release updates* - These updates will be carried out twice a year and will incorporate major updates to the notebook images.

2. *Patch updates* - These updates will be carried out weekly and will focus on incorporating security updates to the notebook images.

## Scope and frequency of the updates

When performing major updates to the notebook images, all components are reviewed for updates, including the base OS image, OS packages, Python version, and Python packages and libraries. A major update, which will be named “YYYYx” release (where YYYY is the year and x is an increased letter), will fix the set of components that are included, as well as their MAJOR and MINOR versions.

During the release lifecycle, which is the period during which the update is supported, the only updates that will be made are patches to allow for security updates and fixes while maintaining compatibility. These weekly updates will only modify the PATCH version, leaving the major and minor versions unchanged.

## Naming Convention for Notebook Images

To ensure consistency in naming of the notebook images, we are using the convention 'workbench-images:image-name-tag'. Where, the "image-name" segment should indicate the image's type/flavor, along with its OS version and Python version (e.g., jupyter-datascience-ubi8-python-3.8), and the "tag" segment should include the release name and patch version for easy identification. For clarity, we suggest using a YearIndex scheme for the release (e.g., 2023a) and incorporating the patch's date and weekly tag in the YYYYMMDD format.

For instance, "*workbench-images:jupyter-datascience-ubi9-python-3.9-2023a-20230115*" refers to the Jupyter Standard Data Science image based on UBI9, using Python 3.9, with a set of components as defined in release 2023a. This image is fully patched as of January 15, 2023. Additionally, "*workbench-images:jupyter-datascience-ubi9-python-3.9-2023a-weekly*" denotes the most recent version of the image.

## Support

Our goal is to ensure that notebook images are supported for a minimum of one year, meaning that typically two supported images will be available at any given time. This provides sufficient time for users to update their code to use components from the latest notebook images. We will continue to make older images available in the registry for users to add as custom notebook images, even if they are no longer supported. This way, users can still access the older images if needed.

Example lifecycle (not actual dates):

- 2023-01-01 - only one version of the notebook images available - version 1 for all images.
- 2023-06-01 - release updated images - version 2 (v2023a). Versions 1 & 2 are supported and available for selection in the UI.
- 2023-12-01 - release updated images - version 3 (v2023b). Versions 2 & 3 are supported and available for selection in the UI.
- 2024-06-01 - release updated images - version 4 (v2024a). Versions 3 & 4 are supported and available for selection in the UI.
2 changes: 1 addition & 1 deletion base/ubi8-python-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL name="odh-notebook-base-ubi8-python-3.8" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/base/ubi8-python-3.8" \
io.openshift.build.image="quay.io/opendatahub/notebooks:base-ubi8-python-3.8"
io.openshift.build.image="quay.io/opendatahub/workbench-images:base-ubi8-python-3.8"

WORKDIR /opt/app-root/bin

Expand Down
2 changes: 1 addition & 1 deletion base/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL name="odh-notebook-base-ubi9-python-3.9" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/base/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/notebooks:base-ubi9-python-3.9"
io.openshift.build.image="quay.io/opendatahub/workbench-images:base-ubi9-python-3.9"

WORKDIR /opt/app-root/bin

Expand Down
2 changes: 1 addition & 1 deletion cuda/ubi8-python-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LABEL name="odh-notebook-cuda-ubi8-python-3.8" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/cuda/ubi8-python-3.8" \
io.openshift.build.image="quay.io/opendatahub/notebooks:cuda-ubi8-python-3.8"
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-ubi8-python-3.8"

# Install CUDA base from:
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.4.2/ubi8/base/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion cuda/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LABEL name="odh-notebook-cuda-ubi9-python-3.9" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/cuda/ubi9-python-3.9" \
io.openshift.build.image="quay.io/opendatahub/notebooks:cuda-ubi9-python-3.9"
io.openshift.build.image="quay.io/opendatahub/workbench-images:cuda-ubi9-python-3.9"

# Install CUDA base from:
# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/11.8.0/ubi8/base/Dockerfile
Expand Down
34 changes: 24 additions & 10 deletions jupyter/datascience/ubi8-python-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,33 @@ LABEL name="odh-notebook-jupyter-datascience-ubi8-python-3.8" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/jupyter/datascience/ubi8-python-3.8" \
io.openshift.build.image="quay.io/opendatahub/notebooks:jupyter-datascience-ubi8-python-3.8"
io.openshift.build.image="quay.io/opendatahub/workbench-images:jupyter-datascience-ubi8-python-3.8"

WORKDIR /opt/app-root/bin

# Install Python packages and Jupyterlab extensions from Pipfile.lock
COPY Pipfile.lock ./
# Copy Elyra setup to utils so that it's sourced at startup
COPY jupyter_elyra_config.py setup-elyra.sh ./utils/

RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock

# Explicitly enable jupyterlab_s3_browser plugin
RUN jupyter serverextension enable --py jupyterlab_s3_browser
RUN echo "Installing softwares and packages" && \
micropipenv install && \
rm -f ./Pipfile.lock && \
# setup path for runtime configuration \
mkdir /opt/app-root/runtimes && \
# Explicitly enable jupyterlab_s3_browser plugin \
jupyter serverextension enable --py jupyterlab_s3_browser && \
# Remove Elyra logo from JupyterLab because this is not a pure Elyra image \
sed -i 's/widget\.id === \x27jp-MainLogo\x27/widget\.id === \x27jp-MainLogo\x27 \&\& false/' /opt/app-root/share/jupyter/labextensions/@elyra/theme-extension/static/lib_index_js.*.js && \
# Replace Notebook's launcher, "(ipykernel)" with Python's version 3.x.y \
sed -i -e "s/Python.*/$(python --version)\",/" /opt/app-root/share/jupyter/kernels/python3/kernel.json && \
# Remove default Elyra runtime-images \
rm /opt/app-root/share/jupyter/metadata/runtime-images/*.json && \
# Fix permissions to support pip in Openshift environments \
chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
fix-permissions /opt/app-root -P

# Remove Elyra logo from JupyterLab because this is not a pure Elyra image \
RUN sed -i 's/widget\.id === \x27jp-MainLogo\x27/widget\.id === \x27jp-MainLogo\x27 \&\& false/' /opt/app-root/share/jupyter/labextensions/@elyra/theme-extension/static/lib_index_js.*.js
# Copy Elyra runtime-images definitions and set the version
COPY runtime-images/ /opt/app-root/share/jupyter/metadata/runtime-images/

# Fix permissions to support pip in Openshift environments
RUN chmod -R g+w /opt/app-root/lib/python3.8/site-packages && \
fix-permissions /opt/app-root -P
WORKDIR /opt/app-root/src
6 changes: 5 additions & 1 deletion jupyter/datascience/ubi8-python-3.8/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ name = "pypi"

[packages]
# Datascience and useful extensions
elyra-pipeline-editor-extension = "~=3.15.0"
elyra-python-editor-extension = "~=3.15.0"
elyra-code-snippet-extension = "~=3.15.0"
kfp-tekton = "<1.6.0"

boto3 = "~=1.26.69"
jupyter-bokeh = "~=3.0.5"
elyra-python-editor-extension = "~=3.14.2"
kafka-python = "~=2.0.2"
matplotlib = "~=3.6.3"
numpy = "~=1.24.1"
Expand Down
Loading

0 comments on commit 1c40b68

Please sign in to comment.