Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: standalone notebook #113

Merged
merged 9 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions components/app-configs/notebook-nvidia-nemo/deployment.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions components/app-configs/notebook-nvidia-nemo/kustomization.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions components/app-configs/notebook-nvidia-nemo/route.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions components/app-configs/notebook-nvidia-nemo/service.yaml

This file was deleted.

76 changes: 76 additions & 0 deletions components/app-configs/notebook-standalone/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: notebook
annotations:
argocd.argoproj.io/sync-wave: "1"
# image.openshift.io/triggers: >-
# [{"from":{"kind":"ImageStreamTag","name":"notebook:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"notebook\")].image","paused":"false"}]
spec:
replicas: 1
strategy:
type: Recreate
template:
spec:
containers:
- name: notebook
image: docker.io/kubeflownotebookswg/jupyter:latest
env:
- name: HOME
value: /workspace
ports:
- containerPort: 8888
protocol: TCP
name: notebook
- containerPort: 8000
protocol: TCP
name: demo
resources:
limits:
cpu: '2'
memory: 8Gi
requests:
cpu: 500m
memory: 8Gi
# livenessProbe:
# httpGet:
# path: /
# port: http
# scheme: HTTP
# timeoutSeconds: 5
# periodSeconds: 5
# successThreshold: 1
# failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: notebook
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
startupProbe:
httpGet:
path: /
port: notebook
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
failureThreshold: 10
volumeMounts:
- name: shm
mountPath: /dev/shm
- name: home
mountPath: /workspace
subPath: data
volumes:
- name: shm
emptyDir:
medium: Memory
sizeLimit: 512Mi
- name: home
persistentVolumeClaim:
claimName: notebook
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

labels:
- includeSelectors: false
- includeSelectors: true
pairs:
component: jupyter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jupyter
labels:
app: jupyter
name: notebook
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: jupyter
labels:
app: jupyter
name: notebook
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
port:
targetPort: 8787
targetPort: 8888
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: jupyter
name: notebook
weight: 100
wildcardPolicy: None
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: jupyter-demo
labels:
app: jupyter
name: notebook-demo
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
Expand All @@ -35,6 +31,6 @@ spec:
termination: edge
to:
kind: Service
name: jupyter
name: notebook
weight: 100
wildcardPolicy: None
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ kind: Service
metadata:
annotations:
argocd.argoproj.io/sync-wave: "1"
service.alpha.openshift.io/serving-cert-secret-name: jupyter
labels:
app: jupyter
name: jupyter
service.alpha.openshift.io/serving-cert-secret-name: notebook
name: notebook
spec:
ports:
- name: notebook
port: 8888
targetPort: 8888
- name: demo
port: 8000
targetPort: 8000
- name: notebook
port: 8787
targetPort: 8787
- name: oauth-proxy
port: 8080
targetPort: 8080
selector:
app: jupyter
sessionAffinity: None
type: ClusterIP
69 changes: 69 additions & 0 deletions components/app-configs/notebook-standalone/base/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
kind: Template
apiVersion: template.openshift.io/v1
labels:
template: standalone-notebook
app.kubernetes.io/part-of: standalone-notebook
app.kubernetes.io/component: ide
metadata:
name: standalone-notebook
labels:
template: standalone-notebook
annotations:
openshift.io/display-name: A Standalone Jupyter Notebook
openshift.io/provider-display-name: Community
description: Data Science Notebook in OpenShift
iconClass: icon-python
tags: python
openshift.io/documentation-url: "https://github.com/redhat-na-ssa/demo-ai-gitops-catalog"
openshift.io/support-url: "https://github.com/redhat-na-ssa/demo-ai-gitops-catalog/issues"
template.openshift.io/bindable: "false"
parameters:
- name: APPLICATION_NAME
displayName: Application Name
required: true
value: standalone-notebook
- name: VOLUME_SIZE
displayName: Volume Size
value: 5Gi
required: true
- name: NOTEBOOK_MEM_LIMIT
displayName: Notebook Memory Limit
value: 1792Mi
required: true
description: Consider the pod quota limits on your namespace
- name: NOTEBOOK_CPU_LIMIT
displayName: Notebook CPU Limit
value: 1700m
required: true
description: Consider the pod quota limits on your namespace
- name: WEBDAV_MEM_LIMIT
displayName: WebDav Memory Limit
value: 256M
required: true
description: Consider the pod quota limits on your namespace
- name: WEBDAV_CPU_LIMIT
displayName: WebDav CPU Limit
value: 300m
required: true
description: Consider the pod quota limits on your namespace
- name: NOTEBOOK_PASSWORD
displayName: Notebook Password
from: "[A-Za-z0-9]{32}"
generate: expression
required: true
description: Password for Notebook
- name: NOTEBOOK_IMAGE
description: The base image for notebook
value: quay.io/opendatahub-contrib/workbench-images:code-server-ubi9-py39_2023b_latest
required: true
- name: WEBDAV_NODE_IMAGE
description: The base image for WebDav
value: quay.io/codekow/webdav:latest
required: true
message: |-
The following application has been created in your project: ${APPLICATION_NAME}.

For more information about using this template, including OpenShift considerations,
see "https://github.com/redhat-na-ssa/demo-ai-gitops-catalog"
objects: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- path: patch-deployment.yaml
target:
kind: Deployment
Loading
Loading