1
votes

I create GCP vm instance, allow http access and set config jupyter server as below:

$ jupyter notebook password

c = get_config()
c.NotebookApp.ip = '10.14.~~~~~~'
c.NotebookApp.allow_origin = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.password = "sha1:~~~~~"

$ sudo ufw allow 8888
$ jupyter notebook --ip 0.0.0.0 --port 8888

and I try to connect to "http(s)://externalip:8888" but failed. It only showing infinite loading.

here is console message:

(base) myID@instance-1:~$ jupyter notebook --ip 0.0.0.0 --port 8888 [I 07:26:32.493 NotebookApp] JupyterLab extension loaded from /home/renwenxue0/anaconda3/lib/python3.7/site-package s/jupyterlab [I 07:26:32.493 NotebookApp] JupyterLab application directory is /home/renwenxue0/anaconda3/share/jupyter/lab [I 07:26:32.495 NotebookApp] Serving notebooks from local directory: /home/renwenxue0 [I 07:26:32.495 NotebookApp] The Jupyter Notebook is running at: [I 07:26:32.495 NotebookApp] http://(instance-1 or 127.0.0.1):8888/ [I 07:26:32.495 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmatio n).

I have sent feedback to google team but got no reply.

2

2 Answers

4
votes

You need to enable firewall rule on GCP console(allow port 8888) https://cloud.google.com/vpc/docs/firewalls#firewall_rules_in

0
votes

I think you'll have a much easier time if you use GCP's AI Platform Notebooks instead.

It's the same price as doing it yourself, but you'll get a full Jupyter Notebook environment with various popular ML libraries preinstalled (and GPU support for them pre-setup as well)

To create one go to the GCP console -> AI Platform -> Notebooks -> New Instance