Cloud Composer workshop at Airflow Summit 2023.pdf

Leah Cole
Leah ColeDeveloper Programs Engineer em Google
Cloud Composer
Airflow Summit 2023
Workshop
September 21, 2023
Hi! It's nice to meet you!
Bartosz Jankiewicz
Engineering Manager
Filip Knapik
Group Product
Michał Modras
Engineering Manager
Leah Cole
Developer Relations
Engineer
Rafal Biegacz
Engineering Manager
Arun Vattoly
Technical Solutions
Engineer
Victor
Cloud Support
Manager
Mateusz Henc
Software Engineer
Agenda
Of workshop
01
Table of contents
Agenda
Setting up
Introduction to Cloud Composer
Disaster Recovery in Cloud Composer
Data Lineage in Cloud Composer
01
02
03
04
05
Data Lineage
● Composer + BigQuery
● Composer + Dataproc
Agenda
Introduction
● Composer Architecture
● Composer Features
Disaster Recovery
● Snapshots
15m 1h 1h
☕
Setting up
Workshop Projects
02
GCP Projects used during Workshop
● Main activities/exercises will be done in environments created in your dedicated project that we set
up for you. Composer environments were pre-set up for you, as well.
These projects and environments will be deleted after the workshop.
● Composer project info to be used by you should be passed to you in the separate email.
● If your email address you used to register for the workshop doesn’t have association with active
Google Account then you will need to finish this registration as described here
● You can also get this information during the workshop
A voucher for Google Cloud Platform (GCP) Credits
● As part of this workshop you will receive a GCP credits voucher worth $500.
To be able to redeem the credits, in a addition to active Google Account you will need to set up your
GCP project and associate it with an active billing account.
This project and GCP credits will be owned by you.
You can use activate GCP coupon within 2 months after the workshop.
Workshop’s GCP credits are valid for 1 year since activation.
Introduction to
Cloud Composer
03
Cloud Composer 2 architecture
Cloud Composer 2 interacts with the following services:
● CloudSQL - running Airflow metadata storage
● Cloud Storage - user uploaded content (DAGs, user data)
● Kubernetes - runs Scheduler(s), WebServer, Redis queue,
SQL proxy and Airflow workloads
● Cloud Logging - stores and indexes components logs
● Cloud Monitoring - searchable Cloud Composer metrics
… and many more that we are managing for you.
Cloud Composer in a nutshell
BigQuery Data Fusion Dataflow Dataproc
Storage
Cloud Composer
100+ APIs …
Orchestrate work across Google Cloud, external SaaS services and proprietary APIs
…
Cloud Composer benefits
Simple
deployment
Robust
Monitoring &
Logging
Enterprise
Security Features
DAG code
portability
Technical
Support
Managed
infrastructure
Disaster Recovery
in Cloud Composer
04
What is a disaster?
Disaster is an event where Cloud
Composer or other components
essential for your environment's
operation are unavailable.
In case of Google Cloud the impact of
disaster can be zonal, regional or global.
��
HR
Highly resilient Cloud Composer
environments are Cloud Composer 2
environments that use built-in
redundancy and failover
mechanisms that reduce the
environment's susceptibility to zonal
failures and single point of failure
outages.
DR
Disaster Recovery (DR), in the context
of Cloud Composer, is a process of
restoring the environment's operation
after a disaster. The process involves
recreating the environment, possibly in
another region.
What about Composer with High Resilience?
Composer HR makes your application is available right
now. DR makes sure you can get it back up later.
HR != DR
High resilience is critical for the availability of Cloud
Composer, but it is often useless for recoverability.
For example, a critical historical transactions table may
be lost, but new transactions will still be processed
Availability should be calculated based on how long a service was unavailable
over a specified period of time. Planned downtime is still downtime.
Definition of availability
Availability =
Uptime
Total Time
Availability = 1 - (1 - Aa) * (1 - Ab)
Availability in distributed systems
Service A SLO
99%
Service B
SLO 99%
Availability = Aa * Ab
Service A SLO
99%
Service B
SLO 99%
98%
Parallelization (OR) Chaining (AND)
99.99%
DR Process: Failover
Step 1: Everything is fine
Primary
environment
Snapshots
storage
Scheduled
Snapshots
Note: User Multi-regional GCS bucket for
snapshots storage.
That's why Snapshots Storage should be
multi-regional.
DR Process: Failover
Step 2: Disaster!
Snapshots
storage
��
Primary
environment
DR Process: Failover
Step 3: Create Cloud Composer in DR region
Snapshots
storage
Primary
environment
Failover
environment
��
Recovery Point
Objective
Maximum acceptable length of time during which
data might be lost from your application due to a
major incident.
Recovery Time
Objective
Maximum acceptable length of time that your
application can be offline.
RTO and RPO
Proprietary + Confidential
DR scenarios
RTO ↘ Cost ↗
RTO ↗ Cost ↘
Warm DR scenario is a variant of Disaster
Recovery, where you use a standby failover
environment, which you create before a
disaster occurs.
Cold DR scenario is a variant of Disaster
Recovery, where you create a failover
environment after a disaster occurs.
DR Process: Failover
Step 4: Load snapshot
Snapshots
storage
��
Primary
environment
Failover
environment
Load
Snapshot
DR Process: Failover
Step 4: Load snapshot and resumed workflows
Snapshots
storage
��
Primary
environment
Failover
environment
Scheduled
Snapshot
DR Process: Failover
Step 5: Disaster mitigated
Snapshots
storage
Primary
environment
Failover
environment
Scheduled
Snapshot
Note: Make sure to pause
DAGs in the Primary
environment
⏸
🥶 Option 1: Switch Failover with Primary environment and delete Primary environment (Cold DR )
🌤Option 1a: Switch Failover with Primary Environment and keep it (Warm DR)
🥶 Option 2: Fallback to Primary Environment and delete Failover environment (Cold DR)
🌤Option 2a: Fallback to Primary Environment and delete Failover environment (Warm DR)
DR Process: Failover
Next steps
Creating a detailed DR plan
1. What is your RTO?
2. What is your RPO?
3. How do you want to verify your plan?
https://cloud.google.com/architecture/dr-scenarios-planning-guide
Practice
Step 1: Create Snapshots storage bucket
● Use a multi-regional bucket to ensure
resiliency to regional failures.
● Make sure the bucket is accessible to your
environment service account
○ Grant permissions to
lab-sa@airflow-summit-workshop-{project}.iam.gse
rviceaccount.com to access created bucket
Step 2: Configure scheduled snapshots
Primary environment
Step 3: Create manual snapshot
[Optional] Step 3a: Setup metadata db maintenance
The Airflow metadata database must have less than 20 Gb of data to support
snapshots
1. Upload a maintenance DAG - http://bit.ly/3t1iiYJ
a. The dag is already in your environment
2. Verify database size metric.
3. [Optional] Set up an alert on database size metric.
Step 4: Verify a snapshot has been created
1. Visit storage bucket to observe created snapshot objects.
2. … or better delegate this effort to Cloud Monitoring.
a. https://cloud.google.com/composer/docs/composer-2/disaster-recovery-with-snapshots
Step 5: Disaster!
��
Step 6: Load snapshot in failover environment
Note: In case of Warm-DR you should skip
some options to reduce time of loading
and therefore RTO
Secondary environment
[Extra topic] Anatomy of Snapshot
● Snapshot is a folder on GCS bucket
● Convention for creating folder names (convention is not validated during load)
{project}_{region}_{environment}_{ISO_DATE_AND_TIME}
Eg.: myproject_us-central1_test-env_2023-09-15T05-02-06/
● Contents:
airflow-database.postgres.sql.gz
environment.json
fernet-key.txt
gcs/
dags/
metadata.json
preliminary_metadata.json
Step 7: Verify Failover environment health
1. Visit Monitoring Dashboard
2. Check your DAGs are running
3. Verify DAGs history - it should have been loaded with Snapshot
Limitations
1. The database size cannot exceed 20GB - the metric available in Monitoring dashboard
2. Snapshot can be stored with 2h+ intervals.
Good practices
1. Prepare your DR plan.
2. Test your disaster recovery procedure on a regular basis.
3. Decide what to do with the primary environment afterwards.
4. Set up DB maintenance and monitor DB size.
5. Set up monitoring for scheduled snapshot operations.
Let's take a break ☕
Data lineage
in Cloud Composer
05
Data lineage traces the
relationship between data
sources based on movement of
data, explaining how data was
sourced and transformed.
● Airflow gains rich lineage capabilities thanks to
the OpenLineage integration.
● Implemented by Dataplex in Google Cloud.
Data Lineage in Google Cloud: Dataplex
● Process
● Run (execution of Process)
● Event (emitted in a Run)
- Currently based on the Airflow
Lineage Backend feature.
- Backend exports lineage data to
Dataplex.
- Working on migrating to
OpenLineage.
Data Lineage in Cloud Composer
Operators support:
- BigQueryExecuteQueryOperator
- BigQueryInsertJobOperator
- BigQueryToBigQueryOperator
- BigQueryToCloudStorageOperator
- BigQueryToGCSOperator
- GCSToBigQueryOperator
- GoogleCloudStorageToBigQueryOperator
- DataprocSubmitJobOperator
Data Lineage in Cloud Composer
- A growing number of Google Cloud
services support Data Lineage (e.g.
BigQuery, Dataproc, Cloud Data
Fusion).
- Goal: Complete data lake lineage.
Data Lineage in other Google Cloud services
Exercise 1: Lineage from Composer
orchestrated BigQuery pipeline
This exercise covers data lineage with Cloud Composer, from a
BigQuery context with a minimum viable data engineering pipeline.
We will demonstrate lineage capture off of an Airflow DAG composed
of BigQuery actions.
We will first use an Apache Airflow DAG on Cloud Composer to
orchestrate the BigQuery jobs and observe the lineage captured by
Dataplex. Note that the lineage shows up minutes after a process is
run/an entity is created.
1. Review the existing Composer environment
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
2. Review the existing lineage graph
Cloud Composer workshop at Airflow Summit 2023.pdf
3. Review the Airflow DAG code
Go to DAGS section of the Composer environment.
Cloud Composer workshop at Airflow Summit 2023.pdf
4. Run the Airflow DAG.
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
5. Validate the creation of
tables in BigQuery.
6. Review the lineage captured in Dataplex
UI.
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
7. Navigate back to Composer Airflow DAG
using a link in Data Lineage UI.
TODO screenshot
Exercise 2: Lineage from Composer
orchestrated Dataproc Spark job
In this exercise, we will repeat what we did with lineage of BigQuery
based Airflow DAG, except, we will use Apache Spark on Dataproc
Serverless instead. Note that Dataproc Serverless is not a natively
supported service with Dataplex automated lineage capture. We will
use custom lineage feature in Cloud Composer.
1. Review the DAG
Navigate to the Cloud Composer UI and launch the Airflow UI
Click on the Spark DAG
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
2. Verify inlets & outlets definition
Scroll to look at the "inlet" and "outlet" where we specify lineage for
BigQuery external tables.
3. Run the DAG
4. Verify the Dataproc Serverless batch jobs in
Dataproc Batches UI in Google Cloud Console.
5. Analyze the lineage captured from
Composer’s environment Airflow.
The lineage captured is custom and BQ external table centric and therefore not visible in the Dataplex UI. The latency of lineage availability
is dependent on discovery settings for the asset.
Navigate to the BigQuery UI and click on the external table, oda_curated_zone.crimes_curated_spark table.
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Cloud Composer workshop at Airflow Summit 2023.pdf
Thank you.
1 de 80

