7

I'm trying to restart a Jupyter Lab server (not just the kernels) running in the background of an AWS SageMaker notebook instance. I have already tried the following:

  • Killing the server by it's process ID
    • pgrep doesn't show me the process
    • pkill can't find the process
    • ps aux shows the process ID as constantly changing
  • Stopping the server through jupyter notebook stop
    • I get an SSL error and nothing happens

The only thing I've been able to do is reboot the entire instance, which isn't a great option as it can take awhile to become available again.

Edit 1:

The main reason I am trying to do this is that after installing the tqdm package and trying to use tqdm.notebook in Jupyter Lab, in order for it to display correctly I need to enable/install notebook and lab extensions. In order for these to take effect the server then needs to be restarted.

Ian
  • 296
  • 1
  • 3
  • 15
  • What is the motivation behind restarting the underlying Jupyter server? – Nick Walsh Mar 04 '20 at 21:37
  • When you shutdown a SageMaker notebook instance it acts like a factory reset. So every time I start it again I have to reinstall extensions to Jupyter Lab (in this case it's for tqdm), and then I need to restart the server for them to work. – Ian Mar 04 '20 at 22:06
  • To clarify, are you trying to reset the memory space for cells/work done within your JupyterLab notebooks without completely wiping the underlying environment changes since instance start (ie: extensions/plugins installed)? – Nick Walsh Mar 04 '20 at 22:25
  • I just need to restart the Jupyter server or kill the server process (the notebook instance automatically restarts the server if it crashes). I don't care if the kernels are killed. – Ian Mar 04 '20 at 22:28

4 Answers4

3

Try this:

  1. Left hand navbar, Commands
  2. Navigate to the Help section on the popout menu
  3. Reset Application State
Nick Walsh
  • 1,807
  • 5
  • 16
3

Both classic Jupyter and Jupyter lab live within the same process.

sudo initctl restart jupyter-server --no-wait is what AWS suggest in https://forums.aws.amazon.com/thread.jspa?messageID=917594&#917594

mkostelac
  • 191
  • 6
0

Assuming it runs on port 8888:

jupyter lab stop 8888 && jupyter lab
sevenam
  • 592
  • 1
  • 8
  • 21
0

If your instance is on Amazon Linux 1, use

sudo initctl restart jupyter-server --no-wait

If your instance is on Amazon Linux 2, use

sudo systemctl restart jupyter-server, which is equivalent to sudo service jupyter-server restart.

zhengz
  • 13
  • 2