Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Introduction to Apache Airflow-Airflow简介

Introduction to Apache Airflow-Airflow简介

作者头像
DevOps云学堂
发布于 2022-12-29 09:07:29
发布于 2022-12-29 09:07:29
2.5K0
举报
文章被收录于专栏:DevOps持续集成DevOps持续集成

Introduction to Apache Airflow

What is Apache Airflow?

什么是Airflow?

  • Airflow is a platform to programmatically author, schedule and monitor workflows.These functions achieved with Directed Acyclic Graphs (DAG) of the tasks. It is an open-source and still in the incubator stage. It was initialized in 2014 under the umbrella of Airbnb since then it got an excellent reputation with approximately 800 contributors on GitHub and 13000 stars. The main functions of Apache Airflow is to schedule workflow, monitor and author.

Airflow是一个以编程方式创作、调度和监控工作流程的平台。这些功能是通过任务的有向无环图(DAG)实现的。它是一个开源的,仍处于孵化器阶段。它于2014年在Airbnb的保护伞下进行了初始化,从那时起,它在GitHub上获得了大约800贡献者13000颗星星的良好声誉。Apache Airflow 的主要功能是调度工作流程,监控和创作。

  • Apache airflow is a workflow (data-pipeline) management system developed by Airbnb. It is used by more than 200 companies such as Airbnb, Yahoo, PayPal, Intel, Stripe and many more.

Apache Airflow 是由Airbnb开发的工作流程(数据管道)管理系统。它被200多家公司使用,如Airbnb,雅虎,PayPal,英特尔,Stripe等等。

  • In this, everything revolves around workflow objects implemented as _directed acyclic graphs _(DAG). For example, such a workflow can involve the merging of multiple data sources and the subsequent execution of an analysis script. It takes care of scheduling the tasks while respecting their internal dependencies and orchestrates the systems involved.

在这方面,一切都围绕着作为有向无环图 (DAG) 实现的工作流对象。例如,此类工作流可能涉及多个数据源的合并以及分析脚本的后续执行。它负责调度任务,同时尊重其内部依赖关系,并编排所涉及的系统。

What is a Workflow?

什么是Workflow? Workflow is a sequence of tasks which is started on a schedule or triggered by an event .It is frequently used to handle big data processing pipelines. workflow是按计划启动或由事件触发的一系列任务。它经常用于处理大数据处理管道。

A typical workflow diagram

典型的工作流程图

  • There are total 5 phases in any workflow.

任何工作流中总共有 5 个阶段。

  • Firstly we download data from source

首先,我们从源头下载数据。

  • Then, send that data to somewhere else to process

然后,将该数据发送到其他地方进行处理

  • When the process is completed we get the result and report is generated which is sent by email.

该过程完成后,我们获得结果并生成报告,并通过电子邮件发送。

Working of Apache Airflow

Airflow 的工作原理

There are four main components that make up this robust and scalable workflow scheduling platform: 有四个主要组件组成了这个强大且可扩展的工作流调度平台:

  1. Scheduler: The scheduler monitors all DAGs and their associated tasks. It periodically checks active tasks to initiate.

调度(Scheduler):计划程序监视所有 DAG 及其关联的任务。它会定期检查要启动的活动任务

  1. Web server: The web server is Airflow’s user interface. It shows the status of jobs and allows the user to interact with the databases and read log files from remote file stores, like Google Cloud Storage, Microsoft Azure blobs, etc.

网页服务器(WebServer):Airflow的用户界面。它显示作业的状态,并允许用户与数据库交互并从远程文件存储(如谷歌云存储,微软Azure blob等)中读取日志文件

  1. Database: The state of the DAGs and their associated tasks are saved in the database to ensure the schedule remembers metadata information. Airflow uses SQLAlchemy and Object Relational Mapping (ORM) to connect to the metadata database. The scheduler examines all of the DAGs and stores pertinent information, like schedule intervals, statistics from each run, and task instances.

数据库(Database):DAG 及其关联任务的状态保存在数据库中,以确保计划记住元数据信息。 Airflow使用 SQLAlchemy和对象关系映射 (ORM) 连接到元数据数据库。调度程序检查所有 DAG 并存储相关信息,如计划间隔、每次运行的统计信息和任务实例。

  1. Executor: There are different types of executors to use for different use cases.Examples of executors:

