Я установил Jupyterhub на Ubuntu 16.04 с установкой conda. Затем я заставил его использовать oAuthenticator, добавив следующее в jupyterhub_config.py.
from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.GitHubOAuthenticator.create_system_users = True
Я также добавил следующее в ~/.bashrc и получил его
#For OAuthentication
export GITHUB_CLIENT_ID=id
export GITHUB_CLIENT_SECRET=secret
export OAUTH_CALLBACK_URL=http://xyz:8000/hub/oauth_callback
export GIT_REPO_NAME=mmf
export GIT_BRANCH_NAME=master
export GITHUB_ACCESS_TOKEN= mytoken
После запуска jupyterhub я смог получить страницу «Войти с помощью git». Теперь я настроил jupyterhub для работы в качестве службы, создав /etc/systemd/system/jupyterhub.service
и добавив к нему следующее:
[Unit]
Description=Starts JupyterHub as Daemon
After=syslog.target network.target
[Service]
User=root
Environment=”PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/etc/Applications/Anaconda3/bin”
ExecStart=/etc/Applications/Anaconda3/bin/jupyterhub –f /etc/Applications/JupyterHub/jupyterhub_config.py
[Install]
WantedBy=multi-user.target
Теперь я запустил его с помощью systemctl start jupyterhub
, но теперь я получаю обычную страницу входа в систему, а не git.
Вероятно, это потому, что он не читает файл jupyterhub_config.py
. Я проверил все каталоги, упомянутые в jupyterhub.service
, и все они проверены.
Каталог установки Anaconda: /etc/Applications/Anaconda3/
Каталог файла конфигурации Jupyterhub: /etc/Applications/JupyterHub/jupyterhub_config.py
Кто-нибудь может мне с этим помочь?