pankajastro commented on code in PR #37477:
URL: https://github.com/apache/airflow/pull/37477#discussion_r1524832344
##########
airflow/providers/google/cloud/operators/kubernetes_engine.py:
##########
@@ -898,3 +898,36 @@ def execute(self, context: Context):
).fetch_cluster_info()
return super().execute(context)
+
+
+class GKEStartKueueJobOperator(GKEStartJobOperator):
+ """
+ Executes a Kubernetes Job in Kueue in the specified Google Kubernetes
Engine cluster.
+
+ :param queue_name: The name of the Queue in the cluster
+ """
+
+ def __init__(
+ self,
+ *,
+ queue_name: str,
+ **kwargs,
+ ) -> None:
+ super().__init__(**kwargs)
+ self.queue_name = queue_name
+
+ if self.suspend is False:
+ raise AirflowException(
+ "The `suspend` parameter can't be False. If you want to use
Kueue for running Job"
+ " in a Kubernetes cluster, set the `suspend` parameter to
True.",
+ )
+ elif self.suspend is None:
+ warnings.warn(
+ f"You have not set parameter `suspend` in class
{self.__class__.__name__}. "
+ "For running a Job in Kueue the `suspend` parameter should set
to True.",
+ AirflowProviderDeprecationWarning,
+ stacklevel=2,
+ )
Review Comment:
looks good. I just like less code :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]