Table of contents:
- Enable Google Compute Engine and Cloud Source Repositories APIs
- Launch a Datalab Instance from gcloud
- Retrieving Code from Github into Datalab VM
- Shutting down/ Deleting the instance
Google Cloud datalab provides an interactive environment for model prototyping.
Enable Google Compute Engine and Cloud Source Repositories APIs
On a new account, enable Google Compute API and then the Cloud Source Repositories API before launching datalab.
APIs & Services Dashboard
Search for Compute Engine APIs
Enable Compute API
Search for Cloud Source Repositories APIs
Enable Cloud Source Repositories API
Launch a Datalab Instance from gcloud
To launch a datalab instance,
- Open gcloud shell
- Create a datalab instance by running the command datalab create instance-name
- Accept all the defaults as the instance is provisioned
- Press Enter twice when asked to generate a passphrase.
- Click on the Web Preview at top-right of the gcloud window, click Change port and selet Port 8081, to start using Datalab.
Note: The instance-name must begin with a lowercase letter, and can have up to 63 lowercase letters, mixed with numbers and hyphens. The instance-name cannot end with a hyphen.
Open Cloud Shell
Create Datalab Instance
Generate SSH keys
Select Port 8081
Open a notebook
To open a new notebook. Click on New Notebook at the top-left hand corner of the instance page.
Retrieving Code from Github into Datalab VM
(1). Log-in into the Datalab VM via
(2). Notebooks are stored in the disk location
/mnt/disks/datalab-pd/content/datalab/notebooks. Change to the directory using the
cd command and clone the repository from Github
git clone https://github.com/dvdbisong/IEEE-Carleton-and-OMPI-Machine-Learning-Workshop.git
(3). The directory
/mnt/disks/datalab-pd/content is mapped to the home directory in Datalab.
Shutting down/ Deleting the instance
To shut down the instance,
- Open the Cloud Compute Dashboard
- Click the check-box to select the instance.
- Click Stop to shut down the instance. Shutting down the instance prevents the user from incurring unnecessary cost when the instance is not in use.
- Click Delete to delete the instance and detach the disk allocated to the compute engine. Only use this action when completely done with all work on that instance. This action is irreversible.