Cadres de planification de workflows

Introduction au data engineering

Vincent Vankrunkelsven

Data Engineer @ DataCamp

Un pipeline d’exemple

 

Exemple de pipeline simple qui extrait depuis un CSV avec Spark

Comment planifier ?

  • Manuellement
  • Outil de planification cron
  • Et les dépendances ?
Introduction au data engineering

DAGs

Graphe orienté acyclique (DAG)

  • Ensemble de nœuds
  • Arêtes orientées
  • Pas de cycles

Exemple de DAG

Introduction au data engineering

Les bons outils

 

  • cron de Linux
  • Luigi de Spotify
  • Apache Airflow
Introduction au data engineering

Logo d’Apache Airflow

  • Créé chez Airbnb
  • DAGs
  • Python
Introduction au data engineering

Airflow : un exemple de DAG

 

Exemple de DAG Airflow

Introduction au data engineering

Airflow : un exemple en code

# Create the DAG object
dag = DAG(dag_id="example_dag", ..., schedule_interval="0 * * * *")

# Define operations start_cluster = StartClusterOperator(task_id="start_cluster", dag=dag) ingest_customer_data = SparkJobOperator(task_id="ingest_customer_data", dag=dag) ingest_product_data = SparkJobOperator(task_id="ingest_product_data", dag=dag) enrich_customer_data = PythonOperator(task_id="enrich_customer_data", ..., dag = dag)
# Set up dependency flow start_cluster.set_downstream(ingest_customer_data) ingest_customer_data.set_downstream(enrich_customer_data) ingest_product_data.set_downstream(enrich_customer_data)
Introduction au data engineering

Passons à la pratique !

Introduction au data engineering

Preparing Video For Download...