MWAA - 配置 requirements.txt 文件的影响

MWAA - Impact of configuring a requirements.txt file

我正在使用 Amazon Managed Workflows for Apache Airflow (MWAA)。

我们有一些 DAG 运行 在实例中成功。他们使用 bash 运算符和 python 运算符。我们目前没有为实例指定 requirments.txt 文件,因为没有 python 外部模块依赖项,默认情况下不包含在 MWAA 中。我需要部署一个新的 DAG,它将引用许多默认情况下未包含在 MWAA 中的外部 python 库。为此,我必须为 MWAA 实例指定一个 requirments.txt 文件。

在 运行 实例上设置 requirements.txt 文件有什么风险?如果文件有问题如:

  1. 错误的文件格式
  2. 未知库 - 在 pypi.org
  3. 上不可用
  4. 库版本在 pypi.org
  5. 上不可用
  6. 库与其他库冲突

在引入 requirements.txt 文件之前已经工作的现有 DAG 是否会继续工作,或者这个文件是否会破坏 运行 系统?

我想了解测试/部署 requirments.txt 到实时生产环境是否安全。不幸的是,我没有可用的非生产环境,也没有 access/permission 在相关的 AWS 账户中创建一个。

What is the risk of setting a requirements.txt file on a running instance?

一般来说,是的,您列出的所有问题(例如错误的文件格式、未知的库等)都可能导致现有 DAG 出现问题。这包括包版本不正确等错误,这些错误可能安装正确,但可能无法正确实施。

示例错误:https://docs.aws.amazon.com/mwaa/latest/userguide/t-apache-airflow-11012.html#troubleshooting-dependencies

I am trying to understand if it is safe to test out / deploy a requirments.txt to a live production environment. Unfortunately, I don't have a non-production environment available nor access/permission to create one in the relevant AWS account.

MWAA local runner 中测试您的新 requirements.txt 文件。本地运行器具有用于测试 requirements.txt.

的特定功能
./mwaa-local-env test-requirements

参考文献:

  1. aws-mwaa-local-runner (GitHub)
  2. Testing requirements.txt (GitHub)
  3. Tutorial: Configuring the aws-mwaa-local-runner in a Continuous Delivery (CD) pipeline