You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: community/examples/gke-tpu-v6/README.md
+75-10Lines changed: 75 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,10 +92,11 @@ This section guides you through the cluster creation process, ensuring that your
92
92
93
93
## Advanced Blueprint: GKE TPU with GCS Integration
94
94
95
-
This repository also includes an advanced blueprint, `gke-tpu-v6-gcs.yaml`, designed for production-ready workloads. It builds on the basic blueprint by adding several key features:
95
+
This repository also includes an advanced blueprint, `gke-tpu-v6-advanced.yaml`, designed for production-ready workloads. It builds on the basic blueprint by adding several key features:
96
96
***Dedicated Service Accounts**for nodes and workloads, following security best practices.
97
97
***Automatic creation of two GCS buckets**for training data and checkpoints.
98
98
***Performance-tuned GCS FUSE mounts** pre-configured in the cluster as Persistent Volumes.
99
+
***Optional High-Performance Storage: [Managed Lustre](https://cloud.google.com/managed-lustre/docs/overview)**for high-performance, fully managed parallel file system optimized for heavy AI and HPC workloads. For details of configuring Managed Lustre, please refer to the [appendix](#understanding-managed-lustre-integration)
99
100
100
101
### Deploying the Advanced Blueprint
101
102
@@ -114,14 +115,6 @@ The process is nearly identical to the basic deployment.
114
115
115
116
1. After deployment, the blueprint will output instructions for running a fio benchmark job. This job serves as a validation test to confirm that the GCS mounts are working correctly for both reading and writing. Follow the printed instructions to run the test.
116
117
117
-
### Understanding the GCS Integration
118
-
119
-
The advanced blueprint provisions several key technologies to create a robust data pipeline for your TPU workloads. Here are some resources to understand how they work together:
120
-
* [Cloud Storage Overview](https://cloud.google.com/storage/docs/introduction#quickstarts): Start here to understand what Cloud Storage buckets are and their role in storing large-scale data.
121
-
* [Cloud TPU Storage Options](https://cloud.google.com/tpu/docs/storage-options): Learn about the recommended storage patterns for Cloud TPUs, including why GCS FUSE is a best practice for providing training data.
122
-
* [Access GCS Buckets with the GCS FUSE CSI Driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver): This is the core technical guide explaining how GKE mounts GCS buckets into your pods, which this blueprint automates.
123
-
* [Configure Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity): Read this to understand the secure, recommended method for GKE applications to access Google Cloud services like GCS, which this blueprint configures for you.
124
-
125
118
## Run the sample job
126
119
127
120
The [tpu-available-chips.yaml](https://github.com/GoogleCloudPlatform/cluster-toolkit/blob/main/community/examples/gke-tpu-v6/tpu-available-chips.yaml) file creates a service and a job resource in kubernetes. It is based on https://cloud.google.com/kubernetes-engine/docs/how-to/tpus#tpu-chips-node-pool. The workload returns the number of TPU chips across all of the nodes in a multi-host TPU slice.
@@ -180,6 +173,78 @@ To avoid recurring charges for the resources used on this page, clean up the res
The advanced blueprint provisions several key technologies to create a robust data pipeline for your TPU workloads. Here are some resources to understand how they work together:
185
+
* [Cloud Storage Overview](https://cloud.google.com/storage/docs/introduction#quickstarts): Start here to understand what Cloud Storage buckets are and their role in storing large-scale data.
186
+
* [Cloud TPU Storage Options](https://cloud.google.com/tpu/docs/storage-options): Learn about the recommended storage patterns for Cloud TPUs, including why GCS FUSE is a best practice for providing training data.
187
+
* [Access GCS Buckets with the GCS FUSE CSI Driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver): This is the core technical guide explaining how GKE mounts GCS buckets into your pods, which this blueprint automates.
188
+
* [Configure Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity): Read this to understand the secure, recommended method for GKE applications to access Google Cloud services like GCS, which this blueprint configures for you.
189
+
190
+
### Understanding Managed Lustre integration
191
+
The advanced blueprint `gke-tpu-v6-advanced.yaml` can also be configured to deploy a Managed Lustre filesystem. Google Cloud **Managed Lustre** delivers a high-performance, fully managed parallel file system optimized for AI and HPC applications. With multi-petabyte-scale capacity and up to 1 TBps throughput, [Managed Lustre](https://cloud.google.com/architecture/optimize-ai-ml-workloads-managed-lustre) facilitates the migration of demanding workloads to the cloud.
192
+
193
+
#### Enabling Managed Lustre
194
+
To enable Managed Lustre, you must make these changes before deploying:
195
+
196
+
1. In the `gke-tpu-v6-advanced.yaml`:
197
+
Find the **vars:** section and **uncomment** the Managed Lustre variables. The defaults provide a high-performance **36000GiB** (~35.16TiB) filesystem with **18 GB/s** of throughput.
198
+
199
+
2. In the `gke-tpu-v6-advanced.yaml`:
200
+
Find the section commented # --- MANAGED LUSTRE ADDITIONS ---. **Uncomment** the entire block of four modules: `private_service_access`, `lustre_firewall_rule`, `managed-lustre`, and `lustre-pv`.
201
+
202
+
After making these changes, run the `gcluster deploy`command as usual.
203
+
204
+
#### Using Managed Lustre in a Pod
205
+
Once deployed, the `Lustre` filesystem is available to the cluster as a `Persistent Volume (PV)`. To use it in your workloads, you need to create a `Persistent Volume Claim (PVC)` and mount it in your pod.
206
+
207
+
#### Testing the Lustre Mount
208
+
209
+
1. Create a file named `lustre-claim-pod.yaml`:
210
+
211
+
```yaml
212
+
apiVersion: v1
213
+
kind: PersistentVolumeClaim
214
+
metadata:
215
+
name: my-lustre-claim
216
+
spec:
217
+
accessModes:
218
+
- ReadWriteMany
219
+
# storageClassName must be empty to bind to the manually created PV
220
+
storageClassName: ""
221
+
resources:
222
+
requests:
223
+
# This size must match lustre_size_gib from your variables
224
+
storage: 36000Gi
225
+
---
226
+
apiVersion: v1
227
+
kind: Pod
228
+
metadata:
229
+
name: lustre-test-pod
230
+
spec:
231
+
containers:
232
+
- name: test-container
233
+
image: ubuntu:22.04
234
+
command: ["/bin/sleep", "infinity"]
235
+
volumeMounts:
236
+
- name: lustre-storage
237
+
mountPath: /mnt/lustre
238
+
volumes:
239
+
- name: lustre-storage
240
+
persistentVolumeClaim:
241
+
claimName: my-lustre-claim
242
+
```
243
+
244
+
2. Apply the manifest to your cluster:
245
+
246
+
```yaml
247
+
kubectl apply -f lustre-claim-pod.yaml
248
+
```
249
+
250
+
The pod will start, and the Managed Lustre filesystem will be available inside the container at `/mnt/lustre`.
0 commit comments