GeoscienceAustralia / dea-sandbox

Digital Earth Australia Sandbox config and planning
Apache License 2.0
13 stars 6 forks source link

latest build image ccannot run jupyter-single user command #236

Closed pindge closed 1 year ago

pindge commented 1 year ago

command freezes with latest build

Jovyan@2289c5887814:~$ jupyterhub-singleuser --ip=0.0.0.0 --port=8888 --SingleUserNotebookApp.default_url=/lab --debug

whereas previous build (1.0.9) returns

jovyan@e0ad92b5168e:~$ jupyterhub-singleuser --ip=0.0.0.0 --port=8888 --SingleUserNotebookApp.default_url=/lab --debug
[D 2022-12-22 22:02:46.564 SingleUserNotebookApp application:183] Searching ['/home/jovyan', '/home/jovyan/.jupyter', '/env/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-12-22 22:02:46.564 SingleUserNotebookApp application:731] Looking for jupyter_config in /etc/jupyter
[D 2022-12-22 22:02:46.564 SingleUserNotebookApp application:731] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-12-22 22:02:46.564 SingleUserNotebookApp application:731] Looking for jupyter_config in /env/etc/jupyter
[D 2022-12-22 22:02:46.565 SingleUserNotebookApp application:731] Looking for jupyter_config in /home/jovyan/.jupyter
[D 2022-12-22 22:02:46.565 SingleUserNotebookApp application:731] Looking for jupyter_config in /home/jovyan
[D 2022-12-22 22:02:46.565 SingleUserNotebookApp application:731] Looking for jupyter_notebook_config in /etc/jupyter
[D 2022-12-22 22:02:46.565 SingleUserNotebookApp application:731] Looking for jupyter_notebook_config in /usr/local/etc/jupyter
[D 2022-12-22 22:02:46.566 SingleUserNotebookApp application:731] Looking for jupyter_notebook_config in /env/etc/jupyter
[D 2022-12-22 22:02:46.566 SingleUserNotebookApp application:731] Looking for jupyter_notebook_config in /home/jovyan/.jupyter
[D 2022-12-22 22:02:46.566 SingleUserNotebookApp application:731] Looking for jupyter_notebook_config in /home/jovyan
[D 2022-12-22 22:02:46.574 SingleUserNotebookApp config_manager:95] Paths used for configuration of jupyter_notebook_config: 
        /etc/jupyter/jupyter_notebook_config.json
[D 2022-12-22 22:02:46.574 SingleUserNotebookApp config_manager:95] Paths used for configuration of jupyter_notebook_config: 
        /usr/local/etc/jupyter/jupyter_notebook_config.json
[D 2022-12-22 22:02:46.574 SingleUserNotebookApp config_manager:95] Paths used for configuration of jupyter_notebook_config: 
        /env/etc/jupyter/jupyter_notebook_config.d/dask_labextension.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupyter-server-proxy-notebookserverextension.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupyter_resource_usage.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupyterlab_code_formatter.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupyterlab_git.json
        /env/etc/jupyter/jupyter_notebook_config.d/jupytext.json
        /env/etc/jupyter/jupyter_notebook_config.d/nbdime.json
        /env/etc/jupyter/jupyter_notebook_config.d/nbgitpuller.json
        /env/etc/jupyter/jupyter_notebook_config.d/panel-client-jupyter.json
        /env/etc/jupyter/jupyter_notebook_config.json
[D 2022-12-22 22:02:46.575 SingleUserNotebookApp config_manager:95] Paths used for configuration of jupyter_notebook_config: 
        /home/jovyan/.jupyter/jupyter_notebook_config.json
[D 2022-12-22 22:02:46.575 SingleUserNotebookApp application:835] Exiting application: jupyter-notebook
JUPYTERHUB_API_TOKEN env is required to run jupyterhub-singleuser. Did you launch it manually?
Failure<1>: restarting
pindge commented 1 year ago
/env/bin/jupyterhub-singleuser: fork: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: line 17: /jupyterhub-singleuser: No such file or directory
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
Failure<1>: restarting
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
/env/bin/jupyterhub-singleuser: fork: retry: Resource temporarily unavailable
pindge commented 1 year ago

v1.0.9

jovyan@2e5252a9588e:~$ cat /env/bin/jupyterhub-singleuser 
#!/env/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyterhub.singleuser import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

current build

jovyan@cc21dbc9dfb4:~$ cat /env/bin/jupyterhub-singleuser
#!/bin/bash

# Wrapper around jupyter-lab to enable restarting jupyter-lab without
# stopping docker image.
#
# This is needed to debug installation of server extensions without re-building
# entire docker images.

set -o pipefail

APP_LOG="/tmp/labhub.log"
REAL_APP="$(dirname $(which python))/jupyterhub-singleuser"

restart_count=0
while true
do
    if "${REAL_APP}" $@ 2>&1 | tee -a "${APP_LOG}" ; then
        echo "Exited normally"
        exit 0
    else
        restart_count=$((restart_count+1))
        if [ $restart_count -gt 100 ]; then
            # avoid infinite restart loops
            exit 1
         else
             echo "Failure<$?>: restarting" | tee -a "${APP_LOG}"
        fi
    fi
done
benjimin commented 1 year ago

Current latest [b5c50ed] appears to work (when used in conjunction with hub 2.0.0).