Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Jupyter auto restart on reboot #108

Closed
dennishuo opened this issue Apr 14, 2017 · 4 comments
Closed

Make Jupyter auto restart on reboot #108

dennishuo opened this issue Apr 14, 2017 · 4 comments

Comments

@dennishuo
Copy link
Contributor

Right now the init action only explicitly calls https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/blob/master/jupyter/internal/launch-jupyter-kernel.sh in the initialization action, so if the master is rebooted, the jupyter server doesn't start up automatically. It should instead configure a systemd service to auto startup.

@sammcveety
Copy link
Contributor

Any preference whether this .service file would inline the startup script or indirect to another file?

.service would be roughly:

[Unit]
Description=Start up Jupyter

[Service]
Type=oneshot
ExecStart=/usr/bin/launch_jupyter

[Install]
WantedBy=multi-user.target

@dennishuo
Copy link
Contributor Author

Inline should be fine, it'd match the cloud-sql proxy: https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/blob/f22d7272d690bd48b9ea94bbf2f07ad464646236/cloud-sql-proxy/cloud-sql-proxy.sh#L115

Otherwise no strong preference either way.

@ghost
Copy link

ghost commented May 6, 2017

Hi, I fixed the problem by connecting to master machine using ssh and created a systemd service(followed @dennishuo 's stackoverflow comment).

  1. go to /usr/lib/systemd/system
  2. sudo su
  3. create a systemd unit file called "jupyter-notebook.service" with content
[Unit]
Description=Start Jupyter Notebook Server at reboot

[Service]
Type=simple
ExecStart=/opt/conda/bin/jupyter notebook --allow-root  --no-browser

[Install]
WantedBy=multi-user.target
  1. systemctl daemon-reload
  2. systemctl enable jupyter-notebook.service
  3. systemctl start jupyter-notebook.service

Next step will be to include above code into dataproc-initialization-actions.
Hope that helps.

@dennishuo
Copy link
Contributor Author

Fixed in #111 and #113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants