Cluster Toolkit 是 Google Cloud 提供的开源软件,可让客户轻松在 Google Cloud 上部署 AI/ML 和 HPC 环境。
Cluster Toolkit 是 Google Cloud 提供的开源软件,可让客户轻松在 Google Cloud 上部署 AI/ML 和 HPC 环境。
Cluster Toolkit is an open-source software provided by Google Cloud that makes it easy to deploy AI/ML and high performance computing (HPC) environments following Google Cloud best practices.
Cluster Toolkit is highly customizable and extensible, addressing the deployment needs of a broad range of workloads, such as compute, networking, and storage, in a repeatable manner.
Cluster Toolkit comes with a suite of tutorials, examples, and full documentation for modules designed for AI/ML and HPC use cases.
The main components of Cluster Toolkit include:
For more information, see Google Cluster Toolkit overview.
Cluster Toolkit is an integral part of Google Cloud AI Hypercomputer. For more information about GKE and Slurm deployments in AI Hypercomputer, see Create an AI-optimized GKE cluster with default configuration and Create a self-managed Slurm cluster for AI workloads.
To get started with Cluster Toolkit deployments, you can follow one of the following quickstart guides:
To create a cluster using Cluster Toolkit, you can use either Cloud Shell, or a workstation that is running Linux or macOS.
Cloud Shell is an interactive development and operations environment that is accessible from your web browser. If you use Cloud Shell, the following dependencies are already pre-installed and you don't need to manually install dependencies.
If you want to work from a Linux or macOS client or workstation, you must follow the steps in Install dependencies before you continue.
You can use two different methods to install Cluster Toolkit:
For the easiest setup, download the appropriate bundle for your operating system and architecture (e.g., gcluster_bundle_linux_amd64.zip, gcluster_bundle_linux_arm64.zip, gcluster_bundle_mac_amd64.zip, or gcluster_bundle_mac_arm64.zip) from the Releases page. These bundles include the pre-compiled gcluster binary, the examples folder, and the community/examples folder.
The pre-built bundles are compiled for Linux and macOS execution environments and support the deployment of the following cluster operating systems.
| Platform | Support Status | Notes |
|---|---|---|
| Linux (amd64 / arm64) | ✅ | Pre-compiled on Debian Bullseye. Includes amd64 (x86_64) and arm64 builds starting v1.85.0. |
| Google Cloud Shell | ✅ | Native support via the Linux amd64 binary. |
| macOS (amd64 / arm64) | ✅ | Native support via the Mac binary. Includes amd64 (Intel) and arm64 (Apple Silicon) builds starting v1.85.0. |
| Windows | ❎ | Please Build from source. |
[!NOTE] Multi-architecture builds (amd64 and arm64) are available starting with version 1.85.0. Tarball bundles (.tgz) are supported starting with version 1.89.0.
Download and extract the bundle:
For versions v1.89.0 and newer (Multi-architecture Tarball):
# Find all available releases at: https://github.com/GoogleCloudPlatform/cluster-toolkit/releases
# Set the desired version TAG (e.g., v1.89.0)
TAG=vX.Y.Z
# Set your OS (linux or mac) and architecture (amd64 or arm64)
OS="linux"
ARCH="amd64"
# Download and extract the platform-specific bundle in a single step
mkdir -p cluster-toolkit && curl -L https://github.com/GoogleCloudPlatform/cluster-toolkit/releases/download/${TAG}/gcluster_bundle_${OS}_${ARCH}.tgz | tar -xz -C cluster-toolkit && cd cluster-toolkitFor versions v1.85.0 through v1.88.0 (Multi-architecture Zip):
# Find all available releases at: https://github.com/GoogleCloudPlatform/cluster-toolkit/releases
# Set the desired version TAG (e.g., v1.85.0)
TAG=vX.Y.Z
# Set your OS (linux or mac) and architecture (amd64 or arm64)
OS="linux"
ARCH="amd64"
# Download and extract the platform-specific bundle
curl -LO https://github.com/GoogleCloudPlatform/cluster-toolkit/releases/download/${TAG}/gcluster_bundle_${OS}_${ARCH}.zip
unzip gcluster_bundle_${OS}_${ARCH}.zip -d cluster-toolkit/
cd cluster-toolkitVerify the installation:
./gcluster --version
./gcluster --helpIf you prefer to build the gcluster binary from source,
you can use the following commands:
git clone https://github.com/GoogleCloudPlatform/cluster-toolkit
cd cluster-toolkit
make
./gcluster --version
./gcluster --help[!NOTE] You must install dependencies (such as Go and Terraform) before building, otherwise the
makecommand fails.
Before deploying your first cluster, ensure the following are configured in your Google Cloud project.
Several APIs must be enabled to deploy your cluster. While Terraform identifies missing APIs during terraform apply, enabling them upfront saves time. Required APIs typically include:
For more information, see Set up Cluster Toolkit.
HPC and AI workloads often require significant resources. You might need to request additional quota to deploy your cluster. For more information, see Request additional quotas.
Terraform can provide credentials for authenticating to Google Cloud in several ways. We recommend using gcloud on your workstation or using service accounts attached to cloud environments.
[!WARNING] We do not recommend downloading or using service account JSON keys. These keys are long-lived credentials that pose a significant security risk if leaked. Instead, use short-lived credentials via Application Default Credentials (ADC).
On your local terminal, Cloud Workstations, or Cloud Shell, generate Application Default Credentials (ADC) associated with your Google Cloud account:
gcloud auth application-default loginFollow the prompts in your browser to authenticate. You are provided a token to copy and paste back into your terminal to complete the process. Once finished, Terraform automatically uses these "Application Default Credentials."
If you receive a quota project error, then set the quota project to your current project ID:
gcloud auth application-default set-quota-project ${PROJECT_ID}To help improve Cluster Toolkit, feature usage statistics are collected and sent to Google. You can opt-out at any time by executing the following command:
./gcluster telemetry offCluster Toolkit telemetry overall is handled in accordance with the Google Privacy Policy. When you use Cluster Toolkit to interact with or utilize GCP Services, your information is handled in accordance with the Google Cloud Privacy Notice.
After installing gcluster, you can deploy, manage, and destroy infrastructure using cluster blueprints:
Create deployment folder: Use a blueprint YAML file to generate deployment files:
./gcluster create examples/hpc-slurm.yamlDeploy cluster: Provision infrastructure with Terraform:
./gcluster deploy hpc-slurmDestroy cluster: Clean up provisioned resources:
./gcluster destroy hpc-slurmWhen running commands like deploy or destroy in non-interactive environments (such as CI/CD pipelines), the toolkit can automatically download missing HashiCorp dependencies (Terraform and Packer) by passing the --download-dependencies flag.
--download-dependencies: Automatically download missing dependencies without prompting.--download-dependencies=false: Fail immediately if any required dependencies are missing.In interactive terminals, this flag is optional; the toolkit will ask for confirmation before downloading missing dependencies.
For detailed guides, blueprint syntax, and configuration options, see the Google Cloud documentation site.
The gcluster job submit command provides a unified interface to submit batch and distributed containerized workloads (JobSets) to your GKE clusters.
Ensure your environment is set up before submitting jobs:
kubectl and gke-gcloud-auth-plugin installed and authenticated (gcloud auth login).--build-context), set export GCLUSTER_IMAGE_REPO= to specify your Artifact Registry repository name (e.g., export GCLUSTER_IMAGE_REPO=gcluster-repo).To reduce boilerplate in job submit commands, you can set default configuration values for project, location, and cluster.
You can open your default system text editor interactively:
./gcluster job config setOr you can set values individually:
./gcluster job config set project my-project
./gcluster job config set cluster my-cluster
./gcluster job config set location us-central1-aCheck the active configuration using:
./gcluster job config showThere are two ways to submit a JobSet with the gcluster job submit command:
To submit with a pre-built image, run ./gcluster job submit with the following properties in your shell:
./gcluster job submit \
--project \
--cluster \
--location \
--name my-job \
--ima暂无开放 Issues,或尚未同步最近议题。