|
28 | 28 | from airflow import models |
29 | 29 | from airflow.decorators import task |
30 | 30 | from airflow.exceptions import AirflowFailException |
| 31 | +from airflow.models.baseoperator import chain |
31 | 32 | from airflow.utils.task_group import TaskGroup |
32 | 33 | from airflow.utils.trigger_rule import TriggerRule |
33 | 34 |
|
@@ -350,7 +351,10 @@ def generate_second_node_pool_name( |
350 | 351 | tpu_accelerator_type="tpu-v6e-slice", |
351 | 352 | tpu_topology="4x4", |
352 | 353 | container_name="jax-tpu-worker", |
353 | | - image="asia-northeast1-docker.pkg.dev/cienet-cmcs/yuna-docker/tpu-info:v0.5.1", |
| 354 | + image=( |
| 355 | + "asia-northeast1-docker.pkg.dev/cienet-cmcs/yuna-docker/" |
| 356 | + "tpu-info:v0.5.1" |
| 357 | + ), |
354 | 358 | tpu_cores_per_pod=4, |
355 | 359 | ) |
356 | 360 |
|
@@ -494,32 +498,30 @@ def generate_second_node_pool_name( |
494 | 498 | setups=create_node_pool, |
495 | 499 | ) |
496 | 500 |
|
497 | | - # Airflow uses >> for task chaining, which is pointless for pylint. |
498 | | - # pylint: disable=pointless-statement |
499 | | - ( |
500 | | - verify_table_amount_task |
501 | | - >> [ |
| 501 | + chain( |
| 502 | + verify_table_amount_task, |
| 503 | + [ |
502 | 504 | validate_tpu_chips_metric, |
503 | 505 | validate_runtime_metric, |
504 | 506 | validate_tensorcore_metric, |
505 | 507 | validate_latency_metric, |
506 | | - ] |
| 508 | + ], |
507 | 509 | ) |
508 | 510 |
|
509 | 511 | [create_first_node_pool, create_second_node_pool] |
510 | | - (cleanup_first_node_pool >> cleanup_second_node_pool) |
511 | 512 |
|
512 | | - ( |
513 | | - cluster_info |
514 | | - >> cluster_info_2 |
515 | | - >> create_node_pool |
516 | | - >> apply_time |
517 | | - >> pod_names |
518 | | - >> wait_for_job_start |
519 | | - >> outputs_of_tpu_info |
520 | | - >> output_of_tpu_info |
521 | | - >> verification_group |
522 | | - >> clean_up_workload |
523 | | - >> cleanup_node_pool |
| 513 | + chain(cleanup_first_node_pool, cleanup_second_node_pool) |
| 514 | + |
| 515 | + chain( |
| 516 | + cluster_info, |
| 517 | + cluster_info_2, |
| 518 | + create_node_pool, |
| 519 | + apply_time, |
| 520 | + pod_names, |
| 521 | + wait_for_job_start, |
| 522 | + outputs_of_tpu_info, |
| 523 | + output_of_tpu_info, |
| 524 | + verification_group, |
| 525 | + clean_up_workload, |
| 526 | + cleanup_node_pool, |
524 | 527 | ) |
525 | | - # pylint: enable=pointless-statement |
|
0 commit comments