@@ -844,6 +844,66 @@ def operate_pod(
844844 return pod_name
845845
846846
847+ @task
848+ def suspended_jobset (node_pool : node_pool_info , jobset_config : JobSet ):
849+ """
850+ Suspend a jobset from the GKE cluster.
851+
852+ This task executes a bash script to:
853+ 1. Authenticate `gcloud` with the specified GKE cluster.
854+ 2. Suspend a JobSet.
855+
856+ Args:
857+ node_pool: Configuration object with cluster details.
858+ jobset_name: The name of the JobSet to delete.
859+ """
860+
861+ with tempfile .NamedTemporaryFile () as temp_config_file :
862+ env = os .environ .copy ()
863+ env ["KUBECONFIG" ] = temp_config_file .name
864+
865+ cmd = " && " .join ([
866+ Command .get_credentials_command (node_pool ),
867+ Command .k8s_suspend_jobset_command (
868+ temp_config_file .name ,
869+ jobset_config .jobset_name ,
870+ jobset_config .namespace ,
871+ ),
872+ ])
873+
874+ subprocess .run_exec (cmd , env = env )
875+
876+
877+ @task
878+ def resume_jobset (node_pool : node_pool_info , jobset_config : JobSet ):
879+ """
880+ Resume a jobset from the GKE cluster.
881+
882+ This task executes a bash script to:
883+ 1. Authenticate `gcloud` with the specified GKE cluster.
884+ 2. Resume a JobSet.
885+
886+ Args:
887+ node_pool: Configuration object with cluster details.
888+ jobset_name: The name of the JobSet to delete.
889+ """
890+
891+ with tempfile .NamedTemporaryFile () as temp_config_file :
892+ env = os .environ .copy ()
893+ env ["KUBECONFIG" ] = temp_config_file .name
894+
895+ cmd = " && " .join ([
896+ Command .get_credentials_command (node_pool ),
897+ Command .k8s_resume_jobset_command (
898+ temp_config_file .name ,
899+ jobset_config .jobset_name ,
900+ jobset_config .namespace ,
901+ ),
902+ ])
903+
904+ subprocess .run_exec (cmd , env = env )
905+
906+
847907@task .sensor (poke_interval = 30 , timeout = 900 , mode = "poke" )
848908def wait_for_jobset_started (
849909 node_pool : node_pool_info ,
0 commit comments