jupyterhub / batchspawner

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

Voila doesn't render notebooks with JupyterHub and BatchSpawner #209

Open sntgluca opened 3 years ago

sntgluca commented 3 years ago

Bug description

Dear all, I am experiencing issues while running Voila from a Jupyter session started via batchspawner. I suspect a configuration / setup problem but alone I can't figure out what I can try to troubleshoot.

In my setup, Voila runs perfectly fine

Unfortunately with BatchSpawner, the Voila landing page starts, notebooks are open but the voila render doesn't start at all.

I can't find Jupyter or Javascript console logs to troubleshoot.

Does anyone have a suggestion for troubleshooting / configuration change?

Many thanks, Gianluca

Your personal set up

My configuration is the following:

This is a minimalistic jupyterhub_config.py file to reproduce this behaviour:

from traitlets import Unicode
from jupyterhub.spawner import SimpleLocalProcessSpawner
import batchspawner

IP = os.getenv("HOSTNAME")
c.JupyterHub.ip = IP
c.JupyterHub.hub_ip = IP
c.JupyterHub.port = 26000
c.JupyterHub.hub_port = 26001
c.ConfigurableHTTPProxy.api_url = f"http://{IP}:26002"
c.Spawner.environment = {
    "JUPYTERHUB_SINGLEUSER_APP": "jupyter_server.serverapp.ServerApp",
}
c.JupyterHub.authenticator_class = "jupyterhub.auth.PAMAuthenticator"

class MyBatchSpawner(batchspawner.GridengineSpawner):
    req_sgeroot = Unicode(os.getenv("SGE_ROOT", "")).tag(config=True)
    req_hostname = Unicode(IP).tag(config=True)
    batch_script = Unicode(
        """#!/bin/sh
#$ -terse
#$ -N TEST
#$ -S /bin/sh
#$ -j y
#$ -notify
#$ -wd {homedir}
#$ -v {keepvars}

export NO_PROXY={hostname},$NO_PROXY
export no_proxy={hostname},$no_proxy

{cmd}
"""
    ).tag(config=True)
    batch_submit_cmd = Unicode("SGE_ROOT={sgeroot} {sgeroot}/bin/lx-amd64/qsub").tag(
        config=True
    )
    batch_query_cmd = Unicode(
        "SGE_ROOT={sgeroot} {sgeroot}/bin/lx-amd64/qstat -xml"
    ).tag(config=True)
    batch_cancel_cmd = Unicode(
        "SGE_ROOT={sgeroot} {sgeroot}/bin/lx-amd64/qdel {job_id}"
    ).tag(config=True)

    def parse_job_id(self, output):
        return output.split(".")[0]

c.JupyterHub.spawner_class = MyBatchSpawner
c.Spawner.ip = "0.0.0.0"
c.Spawner.debug = True
c.JupyterHub.log_level = "DEBUG"
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: