vincbeck commented on code in PR #50516: URL: https://github.com/apache/airflow/pull/50516#discussion_r2087152019
########## providers/amazon/docs/executors/lambda-executor.rst: ########## @@ -0,0 +1,364 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + +.. warning:: + The Lambda Executor is alpha/experimental at the moment and may unstable and be subject to change without warning. +.. |executorName| replace:: Lambda +.. |dockerfileLink| replace:: `here <https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/executors/aws_lambda/docker/Dockerfile>`__ +.. |appHandlerLink| replace:: `here <https://github.com/apache/airflow/blob/main/providers/amazon/src/airflow/providers/amazon/aws/executors/aws_lambda/docker/app.py>`__ + +=================== +AWS Lambda Executor +=================== + +This is an Airflow executor powered by AWS Lambda. Each task that Airflow schedules Review Comment: Should we mention that Lambda has a hard limit of 15 minutes, thus, any task taking more than 15 minutes will fail? ########## providers/amazon/provider.yaml: ########## @@ -1003,6 +1003,82 @@ config: example: '{"Tags": [{"Key": "key", "Value": "value"}]}' default: ~ + aws_lambda_executor: + description: | + This section only applies if you are using the AwsLambdaExecutor in + Airflow's ``[core.executor]`` configuration. + For more information see: + https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda/client/invoke.html + https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html + https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/executors/lambda-executor.html + options: + conn_id: + description: | + The Airflow connection (i.e. credentials) used by the Lambda executor to make API calls. + version_added: "9.7.0" + type: string + example: "aws_default" + default: "aws_default" + region_name: + description: | + The name of the AWS Region where Amazon Lambda is configured. + version_added: "9.7.0" + type: string + example: "us-east-1" + default: ~ + check_health_on_startup: + description: | + Whether or not to check the Lambda Executor health on startup. + version_added: "9.7.0" + type: boolean + example: "True" + default: "True" + max_run_task_attempts: + description: | + The maximum number of times the Lambda Executor should attempt to start an Airflow task. + version_added: "9.7.0" + type: integer + example: "3" + default: "3" + queue_url: + description: | + The name of the SQS queue to use for the Lambda executor. Required. + The Lambda executor will poll this queue for results of the lambda function's Airflow Task. + version_added: "9.7.0" + type: string + example: "airflow-lambda-executor-results-queue" + default: ~ + dead_letter_queue_url: + description: | + The name of the SQS dead letter queue to use for the Lambda function. The Lambda executor Review Comment: name or URL? ########## providers/amazon/provider.yaml: ########## @@ -1003,6 +1003,82 @@ config: example: '{"Tags": [{"Key": "key", "Value": "value"}]}' default: ~ + aws_lambda_executor: + description: | + This section only applies if you are using the AwsLambdaExecutor in + Airflow's ``[core.executor]`` configuration. + For more information see: + https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda/client/invoke.html + https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html + https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/executors/lambda-executor.html + options: + conn_id: + description: | + The Airflow connection (i.e. credentials) used by the Lambda executor to make API calls. + version_added: "9.7.0" + type: string + example: "aws_default" + default: "aws_default" + region_name: + description: | + The name of the AWS Region where Amazon Lambda is configured. + version_added: "9.7.0" + type: string + example: "us-east-1" + default: ~ + check_health_on_startup: + description: | + Whether or not to check the Lambda Executor health on startup. + version_added: "9.7.0" + type: boolean + example: "True" + default: "True" + max_run_task_attempts: + description: | + The maximum number of times the Lambda Executor should attempt to start an Airflow task. + version_added: "9.7.0" + type: integer + example: "3" + default: "3" + queue_url: + description: | + The name of the SQS queue to use for the Lambda executor. Required. Review Comment: name or URL? ########## providers/amazon/src/airflow/providers/amazon/aws/executors/aws_lambda/docker/Dockerfile: ########## @@ -0,0 +1,106 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Use the official AWS Lambda Python base image. +FROM public.ecr.aws/lambda/python:3.12 + +# hadolint ignore=DL3033 +RUN yum -y install unzip \ + && yum clean all \ + && rm -rf /var/cache/yum + +# Install the AWS CLI. +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip \ + && ./aws/install \ + && rm -rf ./aws awscliv2.zip + +## Install Airflow and dependencies. +# The most current version of Airflow is installed by default, along with the amazon and postgres +# provider packages. +# If you would like to install a specific version, you can use the requirements.txt to change the +# version along with installing your dependencies or update this Dockerfile to install a specific +# version of Airflow. + +# NOTE: If you change the below line, specifically removing the amazon extra, please ensure boto3 is +# installed via another method. Boto3 is required for the Lambda executor to function properly. +# hadolint ignore=SC2102 +RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir apache-airflow[amazon,postgres]==2.10.5 Review Comment: Not Airflow 3? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org