How to access and use Google Compute Engine (GCE)?

Account creation

As a HEPIA student enrolled in the Cloud & Deployment module, you have a credit of 50 US$ (in the form of coupon) from Google Cloud Higher education Program.

Here is the URL you will need to access in order to request a Google Cloud Platform coupon. You will be asked to provide your school email address (select the @etu.hesge.ch domain) and name. Before receiving the coupon, you will receive an Email to confirm these details.

For further information on how to use the coupon you received, read this URL.

Create a project

Please read this URL.

Create an instance using the GCE Web portal

The following tutorial will guide you through the creation of your first instance.

Note: This tutorial aims to start a Windows instance. To start a linux instance (ubuntu, debian,...) choose a linux image in step 5

https://cloud.google.com/compute/docs/instances/create-start-instance?hl=fr#publicimage

Setting up a local dev environment

Manual installation.

  1. Install Google Cloud SDK

    https://cloud.google.com/sdk/install?hl=fr

  2. Initialize Google Cloud SDK using the following command and follow on screen instructions

    Note: When asked to login type enter "y", choose the project you just created. When asked to configure a default Compute Region and Zone, enter "n"

    gcloud init
  3. Install Google api python client

    pip install --upgrade google-api-python-client
  4. Run the following command and follow on screen instruction to setup your account as the default account for the Google api python client

    gcloud auth application-default login

Resources and code examples

Google Compute Engine API documentation:

https://developers.google.com/resources/api-libraries/documentation/compute/v1/python/latest/index.html

https://developers.google.com/resources/api-libraries/documentation/compute/v1/python/latest/compute_v1.instances.html

Provision instance

The following tutorial explains how to deploy an instance using the Google Cloud Client Libraries for Python

https://cloud.google.com/compute/docs/tutorials/python-guide?hl=fr

If you have any questions, please send an Email to Raoul(dot)Dupuis(at)hesge(dot)ch

Modifié le: mardi 28 septembre 2021, 13:01