Recomendados

SpringBoot 3 Observability por
SpringBoot 3 ObservabilitySpringBoot 3 Observability
SpringBoot 3 ObservabilityKnoldus Inc.
218 visualizações10 slides
Azure AKS por
Azure AKSAzure AKS
Azure AKSGaetan Jaminon
215 visualizações10 slides
From airflow to google cloud composer por
From airflow to google cloud composerFrom airflow to google cloud composer
From airflow to google cloud composerBruce Kuo
2.7K visualizações33 slides
Introduction to Kubernetes and Google Container Engine (GKE) por
Introduction to Kubernetes and Google Container Engine (GKE)Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)Opsta
2.7K visualizações37 slides
Kubernetes Architecture and Introduction por
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
6K visualizações45 slides
Prometheus monitoring por
Prometheus monitoringPrometheus monitoring
Prometheus monitoringHien Nguyen Van
263 visualizações30 slides

Mais conteúdo relacionado

Mais procurados

Cbs aws-fundamentals-2 por
Cbs aws-fundamentals-2Cbs aws-fundamentals-2
Cbs aws-fundamentals-2Luis Merino Troncoso
298 visualizações100 slides
Azure kubernetes service (aks) por
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)Akash Agrawal
4.1K visualizações23 slides
Kubernetes: A Short Introduction (2019) por
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Megan O'Keefe
7.9K visualizações25 slides
Kubernetes workshop por
Kubernetes workshopKubernetes workshop
Kubernetes workshopRaúl Requero García
189 visualizações23 slides
Google Kubernetes Engine (GKE) deep dive por
Google Kubernetes Engine (GKE) deep diveGoogle Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep diveAkash Agrawal
995 visualizações21 slides
Docker & kubernetes por
Docker & kubernetesDocker & kubernetes
Docker & kubernetesNexThoughts Technologies
6.4K visualizações45 slides

