You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I open a server and exhibit activity on the server (e.g. open a notebook -> create and run cells and periodically save the notebook), it appears that my server gets removed, despite this activity.
Expected behaviour
I would anticipate that my server remains up-and-running.
Actual behaviour
The server gets removed.
How to reproduce
Start up a server
Edit a notebook, actively saving and running/adding cells
See after around --timeout + --cull-every seconds, the server gets culled.
Your personal set up
I am running JupyterHub in Docker with a SwarmSpawner subclass (VariableSwamSpawner) as a spawner class, with support for ContainDSDashboard.
OS:
Below is the Dockerfile I use for my jupyterhub server:
FROM jupyterhub/jupyterhub
COPY ./certs/ca-bundle.crt /usr/local/share/ca-certificates/
RUN pip install cdsdashboards oauthenticator dockerspawner ldap3 pyyaml jupyterhub-idle-culler && update-ca-certificates
COPY ./jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py
COPY ./templates /srv/jupyterhub/templates
# This command may be necesssary if jupyterhub complains about outdated database schemas# CMD jupyterhub upgrade-db && jupyterhub
# jupyterhub_config.pyimportosimportsysimportyamlfromcdsdashboards.appimportCDS_TEMPLATE_PATHSfromcdsdashboards.hubextensionimportcds_extra_handlersfromldap3importConnection, Serverc.Application.log_level='DEBUG'# Configure the user serversc.JupyterHub.spawner_class='cdsdashboards.hubextension.spawners.variabledocker.VariableSwarmSpawner'c.DockerSpawner.image=os.environ['DOCKER_JUPYTER_IMAGE']
c.Spawner.http_timeout=c.Spawner.start_timeout=int(os.environ['STARTUP_TIMEOUT'])
# Set up default user permissions (the ability to start up others' dashboardsc.JupyterHub.load_roles= [
{
'name': 'user',
'description': 'Standard user privileges',
'scopes': [
'self',
'servers',
'tokens',
'list:services',
'read:services',
'access:services',
'access:servers',
],
},
]
# Configure shutting-down/cullingc.JupyterHub.load_roles+= [
{
"name": "jupyterhub-idle-culler-role",
"scopes": [
"list:users",
"read:users:activity",
"read:servers",
"delete:servers",
],
# assignment of role's permissions to:"services": ["jupyterhub-idle-culler-service"],
}
]
c.JupyterHub.services= [ # I use extreme values here just to ensure it works
{
"name": "jupyterhub-idle-culler-service",
"command": [
sys.executable,
"-m", "jupyterhub_idle_culler",
"--api-page-size=200",
"--cull-every=10",
"--remove-named-servers=True",
"--timeout=30",
],
}
]
# Configure the networkc.DockerSpawner.network_name=os.environ['DOCKER_NETWORK_NAME']
c.JupyterHub.hub_connect_ip=os.environ['HUB_IP']
# TODO See if this is actually neededc.DockerSpawner.use_internal_ip=True# Configure ContainDSc.JupyterHub.allow_named_servers=Truec.JupyterHub.template_paths=CDS_TEMPLATE_PATHSc.JupyterHub.extra_handlers=cds_extra_handlersc.CDSDashboardsConfig.include_servers=True# ContainDS Auto-cullingc.VariableMixin.proxy_force_alive=Falsec.VariableMixin.proxy_last_activity_interval=15c.VariableMixin.proxy_request_timeout=10c.CDSDashboardsConfig.builder_class='cdsdashboards.builder.dockerbuilder.DockerBuilder'
Logs
[D 2022-01-27 23:53:00.102 JupyterHub swarmspawner:155] Getting task of service $SERVICE [12/1843]
[D 2022-01-27 23:53:00.102 JupyterHub dockerspawner:982] Getting service $SERVICE
[D 2022-01-27 23:53:00.112 JupyterHub swarmspawner:144] Service upyx7ki status: {'ContainerStatus': {'ContainerID': 'c1b6b64ed3ef5d50ad786a685a8451562a30fcdc7b7f98d70b5a6ad131679c53',
'ExitCode': 0,
'PID': 9852},
'Message': 'started',
'PortStatus': {},
'State': 'running',
'Timestamp': '2022-01-27T23:52:29.645500796Z'}
[D 2022-01-27 23:53:08.554 JupyterHub scopes:298] Authenticated with token <APIToken('2221...', service='jupyterhub-idle-culler-service', client_id='jupyterhub')>
[I 2022-01-27 23:53:08.555 JupyterHub log:189] 200 GET /hub/api/ ([email protected]) 4.47ms
[D 2022-01-27 23:53:08.561 JupyterHub scopes:298] Authenticated with token <APIToken('2221...', service='jupyterhub-idle-culler-service', client_id='jupyterhub')>
[D 2022-01-27 23:53:08.561 JupyterHub scopes:488] Checking access via scope list:users
[D 2022-01-27 23:53:08.561 JupyterHub scopes:386] Unrestricted access to /hub/api/users via list:users
[I 2022-01-27 23:53:08.565 JupyterHub log:189] 200 GET /hub/api/users?limit=200&state=[secret] ([email protected]) 5.90ms
[I 220127 23:53:08 __init__:236] Culling server $USER (inactive for 00:00:36)
[D 2022-01-27 23:53:08.570 JupyterHub scopes:298] Authenticated with token <APIToken('2221...', service='jupyterhub-idle-culler-service', client_id='jupyterhub')>
[D 2022-01-27 23:53:08.570 JupyterHub scopes:488] Checking access via scope delete:servers
[D 2022-01-27 23:53:08.570 JupyterHub scopes:386] Unrestricted access to /hub/api/users/$USER/server via delete:servers
[D 2022-01-27 23:53:08.571 JupyterHub swarmspawner:155] Getting task of service $SERVICE
[D 2022-01-27 23:53:08.571 JupyterHub dockerspawner:982] Getting service $SERVICE
[D 2022-01-27 23:53:08.577 JupyterHub swarmspawner:144] Service upyx7ki status: {'ContainerStatus': {'ContainerID': 'c1b6b64ed3ef5d50ad786a685a8451562a30fcdc7b7f98d70b5a6ad131679c53',
'ExitCode': 0,
'PID': 9852},
'Message': 'started',
'PortStatus': {},
'State': 'running',
'Timestamp': '2022-01-27T23:52:29.645500796Z'}
[I 2022-01-27 23:53:08.577 JupyterHub proxy:310] Removing user $USER from proxy (/user/$USER/)
[D 2022-01-27 23:53:08.577 JupyterHub proxy:821] Proxy: Fetching DELETE http://127.0.0.1:8001/api/routes/user/$USER
23:53:08.578 [ConfigProxy] info: Removing route /user/$USER
23:53:08.578 [ConfigProxy] info: 204 DELETE /api/routes/user/$USER
[D 2022-01-27 23:53:08.579 JupyterHub user:860] Stopping $USER
[D 2022-01-27 23:53:08.579 JupyterHub swarmspawner:155] Getting task of service $SERVICE
[D 2022-01-27 23:53:08.579 JupyterHub dockerspawner:982] Getting service $SERVICE
[D 2022-01-27 23:53:08.583 JupyterHub swarmspawner:144] Service upyx7ki status: {'ContainerStatus': {'ContainerID': 'c1b6b64ed3ef5d50ad786a685a8451562a30fcdc7b7f98d70b5a6ad131679c53',
'ExitCode': 0,
'PID': 9852},
'Message': 'started',
'PortStatus': {},
'State': 'running',
'Timestamp': '2022-01-27T23:52:29.645500796Z'}
[I 2022-01-27 23:53:08.583 JupyterHub dockerspawner:1390] Stopping service $SERVICE (id: upyx7ki)
[I 2022-01-27 23:53:08.583 JupyterHub swarmspawner:257] Removing service upyx7kig7y9x5rt15t5w8gpzg
[D 2022-01-27 23:53:08.595 JupyterHub user:880] Deleting oauth client jupyterhub-user-$USER
[D 2022-01-27 23:53:08.605 JupyterHub user:883] Finished stopping $USER
[I 2022-01-27 23:53:08.616 JupyterHub base:1150] User $USER server took 0.039 seconds to stop
[I 2022-01-27 23:53:08.617 JupyterHub log:189] 204 DELETE /hub/api/users/$USER/server ([email protected]) 48.48ms
[I 2022-01-27 23:53:10.636 JupyterHub log:189] 302 GET /user/$USER/api/contents/Untitled.ipynb?content=0&1643327590437 -> /hub/user/$USER/api/contents/Untitled.ipynb?content=0&1643327590437 (@10.11.0.4) 2.43ms
[D 2022-01-27 23:53:10.673 JupyterHub user:347] Creating <class 'cdsdashboards.hubextension.spawners.variabledocker.VariableSwarmSpawner'> for $USER:
[W 2022-01-27 23:53:10.676 JupyterHub base:1389] Failing suspected API request to not-running server: /hub/user/$USER/api/contents/Untitled.ipynb
[W 2022-01-27 23:53:10.677 JupyterHub log:189] 424 GET /hub/user/$USER/api/contents/Untitled.ipynb?content=0&1643327590437 ([email protected]) 11.34ms
[I 2022-01-27 23:53:11.089 JupyterHub log:189] 302 GET /user/$USER/api/kernels?1643327590885 -> /hub/user/$USER/api/kernels?1643327590885 (@10.11.0.4) 2.91ms
[I 2022-01-27 23:53:11.122 JupyterHub log:189] 302 GET /user/$USER/api/sessions?1643327590919 -> /hub/user/$USER/api/sessions?1643327590919 (@10.11.0.4) 2.92ms
[W 2022-01-27 23:53:11.127 JupyterHub base:1389] Failing suspected API request to not-running server: /hub/user/$USER/api/kernels
[W 2022-01-27 23:53:11.128 JupyterHub log:189] 424 GET /hub/user/$USER/api/kernels?1643327590885 ([email protected]) 7.41ms
The text was updated successfully, but these errors were encountered:
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
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.
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! 👋
@yannsartori I suspect this is because what's reported as activity must be something more than just that a kernel is running - it must emit input/output in some way as well I think.
It’s in what the server considers activity to be reported. Messsged are activity (execution, output), but being statically busy is not considered activity.
This was a surprise to me as well, and it should at least be very clearly documented if we don't resolve it.
Bug description
If I open a server and exhibit activity on the server (e.g. open a notebook -> create and run cells and periodically save the notebook), it appears that my server gets removed, despite this activity.
Expected behaviour
I would anticipate that my server remains up-and-running.
Actual behaviour
The server gets removed.
How to reproduce
--timeout + --cull-every
seconds, the server gets culled.Your personal set up
I am running JupyterHub in Docker with a
SwarmSpawner
subclass (VariableSwamSpawner
) as a spawner class, with support forContainDSDashboard
.Below is the Dockerfile I use for my jupyterhub server:
Full environment
Configuration
Logs
The text was updated successfully, but these errors were encountered: