Configure your environment

To use Cloud HPC Toolkit, you need a Google Cloud project. In your project, you need to enable APIs, permissions, and grant credentials to Terraform. You also need to clone and build the Cloud HPC Toolkit repository.

The following steps can be completed from Cloud Shell or a workstation that is running a Linux or macOS. If you are using a Linux or macOS workstation, ensure that you have installed the dependencies.

To configure your environment, you need to complete the following steps:

Enable APIs

To enable the APIs, you can use either Google Cloud console, or the Google Cloud CLI.

Console

Enable the following APIs:

gcloud

Enable the following APIs:

  • Enable the Compute Engine API:
    gcloud services enable compute.googleapis.com
  • Enable the Filestore API:
    gcloud services enable file.googleapis.com
  • Enable the Cloud Runtime Configuration API:
    gcloud services enable runtimeconfig.googleapis.com

Set a default project

To set a default project, run the following command:

Replace PROJECT_ID with your project ID.

gcloud config set project PROJECT_ID

Ensure that the default Compute Engine service account is enabled

Cloud HPC Toolkit requires that the default Compute Engine service account is enabled in your project and that the roles/editor IAM role is enabled on the service account. This is the default setting that is set up by Google Cloud for projects.

However, if you had disabled the default Compute Engine service account and the roles/editor IAM role in your project, complete the following steps to enable these settings:

  1. Enable the default Compute Engine service account.

    gcloud iam service-accounts enable \
       --project PROJECT_ID \
       PROJECT_NUMBER-compute@developer.gserviceaccount.com
    
  2. Grant the roles/editor IAM role to the service account.

    gcloud projects add-iam-policy-binding PROJECT_ID \
        --member=serviceAccount:PROJECT_NUMBER-compute@developer.gserviceaccount.com \
        --role=roles/editor
    

Replace the following:

  • PROJECT_ID: your project ID
  • PROJECT_NUMBER: the automatically generated unique identifier for your project

    For more information, see Identifying projects.

Grant user access credentials to Terraform

To generate cloud credentials associated with your Google Cloud account, run the following command:

gcloud auth application-default login

This grants the Application Default Credentials (ADC) to Terraform.

Clone the Cloud HPC Toolkit GitHub repository

  1. Clone the GitHub repository:

    git clone https://github.com/GoogleCloudPlatform/hpc-toolkit.git
  2. Go to the main working directory:

    cd hpc-toolkit/

Build the Cloud HPC Toolkit binary

  1. To build the Cloud HPC Toolkit binary from source, run the following command:

    make
  2. To verify the build, run the following command:

    ./ghpc --version

What's next