forked from GoogleCloudPlatform/ai-on-gke
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for PS dlio and PS dataloader (GoogleCloudPlatform#256)
- Loading branch information
Showing
12 changed files
with
375 additions
and
9 deletions.
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/dataloader_job.tpl
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,41 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: data-loader-job | ||
namespace: ${namespace} | ||
spec: | ||
backoffLimit: 0 | ||
template: | ||
metadata: | ||
name: data-loader-job | ||
annotations: | ||
gke-parallelstore/volumes: "true" | ||
gke-parallelstore/cpu-limit: 5 | ||
gke-parallelstore/memory-limit: 5Gi | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: data-loader | ||
image: google/cloud-sdk:latest | ||
env: | ||
- name: BUCKET_NAME | ||
value: ${gcs_bucket} | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- gsutil -m cp -R gs://$BUCKET_NAME/* /disk/; | ||
resources: | ||
limits: | ||
cpu: "10" | ||
memory: 20Gi | ||
requests: | ||
cpu: "10" | ||
memory: 20Gi | ||
volumeMounts: | ||
- name: ml-perf-volume | ||
mountPath: /disk | ||
serviceAccountName: ${service_account} | ||
volumes: | ||
- name: ml-perf-volume | ||
persistentVolumeClaim: | ||
claimName: ${pvc_name} |
18 changes: 18 additions & 0 deletions
18
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/ps_pv.tpl
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,18 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: ${pv_name} | ||
spec: | ||
storageClassName: "" | ||
capacity: | ||
storage: 12Ti | ||
accessModes: | ||
- ReadWriteMany | ||
persistentVolumeReclaimPolicy: Retain | ||
volumeMode: Filesystem | ||
csi: | ||
driver: parallelstore.csi.storage.gke.io | ||
volumeHandle: ${project}/${ps_location}/${ps_instance_name}/default-pool/default-container | ||
volumeAttributes: | ||
ip: "${ps_ip_address_1}, ${ps_ip_address_2}, ${ps_ip_address_3}" | ||
network: ${ps_network_name} |
62 changes: 62 additions & 0 deletions
62
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/ps_pv_pvc.tf
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,62 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
resource "local_file" "ps_pv" { | ||
content = templatefile("${path.module}/ps_pv.tpl", { | ||
pv_name = "${var.pv_name}" | ||
pvc_name = "${var.pvc_name}" | ||
project = "${var.project}" | ||
ps_location = "${var.location}" | ||
ps_instance_name = "${var.ps_instance_name}" | ||
ps_ip_address_1 = "${var.ps_ip_address_1}" | ||
ps_ip_address_2 = "${var.ps_ip_address_2}" | ||
ps_ip_address_3 = "${var.ps_ip_address_3}" | ||
ps_network_name = "${var.ps_network_name}" | ||
}) | ||
filename = "${path.module}/pv-spec-rendered.yaml" | ||
} | ||
|
||
resource "kubectl_manifest" "ps_pv" { | ||
count = var.storageclass == "" ? 1 : 0 | ||
yaml_body = resource.local_file.ps_pv.content | ||
} | ||
|
||
resource "local_file" "ps_pvc" { | ||
content = templatefile("${path.module}/ps_pvc.tpl", { | ||
pv_name = var.storageclass == "" ? "${var.pv_name}" : "" | ||
namespace = "${var.namespace}" | ||
pvc_name = "${var.pvc_name}" | ||
storageclass = "${var.storageclass}" | ||
}) | ||
filename = "${path.module}/pvc-spec-rendered.yaml" | ||
} | ||
|
||
resource "kubectl_manifest" "ps_pvc" { | ||
yaml_body = resource.local_file.ps_pvc.content | ||
} | ||
|
||
resource "local_file" "dataloader" { | ||
content = templatefile("${path.module}/dataloader_job.tpl", { | ||
namespace = "${var.namespace}" | ||
pvc_name = "${var.pvc_name}" | ||
gcs_bucket = "${var.gcs_bucket}" | ||
service_account = "${var.k8s_service_account}" | ||
}) | ||
filename = "${path.module}/dataloader-job-rendered.yaml" | ||
} | ||
|
||
resource "kubectl_manifest" "dataloader" { | ||
count = var.run_parallelstore_data_loader == "\"true\"" ? 1 : 0 | ||
yaml_body = resource.local_file.dataloader.content | ||
} |
13 changes: 13 additions & 0 deletions
13
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/ps_pvc.tpl
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,13 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: ${pvc_name} | ||
namespace: ${namespace} | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
storageClassName: ${storageclass} | ||
volumeName: ${pv_name} | ||
resources: | ||
requests: | ||
storage: 12000Gi |
76 changes: 76 additions & 0 deletions
76
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/variables.tf
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,76 @@ | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
variable "gcs_bucket" { | ||
type = string | ||
description = "GCS Bucket name" | ||
} | ||
|
||
// pv, pvc | ||
variable "pv_name" { | ||
type = string | ||
description = "Name of the PersistentVolume used for DLIO dataset" | ||
} | ||
|
||
variable "pvc_name" { | ||
type = string | ||
description = "Name of the PersistentVolumeClaim used for DLIO dataset" | ||
} | ||
|
||
variable "storageclass" { | ||
type = string | ||
description = "Name of the storageclass" | ||
} | ||
|
||
variable "project" { | ||
type = string | ||
description = "The project name in which the Parallelstore instance is provisioned" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
} | ||
|
||
variable "ps_instance_name" { | ||
type = string | ||
} | ||
|
||
variable "ps_ip_address_1" { | ||
type = string | ||
} | ||
|
||
variable "ps_ip_address_2" { | ||
type = string | ||
} | ||
|
||
variable "ps_ip_address_3" { | ||
type = string | ||
} | ||
|
||
variable "ps_network_name" { | ||
type = string | ||
} | ||
|
||
variable "k8s_service_account" { | ||
type = string | ||
description = "Kubernetes service account name as in the Configure access to Cloud Storage buckets using GKE Workload Identity step" | ||
} | ||
|
||
variable "run_parallelstore_data_loader" { | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
type = string | ||
} |
30 changes: 30 additions & 0 deletions
30
benchmarks/benchmark/tools/dlio/modules/parallelstore_storage/versions.tf
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,30 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
terraform { | ||
required_providers { | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = "~> 2.8.0" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = "2.18.1" | ||
} | ||
kubectl = { | ||
source = "alekc/kubectl" | ||
version = "2.0.1" | ||
} | ||
} | ||
} |
Oops, something went wrong.