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.