执行者(Executer):有不同类型的执行器可用于不同的用例。执行器示例:

  • SequentialExecutor: This executor can run a single task at any given time. It cannot run tasks in parallel. It’s helpful in testing or debugging situations.

SequentialExecutor:此执行程序可以在任何给定时间运行单个任务。它不能并行运行任务。它在测试或调试情况下很有帮助。

  • LocalExecutor: This executor enables parallelism and hyperthreading. It’s great for running Airflow on a local machine or a single node.

LocalExecutor:此执行器启用并行性和超线程。它非常适合在本地计算机或单个节点上运行气流。

  • CeleryExecutor: This executor is the favored way to run a distributed Airflow cluster.

CeleryExecutor:此执行器是运行分布式Airflow集群的首选方式。

  • KubernetesExecutor: This executor calls the Kubernetes API to make temporary pods for each of the task instances to run.

KubernetesExecutor:此执行器调用 Kubernetes API 为每个要运行的任务实例创建临时 Pod。

So, how does Airflow work?

那么,Airflow是如何工作的呢? Airflow examines all the DAGs in the background at a certain period. Airflow在特定时间段内检查后台中的所有 DAG。 This period is set using the config and is equal to one second. 此时间段是使用配置设置的,等于一秒。 Task instances are instantiated for tasks that need to be performed, and their status is set to in the metadata database.processor_poll_intervalSCHEDULED 任务实例针对需要执行的任务进行实例化,其状态在元数据数据库中设置为。processor_poll_interval SCHEDULED The schedule queries the database, retrieves tasks in the state, and distributes them to the executors. 计划查询数据库,检索处于该状态的任务,并将其分发给执行程序。 Then, the state of the task changes to . 然后,任务的状态将更改。 Those queued tasks are drawn from the queue by workers who execute them. 这些排队的任务由执行它们的工作人员从队列中提取。 When this happens, the task status changes to .SCHEDULEDQUEUEDRUNNING 发生这种情况时,任务状态将更改为 。SCHEDULEDQUEUEDRUNNING When a task finishes, the worker will mark it as failed or finished, and then the scheduler updates the final status in the metadata database. 任务完成后,辅助角色会将其标记为_失败_或_已完成_,然后计划程序将更新元数据数据库中的最终状态。

Features(特征)

  • Easy to Use: If you have a bit of python knowledge, you are good to go and deploy on Airflow.

易于使用:如果你具备一点python知识,你会很高兴去部署Airflow。

  • Open Source: It is free and open-source with a lot of active users.

开源:它是免费的开源的,有很多活跃的用户。

  • Robust Integrations: It will give you ready to use operators so that you can work with Google Cloud Platform, Amazon AWS, Microsoft Azure, etc.

强大的集成:它将为您提供随时可用的运算符,以便您可以与谷歌云平台,亚马逊AWS,微软Azure等一起使用。

  • Use Standard Python to code: You can use python to create simple to complex workflows with complete flexibility.

使用标准 Python 编写代码:您可以使用 Python 创建简单到复杂的工作流,并具有完全的灵活性。

  • Amazing User Interface: You can monitor and manage your workflows. It will allow you to check the status of completed and ongoing tasks.

惊人的用户界面:您可以监视和管理工作流。它将允许您检查已完成和正在进行的任务的状态。

Principles (原则)

  • Dynamic: Airflow pipelines are configuration as code (Python), allowing for dynamic pipeline generation. This allows for writing code that instantiates pipelines dynamically.

动态:Airflow管道配置为代码 (Python),允许动态管道生成。这允许编写动态实例化管道的代码。

  • Extensible: Easily define your own operators, executors and extend the library so that it fits the level of abstraction that suits your environment.

可扩展:轻松定义您自己的运算符、执行器和扩展库,使其适合您环境的抽象级别。

  • Elegant: Airflow pipelines are lean and explicit.

优雅:Airflow 管道是精益和明确的。

  • Scalable: It has a modular architecture and uses a message queue to orchestrate an arbitrary number of workers. Airflow is ready to scale to infinity.

