Skip to content

Commit 533eb9b

Browse files
committed
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 779647c commit 533eb9b

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
@@ -889,10 +889,12 @@ def validate_jobset_replica_number(
889889
node_pool: node_pool_info,
890890
jobset_config: JobSet,
891891
replica_type: str,
892-
correct_replica_num: int,
892+
pre_startup: bool,
893893
):
894894
name = jobset_config.replicated_job_name
895895
found_replica_number = get_replica_num(
896896
replica_type=replica_type, job_name=name, node_pool=node_pool
897897
)
898-
return found_replica_number == correct_replica_num
898+
if pre_startup:
899+
return found_replica_number == 0
900+
return found_replica_number == jobset_config.replicas

0 commit comments

Comments
 (0)