diff --git a/jupyter-localhost/web/Dockerfile b/jupyter-localhost/web-jupyterhub/Dockerfile similarity index 94% rename from jupyter-localhost/web/Dockerfile rename to jupyter-localhost/web-jupyterhub/Dockerfile index 064b580..70d822e 100644 --- a/jupyter-localhost/web/Dockerfile +++ b/jupyter-localhost/web-jupyterhub/Dockerfile @@ -1,6 +1,6 @@ ARG branch=unknown -FROM registry.spin.nersc.gov/das/jupyter-base.${branch}:latest +FROM registry.spin.nersc.gov/das/jupyter-base-${branch}:latest LABEL maintainer="Rollin Thomas " # Python 3 Anaconda and additional packages diff --git a/jupyter-localhost/web/README b/jupyter-localhost/web-jupyterhub/README similarity index 100% rename from jupyter-localhost/web/README rename to jupyter-localhost/web-jupyterhub/README diff --git a/jupyter-localhost/web/build.sh b/jupyter-localhost/web-jupyterhub/build.sh similarity index 66% rename from jupyter-localhost/web/build.sh rename to jupyter-localhost/web-jupyterhub/build.sh index d4179c7..65405d0 100644 --- a/jupyter-localhost/web/build.sh +++ b/jupyter-localhost/web-jupyterhub/build.sh @@ -5,4 +5,4 @@ branch=$(git symbolic-ref --short HEAD) docker build \ --build-arg branch=$branch \ "$@" \ - --tag registry.spin.nersc.gov/das/jupyter-localhost-web.$branch:latest . + --tag web-jupyterhub-$branch:latest . diff --git a/jupyter-localhost/web/docker-entrypoint.sh b/jupyter-localhost/web-jupyterhub/docker-entrypoint.sh similarity index 100% rename from jupyter-localhost/web/docker-entrypoint.sh rename to jupyter-localhost/web-jupyterhub/docker-entrypoint.sh diff --git a/jupyter-localhost/web/jupyterhub_config.py b/jupyter-localhost/web-jupyterhub/jupyterhub_config.py similarity index 100% rename from jupyter-localhost/web/jupyterhub_config.py rename to jupyter-localhost/web-jupyterhub/jupyterhub_config.py diff --git a/jupyter-nersc/web-jupyterhub/iris.py b/jupyter-nersc/web-jupyterhub/iris.py index c42c8e0..21ab9e0 100644 --- a/jupyter-nersc/web-jupyterhub/iris.py +++ b/jupyter-nersc/web-jupyterhub/iris.py @@ -41,7 +41,6 @@ async def query(self, query): return escape.json_decode(response.body) def format_request(self, query): - return httpclient.HTTPRequest(self.iris_url, - method="POST", - headers={"Content-Type": "application/json"}, - body=escape.json_encode({"query": query})) + return httpclient.HTTPRequest(self.iris_url, method="POST", + headers={"Content-Type": "application/json"}, + body=escape.json_encode({"query": query})) diff --git a/jupyter-nersc/web-jupyterhub/jupyterhub_config.py b/jupyter-nersc/web-jupyterhub/jupyterhub_config.py index 336926d..c7c2d46 100644 --- a/jupyter-nersc/web-jupyterhub/jupyterhub_config.py +++ b/jupyter-nersc/web-jupyterhub/jupyterhub_config.py @@ -1071,11 +1071,11 @@ def comma_split(string): "sshspawner.sshspawner.SSHSpawner", { "cmd": ["/global/common/cori/das/jupyterhub/jupyter-launcher.sh", "/usr/common/software/python/3.7-anaconda-2019.07/bin/jupyter-labhub"], - "environment": {"OMP_NUM_THREADS" : "2"}, + "environment": {"OMP_NUM_THREADS" : "2", "PYTHONFAULTHANDLER": "1"}, "remote_hosts": ["corijupyter.nersc.gov"], "remote_port_command": "/usr/bin/python /global/common/cori/das/jupyterhub/new-get-port.py --ip", "hub_api_url": "http://{}:8081/hub/api".format(ip), - "path": "/global/common/cori/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", + "path": "/usr/common/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", "ssh_keyfile": '/certs/{username}.key' } ), @@ -1090,7 +1090,7 @@ def comma_split(string): "req_homedir": "/tmp", "req_runtime": "240", "hub_api_url": "http://{}:8081/hub/api".format(ip), - "path": "/global/common/cori/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", + "path": "/usr/common/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", } ), "cori-exclusive-node-gpu": ( @@ -1103,7 +1103,7 @@ def comma_split(string): "req_homedir": "/tmp", "req_runtime": "240", "hub_api_url": "http://{}:8081/hub/api".format(ip), - "path": "/global/common/cori/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", + "path": "/usr/common/software/python/3.7-anaconda-2019.07/bin:/global/common/cori/das/jupyterhub:/usr/common/usg/bin:/usr/bin:/bin", } ), "spin-shared-node-cpu": ( @@ -1129,10 +1129,14 @@ async def setup(spawner): certfile = keyfile + "-cert.pub" k = asyncssh.read_private_key(keyfile) c = asyncssh.read_certificate(certfile) - async with asyncssh.connect(remote_host, username=username, - client_keys=[(k,c)], known_hosts=None) as conn: - result = await conn.run("myquota -c $HOME") - retcode = result.exit_status + try: + async with asyncssh.connect(remote_host, username=username, + client_keys=[(k,c)], known_hosts=None) as conn: + result = await conn.run("myquota -c $HOME") + retcode = result.exit_status + except asyncssh.misc.ConnectionLost: + spawner.log.warning(f"Problem connecting to {remote_host} to check quota oh well") + retcode = 0 if retcode: from jinja2 import Markup e = web.HTTPError(507, reason="Insufficient Storage")