5

I am using the Google AI platform which provides jupyterlab notebooks. I have 2 notebook instances set up to run R of which only one notebook now opens. The first notebook will not open regardless of the number of stops and resets I performed. The notebook overview can be seen in this image and circled is a difference (it is 'started'): difference in dashboard

The only reason I can imagine for this difficulty is that I changed the machine type for the notebook where I decreased the number of CPUs from 4 to 2 and the RAM from 15 to 7.5. Now I cannot open it and it has a blank for where the environment should say R3.6. I would not mind deleting it and starting over if there was not nonbacked-up work on it.

What can be done to bring the notebook back to operation and if it cannot be done, how can I download it or extract some key files?

Vass
  • 2,682
  • 13
  • 41
  • 60
  • Are you using the latest R image? I will try to reproduce it. Basically create n1-standard-4 + latest R image, stop instance, resize CPU + RAM, start it and Jupyter access is not available. Can you try SSH into the instance? – gogasca Aug 23 '20 at 06:31
  • @gogasca, I set it up initially as for R. I don't remember selecting an 'image'. I changed it to n1-standard-4, as it was originally, but no prompt to select the R image. After the change, I started it, but the `OPEN JUPYTERLAB` button does not work still. I have not tried SSH into the instance, how would I go about doing that? – Vass Aug 23 '20 at 19:08
  • Ssh like a regular VM click on it and u will get an ssh button ( you need the right permissions) – gogasca Aug 23 '20 at 19:53
  • I was able to create a new nb, stop it, resize it and start it no issue. Can you start the instance and past the Serial log. ? – gogasca Aug 24 '20 at 04:11
  • @gogasca, I could not ssh into the VM successfully, is there a page that describes how to do it on gcp? From the machine instance where does it list the urls I need for sshing? Where are the `Serial logs` for the instance? – Vass Aug 25 '20 at 17:11
  • 1
    Go go GCP console > Compute Engine, find the VM and there's an SSH button. In the same page you can find the Serial logs at the top – gogasca Aug 27 '20 at 19:39
  • @gogasca, I ssh'd via the button and the terminal shows 'Version: r-cpu.3-6.m40', and I found all the files. how can I extract them? In the `Logs Viewer classic` I see some logs produced with an example being `https://console.cloud.google.com/logs/viewer?resource=gce_instance%2Finstance_id%...` – Vass Aug 29 '20 at 22:44
  • 1
    Version m40 is not very recent. We just released M55 last week. Please go to /home/jupyter folder. This is where all Notebooks are stored by default, you can copy them to a GCS bucket: gsutil cp Documentation here: https://cloud.google.com/storage/docs/gsutil/commands/cp – gogasca Aug 31 '20 at 05:11

2 Answers2

3

As it was commented before, there are two ways to inspect the Notebook Instance using Cloud Console:

  1. GCP Console > AI Platform > Notebooks
  2. GCP Console > Compute Engine > VM Instances. The name of the GCE VM Instance will be the same as the Notebook Instance name.

It looks like you were able to connect to your Notebook instance via SSH button. Additionally you can use gcloud command to connect to instances via SSH that you have permission to access by following:

gcloud compute ssh --project <PROJECT> --zone <ZONE> <INSTANCE>

After you connect, use the terminal to run commands to verify the status of your jupyter service and the service logs by running:

sudo service jupyter status
sudo journalctl -u jupyter.service --no-pager

You can restart the jupyter service to try to recover it:

sudo service jupyter restart

If you want to use other methods or third parties to create a SSH connection to your Notebook instance, you can follow this.

If you were not able to recover your jupyter service, you can copy your files from your VM by click the gear icon in the upper right of the SSH from the Browser window and select Download file.

enter image description here

As it was mentioned before, the gsutil cp command allows you to copy data between your local file system and the cloud, within the cloud, and between cloud storage providers. For example, to upload all files from the local directory to a bucket, you can run:

gsutil cp -r dir gs://my-bucket

Use the -r option to copy an entire directory tree

July
  • 442
  • 4
  • 11
0

In the worst scenario is based on SSH access of the compute engine, user must be granted access.

This instance does not have an external IP and you don't have the iap.tunnelInstances.accessViaIAP permission

Users need certain permissions to access an app that's secured by IAP. To grant these permissions, administrators can use an API to update IAM policies.

Managing access to IAP-secured resources

Tiago Medici
  • 1,944
  • 22
  • 22