Skip to content

Commit 522f718

Browse files
QuinnMMcGarrychiajunglien
authored andcommitted
Change the "validate_jobset_replica_number" function to work using the
new jobset storage method. Since "jobset_confifg.replicas" cannot be accessed in DAG itself.
1 parent 9d16301 commit 522f718

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

dags/tpu_observability/jobset_healthiness_ready.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def generate_second_node_pool_name(
139139
node_pool=cluster_info,
140140
jobset_config=jobset_config,
141141
replica_type="ready",
142-
correct_replica_num=0,
142+
pre_startup=True,
143143
)
144144

145145
start_workload = jobset.run_workload(
@@ -152,7 +152,7 @@ def generate_second_node_pool_name(
152152
node_pool=cluster_info,
153153
jobset_config=jobset_config,
154154
replica_type="ready",
155-
correct_replica_num=jobset_config.replicas,
155+
pre_startup=False,
156156
)
157157

158158
cleanup_workload = jobset.end_workload.override(

dags/tpu_observability/utils/jobset_util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,10 +957,12 @@ def validate_jobset_replica_number(
957957
node_pool: node_pool_info,
958958
jobset_config: JobSet,
959959
replica_type: str,
960-
correct_replica_num: int,
960+
pre_startup: bool,
961961
):
962962
name = jobset_config.replicated_job_name
963963
found_replica_number = get_replica_num(
964964
replica_type=replica_type, job_name=name, node_pool=node_pool
965965
)
966-
return found_replica_number == correct_replica_num
966+
if pre_startup:
967+
return found_replica_number == 0
968+
return found_replica_number == jobset_config.replicas

0 commit comments

Comments
 (0)