jupyterhub / jupyterhub-idle-culler

JupyterHub service to cull idle servers and users
Other
102 stars 37 forks source link

Instead of killing sessions, it resets the counter, but the sessions remain alive #46

Closed alekseyolg closed 1 year ago

alekseyolg commented 2 years ago

I am using the following configuration:

import sys

c.JupyterHub.services = [
    {
        "name": "jupyterhub-idle-culler-service",
        "command": [
            sys.executable,
            "-m", "jupyterhub_idle_culler",
            "--max-age=0",
            "--timeout=60",
            "--cull-every=15",
            "--concurrency=5",
            "--api-page-size=200",
        ],
        "admin": True,
    }
]
c.JupyterHub.debug_proxy = True
c.ConfigurableHTTPProxy.api_url = 'http://localhost:9009'

c.Jupyterhub.spawner_class = 'jupyterhub.spawner.SimpleLocalProcessSpawner'
c.Spawner.cmd='/usr/local/bin/jupyterhub-singleuser'
c.JupyterHub.port = 9000
c.JupyterHub.hub_ip = '0.0.0.0'
c.JupyterHub.hub_port = 9080

#c.JupyterHub.ssl_key = '/root/ssl/nrfapp'
#c.JupyterHub.ssl_cert = '/root/ssl/nrfapp_new.crt'
c.Authenticator.delete_invalid_users = True
c.Authenticator.admin_users = {'jupyter_admin', 'user'}

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_hosts = ['my_data']
c.LDAPAuthenticator.server_port = 389
c.LDAPAuthenticator.bind_user_dn = 'CN=my_data,OU=my_data,OU=my_data,DC=my_data,DC=my_data,DC=net'
c.LDAPAuthenticator.bind_user_password = 'my_data'
c.LDAPAuthenticator.user_search_base = 'dc=my_data,dc=my_data,dc=net'
c.LDAPAuthenticator.user_search_filter = '(&(objectCategory=person)(objectClass=user)(sAMAccountName={username}))'
c.LDAPAuthenticator.user_membership_attribute='memberOf'
c.LDAPAuthenticator.group_search_base = 'dc=my_data,dc=my_data,dc=net'
c.LDAPAuthenticator.group_search_filter = '(&(objectClass=group)(memberOf={group}))'
c.LDAPAuthenticator.allowed_groups = ["my_data",]

c.LDAPAuthenticator.allow_nested_groups = True
c.LDAPAuthenticator.create_user_home_dir = True
c.LDAPAuthenticator.create_user_home_dir_cmd = ['adduser','--create-home']

But when the counter counts down the right time, it simply resets the counter, the user's server will remain alive

ps aux | grep jupyter

root      435284  1.9  0.0 352488 78596 pts/0    S+   16:18   0:00 /bin/python3.7 /bin/jupyterhub -f /opt/jupyterhub/etc/jupyterhub_config.py --upgrade-db --log-level=WARN
root      435301  0.4  0.0 633876 40360 ?        Ssl  16:18   0:00 /bin/python3.7 -m jupyterhub_idle_culler --max-age=0 --timeout=60 --cull-every=15 --concurrency=5 --api-page-size=200
u_m1cpd   435308  6.0  0.0 408188 99040 ?        Ssl  16:19   0:00 /bin/python3.7 /usr/local/bin/jupyterhub-singleuser
root      435327  0.0  0.0  12136  1080 pts/4    S+   16:19   0:00 grep --color=auto jupyter
jupyterhub --version
2.1.1
welcome[bot] commented 2 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: