包附加功能参考¶
Airflow 分发包¶
在 Airflow 3 中,Airflow 现在在已有的 providers
之上被分割成几个独立且隔离的分发包,并且依赖项在这些分发包之间被隔离和简化。
虽然通过 apache-airflow
分发包和附加功能进行的原始安装方法仍然像以前一样工作,并且它会安装完整的 Airflow,可作为调度器、Web 服务器、触发器和工作节点,但现在 apache-airflow
包是一个元包,它会安装所有其他分发包,同时也可以只安装运行 Airflow 特定组件所需的分发包。
提供以下分发包
分发包 |
用途 |
可选附加功能 |
apache-airflow-core |
这是核心分发包,包含 Airflow 调度器、Web 服务器、触发器的代码。 |
|
apache-airflow-task-sdk |
这是在工作节点中运行任务所需的分发包。 |
|
apache-airflow-providers-* |
这些分发包包含 Airflow 与外部系统、第三方软件和服务的集成。通常它们提供 operators、hooks、sensors、triggers,但也提供不同类型的扩展,如日志处理器、执行器以及其他与特定服务或系统相关的功能。 |
|
apache-airflow |
这是一个元分发包,它会安装(强制的):
|
这与 Airflow 2 中的先前安装方法向后兼容。 组附加功能
|
如上所述,Airflow 有许多可选的“附加功能(extras)”,您可以在安装 Airflow 时使用它们来为您的安装添加功能。这些附加功能是用户管理其安装的好方法,对于 Airflow 的贡献者来说也很有用,当他们想通过 providers 贡献一些功能(包括 Airflow 的可选集成)时。
以下是 Apache Airflow 的所有额外依赖项列表。
核心 Airflow 附加功能¶
这些是核心 Airflow 附加功能,用于扩展核心 Airflow 的能力。它们通常不安装 provider 包(除了 celery
和 cncf.kubernetes
附加功能),它们只安装所需包的必要 Python 依赖项。
附加功能 (extra) |
安装命令 |
启用功能 |
---|---|---|
aiobotocore |
|
支持 Amazon 集成的异步(可延迟)operator |
async |
|
Gunicorn 的异步工作节点类 |
github-enterprise |
|
GitHub Enterprise 认证后端 |
google-auth |
|
Google 认证后端 |
graphviz |
|
用于将 DAG 转换为图形输出的 Graphviz 渲染器 |
kerberos |
|
Kerberos 集成,用于支持 Kerberos 的服务(Hadoop, Presto, Trino) |
ldap |
|
用于用户 LDAP 认证 |
leveldb |
|
Google provider 中使用 leveldb extra 所需 |
otel |
|
OpenTelemetry 指标所需 |
pandas |
|
安装与 Airflow 兼容的 Pandas 库 |
rabbitmq |
|
支持 RabbitMQ 作为 Celery 后端 |
sentry |
|
用于应用程序日志和监控的 Sentry 服务 |
s3fs |
|
支持 S3 作为 Airflow 文件系统 |
saml |
|
支持 Airflow 中的 SAML 认证 |
standard |
|
标准 hooks 和 operators |
statsd |
|
StatsD 指标所需 |
uv |
|
安装 uv - 基于 Rust 的快速包安装器(实验性) |
cloudpickle |
|
Cloudpickle hooks 和 operators |
Provider 附加功能¶
这些 provider 附加功能只是方便安装 provider 的额外项,这样您就可以通过简单命令安装 provider - 包括 provider 包和必要的依赖项,都在一个命令中完成,这让 PIP 能够解决任何冲突的依赖项。
这对于首次安装非常有用,您希望重复地安装对 Airflow 和已安装 providers 都“有效”的依赖项版本。
apache-airflow
apache-airflow-core
apache-airflow-task-sdk
例如,以下命令将安装
apache-airflow-providers-amazon
apache-airflow-providers-google
apache-airflow-providers-apache-spark
pip install apache-airflow[google,amazon,apache-spark]==3.0.0 \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.0.0/constraints-3.9.txt"
基于 Airflow 社区在 3.0.0 版本发布时提供的约束文件,安装一组一致的依赖项。
注意,这将安装 Airflow 3.0.0 发布时发布的 provider 版本。如果您想使用最新版本的 provider,可以稍后手动升级这些 provider。
此外,这些附加功能仅在 apache-airflow
分发包中可用,因为它们是方便地将所有 airflow
包一起安装的方式 - 类似于 Airflow 2 中发生的情况。当您单独安装 airflow-core
或 airflow-task-sdk
时,如果您想安装 provider,需要将它们作为 apache-airflow-providers-*
分发包单独安装。
Apache 软件附加功能¶
附加功能 (extra) |
安装命令 |
启用功能 |
---|---|---|
这些是为与其他 Apache 项目集成而添加所需依赖项的附加功能(注意 |
|
pip install 'apache-airflow[apache-atlas]' |
Apache Atlas |
|
pip install 'apache-airflow[apache-beam]' |
Apache Beam operators 和 hooks |
|
pip install 'apache-airflow[apache-cassandra]' |
与 Cassandra 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-drill]' |
与 Drill 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-druid]' |
与 Druid 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-flink]' |
与 Flink 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-hdfs]' |
HDFS hooks 和 operators |
|
pip install 'apache-airflow[apache-hive]' |
所有与 Hive 相关的 operators |
|
pip install 'apache-airflow[apache-iceberg]' |
Apache Iceberg hooks |
|
pip install 'apache-airflow[apache-impala]' |
所有与 Impala 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-kafka]' |
所有与 Kafka 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-kylin]' |
所有与 Kylin 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-livy]' |
所有与 Livy 相关的 operators、hooks 和 sensors |
|
pip install 'apache-airflow[apache-pig]' |
所有与 Pig 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-pinot]' |
所有与 Pinot 相关的 hooks |
|
pip install 'apache-airflow[apache-spark]' |
所有与 Spark 相关的 operators 和 hooks |
|
pip install 'apache-airflow[apache-hdfs]' |
外部服务附加功能¶
这些是为与外部服务(基于云或本地)集成而添加所需依赖项的附加功能。
附加功能 (extra) |
安装命令 |
启用功能 |
---|---|---|
airbyte |
|
Airbyte hooks 和 operators |
alibaba |
|
阿里云 |
apprise |
|
Apprise 通知 |
amazon |
|
亚马逊 Web Services |
asana |
|
Asana hooks 和 operators |
atlassian-jira |
|
Jira hooks 和 operators |
microsoft-azure |
|
Microsoft Azure |
cloudant |
|
Cloudant hook |
cohere |
|
Cohere hook 和 operators |
databricks |
|
Databricks hooks 和 operators |
datadog |
|
Datadog hooks 和 sensors |
dbt-cloud |
|
dbt Cloud hooks 和 operators |
dingding |
|
钉钉 hooks 和 sensors |
discord |
|
Discord hooks 和 sensors |
|
Facebook 社交 |
|
github |
|
GitHub operators 和 hook |
|
Google Cloud |
|
hashicorp |
|
Hashicorp 服务 (Vault) |
openai |
|
Open AI hooks 和 operators |
opsgenie |
|
OpsGenie hooks 和 operators |
pagerduty |
|
Pagerduty hook |
pgvector |
|
pgvector operators 和 hook |
pinecone |
|
Pinecone Operators 和 Hooks |
qdrant |
|
Qdrant Operators 和 Hooks |
salesforce |
|
Salesforce hook |
sendgrid |
|
使用 sendgrid 发送电子邮件 |
segment |
|
Segment hooks 和 sensors |
slack |
|
Slack hooks 和 operators |
snowflake |
|
Snowflake hooks 和 operators |
tableau |
|
Tableau hooks 和 operators |
tabular |
|
Tabular hooks |
telegram |
|
Telegram hooks 和 operators |
vertica |
|
支持 Vertica hook 作为 Airflow 后端 |
weaviate |
|
Weaviate hook 和 operators |
yandex |
|
Yandex.cloud hooks 和 operators |
ydb |
|
YDB hooks 和 operators |
zendesk |
|
Zendesk hooks |
本地安装软件附加功能¶
这些是为与通常作为 Airflow 部署一部分安装的其他软件包集成而添加所需依赖项的附加功能。其中一些使 Airflow 能够使用执行器来运行任务 - 而不是通过内置的 LocalExecutor。
附加功能 (extra) |
安装命令 |
提供 |
启用执行器 |
---|---|---|---|
arangodb |
|
ArangoDB operators, sensors 和 hook |
|
celery |
|
Celery 依赖项和 sensor |
CeleryExecutor, CeleryKubernetesExecutor |
cncf-kubernetes |
|
Kubernetes 客户端库, KubernetesPodOperator 及相关项 |
KubernetesExecutor, LocalKubernetesExecutor |
docker |
|
Docker hooks 和 operators |
|
edge3 |
|
通过 HTTP 将 Edge Workers 连接到调度器 |
EdgeExecutor |
elasticsearch |
|
Elasticsearch hooks 和日志处理器 |
|
exasol |
|
Exasol hooks 和 operators |
|
fab |
|
FAB 认证管理器 |
|
git |
|
Git bundle 和 hook |
|
github |
|
GitHub operators 和 hook |
|
influxdb |
|
Influxdb operators 和 hook |
|
jenkins |
|
Jenkins hooks 和 operators |
|
mongo |
|
Mongo hooks 和 operators |
|
microsoft-mssql |
|
Microsoft SQL Server operators 和 hook。 |
|
mysql |
|
MySQL operators 和 hook |
|
neo4j |
|
Neo4j operators 和 hook |
|
odbc |
|
ODBC 数据源,包括 MS SQL Server。 |
|
openfaas |
|
OpenFaaS hooks |
|
oracle |
|
Oracle hooks 和 operators |
|
postgres |
|
PostgreSQL operators 和 hook |
|
presto |
|
所有与 Presto 相关的 operators 和 hooks |
|
redis |
|
Redis hooks 和 sensors |
|
samba |
|
Samba hooks 和 operators |
|
singularity |
|
Singularity 容器 operator |
|
teradata |
|
Teradata hooks 和 operators |
|
trino |
|
所有与 Trino 相关的 operators 和 hooks |
其他附加功能¶
这些是提供支持以便通过一些(通常是)标准协议与外部系统集成的附加功能。
预安装
列中带有 *
标记的条目表示这些附加功能(provider)在安装 Airflow 时总是预安装的。
附加功能 (extra) |
安装命令 |
启用功能 |
预安装 |
---|---|---|---|
common-compat |
|
旧版本 Airflow 的兼容性代码 |
|
common-io |
|
核心 IO operators |
|
common-messaging |
|
核心消息 operators |
|
common-sql |
|
核心 SQL operators |
|
ftp |
|
FTP hooks 和 operators |
|
grpc |
|
Grpc hooks 和 operators |
|
http |
|
HTTP hooks, operators 和 sensors |
|
imap |
|
IMAP hooks 和 sensors |
|
jdbc |
|
JDBC hooks 和 operators |
|
microsoft-psrp |
|
PSRP hooks 和 operators |
|
microsoft-winrm |
|
WinRM hooks 和 operators |
|
openlineage |
|
发送 OpenLineage 事件 |
|
opensearch |
|
Opensearch hooks 和 operators |
|
papermill |
|
Papermill hooks 和 operators |
|
sftp |
|
SFTP hooks, operators 和 sensors |
|
smtp |
|
SMTP hooks 和 operators |
|
sqlite |
|
SQLite hooks 和 operators |
|
ssh |
|
SSH hooks 和 operators |
组附加功能¶
组附加功能是方便的附加功能。这种附加功能会一起安装许多可选依赖项。不建议在生产环境中使用,但对于 CI、开发和测试很有用。
附加功能 (extra) |
安装命令 |
启用功能 |
---|---|---|
all |
|
所有可选依赖项,包括所有 providers |
all-core |
|
所有可选核心依赖项 |