From 007eb3fa12c66b1f3237f97352477ea3f8ce4ed7 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 25 May 2023 11:04:27 +0200 Subject: [PATCH 1/4] Comment that jupyterhub.service is an example systemd unit file --- jupyterhub.service | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jupyterhub.service b/jupyterhub.service index d1125b7..6916067 100644 --- a/jupyterhub.service +++ b/jupyterhub.service @@ -1,3 +1,10 @@ +# This is a systemd unit file describing a how to start a jupyterhub, provided +# as an example. +# +# systemd ref: https://www.freedesktop.org/wiki/Software/systemd/ +# unit file ref: https://www.freedesktop.org/software/systemd/man/systemd.unit.html +# syntax ref: https://www.freedesktop.org/software/systemd/man/systemd.syntax.html +# [Service] ExecStart=/usr/local/bin/jupyterhub --no-ssl --config /etc/local/jupyterhub/jupyterhub_config.py ReadOnlyDirectories=/ From 0faef8b2fa2c2cbf122bfdc8d9f62b6c59ec5695 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 25 May 2023 11:05:08 +0200 Subject: [PATCH 2/4] Comment that check-kernel.bash cheks prereq. for cpu_limit and mem_limit --- check-kernel.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check-kernel.bash b/check-kernel.bash index 5f92de9..b055e0d 100755 --- a/check-kernel.bash +++ b/check-kernel.bash @@ -1,7 +1,11 @@ #!/bin/bash - +# +# SystemdSpawner's config cpu_limit and mem_limit needs certain linux kernel +# options enabled, otherwise they will fail silently. Running this script checks +# if they are. +# # Partially stolen from https://github.com/docker/docker/blob/master/contrib/check-config.sh - +# possibleConfigs=( '/proc/config.gz' "/boot/config-$(uname -r)" From 49bf4e8254155679c2d068cdeeeb1be74de6090f Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 25 May 2023 11:45:17 +0200 Subject: [PATCH 3/4] Create examples folder and put jupyterhub.service there --- examples/README.md | 2 ++ jupyterhub.service => examples/jupyterhub.service | 0 2 files changed, 2 insertions(+) create mode 100644 examples/README.md rename jupyterhub.service => examples/jupyterhub.service (100%) diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..7823bb4 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,2 @@ +This file should describe how to use the jupyterhub.service file together with a +basic jupyterhub_config.py yet to be provided. diff --git a/jupyterhub.service b/examples/jupyterhub.service similarity index 100% rename from jupyterhub.service rename to examples/jupyterhub.service From 4d40c9d006d531f97875069939c70c6b9367fdfa Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 25 May 2023 12:07:55 +0200 Subject: [PATCH 4/4] Let example config of JupyterHub.spawner_class be set to systemd string --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41f9157..b32cbcd 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ You can enable it for your jupyterhub with the following lines in your `jupyterhub_config.py` file ```python -c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner' +c.JupyterHub.spawner_class = "systemd" ``` Note that to confirm systemdspawner has been installed in the correct jupyterhub