Mais procurados(20)

Azure kubernetes service (aks) por Akash Agrawal
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)
Akash Agrawal4.1K visualizações
Kubernetes: A Short Introduction (2019) por Megan O'Keefe
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
Megan O'Keefe7.9K visualizações
Google Kubernetes Engine (GKE) deep dive por Akash Agrawal
Google Kubernetes Engine (GKE) deep diveGoogle Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep dive
Akash Agrawal995 visualizações
Introduction to helm por Jeeva Chelladhurai
Introduction to helmIntroduction to helm
Introduction to helm
Jeeva Chelladhurai3.7K visualizações
Kubernetes & Google Kubernetes Engine (GKE) por Akash Agrawal
Kubernetes & Google Kubernetes Engine (GKE)Kubernetes & Google Kubernetes Engine (GKE)
Kubernetes & Google Kubernetes Engine (GKE)
Akash Agrawal1.2K visualizações
Istio Ambient Mesh in ACTION - Istio UG Singapore - 22June,2023 por SaiLinnThu2
Istio Ambient Mesh in ACTION - Istio UG Singapore - 22June,2023Istio Ambient Mesh in ACTION - Istio UG Singapore - 22June,2023
Istio Ambient Mesh in ACTION - Istio UG Singapore - 22June,2023
SaiLinnThu2322 visualizações
Prometheus design and philosophy por Docker, Inc.
Prometheus design and philosophy   Prometheus design and philosophy
Prometheus design and philosophy
Docker, Inc.2.7K visualizações
Opa gatekeeper por Rita Zhang
Opa gatekeeperOpa gatekeeper
Opa gatekeeper
Rita Zhang1.7K visualizações
infrastructure as code por Amazon Web Services
infrastructure as codeinfrastructure as code
infrastructure as code
Amazon Web Services4.3K visualizações
Introduction to Ansible por Knoldus Inc.
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
Knoldus Inc.24.2K visualizações
Ingress overview por Harshal Shah
Ingress overviewIngress overview
Ingress overview
Harshal Shah1.5K visualizações
Introduction to kubernetes por Rishabh Indoria
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Rishabh Indoria12.8K visualizações
Datadogoverview.pptx por ssuser8bc443
Datadogoverview.pptxDatadogoverview.pptx
Datadogoverview.pptx
ssuser8bc443914 visualizações
Docker Networking Overview por Sreenivas Makam
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
Sreenivas Makam21.1K visualizações
Nginx Reverse Proxy with Kafka.pptx por wonyong hwang
Nginx Reverse Proxy with Kafka.pptxNginx Reverse Proxy with Kafka.pptx
Nginx Reverse Proxy with Kafka.pptx
wonyong hwang475 visualizações
Best Practices for SecOps on AWS por Amazon Web Services
Best Practices for SecOps on AWSBest Practices for SecOps on AWS
Best Practices for SecOps on AWS
Amazon Web Services2.4K visualizações

