Loading repository data…
Loading repository data…
airscholar / repository
This project demonstrates how to use Apache Airflow to submit jobs to Apache spark cluster in different programming laguages using Python, Scala and Java as an example.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This project orchestrates Spark jobs written in different programming languages using Apache Airflow, all within a Dockerized environment. The DAG sparking_flow is designed to submit Spark jobs written in Python, Scala, and Java, ensuring that data processing is handled efficiently and reliably on a daily schedule.
The DAG sparking_flow includes the following tasks:
start: A PythonOperator that prints "Jobs started".python_job: A SparkSubmitOperator that submits a Python Spark job.scala_job: A SparkSubmitOperator that submits a Scala Spark job.java_job: A SparkSubmitOperator that submits a Java Spark job.end: A PythonOperator that prints "Jobs completed successfully".These tasks are executed in a sequence where the start task triggers the Spark jobs in parallel, and upon their completion, the end task is executed.
Before setting up the project, ensure you have the following:
To run this project using Docker, follow these steps:
docker-compose.yml file.docker-compose up -d --build
This command will start the necessary services defined in your docker-compose.yml, such as Airflow webserver, scheduler, Spark master, and worker containers.
Ensure your Spark job files are placed in the following directories and are accessible to the Airflow container:
These paths should be relative to the mounted Docker volume for Airflow DAGs.
After the Docker environment is set up, the sparking_flow DAG will be available in the Airflow web UI , where it can be triggered manually or run on its daily schedule.
You must add the spark cluster url to the spark connection in the configuration on Airflow UI