Airflow 运行 dataproc 作业,代码位于 git 存储库中

Airflow run dataproc job with code that sits in git repository

我正在查看 documentation of the DataProcPySparkOperator 以了解将 pyspark 作业的代码文件和依赖文件 (pyfiles) 发送到哪里。据我了解,我应该使用 "main" 和 "pyfiles" 参数。 但不清楚这些文件应该存在于何处。我可以给 git 一个 link 然后他们会从那里被拿走,还是我应该使用 Google 云存储(在我的情况下我在 Google 云上)? 还是我自己处理文件的副本,然后提供一个link给主存储?

您需要在main中传递它。它可以是本地 python 文件或 GCS 上的文件,两者都受支持。如果文件是本地文件,Airflow 会将其上传到 GCS 并将该路径传递给 Dataproc API.