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

Jupyterhub Idle Culler update #568

Merged
merged 4 commits into from
Jul 11, 2022
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
11 changes: 11 additions & 0 deletions jupyterhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ Notebook Images do not provide any parameters.

Notebook Images component comes with 3 overlays.

#### [jupyterhub-idle-culler](jupyterhub/overlays/jupyterhub-idle-culler)

Adds a `DeploymentConfig` of the jupyterhub idle culler. It enables shutting down notebooks that are idle for a certain amount of time.

Changes to the culling timeout value can either be made in the `jupyterhub-cfg` `ConfigMap` or in the cluster settings section of the ODH Dashboard.

**Note:** The culling timeout value in the dashboard and manual configuration fo the culler will **not** work if this overlay is deployed together with the operator, as any change to the jupyterhub-cfg `ConfigMap` will be reverted.


Jupyterhub-idle-culler repository: https://github.com/jupyterhub/jupyterhub-idle-culler

#### [additional](notebook-images/overlays/additional/)

Contains additional Jupyter notebook images.
Expand Down
1 change: 1 addition & 0 deletions jupyterhub/jupyterhub/base/jupyterhub-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data:
gpu_mode: ""
singleuser_pvc_size: 2Gi
notebook_destination: "$(notebook_destination)"
culler_timeout: "31536000" # 1 year in seconds
LaVLaS marked this conversation as resolved.
Show resolved Hide resolved

---
apiVersion: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ spec:
labels:
app: jupyterhub-idle-culler
spec:
initContainers:
- name: check-for-jh
image: 'quay.io/odh-jupyterhub/jupyterhub-img:v0.3.3'
Copy link

@dol dol Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image: 'quay.io/odh-jupyterhub/jupyterhub-img:v0.3.5'

Should be increased to 0.3.5 like in this PR: #496 => 1fb9f35

command:
- /bin/sh
- '-c'
- 'while ! curl jupyterhub:8081/hub/api; do sleep 5; done'
resources:
limits:
cpu: 150m
memory: 50Mi
requests:
cpu: 150m
memory: 20Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
containers:
- name: jupyterhub-idle-culler
image: quay.io/odh-jupyterhub/jupyterhub-img:v0.3.5
Expand All @@ -20,9 +37,21 @@ spec:
secretKeyRef:
name: jupyterhub-idle-culler
key: token
- name: CULLER_TIMEOUT
valueFrom:
configMapKeyRef:
name: jupyterhub-cfg
key: culler_timeout
resources:
limits:
cpu: 150m
memory: 50Mi
requests:
cpu: 150m
memory: 50Mi
command:
- jupyterhub-idle-culler
- --timeout=259200 # 3 days
- --timeout=$(CULLER_TIMEOUT) # in seconds
- --url=jupyterhub:8081/hub/api
triggers:
- type: ConfigChange
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ kind: Kustomization
commonLabels:
app.kubernetes.io/part-of: jupyterhub

bases:
- ../../base
resources:
- deploymentconfig.yaml
- ./deploymentconfig.yaml