[英]airflow operator to use gcloud beta dataproc commands
Does anyone know if it exists an Airflow operator that could do what do the gcloud beta commands?有谁知道它是否存在可以执行 gcloud beta 命令的 Airflow 操作员? I'm trying to launch a Spark job on a GKE cluster.
我正在尝试在 GKE 集群上启动 Spark 作业。 The gcloud beta commands works, but it is not the case using
DataprocSparkOperator
. gcloud beta 命令有效,但使用
DataprocSparkOperator
时并非如此。
With this operator, the job keeps turning but the driver pod is not instantiated, but it works doing the gcloud command referenced here: https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke有了这个操作员,工作一直在进行,但驱动程序 pod 没有被实例化,但是它可以执行这里引用的 gcloud 命令: https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke
To be completely honest, I believe that Airflow is not intended to run gcloud
commands.老实说,我认为 Airflow 不是用来运行
gcloud
命令的。 If there is no operator, that you can use it's better to use Google API in conduction with PythonOperator
.如果没有运营商,你可以使用它更好地使用谷歌 API 与
PythonOperator
一起进行。
If you really want to use gcloud
commands, you'll need to install gcloud
SDK in your Airflow instance: https://cloud.google.com/sdk/docs/downloads-interactive#silent .如果你真的想使用
gcloud
命令,你需要在你的 Airflow 实例中安装gcloud
SDK: https://cloud.google.com/sdk/docs/downloads-interactive#silent 。 It's quite heavy, so if you have Airflow as a Service it will take longer to deploy it.它非常重,所以如果你有 Airflow 作为服务,部署它需要更长的时间。
After all you'll need to authorize - there is service-account
way which might be optimal for you: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account .毕竟您需要授权 -
service-account
方式可能最适合您: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account 。
You'll have to put service-account
in some safe place, eg HDFS
(if you have a cluster).您必须将
service-account
地方,例如HDFS
(如果您有集群)。 For local purposes it can be stored locally.出于本地目的,它可以存储在本地。
If you're done with authorization just use BashOperator
to do what you want - you have gcloud
in your Airflow installed.如果你完成了授权,只需使用
BashOperator
来做你想做的事——你的gcloud
中安装了 gcloud。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.