可扩展:它具有模块化架构,并使用消息队列来编排任意数量的工作者。Airflow已准备好扩展到无限远。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-10-15,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DevOps云学堂 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
你不可不知的任务调度神器-AirFlow
Airflow 是一个编排、调度和监控workflow的平台,由Airbnb开源,现在在Apache Software Foundation 孵化。AirFlow 将workflow编排为tasks组成的DAGs,调度器在一组workers上按照指定的依赖关系执行tasks。同时,Airflow 提供了丰富的命令行工具和简单易用的用户界面以便用户查看和操作,并且Airflow提供了监控和报警系统。
王知无-import_bigdata
2021/01/06
3.9K0
你不可不知的任务调度神器-AirFlow
助力工业物联网,工业大数据之服务域:AirFlow的架构组件【三十二】
示例:http://airflow.apache.org/docs/apache-airflow/stable/tutorial.html
Maynor
2023/08/16
4360
助力工业物联网,工业大数据之服务域:AirFlow的架构组件【三十二】
Apache Airflow的组件和常用术语
The many functions of Airflow are determined by the perfect interaction of its components. The architecture can vary depending on the application. It is thus possible to scale flexibly from a single machine to an entire cluster. The graphic shows a multi-node architecture with several machines. Airflow 的许多功能取决于其组件的完美相互作用。体系结构可因应用程序而异。因此,可以从单台机器灵活地扩展到整个集群。该图显示了具有多台计算机的多节点体系结构。
DevOps云学堂
2022/12/29
1.3K0
Apache Airflow的组件和常用术语
Python 实现定时任务的八种方案!
来源:https://www.biaodianfu.com/python-schedule.html
Python编程与实战
2021/10/12
34.3K0
大数据调度平台Airflow(二):Airflow架构及原理
Airflow我们可以构建Workflow工作流,工作流使用DAG有向无环图来表示,DAG指定了任务之间的关系,如下图:
Lansonli
2022/03/29
6.7K1
大数据调度平台Airflow(二):Airflow架构及原理
Apache Airflow单机/分布式环境搭建
Apache Airflow是一个提供基于DAG(有向无环图)来编排工作流的、可视化的分布式任务调度平台(也可单机),与Oozie、Azkaban等调度平台类似。Airflow在2014年由Airbnb发起,2016年3月进入Apache基金会,在2019年1月成为顶级项目。Airflow采用Python语言编写,并提供可编程方式定义DAG工作流(编写Python代码)。当工作流通过代码来定义时,它们变得更加可维护、可版本化、可测试和协作。
端碗吹水
2022/01/12
4.7K0
Apache Airflow单机/分布式环境搭建
Airflow速用
Airflow是Apache用python编写的,用到了 flask框架及相关插件,rabbitmq,celery等(windows不兼容);、
用户1558882
2019/10/31
5.7K0
八种用Python实现定时执行任务的方案,一定有你用得到的!
我们在日常工作中,常常会用到需要周期性执行的任务。 一种方式是采用 Linux 系统自带的 crond 结合命令行实现; 一种方式是直接使用Python; 于是我把常见的Python定时任务实现方法整理了一下,希望对大家有所帮助。
全栈程序员站长
2022/09/07
3K0
八种用Python实现定时执行任务的方案,一定有你用得到的!
Airflow 实践笔记-从入门到精通一
数据处理逻辑多,脚本相互依赖强,运维管理监测难,怎么办?!为了解决这些问题,最近比较深入研究Airflow的使用方法,重点参考了官方文档和Data Pipelines with Apache Airflow,特此笔记,跟大家分享共勉。
大数据技术架构
2022/06/14
5.8K0
Airflow 实践笔记-从入门到精通一
Apache AirFlow 入门
Airflow 于 2014 年 10 月由 Airbnb 的 Maxime Beauchemin 开始。它是第一次提交的开源,并在 2015 年 6 月宣布正式加入 Airbnb Github。
HLee
2021/06/04
2.8K0
Apache AirFlow 入门
Airflow配置和使用
Airflow能做什么 Airflow是一个工作流分配管理系统,通过有向非循环图的方式管理任务流程,设置任务依赖关系和时间调度。 Airflow独立于我们要运行的任务,只需要把任务的名字和运行方式提供给Airflow作为一个task就可以。 安装和使用 最简单安装 在Linux终端运行如下命令 (需要已安装好python2.x和pip): pip install airflow pip install "airflow[crypto, password]" 安装成功之后,执行下面三步,就可以使用了。默认是使
生信宝典
2018/02/05
14.1K0
Apache Airflow-编写第一个DAG
Apache Airflow: Write your first DAG in Apache Airflow
DevOps云学堂
2022/12/29
1.8K0
Apache Airflow-编写第一个DAG
airflow—执行器CeleryExecutor(3)
本文介绍了Airflow这个开源框架,用于构建、管理和执行工作流。Airflow基于Python开发,利用Django、Flask等后端框架提供的Web接口,支持各种任务调度和错误处理机制。通过使用Python的类、函数和钩子,用户可以自定义和管理自己的工作流。Airflow还提供了丰富的客户端API,可以方便地与其他工具集成。同时,Airflow支持多租户,每个租户有自己的DAG和Task。Airflow还支持通过Celery将Task分布到多个机器上运行,以支持大规模并发处理。此外,Airflow还有丰富的监控和报警功能,可以实时监控Task和DAG的运行状态,并支持邮件报警。总之,Airflow是一个强大、灵活、易用的工作流框架,在数据科学和大数据处理领域具有广泛应用。
刘远
2017/12/29
4.2K0
【 airflow 实战系列】 基于 python 的调度和监控工作流的平台
本文介绍了 Airflow 这款开源的 DAG 流程编排框架,从架构、原理、优点、使用场景、实现细节、扩展、ETL、数据依赖、资源依赖、任务依赖、安全、Hook、日志、任务定义、执行、调度、监控、运维、社区、文档等方面进行了详细的介绍。Airflow 旨在解决 Celery 和 Kubernetes 等工具无法解决的问题,通过实践证明了 DAG 流程编排的价值。Airflow 的架构设计巧妙,实现了分布式、高可用的 DAG 执行引擎。Airflow 使用 Python 实现,支持多种 DAG 定义格式,可与主流的分布式数据存储系统无缝集成。Airflow 还支持云原生技术,可以轻松地在 Kubernetes 上运行。通过本文的讲解,读者可以了解到 Airflow 的设计理念、架构、使用方式和实现细节,掌握如何在分布式环境下实现 DAG 流程编排。同时,本文还提供了实际案例,帮助读者更好地理解 Airflow 的使用方式。
刘远
2017/04/27
6.2K0
【 airflow 实战系列】 基于  python  的调度和监控工作流的平台
Apache Airflow:安装指南和基本命令
The more preferable approach to installing Apache-Airflow is to install it in a virtual environment. Airflow requires the latest version of PYTHON and PIP (package installer for python).
DevOps云学堂
2022/12/29
3K0
Apache Airflow:安装指南和基本命令
面试分享:Airflow工作流调度系统架构与使用指南
本篇博客将深入剖析Airflow的核心架构与使用方法,分享面试必备知识点,并通过代码示例进一步加深理解,助您在求职过程中得心应手地应对与Airflow相关的技术考察。
Jimaks
2024/04/13
4560
apache-airflow
Apache Airflow® 是一个开源平台,用于开发、安排和监控面向批处理的工作流。Airflow 的可扩展 Python 框架使您能够构建与几乎任何技术连接的工作流。Web 界面有助于管理工作流程的状态。Airflow 可以通过多种方式进行部署,从笔记本电脑上的单个进程到分布式设置,以支持最大的工作流程。
阿超
2024/10/03
4170
apache-airflow
面向DataOps:为Apache Airflow DAG 构建 CI/CD管道
使用 GitHub Actions 构建有效的 CI/CD 管道以测试您的 Apache Airflow DAG 并将其部署到 Amazon MWAA
DevOps云学堂
2022/10/04
3.4K0
面向DataOps:为Apache Airflow DAG 构建 CI/CD管道
如何部署一个健壮的 apache-airflow 调度系统
介绍了如何安装、配置、及使用,本文介绍如何如何部署一个健壮的 apache-airflow 调度系统 - 集群部署。
somenzz
2020/12/10
6.4K0
如何部署一个健壮的 apache-airflow 调度系统
没看过这篇文章,别说你会用Airflow
Airflow 作为一款开源分布式任务调度框架,已经在业内广泛应用。本文总结了 Freewheel Transformer 团队近两年使用 Airflow 作为调度器,编排各种批处理场景下 ETL Data Pipelines 的经验,希望能为正在探索 Airflow 的技术团队提供一些参考价值。
深度学习与Python
2021/06/08
1.7K0
没看过这篇文章,别说你会用Airflow
相关推荐
你不可不知的任务调度神器-AirFlow
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档