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

Personalize callysto singleuser server page #1710

Merged
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
22 changes: 22 additions & 0 deletions config/clusters/callysto/common.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,28 @@ jupyterhub:
image:
name: callysto/2i2c
tag: 0.1.0
extraFiles:
tree.html:
Copy link
Member Author

Choose a reason for hiding this comment

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

Normally, extending only the page.html template would have been enough since both the tree and the notebook templates are extending it themselves. But for some reason, it turned impossible to make it to work like this... I fear this is because of NotebookApp -> ServerApp? But I have tried everything with no luck, so this is the best version that's actually doing the job

mountPath: /usr/local/share/jupyter/custom_template/tree.html
stringData: |
{% extends "templates/tree.html" %}
{% block header %}
<style>
.clusters_tab_link {
visibility: hidden;
}
</style>
Comment on lines +41 to +45
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, actually this one is only possible in "tree.html", so we would have needed two templates anyway

{% endblock %}
{% block logo %}
<img src="https://www.callysto.ca/wp-content/uploads/2022/08/Callysto-HUB_horizontal.png" alt="CallystoHub"/>
{% endblock %}
notebook.html:
mountPath: /usr/local/share/jupyter/custom_template/notebook.html
stringData: |
{% extends "templates/notebook.html" %}
{% block logo %}
<img src="https://www.callysto.ca/wp-content/uploads/2022/08/Callysto-HUB_horizontal.png" alt="CallystoHub"/>
{% endblock %}
hub:
config:
JupyterHub:
Expand Down
7 changes: 7 additions & 0 deletions helm-charts/basehub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ jupyterhub:
extraEnv:
# until https://github.com/jupyterhub/jupyterhub/pull/3918 or equivalent lands,
# and we upgrade to jupyterhub >= 2.3.1 on all images.
# Note: please checkout all occurences of `NotebookApp` configurations
# when moving away from it.
JUPYTERHUB_SINGLEUSER_APP: "notebook.notebookapp.NotebookApp"
# notebook writes secure files that don't need to survive a
# restart here. Writing 'secure' files on some file systems (like
Expand Down Expand Up @@ -206,6 +208,11 @@ jupyterhub:
# this is what allows us to shutdown servers
# when people leave a notebook open and wander off
cull_connected: true
# If we switch from setting `JUPYTERHUB_SINGLEUSER_APP` to be the NotebookApp
# this config kere might need to go under ServerApp instead
NotebookApp:
extra_template_paths:
- /usr/local/share/jupyter/custom_template
Comment on lines +213 to +215
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm setting this one in the basehub template because it does no harm if we set it here and we provide no custom templates.

The benefit of this being here is that we can inject extraFiles for other hubs too to extend the templates if need be in the future.

Or at least until will decide on a better strategy as part of #1697 that might imply sync-ing the templates from a repo on the fly like we do with the hub templates.

startTimeout: 600 # 10 mins, because sometimes we have too many new nodes coming up together
defaultUrl: /tree
nodeSelector:
Expand Down