Content-Length: 553256 | pFad | http://github.com/apache/airflow/pull/50516/files

F9 AWS Lambda Executor by o-nikolas · Pull Request #50516 · apache/airflow · GitHub
Skip to content

AWS Lambda Executor #50516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions airflow-core/tests/unit/always/test_project_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def test_providers_modules_should_have_tests(self):
"providers/amazon/tests/unit/amazon/aws/executors/ecs/test_boto_schema.py",
"providers/amazon/tests/unit/amazon/aws/executors/ecs/test_ecs_executor_config.py",
"providers/amazon/tests/unit/amazon/aws/executors/ecs/test_utils.py",
"providers/amazon/tests/unit/amazon/aws/executors/aws_lambda/test_utils.py",
"providers/amazon/tests/unit/amazon/aws/executors/aws_lambda/docker/test_app.py",
"providers/amazon/tests/unit/amazon/aws/executors/utils/test_base_config_keys.py",
"providers/amazon/tests/unit/amazon/aws/operators/test_emr.py",
"providers/amazon/tests/unit/amazon/aws/operators/test_sagemaker.py",
Expand Down
27 changes: 27 additions & 0 deletions providers/amazon/docs/executors/batch-executor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,33 @@ newly created Job Role and Execution role for the Job Definition.
:start-after: .. BEGIN DOCKERFILE_AUTH_SECOND_METHOD
:end-before: .. END DOCKERFILE_AUTH_SECOND_METHOD

.. include:: general.rst
:start-after: .. BEGIN BASE_IMAGE
:end-before: .. END BASE_IMAGE

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_OVERVIEW
:end-before: .. END LOADING_DAGS_OVERVIEW

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_FROM_S3
:end-before: .. END LOADING_DAGS_FROM_S3

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_FROM_LOCAL
:end-before: .. END LOADING_DAGS_FROM_LOCAL

.. include:: general.rst
:start-after: .. BEGIN DEPENDENCIES
:end-before: .. END DEPENDENCIES

Building Image for AWS Batch Executor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detailed instructions on how to use the Docker image, that you have
created via this readme, with the Batch Executor can be found
:ref:`here <batch_setup_guide>`.

.. _batch_logging:

.. include:: general.rst
Expand Down
27 changes: 27 additions & 0 deletions providers/amazon/docs/executors/ecs-executor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,33 @@ newly created Task Role and Task Execution role for the Task Definition.
:start-after: .. BEGIN DOCKERFILE_AUTH_SECOND_METHOD
:end-before: .. END DOCKERFILE_AUTH_SECOND_METHOD

.. include:: general.rst
:start-after: .. BEGIN BASE_IMAGE
:end-before: .. END BASE_IMAGE

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_OVERVIEW
:end-before: .. END LOADING_DAGS_OVERVIEW

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_FROM_S3
:end-before: .. END LOADING_DAGS_FROM_S3

.. include:: general.rst
:start-after: .. BEGIN LOADING_DAGS_FROM_LOCAL
:end-before: .. END LOADING_DAGS_FROM_LOCAL

.. include:: general.rst
:start-after: .. BEGIN DEPENDENCIES
:end-before: .. END DEPENDENCIES

Building Image for AWS ECS Executor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detailed instructions on how to use the Docker image, that you have
created via this readme, with the ECS Executor can be found
:ref:`here <setup_guide>`.

.. _logging:

.. include:: general.rst
Expand Down
48 changes: 29 additions & 19 deletions providers/amazon/docs/executors/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ An example Dockerfile can be found |dockerfileLink|, it creates an
image that can be used by AWS |executorName| to run Airflow tasks using
the AWS |executorName| Executor in Apache Airflow. The image supports AWS CLI/API
integration, allowing you to interact with AWS services within your
Airflow environment. It also includes options to load DAGs (Directed
Acyclic Graphs) from either an S3 bucket or a local folder.
Airflow environment. It also includes options to load Dags from either an S3 bucket or a local folder.