Similar a Cloud Composer workshop at Airflow Summit 2023.pdf

Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop por
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and HadoopGoogle Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoophuguk
6.2K visualizações42 slides
Flink Forward SF 2017: James Malone - Make The Cloud Work For You por
Flink Forward SF 2017: James Malone - Make The Cloud Work For YouFlink Forward SF 2017: James Malone - Make The Cloud Work For You
Flink Forward SF 2017: James Malone - Make The Cloud Work For YouFlink Forward
807 visualizações43 slides
b04-DataflowArchitecture.pdf por
b04-DataflowArchitecture.pdfb04-DataflowArchitecture.pdf
b04-DataflowArchitecture.pdfRAJA RAY
3 visualizações20 slides
Extending Twitter's Data Platform to Google Cloud por
Extending Twitter's Data Platform to Google CloudExtending Twitter's Data Platform to Google Cloud
Extending Twitter's Data Platform to Google CloudDataWorks Summit
1K visualizações36 slides
Serverless and Design Patterns In GCP por
Serverless and Design Patterns In GCPServerless and Design Patterns In GCP
Serverless and Design Patterns In GCPOliver Fierro
166 visualizações41 slides
Google Cloud Platform (GCP) At a Glance por
Google Cloud Platform (GCP)  At a GlanceGoogle Cloud Platform (GCP)  At a Glance
Google Cloud Platform (GCP) At a GlanceCloud Analogy
1.2K visualizações8 slides

