Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit 0fb7041

Browse files
author
Samu
authored
Import notebook controller images using ImageStreams (#584)
Fix a issue with the ODH notebook controller where the notebook couldn't start when the notebook images was referenced by a ImageStream. See opendatahub-io/kubeflow#27
1 parent 7df1e6b commit 0fb7041

11 files changed

Lines changed: 80 additions & 14 deletions

File tree

odh-notebook-controller/gen_kubeflow_manifests.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ctrl_dir="kf-notebook-controller"
55
ctrl_repository="github.com/opendatahub-io/kubeflow"
66
ctrl_branch="master"
77
ctrl_image="quay.io/opendatahub/kubeflow-notebook-controller"
8-
ctrl_tag="1.6-55d78ca"
8+
ctrl_tag="1.6-57a7a0d"
99
ctrl_namespace="opendatahub"
1010

1111
cleanup() {
@@ -38,14 +38,15 @@ echo -n ".. Copying controller/default folder"
3838
cp -r "${ctrl_controller_dir}/config/default" ${ctrl_dir}/default
3939
echo -e "\r ✓"
4040

41-
echo -n " .. Updating controller namespace to opendatahub"
42-
sed -i 's,namespace:.*,namespace: '${ctrl_namespace}',g' ${ctrl_dir}/default/kustomization.yaml
43-
echo -e "\r ✓"
4441
echo -n ".. Copying controller/overlays folder"
4542
mkdir ${ctrl_dir}/overlays
4643
cp -r "${ctrl_controller_dir}/config/overlays/openshift" ${ctrl_dir}/overlays/openshift
4744
echo -e "\r ✓"
4845

46+
echo -n " .. Updating controller namespace to opendatahub"
47+
sed -i 's,namespace:.*,namespace: '${ctrl_namespace}',g' ${ctrl_dir}/overlays/openshift/kustomization.yaml
48+
echo -e "\r ✓"
49+
4950
echo -n " .. Updating controller image"
5051
sed -i 's,newName:.*,newName: '${ctrl_image}',g' ${ctrl_dir}/overlays/openshift/kustomization.yaml
5152
sed -i 's,newTag:.*,newTag: '${ctrl_tag}',g' ${ctrl_dir}/overlays/openshift/kustomization.yaml

odh-notebook-controller/gen_odh_manifests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ctrl_dir="odh-notebook-controller"
55
ctrl_repository="github.com/opendatahub-io/kubeflow"
66
ctrl_branch="master"
77
ctrl_image="quay.io/opendatahub/odh-notebook-controller"
8-
ctrl_tag="1.6-55d78ca"
8+
ctrl_tag="1.6-57a7a0d"
99
ctrl_namespace="opendatahub"
1010

1111
cleanup() {

odh-notebook-controller/kf-notebook-controller/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Adds namespace to all resources.
2-
namespace: opendatahub
2+
namespace: notebook-controller-system
33

44
# Value of this field is prepended to the
55
# names of all resources, e.g. a deployment named

odh-notebook-controller/kf-notebook-controller/overlays/openshift/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- ../../base
6-
namespace: notebook-controller-system
6+
namespace: opendatahub
77
commonLabels:
88
app.kubernetes.io/part-of: odh-notebook-controller
99
component.opendatahub.io/name: kf-notebook-controller
1010
opendatahub.io/component: "true"
1111
images:
1212
- name: public.ecr.aws/j1r0q0g6/notebooks/notebook-controller
1313
newName: quay.io/opendatahub/kubeflow-notebook-controller
14-
newTag: 1.6-55d78ca
14+
newTag: 1.6-57a7a0d
1515
configMapGenerator:
1616
- name: config
1717
behavior: merge

odh-notebook-controller/odh-notebook-controller/base/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ resources:
66
images:
77
- name: quay.io/opendatahub/odh-notebook-controller
88
newName: quay.io/opendatahub/odh-notebook-controller
9-
newTag: 1.6-55d78ca
9+
newTag: 1.6-57a7a0d

odh-notebook-controller/odh-notebook-controller/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rules:
2525
verbs:
2626
- get
2727
- list
28+
- patch
2829
- watch
2930
- apiGroups:
3031
- kubeflow.org

tests/basictests/odh-notebook-controller.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function test_notebook_deletion() {
7575
local notebook_path=${1}
7676
local notebook_name=${2}
7777
# Delete the notebook object
78-
os::cmd::expect_success "oc delete notebook ${notebook_name}"
78+
os::cmd::expect_success "oc delete -f ${notebook_path}"
7979
# Verify the notebook CR does not exist anymore
8080
os::cmd::try_until_text "oc get notebook ${notebook_name}" "not found" $odhdefaulttimeout $odhdefaultinterval
8181
# Verify the notebook STS is deleted

tests/resources/notebook-controller/notebooks/kubeflow-jupyter-oauth-notebook.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
---
2+
apiVersion: image.openshift.io/v1
3+
kind: ImageStream
4+
metadata:
5+
name: kubeflow-jupyter-scipy
6+
spec:
7+
tags:
8+
- name: v1.6.0
9+
from:
10+
kind: DockerImage
11+
name: docker.io/kubeflownotebookswg/jupyter-scipy:v1.6.0-rc.0
12+
referencePolicy:
13+
type: Local
14+
lookupPolicy:
15+
local: true
16+
117
---
218
apiVersion: kubeflow.org/v1
319
kind: Notebook
@@ -14,7 +30,7 @@ spec:
1430
fsGroup: 100
1531
containers:
1632
- name: kubeflow-jupyter-oauth-notebook
17-
image: public.ecr.aws/j1r0q0g6/notebooks/notebook-servers/jupyter-scipy:v1.5.0
33+
image: image-registry.openshift-image-registry.svc:5000/opendatahub/kubeflow-jupyter-scipy:v1.6.0
1834
imagePullPolicy: Always
1935
ports:
2036
- name: notebook-port

tests/resources/notebook-controller/notebooks/thoth-generic-oauth-notebook.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
---
2+
apiVersion: image.openshift.io/v1
3+
kind: ImageStream
4+
metadata:
5+
name: thoth-generic-data-science-notebook
6+
spec:
7+
tags:
8+
- name: v0.0.5
9+
from:
10+
kind: DockerImage
11+
name: quay.io/thoth-station/s2i-generic-data-science-notebook:v0.0.5
12+
referencePolicy:
13+
type: Local
14+
lookupPolicy:
15+
local: true
16+
117
---
218
apiVersion: kubeflow.org/v1
319
kind: Notebook
@@ -10,7 +26,7 @@ spec:
1026
spec:
1127
containers:
1228
- name: thoth-generic-oauth-notebook
13-
image: quay.io/thoth-station/s2i-generic-data-science-notebook:v0.0.5
29+
image: image-registry.openshift-image-registry.svc:5000/opendatahub/thoth-generic-data-science-notebook:v0.0.5
1430
imagePullPolicy: Always
1531
workingDir: /opt/app-root/src
1632
env:

tests/resources/notebook-controller/notebooks/thoth-minimal-notebook.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
---
2+
apiVersion: image.openshift.io/v1
3+
kind: ImageStream
4+
metadata:
5+
name: thoth-minimal-notebook
6+
spec:
7+
tags:
8+
- name: v0.3.0
9+
from:
10+
kind: DockerImage
11+
name: quay.io/thoth-station/s2i-minimal-notebook:v0.3.0
12+
referencePolicy:
13+
type: Local
14+
lookupPolicy:
15+
local: true
16+
117
---
218
apiVersion: kubeflow.org/v1
319
kind: Notebook
@@ -8,7 +24,7 @@ spec:
824
spec:
925
containers:
1026
- name: thoth-minimal-notebook
11-
image: quay.io/thoth-station/s2i-minimal-notebook:v0.3.0
27+
image: image-registry.openshift-image-registry.svc:5000/opendatahub/thoth-minimal-notebook:v0.3.0
1228
imagePullPolicy: Always
1329
workingDir: /opt/app-root/src
1430
env:

0 commit comments

Comments
 (0)