From 4042288e91a2b54bb4e798e7a21578ed79952da7 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Tue, 26 Jun 2018 18:36:42 -0700 Subject: [PATCH] Move jupyterhub_config.py inside the package This is where it's referred to from the systemd package --- jupyterhub_config.py => tljh/jupyterhub_config.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) rename jupyterhub_config.py => tljh/jupyterhub_config.py (66%) diff --git a/jupyterhub_config.py b/tljh/jupyterhub_config.py similarity index 66% rename from jupyterhub_config.py rename to tljh/jupyterhub_config.py index 7e75a96..a9ca75b 100644 --- a/jupyterhub_config.py +++ b/tljh/jupyterhub_config.py @@ -14,15 +14,13 @@ starts. from tljh import conda import os +INSTALL_PREFIX = os.environ.get('TLJH_INSTALL_PREFIX', '/opt/tljh') +USER_ENV_PREFIX = os.path.join(INSTALL_PREFIX, 'user') + c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner' c.JupyterHub.authenticator_class = 'dummyauthenticator.DummyAuthenticator' -here = os.getcwd() - -user_environment_prefix = os.path.join(here, 'user-environment') - -conda.ensure_conda_env(user_environment_prefix) -conda.ensure_conda_packages(user_environment_prefix, ['notebook', 'jupyterhub']) - -c.SystemdSpawner.extra_paths = [os.path.join(user_environment_prefix, 'bin')] +c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, 'bin')] c.SystemdSpawner.use_sudo = True + +c.SystemdSpawner.dynamic_users = True