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

Commit

Permalink
Jupyterhub Idle Culler update (#568)
Browse files Browse the repository at this point in the history
* Add timeout env var to culler and modify overlay

* Add limits/requests to culler

* Add culler timeout to jupyterhub-cfg

* Add readme section
  • Loading branch information
maroroman authored Jul 11, 2022
1 parent 0fb7041 commit a1c7bfd
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
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

---
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'
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

0 comments on commit a1c7bfd

Please sign in to comment.