Luigi is a Python package for chaining batch jobs with dependency resolution, failure handling, and workflow visualization. It targets long-running data processing such as Hadoop work.
Overview
Luigi helps teams run complex pipelines of batch jobs by managing dependencies, retries, and orchestration so authors can focus on individual tasks. Tasks can wrap Hive queries, Hadoop or Spark jobs, Python snippets, database dumps, and other steps wired together in Python rather than external config files.
The package includes templates for common patterns, including Python mapreduce on Hadoop plus Hive and Pig integration. File system abstractions for HDFS and local paths aim to keep operations atomic so partial outputs are less likely after failures.
A Luigi server exposes a web interface to search and filter tasks, and a visualizer renders the dependency graph with completion status. Luigi is conceptually compared to build tools like GNU Make and schedulers like Oozie or Azkaban, but stays Python-centric and is not limited to a single execution backend.
Spotify developed Luigi to operate large daily task graphs for recommendations, reporting, dashboards, and similar data products. Pipelines can span thousands of tasks over days or weeks.
Key features
- Dependency resolution between batch tasks
- Workflow and failure management
- Web task search and visualizer
- Hadoop mapreduce job templates
- Hive and Pig job support
- HDFS and local atomic file helpers
- Command-line integration
Use cases
- Chaining Hadoop and Spark batch steps
- Running multi-day ETL dependency graphs
- Monitoring batch workflow progress in a UI
- Orchestrating Hive or Pig alongside Python tasks