Skip to content

Commit e8a99b3

Browse files
authored
fix to the expected json format (GoogleCloudPlatform#1060)
1 parent 8a98414 commit e8a99b3

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

xlml/apis/task.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ def run(self) -> DAGNode:
979979

980980
gke_run = gke.run_job.override(group_id="run_model")(
981981
job_body,
982+
self.task_test_config,
982983
self.task_gcp_config,
983984
self.cluster_name,
984985
self.job_create_timeout,

xlml/utils/gke.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from google.cloud import container_v1
1313
import kubernetes
1414

15-
from xlml.apis import gcp_config
15+
from xlml.apis import gcp_config, test_config
1616
from xlml.utils import composer
1717

1818
"""Utilities for GKE."""
@@ -55,6 +55,7 @@ def get_authenticated_client(
5555
def run_job(
5656
body: Dict[str, Any],
5757
gcp: gcp_config.GCPConfig,
58+
gke_test_config: test_config.GpuGkeTest,
5859
cluster_name: str,
5960
job_create_timeout: datetime.timedelta,
6061
gcs_location: str = '',
@@ -64,6 +65,7 @@ def run_job(
6465
Args:
6566
body: Dict that defines a Kubernetes `Job`.
6667
gcp: GCP config with the project name and zone of the GKE cluster.
68+
gke_test_config: Test config with the accelerator information of the GKE cluster
6769
cluster_name: Name of the GCP cluster.
6870
job_create_timeout: Amount of time to wait for all pods to become active.
6971
"""
@@ -72,12 +74,13 @@ def run_job(
7274
def deploy_job(gcs_location):
7375
# Log required info for XLML PLX Dashboard
7476
composer.log_metadata_for_xlml_dashboard({
75-
'project_name': gcp.project_name,
77+
'cluster_project': gcp.project_name,
7678
'zone': gcp.zone,
7779
'dataset_name': gcp.dataset_name.value,
7880
'composer_project': gcp.composer_project,
7981
'dataset_project': gcp.dataset_project,
8082
'cluster_name': cluster_name,
83+
'accelerator_type': gke_test_config.accelerator.machine_type,
8184
})
8285

8386
body['spec']['template']['spec']['containers'][0]['env'].append(

xlml/utils/gpu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def create_resource_request(
319319
# Log required info for XLML PLX Dashboard
320320
composer.log_metadata_for_xlml_dashboard({
321321
"instance_name": instance_name,
322-
"project_name": gcp.project_name,
322+
"cluster_project": gcp.project_name,
323323
"zone": gcp.zone,
324324
"dataset_name": gcp.dataset_name.value,
325325
"composer_project": gcp.composer_project,
@@ -331,6 +331,7 @@ def create_resource_request(
331331
"machine_type": accelerator.machine_type,
332332
"image_family": accelerator.image_family,
333333
},
334+
"accelerator_type": accelerator.machine_type,
334335
})
335336

336337
machine_type = accelerator.machine_type

xlml/utils/tpu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def create_queued_resource_request(
8686
# Log required info for XLML PLX Dashboard
8787
composer.log_metadata_for_xlml_dashboard({
8888
'instance_name': tpu_name,
89-
'project_name': gcp.project_name,
89+
'cluster_project': gcp.project_name,
9090
'zone': gcp.zone,
9191
'dataset_name': gcp.dataset_name.value,
9292
'composer_project': gcp.composer_project,
@@ -97,6 +97,7 @@ def create_queued_resource_request(
9797
'runtime_version': task_test_config.accelerator.runtime_version,
9898
'version': task_test_config.accelerator.version.value,
9999
},
100+
'accelerator_type': task_test_config.accelerator.name,
100101
})
101102

102103
creds, _ = google.auth.default()

0 commit comments

Comments
 (0)