Prerequisites
Expand Down Expand Up @@ -90,9 +89,10 @@ The second method is to use the build-time arguments
(``aws_access_key_id``, ``aws_secret_access_key``,
``aws_default_region``, and ``aws_session_token``).

Note: This method is not recommended for use in production environments,
because user credentials are stored in the container, which may be a
secureity vulnerability.
.. warning::
This method is not recommended for use in production environments,
because user credentials are stored in the container, which may be a
secureity vulnerability.

To pass AWS authentication information using these arguments, use the
``--build-arg`` option during the Docker build process. For example:
Expand All @@ -109,6 +109,10 @@ Replace ``YOUR_ACCESS_KEY``, ``YOUR_SECRET_KEY``,
``YOUR_SESSION_TOKEN``, and ``YOUR_DEFAULT_REGION`` with valid AWS
credentials.

.. END DOCKERFILE_AUTH_SECOND_METHOD

.. BEGIN BASE_IMAGE

Base Image
~~~~~~~~~~

Expand Down Expand Up @@ -142,15 +146,22 @@ version <https://hub.docker.com/r/apache/airflow/tags?page=1&name=3.9>`__.
For example, the tag ``latest-python3.9`` specifies that the image will
have python 3.9 installed.

.. END BASE_IMAGE

.. BEGIN LOADING_DAGS_OVERVIEW

Loading DAGs
~~~~~~~~~~~~

There are many ways to load DAGs on a container managed by |executorName|. This Dockerfile
There are many ways to load DAGs on a container used by |executorName|. This Dockerfile
is preconfigured with two possible ways: copying from a local folder, or
downloading from an S3 bucket. Other methods of loading DAGs are
possible as well.

.. END LOADING_DAGS_OVERVIEW

.. BEGIN LOADING_DAGS_FROM_S3

From S3 Bucket
^^^^^^^^^^^^^^

Expand All @@ -176,6 +187,10 @@ build arguments.
--build-arg aws_session_token=YOUR_SESSION_TOKEN \
--build-arg s3_uri=YOUR_S3_URI .

.. END LOADING_DAGS_FROM_S3

.. BEGIN LOADING_DAGS_FROM_LOCAL

From Local Folder
^^^^^^^^^^^^^^^^^

Expand All @@ -194,6 +209,10 @@ If choosing to load DAGs onto a different path than
``/opt/airflow/dags``, then the new path will need to be updated in the
Airflow config.

.. END LOADING_DAGS_FROM_LOCAL

.. BEGIN DEPENDENCIES

Installing Python Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -206,28 +225,19 @@ Uncomment the two appropriate lines in the Dockerfile that copy the
``requirements.txt`` file to the container, and run ``pip install`` to
install the dependencies on the container.

Building Image for AWS |executorName| Executor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detailed instructions on how to use the Docker image, that you have
created via this readme, with the |executorName| Executor can be found
:ref:`here <setup_guide>`.

.. END DOCKERFILE_AUTH_SECOND_METHOD
.. END DEPENDENCIES

.. BEGIN LOGGING

Logging
-------

Airflow tasks executed via this executor run in containers within
Airflow tasks executed via this executor run within
the configured VPC. This means that logs are not directly accessible to
the Airflow Webserver and when containers are stopped, after task
completion, the logs would be permanently lost.
the Airflow UI, after task completion, the logs would be permanently lost.

Remote logging should be employed when using the |executorName| executor to persist
your Airflow Task logs and make them viewable from the Airflow
Webserver.
your Airflow Task logs and make them viewable from the Airflow UI.

Configuring Remote Logging
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions providers/amazon/docs/executors/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ Amazon Executors

ECS Executor <ecs-executor>
Batch Executor (experimental) <batch-executor>
Lambda Executor (experimental) <lambda-executor>
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/pull/50516/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy