-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a3u-gke-gcs blueprint #3454
Open
samskillman
wants to merge
3
commits into
GoogleCloudPlatform:develop
Choose a base branch
from
samskillman:examples/a3u-gke-gcs
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# A3-Ultra GKE + GCS Reference Design | ||
|
||
This reference design provides a high-performance and scalable architecture for | ||
deploying AI/ML workloads on Google Kubernetes Engine (GKE) with Google Cloud | ||
Storage (GCS). | ||
|
||
## Key Features | ||
|
||
* **Multi-VPC Design:** Utilizes three VPCs: two for GKE nodes and one dedicated | ||
for GPU RDMA networks. | ||
* **Cloud Storage Fuse Integration:** Enables seamless access to GCS buckets | ||
from within your containers using the Cloud Storage Fuse CSI Driver. Cloud | ||
Storage Fuse is configured to utilize the 12 TB of Local SSD | ||
* **Hierarchical Namespace Buckets:** Leverages GCS buckets with Hierarchical | ||
Namespace enabled, optimizing performance for checkpointing and restarting | ||
workloads. | ||
* **Kueue for Workload Scheduling:** Provides a robust and flexible system for | ||
managing your AI/ML training jobs. | ||
* **Jobset API for Tightly Coupled Workloads:** Facilitates running tightly | ||
coupled AI/ML training jobs efficiently. | ||
|
||
## Deployment Steps | ||
|
||
1. **Build the Cluster Toolkit `gcluster` binary:** | ||
|
||
Follow the instructions [here](https://cloud.google.com/cluster-toolkit/docs/setup/configure-environment). | ||
|
||
2. **(Optional) Create a GCS Bucket for Terraform State:** | ||
|
||
This step is recommended for storing your Terraform state. Use the | ||
following commands, replacing placeholders with your project details: | ||
|
||
```bash | ||
BUCKET_NAME=<your-bucket-name> | ||
PROJECT_ID=<your-gcp-project> | ||
REGION=<your-preferred-region> | ||
|
||
gcloud storage buckets create gs://${BUCKET_NAME} \ | ||
--project=${PROJECT_ID} \ | ||
--default-storage-class=STANDARD \ | ||
--location=${REGION} \ | ||
--uniform-bucket-level-access | ||
|
||
gcloud storage buckets update gs://${BUCKET_NAME} --versioning | ||
``` | ||
|
||
3. **Create and Configure GCS Buckets:** | ||
|
||
* Create separate GCS buckets for training data and checkpoint/restart data: | ||
|
||
```bash | ||
PROJECT_ID=<your-gcp-project> | ||
REGION=<your-preferred-region> | ||
TRAINING_BUCKET_NAME=<training-bucket-name> | ||
CHECKPOINT_BUCKET_NAME=<checkpoint-bucket-name> | ||
PROJECT_NUMBER=<your-project-number> | ||
|
||
gcloud storage buckets create gs://${TRAINING_BUCKET_NAME} \ | ||
--location=${REGION} \ | ||
--uniform-bucket-level-access \ | ||
--enable-hierarchical-namespace | ||
|
||
gcloud storage buckets create gs://${CHECKPOINT_BUCKET_NAME} \ | ||
--location=${REGION} \ | ||
--uniform-bucket-level-access \ | ||
--enable-hierarchical-namespace | ||
``` | ||
|
||
* Grant workload identity service accounts (WI SAs) access to the buckets: | ||
|
||
```bash | ||
|
||
gcloud storage buckets add-iam-policy-binding gs://${TRAINING_BUCKET_NAME} \ | ||
--member "principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/default" \ | ||
--role roles/storage.objectUser | ||
|
||
gcloud storage buckets add-iam-policy-binding gs://${CHECKPOINT_BUCKET_NAME} \ | ||
--member "principal://iam.googleapis.com/projects/$PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/default" \ | ||
--role roles/storage.objectUser | ||
``` | ||
|
||
4. **Customize Deployment Configuration:** | ||
|
||
Modify the `deployment.yaml` file to suit your needs. This will include | ||
region/zone, nodepool sizes, reservation name, and checkpoint/training bucket | ||
names. | ||
|
||
5. **Deploy the Cluster:** | ||
|
||
Use the `gcluster` tool to deploy your GKE cluster with the desired configuration: | ||
|
||
```bash | ||
gcluster deploy -d deployment.yaml a3u-gke-gcs.yaml | ||
``` | ||
|
||
## Example Workload Job | ||
|
||
Once the cluster has been deployed, there will be instructions on how to get | ||
credentials for the cluster, as well as how to deploy an example workload. This | ||
example workload uses [fio](https://github.com/axboe/fio) to run a series of | ||
benchmarks against the LocalSSD and GCSFuse mounts. | ||
|
||
The instructions will look something like: | ||
|
||
```bash | ||
Use the following commands to: | ||
Submit your job: | ||
kubectl create -f <PATH/TO/DEPLOYMENT_DIR>/primary/my-job-<some-id>.yaml | ||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCS HNS only supported by GKE 1.31 and later