Starting Datalab from Cloud Shell

9/21/2016

The Datalab documentation shows how to run datalab on:

  • your own machine or,
  • on Google Cloud Platform.

Unfortunately if you are restricted to a Windows 7/8 machine without the required Docker support, I don't think you have easy* options to deploy datalab.

What is the recommended way to deploy Datalab, since the datalab deployer is now deprecated?

*You could of course run Linux in Virtualbox and deploy everything from there, but it's not really easy.

-- Fematich
docker
google-cloud-datalab
google-cloud-shell
google-kubernetes-engine

2 Answers

9/21/2016

The easiest way I have come up with is using Cloud Shell in combination with container engine.

Below, you can find the commands to paste in Cloud Shell, this will return the IP address of the service running datalab:

gcloud container clusters create datalab-cluster --machine-type n1-standard-4 --num-nodes 1 --zone europe-west1-d --scopes cloud-platform
kubectl run datalab --image=gcr.io/cloud-datalab/datalab:local --port=80
kubectl expose deployment datalab --type="LoadBalancer"
kubectl get service datalab

To stop/delete datalab you run this command in Cloud Shell:

gcloud container clusters delete datalab-cluster

Note1: If you delete the datalab service, you will also lose your data, so keep in mind to copy your data-folder to Google Cloud Storage.

Note2: When I try to use the Sign in button in the upper right corner in Datalab, this always fails (redirects to localhost). You can also login using the gcloud commands in Datalab:

  • run: !echo Y |gcloud auth login --no-launch-browser
  • go to the url that was returned in the previous step, click on login and copy the returned code
  • run: !echo <code>|!echo Y |gcloud auth login --no-launch-browser with <code>, the code obtained in the previous step

Edit: As mentioned by @Dinesh (PM Datalab), there is a new alternative available now that works better than this method and doesn't require Docker on your machine.

-- Fematich
Source: StackOverflow

10/3/2016

Two quick comments:

  1. There are issues with using Cloud Dev Shell - one mentioned above plus problems with the communication protocol between the notebook server and the kernel and a few others. So we decided against documenting this as an alternative to Docker installation at this point.
  2. There is a better alternative now that is documented here: https://cloud.google.com/datalab/docs/quickstarts/quickstart-gce-frontend. It requires the ability to create an SSH tunnel from your client (Mac/Windows etc) to the GCE VM running Datalab but should otherwise free you from the Docker installation requirement.

Thanks.

Dinesh

(Cloud Datalab Product Manager)

-- Dinesh
Source: StackOverflow