简体   繁体   English

如何通过气流在 s3 中运行 python 脚本

[英]How can I run a python script in s3 via airflow

We usually store our code in s3 and call it from airflow to add them as new steps in emr.我们通常将我们的代码存储在 s3 中,并从气流中调用它以将它们添加为 emr 中的新步骤。 spark-submit can read data from s3 (like jars and files). spark-submit 可以从 s3 读取数据(如 jars 和文件)。 But how can i call a python script that is present in s3 from airflow?但是如何从气流中调用 s3 中存在的 python 脚本? It is a simple boto3 script.这是一个简单的 boto3 脚本。 Please provide me some guidance.请给我一些指导。

I would think that its a round about way of actually running an emr job via ariflow.我认为这是通过 ariflow 实际运行 emr 作业的一种方式。 Why would you even need to add steps.Your easiest option would be to use the ssh operator that connects to emr and then do a spark-submit via the ssh operator.为什么您甚至需要添加步骤。最简单的选择是使用连接到 emr 的 ssh 运算符,然后通过 ssh 运算符执行 spark-submit。 spark-submit will get your code from s3 and and then run the jobs. spark-submit 将从 s3 获取您的代码,然后运行作业。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM