Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #68 from NERSC/19-08
Browse files Browse the repository at this point in the history
19 08
  • Loading branch information
rcthomas authored Sep 12, 2019
2 parents a51450d + 9bff9ff commit ffb1549
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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 <rcthomas@lbl.gov>"

# Python 3 Anaconda and additional packages
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
7 changes: 3 additions & 4 deletions jupyter-nersc/web-jupyterhub/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
20 changes: 12 additions & 8 deletions jupyter-nersc/web-jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
),
Expand All @@ -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": (
Expand All @@ -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": (
Expand All @@ -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")
Expand Down

0 comments on commit ffb1549

Please sign in to comment.