Similar a Cloud Composer workshop at Airflow Summit 2023.pdf(20)

Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop por huguk
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and HadoopGoogle Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
Google Cloud Dataproc - Easier, faster, more cost-effective Spark and Hadoop
huguk6.2K visualizações
Flink Forward SF 2017: James Malone - Make The Cloud Work For You por Flink Forward
Flink Forward SF 2017: James Malone - Make The Cloud Work For YouFlink Forward SF 2017: James Malone - Make The Cloud Work For You
Flink Forward SF 2017: James Malone - Make The Cloud Work For You
Flink Forward807 visualizações
b04-DataflowArchitecture.pdf por RAJA RAY
b04-DataflowArchitecture.pdfb04-DataflowArchitecture.pdf
b04-DataflowArchitecture.pdf
RAJA RAY3 visualizações
Extending Twitter's Data Platform to Google Cloud por DataWorks Summit
Extending Twitter's Data Platform to Google CloudExtending Twitter's Data Platform to Google Cloud
Extending Twitter's Data Platform to Google Cloud
DataWorks Summit1K visualizações
Serverless and Design Patterns In GCP por Oliver Fierro
Serverless and Design Patterns In GCPServerless and Design Patterns In GCP
Serverless and Design Patterns In GCP
Oliver Fierro166 visualizações
Google Cloud Platform (GCP) At a Glance por Cloud Analogy
Google Cloud Platform (GCP)  At a GlanceGoogle Cloud Platform (GCP)  At a Glance
Google Cloud Platform (GCP) At a Glance
Cloud Analogy1.2K visualizações
Gdsc muk - innocent por junaidhasan17
Gdsc   muk - innocentGdsc   muk - innocent
Gdsc muk - innocent
junaidhasan17133 visualizações
GCP-Professional-Cloud-Developer-Exam-v22.2.1_139-taqwlj.pdf por ssuserc36624
GCP-Professional-Cloud-Developer-Exam-v22.2.1_139-taqwlj.pdfGCP-Professional-Cloud-Developer-Exam-v22.2.1_139-taqwlj.pdf
GCP-Professional-Cloud-Developer-Exam-v22.2.1_139-taqwlj.pdf
ssuserc36624131 visualizações
DATASHEET▶ Enterprise Cloud Backup & Recovery with Symantec NetBackup por Symantec
DATASHEET▶ Enterprise Cloud Backup & Recovery with Symantec NetBackupDATASHEET▶ Enterprise Cloud Backup & Recovery with Symantec NetBackup
DATASHEET▶ Enterprise Cloud Backup & Recovery with Symantec NetBackup
Symantec4.3K visualizações
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ... por James Anderson
GDG Cloud Southlake #8  Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...GDG Cloud Southlake #8  Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
James Anderson457 visualizações
Sitecore MC best practices for DR and HA.pptx por Jitendra Soni
Sitecore MC best practices for DR and HA.pptxSitecore MC best practices for DR and HA.pptx
Sitecore MC best practices for DR and HA.pptx
Jitendra Soni201 visualizações
Breaking the Monolith road to containers.pdf por Amazon Web Services
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
Amazon Web Services206 visualizações
Breaking the Monolith road to containers.pdf por Amazon Web Services
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
Amazon Web Services339 visualizações
Google Cloud Next '22 Recap: Serverless & Data edition por Daniel Zivkovic
Google Cloud Next '22 Recap: Serverless & Data editionGoogle Cloud Next '22 Recap: Serverless & Data edition
Google Cloud Next '22 Recap: Serverless & Data edition
Daniel Zivkovic91 visualizações
Solving enterprise challenges through scale out storage & big compute final por Avere Systems
Solving enterprise challenges through scale out storage & big compute finalSolving enterprise challenges through scale out storage & big compute final
Solving enterprise challenges through scale out storage & big compute final
Avere Systems578 visualizações
Apache Beam and Google Cloud Dataflow - IDG - final por Sub Szabolcs Feczak
Apache Beam and Google Cloud Dataflow - IDG - finalApache Beam and Google Cloud Dataflow - IDG - final
Apache Beam and Google Cloud Dataflow - IDG - final
Sub Szabolcs Feczak3.2K visualizações
Train, predict, serve: How to go into production your machine learning model por Cloudera Japan
Train, predict, serve: How to go into production your machine learning modelTrain, predict, serve: How to go into production your machine learning model
Train, predict, serve: How to go into production your machine learning model
Cloudera Japan3.9K visualizações
[Study Guide] Google Professional Cloud Architect (GCP-PCA) Certification por Amaaira Johns
[Study Guide] Google Professional Cloud Architect (GCP-PCA) Certification[Study Guide] Google Professional Cloud Architect (GCP-PCA) Certification
[Study Guide] Google Professional Cloud Architect (GCP-PCA) Certification
Amaaira Johns160 visualizações
Session 4 GCCP.pptx por DSCIITPatna
Session 4 GCCP.pptxSession 4 GCCP.pptx
Session 4 GCCP.pptx
DSCIITPatna44 visualizações

Último

