Project for the Datalakes & Data Integration class
Ce projet utilise Apache Airflow pour orchestrer le pipeline de transformation des données. L'environnement Airflow est déployé via Docker Compose, ce qui permet de démarrer simultanément tous les conteneurs nécessaires (Airflow, Redis, PostgreSQL, Localstack, Cassandra, etc.).
Après avoir lancé la commande docker-compose up -d
, les conteneurs suivants sont démarrés :
- airflow-init : Initialise la base de métadonnées d'Airflow et crée un utilisateur administrateur par défaut.
- airflow-webserver : Fournit l'interface web pour visualiser et gérer les DAGs.
- airflow-scheduler : Planifie l'exécution des tâches selon les dépendances définies dans les DAGs.
- airflow-worker : Exécute les tâches distribuées via Celery.
Ouvrez votre navigateur et accédez à :
Connectez-vous avec les identifiants suivants :
- Username : admin
- Password : admin
Une fois authentifié, vous pourrez accéder au DAG qui orchestre l'ensemble des transformations de données.
We choose to use flask for our API as it is a simple and efficient way to do an API Gateway for a POC such as this. To run the api please run the following command at the root of the project folder: (you may need to replace pyton by python3 or py)
python src/main.py
We have 4 endpoints in our API, all are of the method POST:
- /ingest/blob : This endpoint is used to ingest data from one or several blob made out of csv files. It takes a json payload with the following format:
{
"data" : [blob1, blob2]
}
- /ingest/csv : This endpoint is used to ingest data from one or several csv files. It takes a json payload with the following format:
{
"files" : ["file1.csv", "file2.csv"]
}
- /ingest : This endpoint autoredirect to the right endpoint depending on the type of the file. It takes a json payload with the following format:
{
"files" : ["file1.csv", "file2.csv"]
}
OR
{
"data" : [blob1, blob2]
}
- /ingest/fast : This endpoint is an optimised version of the endpoint /ingest. It takes the same possible payload.
- /ingest : This endpoint autoredirect to the right endpoint depending on the type of the file. It takes a json payload with the following format:
{
"files" : ["file1.csv", "file2.csv"]
}
OR
{
"data" : [blob1, blob2]
}
- /ingest/fast : This endpoint is an optimised version of the endpoint /ingest. It takes the same possible payload.