3
votes

Trying to access Google Cloud Datalab server with: docker run -it -p "127.0.0.1:8081:8080" -v "${HOME}:/content" -e "GATEWAY_VM=mltensorflow-1470671201129/us-east1-b/vm-instance-name" gcr.io/cloud-datalab/datalab:local

as per Run Cloud Datalab on Google Cloud Platform

It fails with: ERROR: (gcloud.compute.ssh) Could not SSH to the instance. It is possible that your SSH key has not propagated to the instance yet. Try running this command again. If you still cannot connect, verify that the firewall and instance are set to accept ssh traffic.

I am on a Windows 10 client. Repeated installation now produces this error: channel 2: open failed: connect failed: Connection refused Failed to set up the SSH tunnel to the VM vm-instance-name

Instance is accessible via other means, for example: gcloud compute --project "project_name" ssh --zone "us-west1-a" "ins-name"

2
Just a quick check. Did you replace vm-instance-name with the vm instance you created? The reason I ask is because vm-instance-name does not match the instance name used in gcloud compute ...Anthonios Partheniou
Good catch, Anthonios. Unfortunately, that is not the cause ( I listed generic gcloud statement - real arguments are ok and match actual vm instance name ).Ranko Mosic
I think something is missing in Datalab docs - they just changed way you access it over the weekend. It might be something along the lines of: gloud dockerRanko Mosic
I ran through the docs and I could connect to a gateway server in GCE. Note: I received the same error that you mention here (Failed to setup the SSH tunnel). After 30 seconds, I tried docker run it ... again and didn't get the error.Anthonios Partheniou
Unfortunately, I'm not on Windows. Docker doesn't work in my windows virtual machine. From forums.docker.com/t/… , "Docker for Windows requires hyper-v and virtualization extensions. Without nested virtualization (not available in VirtualBox), Docker for Windows can't install and work."Anthonios Partheniou

2 Answers

2
votes

The command docker run ... has an argument that doesn't work on Windows AFAIK. But the strange thing is that I would expect a very different error and in fact managed to get an error due to ${HOME}.

Here is the command I ran and it worked well - after substituting the value for HOME (you will need to replace [proj-id] below.

docker run -it -p "8081:8080" -v "/C/Users/dinesh/Documents/:/content"    -e "GATEWAY_VM=[proj-id]/us-central1-f/datalab"  gcr.io/cloud-datalab/datalab:local

Not sure if this will work for you but something worth trying in case substitution was a problem. (I am assuming that the VM was created with datalab-gateway.yaml without any errors.)

Thanks.

Dinesh Kulkarni

PM, Datalab & Cloud ML

1
votes

The problem with official instructions Run Cloud Datalab on Google Cloud Platform, is that provided command to create the gateway VM does not work correctly on Windows.

Replace --metadata "google-container-manifest=$(cat datalab-gateway.yaml)" with --metadata-from-file google-container-manifest=datalab-gateway.yaml and it will create VM with datalab-gateway.yaml without any errors. You can login to your new instance and run sudo docker ps to double check if container is running.

Afterwards you can continue with next step (docker run...), just substitute ${HOME} with /C/Users/<your path> as Dinesh described.