The Forbidden VPN Secrets.pdf por
The Forbidden VPN Secrets.pdfThe Forbidden VPN Secrets.pdf
The Forbidden VPN Secrets.pdfMariam Shaba
20 visualizações72 slides
Piloting & Scaling Successfully With Microsoft Viva por
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
13 visualizações160 slides
Unit 1_Lecture 2_Physical Design of IoT.pdf por
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdfStephenTec
15 visualizações36 slides
Scaling Knowledge Graph Architectures with AI por
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AIEnterprise Knowledge
50 visualizações15 slides
Future of Indian ConsumerTech por
Future of Indian ConsumerTechFuture of Indian ConsumerTech
Future of Indian ConsumerTechKapil Khandelwal (KK)
24 visualizações68 slides
The Research Portal of Catalonia: Growing more (information) & more (services) por
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)CSUC - Consorci de Serveis Universitaris de Catalunya
115 visualizações25 slides

Último(20)

The Forbidden VPN Secrets.pdf por Mariam Shaba
The Forbidden VPN Secrets.pdfThe Forbidden VPN Secrets.pdf
The Forbidden VPN Secrets.pdf
Mariam Shaba20 visualizações
Piloting & Scaling Successfully With Microsoft Viva por Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Richard Harbridge13 visualizações
Unit 1_Lecture 2_Physical Design of IoT.pdf por StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec15 visualizações
Scaling Knowledge Graph Architectures with AI por Enterprise Knowledge
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AI
Enterprise Knowledge50 visualizações
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... por The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
The Digital Insurer24 visualizações
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson126 visualizações
Five Things You SHOULD Know About Postman por Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman38 visualizações
PRODUCT LISTING.pptx por angelicacueva6
PRODUCT LISTING.pptxPRODUCT LISTING.pptx
PRODUCT LISTING.pptx
angelicacueva618 visualizações
Kyo - Functional Scala 2023.pdf por Flavio W. Brasil
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdf
Flavio W. Brasil418 visualizações
PRODUCT PRESENTATION.pptx por angelicacueva6
PRODUCT PRESENTATION.pptxPRODUCT PRESENTATION.pptx
PRODUCT PRESENTATION.pptx
angelicacueva618 visualizações
"Running students' code in isolation. The hard way", Yurii Holiuk por Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays24 visualizações
Microsoft Power Platform.pptx por Uni Systems S.M.S.A.
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.61 visualizações
virtual reality.pptx por G036GaikwadSnehal
virtual reality.pptxvirtual reality.pptx
virtual reality.pptx
G036GaikwadSnehal18 visualizações
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors por sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab23 visualizações
Info Session November 2023.pdf por AleksandraKoprivica4
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdf
AleksandraKoprivica415 visualizações
HTTP headers that make your website go faster - devs.gent November 2023 por Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn26 visualizações
Special_edition_innovator_2023.pdf por WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 visualizações
Ransomware is Knocking your Door_Final.pdf por Security Bootcamp
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdf
Security Bootcamp66 visualizações

