I Need a working Dockerimage or Dockerfile with jupyterhub_config of tmpauthenticator

Getting below error when I try using this authenticator on docker

500 : Internal Server Error

Error in Authenticator.pre_spawn_start: FileNotFoundError [Errno 2] No such file or directory: 'systemctl'

You can try restarting your server from the home page.

Dockerfile

FROM jupyter/minimal-notebook:latest
RUN pip install notebook jupyterhub-tmpauthenticator jupyterhub-systemdspawner
COPY jupyterhub_config.py /home/jovyan/jupyterhub_config.py

jupyterhub_config.py

import tmpauthenticator
import systemdspawner
c=get_config()
c.JupyterHub.authenticator_class=tmpauthenticator.TmpAuthenticator
c.JupyterHub.spawner_class=systemdspawner.SystemdSpawner
c.SystemdSpawner.dynamic_users=True

Maybe you can report this issue to the GitHub repository where the image is maintained?

I already posted it on github issues and someone closed the issue and asked me to use community form. I need a working docker image of jupyterhub-tmpauthenticator. Hoping for help.

@1kastner The issue was posted in the https://github.com/jupyterhub/tmpauthenticator repo which doesn’t contain a Dockerfile, so I requested that the discussion be moved to this forum

1 Like

Can I have a working example please, I have been trying so long to implement it.

@manics I see the point now.

@sridhar562345 have you tried out The Littlest JupyterHub? It is easier to rely on a working setup than trying to create your own setup. You can get some insights into the architecture in the JupyterHub manual.

Regarding your concrete problem, please have a deep look at the difference between a docker spawner which is started for each user and on the other side a JupyterHub server instance (usually for one working login mask you need exactly one instance).

1 Like

Well yes, I tried the littlest jupyter but it didn’t work on AWS ECS. Yuvi panda already said it doesn’t have a docker image. So, looking for the options here.

So could you elaborate on the solution you try to craft and the requirements you plan to consider? Possibly including a figure of the desired system?

If you just need a copy&paste solution, have a look at https://collaborating.tuhh.de/cmk3624/minimal-jupyterhub-docker-config - the very very lean documentation is mostly in German but the web can translate it for you.

1 Like

My requirement is exactly same as the one which was stated by jupyterhub-tmpauthenticator. Simple authenticator for JupyterHub that gives anyone who visits the home page a user account without having to log in using any UI at all.I want to provide temporary notebook servers for all whoever visits my site without authentication.

Then I suggest you to copy my copy&paste solution and replace the authenticator. Maybe you can do some publicly on GitHub so that later people who have the same requirements can find your solution. Once you run into specific issues, you can return to me and hopefully I find some time. Otherwise the JupyterHub manual is always a great source to look up information!

1 Like

It works on local system if I replace the authenticator, but it’s complex to deploy on AWS ECS with docker network and all these things. Can we simplify this using one docker file or we have to use docker spawner to spawn another image notebooks to use tmpauthenticator?

Another problem, how can I introduce culling into this, I tried to implement by adding this in jupyterhub_config.py

c.JupyterHub.services = [
    {
        'name': 'idle-culler',
        'admin': True,
        'command': [
            sys.executable,
            '-m', 'jupyterhub_idle_culler',
            '--cull-every=120'
        ],
    }
]

But the generated exam-scipy-containers are not culled

If you could please take your time and check the DockerSpawner manual? You will see their architecture and how things are intended to work.

I am indeed doing that, thank you. Can I get a reference for that?