gpt4 book ai didi

airflow - Apache Airflow 和 AWS Glue 之间的连接问题

转载 作者:行者123 更新时间:2023-12-04 18:19:51 24 4
gpt4 key购买 nike

我在我的虚拟机 Apache Airflow 上本地启动,我想连接到 Amazon Glue 作业来运行它们。
我从拉取请求中得到的源代码:https://github.com/apache/incubator-airflow/pull/3504/files

那么我应该建立哪些连接(在 Airflow UI 中)来运行 Amazon Glue 作业?你能告诉我一些文件吗?因为我在官方文档中没有找到任何有用的东西。

对于 dag,我使用简单的代码:

from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.aws_glue_operator import AWSGlueJobOperator
def print_hello():
return 'Hello hello!'

dag = DAG('hello_world', description='Simple glue DAG',
schedule_interval='0 0 * * *',
start_date=datetime(2018, 6, 28), catchup=False)

awsGlueOperator = AWSGlueJobOperator(job_name='FIRST_JOB', script_location='https://s3.us-east-2.amazonaws.com/path-to-script',s3_bucket='https://s3.console.aws.amazon.com/s3/', iam_role_name='AWSGlueServiceRole', dag=dag)

hello_operator = PythonOperator(task_id='hello_task', python_callable=print_hello, dag=dag)

awsGlueOperator >> hello_operator

先感谢您。

最佳答案

看起来您正在使用的 GlueOperator 使用了 AWS Hook .跳转到源代码显示 aws 键等可以进入 extras field as a JSON object .
所以你可能只使用 Amazon Web Services连接类型并在那里填写适当的值。

这是它的外观(在具有修改颜色和字体的 UI 中):
enter image description here

关于airflow - Apache Airflow 和 AWS Glue 之间的连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51247712/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com