Cloud Composer workshop at Airflow Summit 2023.pdf

  • 1. Cloud Composer Airflow Summit 2023 Workshop September 21, 2023
  • 2. Hi! It's nice to meet you! Bartosz Jankiewicz Engineering Manager Filip Knapik Group Product Michał Modras Engineering Manager Leah Cole Developer Relations Engineer Rafal Biegacz Engineering Manager Arun Vattoly Technical Solutions Engineer Victor Cloud Support Manager Mateusz Henc Software Engineer
  • 4. Table of contents Agenda Setting up Introduction to Cloud Composer Disaster Recovery in Cloud Composer Data Lineage in Cloud Composer 01 02 03 04 05
  • 5. Data Lineage ● Composer + BigQuery ● Composer + Dataproc Agenda Introduction ● Composer Architecture ● Composer Features Disaster Recovery ● Snapshots 15m 1h 1h ☕
  • 7. GCP Projects used during Workshop ● Main activities/exercises will be done in environments created in your dedicated project that we set up for you. Composer environments were pre-set up for you, as well. These projects and environments will be deleted after the workshop. ● Composer project info to be used by you should be passed to you in the separate email. ● If your email address you used to register for the workshop doesn’t have association with active Google Account then you will need to finish this registration as described here ● You can also get this information during the workshop
  • 8. A voucher for Google Cloud Platform (GCP) Credits ● As part of this workshop you will receive a GCP credits voucher worth $500. To be able to redeem the credits, in a addition to active Google Account you will need to set up your GCP project and associate it with an active billing account. This project and GCP credits will be owned by you. You can use activate GCP coupon within 2 months after the workshop. Workshop’s GCP credits are valid for 1 year since activation.
  • 10. Cloud Composer 2 architecture Cloud Composer 2 interacts with the following services: ● CloudSQL - running Airflow metadata storage ● Cloud Storage - user uploaded content (DAGs, user data) ● Kubernetes - runs Scheduler(s), WebServer, Redis queue, SQL proxy and Airflow workloads ● Cloud Logging - stores and indexes components logs ● Cloud Monitoring - searchable Cloud Composer metrics … and many more that we are managing for you.
  • 11. Cloud Composer in a nutshell BigQuery Data Fusion Dataflow Dataproc Storage Cloud Composer 100+ APIs … Orchestrate work across Google Cloud, external SaaS services and proprietary APIs …
  • 12. Cloud Composer benefits Simple deployment Robust Monitoring & Logging Enterprise Security Features DAG code portability Technical Support Managed infrastructure
  • 14. What is a disaster? Disaster is an event where Cloud Composer or other components essential for your environment's operation are unavailable. In case of Google Cloud the impact of disaster can be zonal, regional or global. ��
  • 15. HR Highly resilient Cloud Composer environments are Cloud Composer 2 environments that use built-in redundancy and failover mechanisms that reduce the environment's susceptibility to zonal failures and single point of failure outages. DR Disaster Recovery (DR), in the context of Cloud Composer, is a process of restoring the environment's operation after a disaster. The process involves recreating the environment, possibly in another region. What about Composer with High Resilience?
  • 16. Composer HR makes your application is available right now. DR makes sure you can get it back up later. HR != DR High resilience is critical for the availability of Cloud Composer, but it is often useless for recoverability. For example, a critical historical transactions table may be lost, but new transactions will still be processed
  • 17. Availability should be calculated based on how long a service was unavailable over a specified period of time. Planned downtime is still downtime. Definition of availability Availability = Uptime Total Time
  • 18. Availability = 1 - (1 - Aa) * (1 - Ab) Availability in distributed systems Service A SLO 99% Service B SLO 99% Availability = Aa * Ab Service A SLO 99% Service B SLO 99% 98% Parallelization (OR) Chaining (AND) 99.99%
  • 19. DR Process: Failover Step 1: Everything is fine Primary environment Snapshots storage Scheduled Snapshots Note: User Multi-regional GCS bucket for snapshots storage.
  • 20. That's why Snapshots Storage should be multi-regional. DR Process: Failover Step 2: Disaster! Snapshots storage �� Primary environment
  • 21. DR Process: Failover Step 3: Create Cloud Composer in DR region Snapshots storage Primary environment Failover environment ��
  • 22. Recovery Point Objective Maximum acceptable length of time during which data might be lost from your application due to a major incident. Recovery Time Objective Maximum acceptable length of time that your application can be offline. RTO and RPO
  • 23. Proprietary + Confidential DR scenarios RTO ↘ Cost ↗ RTO ↗ Cost ↘ Warm DR scenario is a variant of Disaster Recovery, where you use a standby failover environment, which you create before a disaster occurs. Cold DR scenario is a variant of Disaster Recovery, where you create a failover environment after a disaster occurs.
  • 24. DR Process: Failover Step 4: Load snapshot Snapshots storage �� Primary environment Failover environment Load Snapshot
  • 25. DR Process: Failover Step 4: Load snapshot and resumed workflows Snapshots storage �� Primary environment Failover environment Scheduled Snapshot
  • 26. DR Process: Failover Step 5: Disaster mitigated Snapshots storage Primary environment Failover environment Scheduled Snapshot Note: Make sure to pause DAGs in the Primary environment ⏸
  • 27. 🥶 Option 1: Switch Failover with Primary environment and delete Primary environment (Cold DR ) 🌤Option 1a: Switch Failover with Primary Environment and keep it (Warm DR) 🥶 Option 2: Fallback to Primary Environment and delete Failover environment (Cold DR) 🌤Option 2a: Fallback to Primary Environment and delete Failover environment (Warm DR) DR Process: Failover Next steps
  • 28. Creating a detailed DR plan 1. What is your RTO? 2. What is your RPO? 3. How do you want to verify your plan? https://cloud.google.com/architecture/dr-scenarios-planning-guide
  • 30. Step 1: Create Snapshots storage bucket ● Use a multi-regional bucket to ensure resiliency to regional failures. ● Make sure the bucket is accessible to your environment service account ○ Grant permissions to lab-sa@airflow-summit-workshop-{project}.iam.gse rviceaccount.com to access created bucket
  • 31. Step 2: Configure scheduled snapshots Primary environment
  • 32. Step 3: Create manual snapshot
  • 33. [Optional] Step 3a: Setup metadata db maintenance The Airflow metadata database must have less than 20 Gb of data to support snapshots 1. Upload a maintenance DAG - http://bit.ly/3t1iiYJ a. The dag is already in your environment 2. Verify database size metric. 3. [Optional] Set up an alert on database size metric.
  • 34. Step 4: Verify a snapshot has been created 1. Visit storage bucket to observe created snapshot objects. 2. … or better delegate this effort to Cloud Monitoring. a. https://cloud.google.com/composer/docs/composer-2/disaster-recovery-with-snapshots
  • 36. Step 6: Load snapshot in failover environment Note: In case of Warm-DR you should skip some options to reduce time of loading and therefore RTO Secondary environment
  • 37. [Extra topic] Anatomy of Snapshot ● Snapshot is a folder on GCS bucket ● Convention for creating folder names (convention is not validated during load) {project}_{region}_{environment}_{ISO_DATE_AND_TIME} Eg.: myproject_us-central1_test-env_2023-09-15T05-02-06/ ● Contents: airflow-database.postgres.sql.gz environment.json fernet-key.txt gcs/ dags/ metadata.json preliminary_metadata.json
  • 38. Step 7: Verify Failover environment health 1. Visit Monitoring Dashboard 2. Check your DAGs are running 3. Verify DAGs history - it should have been loaded with Snapshot
  • 39. Limitations 1. The database size cannot exceed 20GB - the metric available in Monitoring dashboard 2. Snapshot can be stored with 2h+ intervals.
  • 40. Good practices 1. Prepare your DR plan. 2. Test your disaster recovery procedure on a regular basis. 3. Decide what to do with the primary environment afterwards. 4. Set up DB maintenance and monitor DB size. 5. Set up monitoring for scheduled snapshot operations.
  • 41. Let's take a break ☕
  • 42. Data lineage in Cloud Composer 05
  • 43. Data lineage traces the relationship between data sources based on movement of data, explaining how data was sourced and transformed. ● Airflow gains rich lineage capabilities thanks to the OpenLineage integration. ● Implemented by Dataplex in Google Cloud.
  • 44. Data Lineage in Google Cloud: Dataplex ● Process ● Run (execution of Process) ● Event (emitted in a Run)
  • 45. - Currently based on the Airflow Lineage Backend feature. - Backend exports lineage data to Dataplex. - Working on migrating to OpenLineage. Data Lineage in Cloud Composer
  • 46. Operators support: - BigQueryExecuteQueryOperator - BigQueryInsertJobOperator - BigQueryToBigQueryOperator - BigQueryToCloudStorageOperator - BigQueryToGCSOperator - GCSToBigQueryOperator - GoogleCloudStorageToBigQueryOperator - DataprocSubmitJobOperator Data Lineage in Cloud Composer
  • 47. - A growing number of Google Cloud services support Data Lineage (e.g. BigQuery, Dataproc, Cloud Data Fusion). - Goal: Complete data lake lineage. Data Lineage in other Google Cloud services
  • 48. Exercise 1: Lineage from Composer orchestrated BigQuery pipeline This exercise covers data lineage with Cloud Composer, from a BigQuery context with a minimum viable data engineering pipeline. We will demonstrate lineage capture off of an Airflow DAG composed of BigQuery actions. We will first use an Apache Airflow DAG on Cloud Composer to orchestrate the BigQuery jobs and observe the lineage captured by Dataplex. Note that the lineage shows up minutes after a process is run/an entity is created.
  • 49. 1. Review the existing Composer environment
  • 52. 2. Review the existing lineage graph
  • 54. 3. Review the Airflow DAG code Go to DAGS section of the Composer environment.
  • 56. 4. Run the Airflow DAG.
  • 59. 5. Validate the creation of tables in BigQuery.
  • 60. 6. Review the lineage captured in Dataplex UI.
  • 67. 7. Navigate back to Composer Airflow DAG using a link in Data Lineage UI. TODO screenshot
  • 68. Exercise 2: Lineage from Composer orchestrated Dataproc Spark job In this exercise, we will repeat what we did with lineage of BigQuery based Airflow DAG, except, we will use Apache Spark on Dataproc Serverless instead. Note that Dataproc Serverless is not a natively supported service with Dataplex automated lineage capture. We will use custom lineage feature in Cloud Composer.
  • 69. 1. Review the DAG Navigate to the Cloud Composer UI and launch the Airflow UI Click on the Spark DAG
  • 72. 2. Verify inlets & outlets definition Scroll to look at the "inlet" and "outlet" where we specify lineage for BigQuery external tables.
  • 73. 3. Run the DAG
  • 74. 4. Verify the Dataproc Serverless batch jobs in Dataproc Batches UI in Google Cloud Console.
  • 75. 5. Analyze the lineage captured from Composer’s environment Airflow. The lineage captured is custom and BQ external table centric and therefore not visible in the Dataplex UI. The latency of lineage availability is dependent on discovery settings for the asset. Navigate to the BigQuery UI and click on the external table, oda_curated_zone.crimes_curated_spark table.