Skip to main content

Jupyter Server auto stop

Project description

stoy

Application for shutting down kernels and terminals in Jupyter Lab after they were idle for a specified period of time. Jupyter Lab itself is terminated when no kernels and terminals were open for some time.

Installation

Install with pip

pip install stoy

Usage

Define the three timeouts, in seconds, as demonstrated in the example below:

stoy --kernel-idle=3600 --terminal-idle=3600 --server-idle=1800 &

If jupyter lab is not in the system path you will need to provide it as an optional parameter, for example:

stoy --kernel-idle=3600 --terminal-idle=3600 --server-idle=1800 --path="/home/ec2-user/anaconda3/bin" &

If you run the script in the cloud and wish to shut down the instance use the optional --shutdown flag. This option requires that the script is run by a super user (use sudo when in doubt).

Troubleshooting

The application saves logs in ~/.stoy/stoy.log. To access the logs open jupyter lab terminal and run:

cat ~/.stoy/stoy.log

or

tail -n 20 ~/.stoy/stoy.log

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stoy-0.0.7.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

stoy-0.0.7-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page