Quickstart | Cloud Datalab Documentation | Google Cloud
Total Page:16
File Type:pdf, Size:1020Kb
8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud Quicksta Objective: This page shows you how to use the datalab command line tool to set up and open Google Cloud Datalab. Before you begin 1. Sign in (https://accounts.google.com/Login) to your Google Account. If you don't already have one, sign up for a new account (https://accounts.google.com/SignUp). 2. In the Cloud Console, on the project selector page, select or create a Cloud project. Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you nish these steps, you can delete the project, removing all resources associated with the project. Go to the project selector page (https://console.cloud.google.com/projectselector2/home/dashboar 3. Make sure that billing is enabled for your Google Cloud project. Learn how to conrm billing is enabled for your project (/billing/docs/how-to/modify-project). 4. Enable the Google Compute Engine and Cloud Source Repositories APIs. Enable the APIs (https://console.cloud.google.com/ows/enableapi?apiid=compute,sourcerepo.goog 5. Install and initialize the Cloud SDK (/sdk/docs). If you can't install Cloud SDK because you are using an unsupported device or platform, such as Chromebook, see Starting Cloud Datalab on a Chromebook (/datalab/docs/how-to/datalab-using-shell). Steps to set up and open Cloud Datalab https://cloud.google.com/datalab/docs/quickstart/ 1/6 8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud From a terminal window on your local machine: 1. Update your gcloud command-line tool components: $ gcloud components update If you installed the gcloud command-line tool through apt or yum, use those package managers to update the components: $ sudo apt update && sudo apt upgrade google-cloud-sdk $ sudo yum upgrade google-cloud-sdk 2. Install the datalab component for the gcloud command-line tool: $ gcloud components install datalab If you installed the gcloud command-line tool through apt or yum, use those package managers to update the components: $ sudo apt update && sudo apt install google-cloud-sdk-datalab $ sudo yum install google-cloud-sdk-datalab 3. Create a Cloud Datalab instance. The name of the instance must start with a lowercase letter, followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen. $ datalab create datalab-instance-name https://cloud.google.com/datalab/docs/quickstart/ 2/6 8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud If the command returns an error, re-run the command with the following debug ag to help diagnose the problem: datalab create --verbosity=debug datalab-instance-name. To create a Cloud Datalab instance with GPUs. To create a Cloud Datalab VM with one K80 GPU (/compute/docs/gpus#introduction) (see GPU Pricing (/compute/pricing#gpus)), use the following beta command: $ datalab beta create-gpu datalab-instance-name To specify more than one K80 GPU, use the --accelerator-count number ag. For more information, run: $ datalab beta create-gpu --help 4. Open the Cloud Datalab home page in your browser. http://localhost:8081 https://cloud.google.com/datalab/docs/quickstart/ 3/6 8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud The connection to your Datalab instance remains open while the datalab command is active. If the terminal command window is closed or interrupted, the connection will terminate, and you will need to run the following command to reestablish the connection: $ datalab connect instance-name Clean up To avoid incurring charges to your Google Cloud account for the resources used in this quickstart, follow these steps. 1. You incur charges from the time of creation to the time of deletion of the Cloud Datalab VM instance (see Cloud Datalab Pricing (/datalab/docs/resources/pricing)). You are also charged for the Persistent Disk where notebooks are stored. The Persistent Disk remains after the deletion of the VM until you delete it. The following command deletes both the VM instance and its Persistent Disk. https://cloud.google.com/datalab/docs/quickstart/ 4/6 8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud $ datalab delete --delete-disk instance-name 2. Other cleanup tasks. Additional resources are created by the datalab create command, and will be reused by other Cloud Datalab instances that you create. You can run the following commands to delete the additional resources listed below if you do not expect to create additional Cloud Datalab instances. Delete the datalab-network-allow-ssh rewall rule, which allows SSH connections to your Cloud Datalab instances: $ gcloud compute firewall-rules delete datalab-network-allow-ssh Delete the datalab-network Virtual Private Cloud (VPC) (/vpc/docs/overview) network, to which Datalab instances are connected by default. $ gcloud compute networks delete datalab-network Delete the datalab-notebooks Cloud Source Repository (/source-repositories/docs/features), which is set up for you to store your notebooks (see Working with notebooks (/datalab/docs/how-to/working-with-notebooks) if you wish to backup notebooks before deleting the repo). $ gcloud source repos delete datalab-notebooks What's next 1. Browse the /datalab/docs/intro Cloud Datalab notebook folder to become familiar with the capabilities of Cloud Datalab. You will nd tutorials and samples for using Google Cloud Platform services and for performing common data analysis tasks. https://cloud.google.com/datalab/docs/quickstart/ 5/6 8/23/2020 Quickstart | Cloud Datalab Documentation | Google Cloud 2. You can view the datalab server VM logs with the Cloud Platform Console logs viewer (/logging/docs/view/logs_viewer#understand_the_logs_viewer_interface). 3. Read Cloud Datalab How-to Guides (/datalab/docs/how-to). 4. Learn more about the options available in the datalab command line tool by running datalab --help. 5. Learn about Using Datalab in a team environment (/datalab/docs/how-to/datalab-team). Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its aliates. Last updated 2020-06-23 UTC. https://cloud.google.com/datalab/docs/quickstart/ 6/6.