jupyterhub / batchspawner

Custom Spawner for Jupyterhub to start servers in batch scheduled systems
BSD 3-Clause "New" or "Revised" License
185 stars 131 forks source link

Cannot spawn jupyterhub-singleuser with TLJH #214

Open JonnyTran opened 3 years ago

JonnyTran commented 3 years ago

Bug description

When using the spawner wrapspawner.ProfilesSpawner and trying to lanch a local jupyter-singleuser with the Littlest JupyterHub, it shows the error:

$ journalctl -u jupyterhub Apr 14 15:51:02 gpu-server python3[16041]: [E 2021-04-14 15:51:02.481 JupyterHub pages:261] Failed to spawn single-user server with form Apr 14 15:51:02 gpu-server python3[16041]: Traceback (most recent call last): Apr 14 15:51:02 gpu-server python3[16041]: File "/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/handlers/pages.py", line 257, in post Apr 14 15:51:02 gpu-server python3[16041]: return await self._wrap_spawn_single_user( Apr 14 15:51:02 gpu-server python3[16041]: File "/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/handlers/pages.py", line 314, in _wrap_spawn_single_user Apr 14 15:51:02 gpu-server python3[16041]: raise web.HTTPError( Apr 14 15:51:02 gpu-server python3[16041]: tornado.web.HTTPError: HTTP 500: Internal Server Error (Error in Authenticator.pre_spawn_start: FileNotFoundError [Errno 2] No such file or directory: 'jupyterhub-singleuser')

Expected behaviour

/opt/tljh/hub/bin/jupyter-singleuser should found from path.

Actual behaviour

It is as if upon launching, /opt/tljh/hub/bin or /opt/tljh/user/bin is not loaded into path, so jupyterhub-singleuser or jupyterhub-labhub cannot start (although I have very limited experience with TLJH's Jupyterhub).

Your personal set up

paste output of pip freeze or conda list here

$ opt/tljh/hub/bin/pip freeze aiohttp==3.7.4.post0 alembic==1.5.8 anyio==2.2.0 argon2-cffi==20.1.0 async-generator==1.10 async-timeout==3.0.1 attrs==20.3.0 Babel==2.9.0 backcall==0.2.0 backoff==1.10.0 batchspawner==1.1.0 bcrypt==3.2.0 bleach==3.3.0 certifi==2020.12.5 certipy==0.1.3 cffi==1.14.5 chardet==4.0.0 cryptography==3.4.7 decorator==5.0.6 defusedxml==0.7.1 deprecation==2.1.0 docker==5.0.0 dockerspawner==12.0.0 entrypoints==0.3 escapism==1.0.1 etcd3==0.12.0 greenlet==1.0.0 grpcio==1.36.1 idna==2.10 ipykernel==5.5.3 ipython==7.22.0 ipython-genutils==0.2.0 jedi==0.18.0 Jinja2==2.11.3 json5==0.9.5 jsonschema==3.2.0 jupyter-client==6.1.12 jupyter-core==4.7.1 jupyter-packaging==0.9.1 jupyter-server==1.6.1 jupyter-telemetry==0.1.0 jupyterhub==1.3.0 jupyterhub-dummyauthenticator==0.3.1 jupyterhub-firstuseauthenticator==0.14.1 jupyterhub-idle-culler==1.0 jupyterhub-ldapauthenticator==1.3.0 jupyterhub-nativeauthenticator==0.0.5 jupyterhub-systemdspawner==0.15.0 jupyterhub-tmpauthenticator==0.6 jupyterhub-traefik-proxy==0.2.0 jupyterlab==3.0.14 jupyterlab-pygments==0.1.2 jupyterlab-server==2.4.0 ldap3==2.9 Mako==1.1.4 MarkupSafe==1.1.1 mistune==0.8.4 multidict==5.1.0 nbclassic==0.2.7 nbclient==0.5.3 nbconvert==6.0.7 nbformat==5.1.3 nest-asyncio==1.5.1 notebook==6.3.0 oauthenticator==0.10.0 oauthlib==3.1.0 onetimepass==1.0.1 packaging==20.9 pamela==1.0.0 pandocfilters==1.4.3 parso==0.8.2 passlib==1.7.4 pexpect==4.8.0 pickleshare==0.7.5 pluggy==1.0.0.dev0 prometheus-client==0.10.1 prompt-toolkit==3.0.18 protobuf==3.15.7 ptyprocess==0.7.0 pyasn1==0.4.8 pycparser==2.20 pycurl==7.43.0.6 Pygments==2.8.1 pyOpenSSL==20.0.1 pyparsing==2.4.7 pyrsistent==0.17.3 python-consul2==0.1.5 python-dateutil==2.8.1 python-editor==1.0.4 python-json-logger==2.0.1 pytz==2021.1 pyzmq==22.0.3 requests==2.25.1 ruamel.yaml==0.15.100 ruamel.yaml.clib==0.2.2 Send2Trash==1.5.0 six==1.15.0 sniffio==1.2.0 SQLAlchemy==1.4.7 sshspawner==0.1.0 tenacity==7.0.0 terminado==0.9.4 testpath==0.4.4 the-littlest-jupyterhub==0.1 toml==0.10.2 tomlkit==0.7.0 tornado==6.1 traitlets==5.0.5 typing-extensions==3.7.4.3 urllib3==1.26.4 wcwidth==0.2.5 webencodings==0.5.1 websocket-client==0.58.0 wrapspawner==1.0.0 yarl==1.6.3

# jupyterhub_config.py
import batchspawner, wrapspawner

c.JupyterHub.bind_url = 'http://192.168.1.100:80'

c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'

c.Spawner.http_timeout = 120
#------------------------------------------------------------------------------
# ProfilesSpawner configuration
#------------------------------------------------------------------------------
# List of profiles to offer for selection. Signature is:
#   List(Tuple( Unicode, Unicode, Type(Spawner), Dict ))
# corresponding to profile display name, unique key, Spawner class,
# dictionary of spawner config options.
# 
# The first three values will be exposed in the input_template as {display},
# {key}, and {type}
#
c.ProfilesSpawner.profiles = [
    ( "Host process", 'local', 'jupyterhub.spawner.LocalProcessSpawner', 
        {'ip':'0.0.0.0'} ),
    ( "biomecis-exxact-2a", 'singleuser', 'jupyterhub.spawner.LocalProcessSpawner', 
        {'ip':'192.168.1.101'} ),
    ( "biomecis-exxact-2b", 'singleuser', 'jupyterhub.spawner.LocalProcessSpawner', 
        {'ip':'192.168.1.102'} ),
    ( "biomecis-exxact-2c", 'singleuser', 'jupyterhub.spawner.LocalProcessSpawner', 
        {'ip':'192.168.1.103'} ),
    ( "biomecis-exxact-2d", 'singleuser', 'jupyterhub.spawner.LocalProcessSpawner', 
        {'ip':'192.168.1.104'} ),]

c.JupyterHub.tornado_settings = {
    'headers': {
        'Access-Control-Allow-Origin': "*",
    },
}

welcome[bot] commented 3 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: