Available Executors
Mage provides several executor types for running pipelines and blocks:Spark (PySpark)
Run PySpark pipelines on AWS EMR clusters with automatic cluster management
Kubernetes
Execute pipelines and blocks as Kubernetes Jobs with full resource control
AWS ECS
Run blocks as ECS tasks on AWS Fargate or EC2
GCP Cloud Run
Execute blocks on GCP Cloud Run with serverless container execution
Executor Types
Mage supports the following executor types defined in the codebase:| Executor Type | Description | Use Case |
|---|---|---|
local_python | Local Python execution (default) | Development and testing |
pyspark | PySpark execution on AWS EMR | Large-scale data processing with Spark |
k8s | Kubernetes Job execution | Container orchestration and resource isolation |
ecs | AWS ECS task execution | AWS-native container execution |
gcp_cloud_run | GCP Cloud Run execution | Serverless containers on GCP |
azure_container_instance | Azure Container Instance execution | Serverless containers on Azure |
Configuration Levels
Executor configuration can be set at multiple levels with the following precedence:Project Level
Configure default executors in your project’s
metadata.yaml file. This applies to all pipelines and blocks unless overridden.Block-level configuration takes highest precedence, followed by pipeline-level, then project-level configuration.
Setting Default Executor Type
You can set a default executor type for all pipelines using theDEFAULT_EXECUTOR_TYPE environment variable:
Executor Factory
Mage uses an executor factory pattern to dynamically create the appropriate executor based on:- Pipeline type: PySpark pipelines automatically use the
pysparkexecutor - Explicit configuration: Executor type specified in metadata
- Default executor: Set via
DEFAULT_EXECUTOR_TYPEenvironment variable - Fallback: Falls back to
local_pythonif no configuration is found
mage_ai/data_preparation/executors/executor_factory.py:
Next Steps
Spark Integration
Configure PySpark execution on AWS EMR clusters
Kubernetes Integration
Set up Kubernetes Job execution for scalable pipeline runs