Giter VIP home page Giter VIP logo

airflow-spark-minio-postgres's Introduction

Table of contents

Project Requirements

This project was develop and tested using the following environment.

Item Version
Ubuntu 22.04.1 LTS
Docker 20.10.17, build 100c701
Docker Compose 1.29.2, build 5becea4c
Visual Studio Code 1.71.0
Python 3.10.4
OpenJDK 11.0.16
Git 2.34.1

If due to license issues you are not allowed to use Docker it's possible to replace it with Podman which is an alternative highly recommended for companies such as RedHat.

Project Structure

This challenge is currently structured with the following specifications.

Path Description
src Dockefile, dags and Spark applications

High Level Architecture

๐Ÿšข Containers

  • airflow-webserver: Airflow v2.2.4 (Webserver & Scheduler)

    • image: andrejunior/airflow-spark:latest | Based on python:3.8-buster
    • port: 8085
  • postgres: Postgres database (Airflow metadata and our pipeline)

    • image: postgres:14-bullseye
    • port: 5432
  • spark-master: Spark Master

    • image: bitnami/spark:3.2.1
    • port: 8081
  • spark-worker: Spark workers

    • image: bitnami/spark:3.2.1
  • MinIO: Object storage

    • image: bitnami/minio:latest

Step-by-Step

1. Clone the Repository

git clone https://github.com/andrejnevesjr/airflow-spark-minio-postgres.git

2. Setup environment

cd otrium-challenge
docker-compose -f docker-compose.yml up -d

3. Airflow: Create user for UI

To access Airflow UI is required to create a new user account, so in our case, we are going to create an fictional user with an Admin role attached.

NOTE: Before RUN the command below please confirm that Airflow is up and running, it can be checked by accessing the URL http://localhost:8085. Have in mind that in the first execution it may take 2 to 3 minutes ๐Ÿ˜œ

docker-compose run airflow-webserver airflow users create --role Admin --username airflow
--email [email protected] --firstname airflow --lastname airflow --password airflow

3.1 Airflow: Postgres, MinIO & Spark connections configuration

  1. Open the service in your browser at http://localhost:8085 Use the credentials

    User: airflow
    Password: airflow
    
  2. Click on Admin -> Connections in the top bar.

  3. Click on + sign and fill in the necessary details for each source below:

Postgres

Conn Id: postgres_conn
Conn Type: Postgres
Host: postgres
Schema: airflow
Login: airflow
Password: airflow
Port: 5432

MinIO

Conn ID: minio_conn
Conn Type: Amazon S3
Extra: consists of the JSON below:
    { "aws_access_key_id":"airflow",
      "aws_secret_access_key": "airflow",
      "host": "http://bucket:9000"
    }

Spark

Conn ID: spark_conn
Host: spark://spark
Port: 7077
Extra: consists of the JSON below:
{"queue": "root.default"}

Stack

Application URL Credentials
Airflow http://localhost:8085 User: airflow
Pass: airflow
MinIO http://localhost:9001 User: airflow
Pass: airflow
Postgres Server/Database: localhost:5432/airflow User: airflow
Pass: airflow
Spark (Master) http://localhost:8081

References

airflow.apache.org

puckel/docker-airflow

cordon-thiago/airflow-spark

pyjaime/docker-airflow-spark

airflow-spark-minio-postgres's People

Contributors

andrejnevesjr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.