To use Cluster 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 Cluster Toolkit repository.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine, Filestore, Cloud Storage, and Service Usage APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine, Filestore, Cloud Storage, and Service Usage APIs.
Overview
To set up Cluster Toolkit, you need to complete the following steps:
- Set up your CLI
- Set the default project
- Ensure that the default Compute Engine service account is enabled
- Grant user access credentials to Terraform
- Enable OS Login at the project-level
- Clone the Cluster Toolkit GitHub repository
- Build the Cluster Toolkit binary
Set up your CLI
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.
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
Cluster 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:
Enable the default Compute Engine service account.
gcloud iam service-accounts enable \ --project PROJECT_ID \ PROJECT_NUMBER[email protected]
Grant the
roles/editor
IAM role to the service account.gcloud projects add-iam-policy-binding PROJECT_ID \ --member=serviceAccount:PROJECT_NUMBER[email protected] \ --role=roles/editor
Replace the following:
PROJECT_ID
: your project IDPROJECT_NUMBER
: the automatically generated unique identifier for your projectFor 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.
Enable OS Login at the project-level
To be able to connect to a VM in your cluster by using ssh
, you must enable
OS Login. If OS Login is already enabled at the organization level,
you don't need to enable it on your project.
gcloud compute project-info add-metadata \ --metadata enable-oslogin=TRUE
Clone the Cluster Toolkit GitHub repository
Clone the GitHub repository:
git clone https://github.com/GoogleCloudPlatform/cluster-toolkit.git
Go to the main working directory:
cd cluster-toolkit/
Build the Cluster Toolkit binary
To build the Cluster Toolkit binary from source, run the following command:
make
To verify the build, run the following command:
./gcluster --version
After building the binary, you are now ready to deploy clusters to run your jobs or workloads.
What's next
- Learn about Cluster blueprints.
- Review best practices for running HPC workloads.
- Try a quickstart tutorial, see Deploy an HPC cluster with Slurm.