我在虚拟机Apache Airflow上本地启动,我想连接到Amazon Glue作业以运行它们。我从pull-request获取的源代码: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
Run Code Online (Sandbox Code Playgroud)
先感谢您。
我在从代码下载所有 Airflow 变量时遇到问题。
有机会从 UI 导出,但我还没有找到任何以编程方式进行导出的方法。
我发现了唯一Variable.get('variable_name')返回一个 Airflow 变量的方法。没有获取气流变量列表的变体。
在源代码中搜索也没有帮助。你知道一些简单的方法吗?
先感谢您。