Hi Everyone,
I want to add a direct access image for our containerized jupyterhub to have the same experience as direct access on a host installed jupyterhub, only difference that our direct access is a container. I can run it outside of jupyterhub with this command: sudo docker run --rm -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v $HOME:/home/student -it ubuntu_conda:test bash
Mounting the volume seems to work but not passing along the uid and gid, I have also tried to declare them statically during troubleshooting but no luck so far. Here is my(somewhat messy) jupyterhub_config.py:
c.ConfigurableHTTPProxy.should_start = False
c.ConfigurableHTTPProxy.api_url = âhttp://proxy:8001â
# tell the hub to use Dummy Auth (for testing)
c.JupyterHub.authenticator_class = âdummyâ
# use SwarmSpawner
c.JupyterHub.spawner_class = âdockerspawner.SwarmSpawnerâ
# The Hub should listen on all interfaces,
# so user servers can connect
c.JupyterHub.hub_ip = â0.0.0.0â
# this is the name of the âserviceâ in docker-compose.yml
c.JupyterHub.hub_connect_ip = âhubâ
# this is the network name for jupyterhub in docker-compose.yml
# with a leading âswarm_â that docker-compose adds
c.SwarmSpawner.network_name = âswarm_jupyterhub-netâ
# increase launch timeout because initial image pulls can take a while
c.SwarmSpawner.spawn_timeout = 100
c.SwarmSpawner.http_timeout = 100
# start jupyterlab
c.Spawner.cmd = [âjupyterâ, âlabhubâ]
# debug-logging for testing
import logging
c.JupyterHub.log_level = logging.DEBUG
### NON DEFAULT ###
#c.Spawner.image = âeuclid_nvidiatorch:latestâ
username = âlageberâ
uid = 1117
gid = 1117
c.SwarmSpawner.extra_container_spec = {
âuserâ: â1117â
}
c.SwarmSpawner.environment = {
âJUPYTER_ENABLE_LABâ: âyesâ,
âNB_USERâ: fâ{username}',
âUSER_IDâ: int(uid),
âGROUP_IDâ: int(gid),
}
#c.SwarmSpawner.extra_container_spec = {
# âenvâ: [âUSER_ID=$(id -u)â, âGROUP_ID=$(id -g)â]
#}
c.SwarmSpawner.volumes = { â/home/{username}â: â/home/studentâ}
c.SwarmSpawner.image = âubuntu_conda:latestâ