0

I have installed Jupyterhub on Ubuntu 16.04 with conda install. Next, I made it use oAuthenticator by adding the following in jupyterhub_config.py

from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.GitHubOAuthenticator.create_system_users = True

I also added the following in ~/.bashrc and sourced it

#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

After starting jupyterhub, I was able to get the "login with git" page. Now, I have configured jupyterhub to run as a service by creating /etc/systemd/system/jupyterhub.service and adding the following to it

[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

Now, I started it using systemctl start jupyterhub, but now I get the regular login page as opposed to the git login.

It's probably because it isn't reading the jupyterhub_config.py. I checked all the directories mentioned in jupyterhub.service and they all check out.

Anaconda installation directory : /etc/Applications/Anaconda3/

Jupyterhub config file directory : /etc/Applications/JupyterHub/jupyterhub_config.py

Can anyone help me with this?

Amber
  • 914
  • 6
  • 20
  • 51

1 Answers1

0

Start a Jupyterhub with below command:

jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py

In Your case, i guess it must be

systemctl start jupyterhub -f /etc/Applications/JupyterHub/jupyterhub_config.py

For Doc Reference

https://jupyterhub.readthedocs.io/en/stable/getting-started/config-basics.html#start-with-a-specific-config-file

saurssaurav
  • 715
  • 5
  • 16