Repository: apache/airflow

Issue:
Chart: Allow AWS ECS Executor
Make it possible to use the alpha/experimental AWS ECS Executor with the Helm chart. (link: https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/executors/ecs-executor.html)

The changes are:

1. Add the following executors into the allowed `executor` values:
   - ``airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor``
   - ``airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor``
2. Truncate the `executor` label value to a max of ~50~ 63 characters because Kubernetes doesn't allow a label value with more than ~50~ 63 characters.
3. Updated the Helm chart README.

I've tested this setup and it works. These are the minimum changes I need in the Helm chart.


Discussion:

Resolving patch:
diff --git a/airflow/providers/amazon/aws/executors/batch/__init__.py b/airflow/providers/amazon/aws/executors/batch/__init__.py
--- a/airflow/providers/amazon/aws/executors/batch/__init__.py
+++ b/airflow/providers/amazon/aws/executors/batch/__init__.py
@@ -14,3 +14,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+from __future__ import annotations  # Added by precommit hooks
+
+__all__ = ["AwsBatchExecutor"]
+
+from airflow.providers.amazon.aws.executors.batch.batch_executor import AwsBatchExecutor
diff --git a/airflow/providers/amazon/aws/executors/ecs/__init__.py b/airflow/providers/amazon/aws/executors/ecs/__init__.py
--- a/airflow/providers/amazon/aws/executors/ecs/__init__.py
+++ b/airflow/providers/amazon/aws/executors/ecs/__init__.py
@@ -14,3 +14,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+from __future__ import annotations  # Added by precommit hooks
+
+__all__ = ["AwsEcsExecutor"]
+
+from airflow.providers.amazon.aws.executors.ecs.ecs_executor import AwsEcsExecutor


Test patch:
diff --git a/tests/providers/amazon/aws/executors/batch/test_batch_executor.py b/tests/providers/amazon/aws/executors/batch/test_batch_executor.py
--- a/tests/providers/amazon/aws/executors/batch/test_batch_executor.py
+++ b/tests/providers/amazon/aws/executors/batch/test_batch_executor.py
@@ -834,3 +834,8 @@ def test_submit_job_kwargs_exec_config_overrides(
         final_run_task_kwargs = executor._submit_job_kwargs(mock_ti_key, command, "queue", exec_config)
 
         assert final_run_task_kwargs == expected_result
+
+    def test_short_import_path(self):
+        from airflow.providers.amazon.aws.executors.batch import AwsBatchExecutor as AwsBatchExecutorShortPath
+
+        assert AwsBatchExecutor is AwsBatchExecutorShortPath
diff --git a/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py b/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py
--- a/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py
+++ b/tests/providers/amazon/aws/executors/ecs/test_ecs_executor.py
@@ -1703,3 +1703,8 @@ def test_run_task_kwargs_exec_config_overrides(
         final_run_task_kwargs = executor._run_task_kwargs(mock_ti_key, command, "queue", exec_config)
 
         assert final_run_task_kwargs == expected_result
+
+    def test_short_import_path(self):
+        from airflow.providers.amazon.aws.executors.ecs import AwsEcsExecutor as AwsEcsExecutorShortPath
+
+        assert AwsEcsExecutor is AwsEcsExecutorShortPath