<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oscar Pulido on Medium]]></title>
        <description><![CDATA[Stories by Oscar Pulido on Medium]]></description>
        <link>https://medium.com/@oscarpulido55?source=rss-9a9ce48e9c6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UUVwkoK7TaPU79-_</url>
            <title>Stories by Oscar Pulido on Medium</title>
            <link>https://medium.com/@oscarpulido55?source=rss-9a9ce48e9c6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 22 May 2026 06:59:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oscarpulido55/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Iceberg Ahead! Navigating the Three Flavors of Iceberg on BigQuery]]></title>
            <link>https://medium.com/google-cloud/iceberg-ahead-navigating-the-three-flavors-of-iceberg-on-bigquery-e004eec18d5c?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e004eec18d5c</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[iceberg-table]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 21:51:40 GMT</pubDate>
            <atom:updated>2026-01-09T02:47:33.465Z</atom:updated>
            <content:encoded><![CDATA[<p>Navigating the world of modern data architectures can often feel like a complex journey, and a recent customer evaluation I undertook really brought this to light. The goal was to build a flexible and future-proof data lakehouse on Google Cloud, and Apache Iceberg was the clear choice for the open table format. However, the moment we turned to the BigQuery ecosystem, we were faced with a dizzying array of options: <a href="https://cloud.google.com/bigquery/docs/about-blms">BigLake Metastore</a>, <a href="https://cloud.google.com/bigquery/docs/iceberg-tables">BigQuery tables for Apache Iceberg</a>, and <a href="https://cloud.google.com/bigquery/docs/iceberg-external-tables">read-only Iceberg external tables</a>. I know it can be painful to keep track of so many names and offerings that all seem to refer to the same thing. What’s the difference, and when should you use each one? In this post, I’ll break down the analysis, sharing a clear side-by-side comparison to help you choose the right path for your specific use case.</p><h3>Side-by-Side Comparison</h3><p><a href="https://github.com/oscarpulido55/iceberg_in_BQ/blob/main/iceberg_on_BQ-side_by.csv">iceberg_in_BQ/iceberg_on_BQ-side_by.csv at main · oscarpulido55/iceberg_in_BQ</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87OS5JOGWNdFS7lTE5yfmg.png" /></figure><h3>Preferred Use Cases</h3><h4>1. BigLake Metastore (BLMS)</h4><p>BigLake Metastore is the recommended metastore on Google Cloud and is ideal for organizations building a true open-format data lakehouse where multiple analytics engines need to operate on the same data with a consistent view of the tables.</p><ul><li><strong>Interoperability:</strong> The primary use case is when you need to use both BigQuery and open-source engines like Apache Spark to read and write to the same Iceberg tables.[<a href="https://cloud.google.com/bigquery/docs/about-blms">1</a>] For example, a data engineering team can use Spark for complex ETL transformations to create or modify an Iceberg table, and a data analysis team can immediately query that same table in BigQuery without any synchronization steps.[<a href="https://cloud.google.com/bigquery/docs/about-blms">1</a>]</li><li><strong>Centralized Metadata Management:</strong> It is best for scenarios that require a single, unified catalog for all open-format tables, eliminating metadata silos and simplifying data governance across different platforms like Dataproc, Spark stored procedures, and BigQuery.[<a href="https://cloud.google.com/bigquery/docs/about-blms">1</a>]</li><li><strong>Migrating from Hive Metastore:</strong> BLMS is the target for migrating from a self-managed Hive Metastore (like Dataproc Metastore) to a serverless, fully managed solution on Google Cloud.[<a href="https://cloud.google.com/bigquery/docs/about-blms">1</a>]</li></ul><h4>2. BigQuery Tables for Apache Iceberg</h4><p>This option is best suited for users who want the benefits of the open Iceberg format while retaining the simplicity and fully managed experience of native BigQuery tables.</p><ul><li><strong>BigQuery-Centric Workloads:</strong> Ideal for teams that primarily use BigQuery for their analytics, DML operations, and streaming ingestion but want their data stored in an open format for long-term flexibility or for occasional reads from other engines.[<a href="https://cloud.google.com/bigquery/docs/iceberg-tables">2</a>]</li><li><strong>Simplified Management:</strong> Use this when you want Google to handle all the complex table maintenance tasks, such as file compaction, garbage collection, and performance optimization, just like it does for standard BigQuery tables.[<a href="https://cloud.google.com/bigquery/docs/iceberg-tables">2</a>]</li><li><strong>Open Format with BigQuery Features:</strong> This is the preferred choice when you need to combine the Iceberg format with BigQuery-native features like time travel, seamless streaming with the Storage Write API, and automatic storage optimization.[<a href="https://cloud.google.com/bigquery/docs/iceberg-tables">2</a>]</li></ul><h4>3. Apache Iceberg Read-Only External Tables</h4><p>These tables are designed for querying existing Iceberg datasets that are managed and written to by external systems.</p><ul><li><strong>Querying Existing Iceberg Tables:</strong> The main use case is to provide BigQuery users with read-only access to Iceberg tables that are already created and maintained by other processes or engines (e.g., a Spark cluster running on-premises or in another cloud).[<a href="https://cloud.google.com/bigquery/docs/iceberg-external-tables">3</a>]</li><li><strong>Multi-Cloud Analytics:</strong> Perfect for when your Iceberg data resides in AWS S3 or Azure Blob Storage and you want to query it from BigQuery without moving the data.[<a href="https://cloud.google.com/bigquery/docs/iceberg-external-tables">3</a>]</li><li><strong>Fine-Grained Access Control:</strong> Use this to apply and enforce BigQuery’s granular security policies — such as row-level security, column-level security, and data masking — on your existing Iceberg data for consumption by BigQuery users.[<a href="https://cloud.google.com/bigquery/docs/iceberg-external-tables">3</a>] It is the recommended approach, in conjunction with BigLake Metastore, to provide governed, read-only access to your open data lake.</li></ul><p>So, while the number of options for Iceberg on Google Cloud might seem daunting at first, it’s actually a reflection of a mature ecosystem designed to fit different needs. There isn’t one “best” way — only the way that’s best for <em>you</em>. If you’re building a true multi-engine lakehouse, the BigLake Metastore is your central nervous system. If you love the simplicity of BigQuery but need an open format, the native Iceberg tables are a perfect fit. And if you just need to grant governed, read-only access to your existing Iceberg data, external tables have you covered. The key is to understand that these aren’t competing products but rather complementary tools in your data strategy. By aligning your architectural needs with the right offering, you can unlock the full power of an open and flexible data platform on Google Cloud.</p><h3>Sources</h3><ol><li><a href="https://cloud.google.com/bigquery/docs/about-blms">BigLake metastore</a></li><li><a href="https://cloud.google.com/bigquery/docs/iceberg-tables">BigLake tables for Apache Iceberg in BigQuery</a></li><li><a href="https://cloud.google.com/bigquery/docs/iceberg-external-tables">Apache Iceberg read-only external tables</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e004eec18d5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/iceberg-ahead-navigating-the-three-flavors-of-iceberg-on-bigquery-e004eec18d5c">Iceberg Ahead! Navigating the Three Flavors of Iceberg on BigQuery</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Powered Legacy Migration: Modularity, Human-in-the-Loop, and LLM Last]]></title>
            <link>https://medium.com/google-cloud/ai-powered-legacy-migration-modularity-human-in-the-loop-and-llm-last-774a591a34d7?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/774a591a34d7</guid>
            <category><![CDATA[ai-code-generator]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[application-modernization]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Tue, 25 Mar 2025 15:51:48 GMT</pubDate>
            <atom:updated>2025-03-26T05:06:59.286Z</atom:updated>
            <content:encoded><![CDATA[<p>AI is rapidly transforming application development. Tools like Google Gemini Code Assist and GitHub Copilot accelerate development cycles by assisting with code writing, providing real-time suggestions, ensuring consistency and clarity, aiding in code review to identify bugs and performance bottlenecks, and automatically generating baseline unit tests. In some instances, they can even write code from unit tests, speeding up feature implementation and application creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*W2Vxd2rftPlWrBPDoD5Cuw.png" /></figure><p>A different challenge arises when modernizing legacy applications for the cloud. Migrating code from outdated languages requires precise translation while preserving original functionality. Here, AI shifts from real-time assistance to a batch refactoring tool for large-scale code transformation.</p><p>One major hurdle of this approach is the output limit inherent in Large Language Models (LLMs). Generating large volumes of translated code is costly and increases the risk of the LLM deviating from the original logic, potentially introducing errors. Furthermore, when processing extensive codebases, the LLMs may struggle to maintain a comprehensive understanding of the relationships between different modules and functions, leading to inconsistencies in the translation.</p><p>Beyond output size limit and context, other issues arise, including the need for specialized training data for specific legacy languages, and the difficulty in automatically verifying the functional equivalence of the translated code. Addressing these challenges is crucial to unlocking the full potential of AI in modernizing legacy applications.</p><h3><strong>Chunking, iterative processing, and prompt engineering</strong></h3><p>Overcoming AI’s limitations in modernizing legacy applications requires innovative strategies. The main solution to LLM output token length limitations is combining chunking, iterative processing, and refined prompt engineering. LLMs rely on attention mechanisms that track relationships between tokens in their context window. This memory requirement, growing with input and output length, necessitates output limits and affects the model’s cost and capabilities. Longer outputs also risk coherence, as LLMs can deviate from the topic or generate nonsense, which output limits help prevent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*3llzBlfYBRhtsJpQSFlkOQ.png" /><figcaption>AI generated Image</figcaption></figure><p>While maintaining coherence over long outputs remains a challenge, chunking and iterative processing, coupled with a refined prompt with specificity, and clarity, can significantly improve results. Key strategies include focusing on functional equivalence for conversions, limiting the output size per chunk, and implementing mechanisms for handling outliers.</p><ul><li><strong>Divide and Conquer: </strong>Break down large code files into smaller, manageable chunks that fit within the LLM’s token limits. Chunking should be performed deterministically at the end of functional code blocks. Process each chunk independently, minimizing the risk of exceeding the context window or output token limit.</li><li><strong>Iterative Refinement: </strong>Handle files of arbitrary size by processing them iteratively, ensuring each chunk remains within the LLM’s capabilities.</li><li><strong>Prompt Control:</strong> Use well-crafted prompts to ensure the LLM returns only the requested converted and formatted code, eliminating extraneous information.</li></ul><h3><strong>Architectural principles</strong></h3><p>To truly boost the migration process, AI applications leveraging techniques like <a href="https://www.youtube.com/watch?v=4w_uXjGl5Tk">Retrieval-Augmented Generation (RAG)</a> and <a href="https://www.youtube.com/watch?v=Qd6anWv0mv0">AI agents</a> should be developed in a modular and in an <a href="https://www.youtube.com/watch?v=Qd6anWv0mv0">Agentic workload</a> fashion. The AI agents we build should be <a href="https://www.youtube.com/watch?v=4w_uXjGl5Tk">evaluated</a>, function independently, or in a chain, using the output of some agents as input for others. This is crucial because LLMs perform best when they have complete context and the problem to solve is punctual and well-defined.</p><p>An agentic workload built on these principles needs to be framed within a revised migration strategy, one guided by the following architectural principles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XDzD1YJ4pv9odXjQ6EEUCw.png" /></figure><ul><li><strong>Modular</strong>: To maximize impact and address diverse use cases, accelerator designs must be as generic as possible. This modularity also aligns with the fact that AI achieves better accuracy when the problem to solve is highly specific.</li><li><strong>LLM Last: </strong>Prioritize cost-effective and deterministic alternatives, such as NLP and traditional ML techniques, whenever possible. Only resort to LLMs when other options are exhausted. This approach reduces risk and increases the overall quality of the replatforming baseline generation by reserving LLMs for the tasks where their unique capabilities are truly essential.</li><li><strong>Human-in-the-Loop: </strong>Avoid aiming for 100% automation. Instead, leverage AI to provide a strong foundation and solve the cold start problem. Recognize that AI cannot handle the entire task autonomously, but it can excel at predictable, well-scoped pieces of work based on carefully crafted prompts.</li></ul><blockquote>Thanks to <a href="https://www.linkedin.com/in/pradeep-bhattiprolu/">Pradeep Bhattiprolu,</a> and <a href="https://www.linkedin.com/in/aadila-jasmin/">Aadila Jasmin</a> who collaborated on this story.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=774a591a34d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/ai-powered-legacy-migration-modularity-human-in-the-loop-and-llm-last-774a591a34d7">AI-Powered Legacy Migration: Modularity, Human-in-the-Loop, and LLM Last</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Orchestrating Your Data Pipelines on Google Cloud]]></title>
            <link>https://medium.com/google-cloud/orchestrating-your-data-pipelines-on-google-cloud-a4db0dee6331?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4db0dee6331</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-platforms]]></category>
            <category><![CDATA[data-orchestration]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 18:51:01 GMT</pubDate>
            <atom:updated>2024-11-01T13:51:31.524Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In the ever-evolving world of data engineering, orchestrating data pipelines efficiently is paramount. Google Cloud Platform offers a rich set of tools for this purpose, each with its own strengths.</blockquote><h3>Domain-Based Orchestration V.S Central Orchestration</h3><p>Before diving into specific tools, let’s address the strategies for data orchestration:</p><h4>Domain-Based Orchestration</h4><p>This approach advocates for decentralized ownership, where each data domain team manages its own pipelines and tools. This structure, inherent to the <a href="https://services.google.com/fh/files/misc/build-a-modern-distributed-datamesh-with-google-cloud-whitepaper.pdf">data mesh paradigm</a>, can simplify IAM, networking, and potentially offer better control and agility for individual teams. However, it can lead to increased operational overhead and complexity, especially when <a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/multicluster-dag-dependencies">managing dependencies</a> across domains.</p><p>The <a href="https://medium.com/google-cloud/stop-thinking-in-data-pipelines-think-in-data-platforms-introducing-the-analytics-engineering-2a2a4d72b3b4">Analytics Engineering Framework</a> (AEF) offers a tangible example of this by deploying one <a href="https://github.com/oscarpulido55/aef-data-orchestration/blob/dbfd38e0f512f321b467b557cc877497dd00d83d/terraform/variables.tf#L69">Composer environment</a> for each data orchestration domain team. Each domain team should manage a copy of <a href="https://github.com/oscarpulido55/aef-data-orchestration/blob/dbfd38e0f512f321b467b557cc877497dd00d83d/terraform/variables.tf#L69">the data orchestration repository</a> and, consequently, its own dedicated Composer environment. This setup, while providing isolation and control, can exemplify the potential for increased operational overhead as the number of independent environments and repositories multiplies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8i8_E3cS2zxa-f1hjl7htw.png" /><figcaption>AI generated Image</figcaption></figure><h4>Central Orchestration</h4><p>This approach consolidates orchestration within a single project, account, or environment centralizing DataOps and potentially simplifying management. This approach may be easier to understand and manage, particularly in single-domain environments or those with shared networks. However, it may require careful IAM adjustments to ensure proper access control. Challenges faced in multi-tenant environments are <a href="https://cloud.google.com/blog/products/data-analytics/a-cloud-composer-tenancy-case-study?e=48754805">explained here</a>, including single point of failure, <a href="https://cloud.google.com/blog/products/data-analytics/airflow-dag-and-task-concurrency-in-cloud-composer?e=48754805">limited scalability</a>, eventual need for logical groupings, opportunity cost and insufficient isolation.</p><p>Additionally, it’s crucial to select a tool that supports cost-effective horizontal scalability for your central orchestration implementation. If your chosen tool cannot scale to meet your organization’s growing needs, you may be forced to distribute the workload across multiple instances. This can complicate pipeline dependencies and lead to difficult decisions about how to divide the workload (e.g., by line of business, data layer, or load type). Such a scenario necessitates careful business alignment, further emphasizing the importance of choosing a horizontally scalable tool from the outset.</p><p>The <a href="https://github.com/oscarpulido55/aef-orchestration-framework?tab=readme-ov-file#cloud-workflows-orchestration-implementation">AEF exemplifies this approach</a> by deploying <a href="https://github.com/oscarpulido55/aef-data-orchestration/tree/main?tab=readme-ov-file#concepts">orchestration workflows</a> within a single project for all data domain teams, leveraging the fully serverless and horizontally scalable capabilities of Cloud Workflows. In this setup, a <a href="https://github.com/oscarpulido55/aef-data-orchestration/blob/main/terraform/variables.tf#L17">central Google Cloud project</a> houses all the orchestration workflows. Data domain teams, whether using multiple or a single data <a href="https://github.com/oscarpulido55/aef-data-orchestration/tree/main?tab=readme-ov-file#data-orchestration">orchestration repository</a>, write their data pipelines and deploy them to this <a href="https://github.com/oscarpulido55/aef-data-orchestration/blob/dbfd38e0f512f321b467b557cc877497dd00d83d/terraform/variables.tf#L17">centralized project</a>.</p><blockquote>Both approaches are valid, the choice between these approaches depends on your organization’s structure, data access patterns, and technical expertise. Factors such as the number of domains, data access patterns, DataOps strategy and networking configurations should inform the decision.</blockquote><h3>Cloud Composer: The Powerhouse for Data Pipelines</h3><p>Built on the popular Apache Airflow, <a href="https://cloud.google.com/composer">Cloud Composer</a> is a fully managed service designed for complex data pipelines. Its Python-based DAGs offer flexibility and a rich ecosystem of <a href="https://airflow.apache.org/docs/apache-airflow-providers-google/stable/operators/cloud/index.html">operators</a> for various tasks. Cloud Composer shines in scenarios requiring:</p><ul><li><strong>Complex Workflows:</strong> Handling intricate dependencies, branching logic, and diverse data sources.</li><li><strong>Hybrid and Multi-Cloud Environments:</strong> Orchestrating workflows spanning on-premises systems and multiple cloud providers.</li><li><strong>Large-Scale Batch Processing:</strong> Executing long-running, resource-intensive tasks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/1*KV3vHTrvvgRJjhgQtH_IKA.png" /></figure><p>However, Airflow and subsequently Composer has its limitations:</p><ul><li><strong>Scalability Limits:</strong> While <a href="https://medium.com/@shuvro_25220/cloud-composer-3-truly-serverless-5af001bc7930">Composer 3 introduces improvements</a>, Airflow’s architecture inherently poses <a href="https://cloud.google.com/blog/products/data-analytics/scale-your-composer-environment-together-your-business?e=48754805">challenges for horizontal scalability</a> and serverless operation. <a href="https://cloud.google.com/blog/products/data-analytics/optimize-cloud-composer-via-better-airflow-dags?e=48754805">Optimizing DAGs for concurrency and scaling</a> environments can be complex</li><li><strong>Operational Overhead:</strong> Managing Composer environments, including <a href="https://cloud.google.com/composer/docs/composer-2/save-load-snapshots">DR management and backup</a>, security configurations, and <a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/multicluster-dag-dependencies">dependency management</a>, can add operational complexity.</li><li><strong>Cost: </strong>Each Composer environment incurs <a href="https://cloud.google.com/composer/pricing#composer-2">fixed costs</a>, and <a href="https://medium.com/yugen-ai-technology-blog/optimise-cloud-composer-1-costs-from-188-day-to-11-day-8daf8c952cc7">optimizing Cloud Composer</a> for cost-effectiveness requires careful consideration and ongoing effort. <a href="https://cloud.google.com/composer/pricing#transition-composer-3">Composer 3 pricing</a> is based on Data Compute Units (DCUs) but it keeps a cluster running in a tenant project even when no tasks are being executed.</li></ul><p>Despite these limitations, Composer, particularly when adopted in a domain-based approach with potentially smaller, dedicated environments, remains a powerful tool for organizations with complex data orchestration needs.</p><h3>Cloud Workflows: Serverless Simplicity for Service Orchestration</h3><p><a href="https://cloud.google.com/workflows">Cloud Workflows</a> offers a serverless, fully managed platform for orchestrating services through HTTP-based APIs. Defined using <a href="https://cloud.google.com/workflows/docs/reference/syntax">YAML</a> or JSON, workflows excel in scenarios requiring:</p><ul><li><strong>Service Integration:</strong> Chaining together microservices, APIs, and serverless functions.</li><li><strong>Event-Driven Automation:</strong> Triggering workflows based on events like file uploads, database changes, or messages in Pub/Sub.</li><li><strong>Cost-Effective Scalability:</strong> Automatic scaling based on demand, with a pay-per-use billing model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/1*r5scZGoOjy_xkpvfAox7tw.png" /></figure><p>While Cloud Workflows excels in service orchestration, it currently lacks some features crucial for robust data pipeline management, such as advanced retry mechanisms and data-aware triggers.</p><h3>Bridging the Gap: The Analytics Engineering Framework (AEF)</h3><p>The AEF emerges as a potential solution, by abstracting <a href="https://github.com/oscarpulido55/aef-data-orchestration/tree/main?tab=readme-ov-file#concepts">data pipelines into levels, threads, and steps</a>, AEF simplifies pipeline definition and promotes best practices like <a href="https://medium.com/google-cloud/stop-thinking-in-data-pipelines-think-in-data-platforms-introducing-the-analytics-engineering-2a2a4d72b3b4">CI/CD and a multi-repository strategy</a>.</p><p>Importantly, <a href="https://github.com/oscarpulido55/aef-data-orchestration/tree/main/workflow-definitions">AEF supports both Cloud Composer and Cloud Workflows</a>, allowing you to choose the best tool for your needs. This flexibility enables a hybrid approach, leveraging Composer’s power for complex pipelines and Workflows’ simplicity for service orchestration.</p><h3>BigQuery Workflows: Streamlining BigQuery-Centric Orchestration</h3><p><a href="https://cloud.google.com/bigquery/docs/workflows-introduction">BigQuery Workflows</a> simplifies the scheduling and orchestration of tasks within the BigQuery ecosystem, which is rapidly growing into a single unified serverless data platform. It allows you to schedule SQL scripts, notebooks, and data transfers, offering a centralized location for managing BigQuery-centric workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*2znfynltNV_c7WfgIC1E_w.png" /></figure><p>This growing ecosystem includes new capabilities like running <a href="https://cloud.google.com/bigquery/docs/spark-procedures">Apache Spark</a> and <a href="https://cloud.google.com/bigquery-engine-for-apache-flink/docs/overview">Flink jobs</a> directly within BigQuery, further solidifying its position as a comprehensive data platform. With BigQuery Workflows, you can seamlessly orchestrate these diverse tasks, including SQL analytics, Spark processing, and <a href="https://cloud.google.com/managed-service-for-apache-kafka/docs/overview">Apache Kafka</a> and Flink streaming pipelines, all within a unified environment.</p><h3><strong>Choosing the Right Tool: A Strategic Decision</strong></h3><p>Selecting the optimal data orchestration tool involves carefully considering your organization’s specific needs and constraints. Here’s a quick recap:</p><ul><li><strong>Cloud Composer:</strong> Ideal for complex data pipelines, hybrid/multi-cloud environments, and large-scale batch processing. Best suited for domain-based orchestration.</li><li><strong>Cloud Workflows:</strong> Perfect for service orchestration, event-driven automation, and cost-effective scaling. Well-suited for central orchestration. Will require engineering to manage data use cases properly.</li><li><strong>BigQuery Workflows:</strong> Simplifies scheduling and orchestration within the fast growing BigQuery ecosystem, ideal for BigQuery-centric workflows.</li></ul><blockquote>The <a href="https://medium.com/google-cloud/stop-thinking-in-data-pipelines-think-in-data-platforms-introducing-the-analytics-engineering-2a2a4d72b3b4">AEF</a> provides a valuable framework for implementing either domain-based or central orchestration, offering flexibility and promoting best practices.</blockquote><blockquote>Ultimately, the key is to choose a solution that aligns with your data strategy, technical capabilities, and long-term vision for your data platform.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4db0dee6331" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/orchestrating-your-data-pipelines-on-google-cloud-a4db0dee6331">Orchestrating Your Data Pipelines on Google Cloud</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Thinking in Data Pipelines, Think in Data Platforms: Introducing the Analytics Engineering…]]></title>
            <link>https://medium.com/google-cloud/stop-thinking-in-data-pipelines-think-in-data-platforms-introducing-the-analytics-engineering-2a2a4d72b3b4?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a2a4d72b3b4</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-platforms]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 22:04:34 GMT</pubDate>
            <atom:updated>2025-05-10T20:03:07.192Z</atom:updated>
            <content:encoded><![CDATA[<h3>Stop Thinking in Data Pipelines, Think in Data Platforms: Introducing the Analytics Engineering Framework</h3><blockquote>Imagine a world where you could deploy your entire enterprise-ready data platform in minutes and empower your data practitioners to independently write complex, end-to-end data pipelines in a standardized and scalable way, allowing them to focus on insights from day one.</blockquote><p>This is the vision behind the <a href="https://github.com/GoogleCloudPlatform/aef-orchestration-framework/blob/main/AEF_DEPLOYMENT.md"><strong>Analytics Engineering Framework (AEF)</strong></a>, a comprehensive, <strong>opinionated</strong> <strong>design</strong> and sample code for building and deploying robust, flexible, and cost-effective data platforms in Google Cloud Platform (GCP).</p><p>Consider using the AEF if you are looking for an enterprise-ready strategy and <strong>declarative</strong> approach that enables end data practitioners to build robust, scalable, and cost-effective data pipelines in GCP. Especially if you’re starting from scratch or looking to modernize an existing platform and you need:</p><ul><li>To empower your data practitioners with a <strong>self-service model</strong>.</li><li>A practical, scalable <strong>data mesh</strong> implementation ready for deployment.</li><li>To simplify and <strong>standardize</strong> your data pipeline <strong>orchestration</strong>.</li><li>To reduce operational overhead and costs with a <strong>serverless-first</strong> approach</li><li>Improve the maintainability and reliability of your data pipelines using a <strong>solid CI/CD and repositories strategy</strong>.</li></ul><h3>The challenge with maintainable Data Pipelines</h3><p>While BigQuery offers a <a href="https://cloud.google.com/blog/products/data-analytics/bigquery-is-a-unified-ai-ready-data-analytics-platform?e=48754805">comprehensive solution</a> for modern data challenges by unifying data management, governance, and analysis within a single platform, building a robust DataOps strategy around it often feels like assembling a complex puzzle, requiring organizations to piece together various tools for IaaC, CI/CD, data ingestion, orchestration, and governed cataloging.</p><p>This complexity leads to substantial engineering costs for setup, maintenance, and training, creating a high barrier to entry for organizations seeking to leverage the power of data analytics on Google Cloud Platform while simultaneously <strong>adhering to software engineering principles for a maintainable platform</strong>.</p><p>The situation is further complicated by the often unclear ROI of data initiatives. Investing heavily in a complex platform can be risky, especially when the value derived from the data is uncertain.</p><ul><li><strong>Fragmented Development:</strong> Individual pipelines are built in isolation, leading to inconsistencies, redundancy and avoiding organized growing and fast new use cases implementation.</li><li><strong>Centralized Bottleneck:</strong> Data practitioners often rely on data engineers to build and manage pipelines, creating a bottleneck and hindering agility.</li><li><strong>Limited Scalability and Flexibility:</strong> Scaling and adapting pipelines to new use cases can be challenging and time-consuming.</li><li><strong>Cost Inefficiency:</strong> Orchestration tools like Apache Airflow can be costly to operate at scale, some organizations need cost-effective alternatives.</li></ul><p>Data teams often end with <strong>technical debt surrounding CI/CD, IaS, observability, and the least privilege principle</strong>. Establishing a foundational data platform that proactively addresses these potential gaps would empower teams to concentrate their efforts on building their data pipelines.</p><h3>AEF: A Paradigm Shift in Data Platform CI/CD</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZeUELi780I3BSBkm" /></figure><p>The AEF addresses these challenges by introducing a paradigm shift in data platform development. Its core design principles are:</p><h3>1. CI/CD and Declarative-Driven Approach:</h3><p>AEF leverages a <strong>multi-repository strategy</strong>, with dedicated repositories for:</p><ol><li><a href="https://github.com/googlecloudplatform/aef-orchestration-framework"><strong>Orchestration Framework</strong></a><strong>: </strong>Maintained by <strong>analytics engineers</strong> to provide seamless, extensible orchestration and execution infrastructure.</li><li><a href="https://github.com/googlecloudplatform/aef-data-model"><strong>Data Model</strong></a><strong>: </strong>Directly used by <strong>end data practitioners</strong> to manage data models, schemas, and Dataplex metadata.</li><li><a href="https://github.com/googlecloudplatform/aef-data-orchestration"><strong>Data Orchestration</strong></a><strong>: </strong>Directly used by <strong>end data practitioners</strong> to define and deploy data pipelines using levels, threads, and steps.</li><li><a href="https://github.com/googlecloudplatform/aef-data-transformation"><strong>Data Transformation</strong></a><strong>: </strong>Directly used by <strong>end data practitioners</strong> to define, store, and deploy data transformations.</li></ol><p>This separation of concerns allows for independent deployment, scalability, and clear ownership of different platform components. <strong>Each repository should have its own CI/CD pipeline</strong>, enabling independent deployment and faster iteration cycles.</p><h3>2. Embracing the Analytics Engineering Concept:</h3><p>AEF is built on the principles of <a href="https://www.getdbt.com/what-is-analytics-engineering">analytics engineering</a>, empowering data practitioners to independently build, organize, transform, and document data using software engineering best practices. This fosters a self-service data platform where data practitioners can create their own data products while adhering to a federated computational governance model.</p><h3>3. Agnostic to Orchestration and Processing Tools:</h3><p>AEF is designed to be agnostic to the <a href="https://github.com/googlecloudplatform/aef-data-orchestration?tab=readme-ov-file#domain-based-vs-central-orchestration">orchestration tool</a> and <a href="https://github.com/googlecloudplatform/aef-data-transformation?tab=readme-ov-file#repository">data processing</a> engine. While it provides sample orchestration code for <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/blob/24614731597341c9f4b051920c4fc915f493f5ab/workflow-definitions/demo_pipeline_cloud_workflows.json#L2">Cloud Workflows</a>, and <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/blob/24614731597341c9f4b051920c4fc915f493f5ab/workflow-definitions/demo_pipeline_composer.json#L2">Cloud Composer</a> it can be integrated with other tools based on specific needs. This flexibility allows for seamless integration with existing systems and future-proofs the data platform.</p><h3>4. Serverless-First Approach:</h3><p>AEF prioritizes serverless technologies, leveraging the scalability, cost-effectiveness, and ease of use of services like Cloud Functions, BigQuery, and Cloud Workflows. This minimizes the need for long-term running servers, reducing operational overhead and costs.</p><h3>5. Cost-Effectiveness:</h3><p>By leveraging serverless technologies and providing a standardized framework for data pipeline development, AEF significantly reduces the overall cost of building and operating a data platform. This ensures cost-effectiveness and makes the platform accessible to a wider range of organizations.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJ_PFqIw7UaQ&amp;type=text%2Fhtml&amp;schema=google&amp;display_name=YouTube&amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJ_PFqIw7UaQ" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d257a83154bc0d40f174f240efab716/href">https://medium.com/media/7d257a83154bc0d40f174f240efab716/href</a></iframe><h3>Multi-Repository Strategy is Core to AEF</h3><p>While data models are rarely changed due to their significant impact, they require robust schema evolution controls. Data pipelines, however, change more frequently and are developed by various personas. Reusable data transformations can also be shared across teams.</p><p>Additionally, core capabilities must be secured and standardized to ensure availability for multiple diverse teams while enabling a self-served data platform experience.</p><p>Therefore, segregation of responsibilities, independent repositories, and CI/CD pipelines are crucial for a scalable and robust data platform.</p><p>The multi-repository strategy and a robust CI/CD strategy are at the heart of AEF’s design, enabling:</p><ul><li><strong>Clear Ownership and Responsibility:</strong> Different teams can own and manage specific repositories, fostering a sense of ownership and accountability.</li><li><strong>Independent Deployment and Scalability:</strong> Independent CI/CD pipelines for each repository allow for granular control over deployment and scaling of individual components that are released at different frequencies.</li><li><strong>Isolation of Failures:</strong> Failures in one repository are less likely to impact other components, ensuring overall platform stability.</li><li><strong>Easier Rollbacks:</strong> Changes can be rolled back more easily at a granular level, minimizing the impact of deployment issues.</li><li><strong>Parallel Development:</strong> Multiple teams can work on different repositories simultaneously, accelerating development and fostering collaboration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*49WjEjE9g0L8cFPa" /></figure><p>CI/CD plays a crucial role by automating deployment, and in that way enabling self-serve approach and minimizing errors. Additionally, it enables version control and rollbacks, allowing for easy recovery in case of issues. Automated tests can be integrated into the CI/CD pipeline, ensuring the quality and integrity of the code. By streamlining these processes, CI/CD facilitates faster iteration cycles, accelerating the development and deployment of new features and bug fixes.</p><h3>Domain-Based Orchestration V.S Central Orchestration</h3><p><a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/tree/main?tab=readme-ov-file#data-orchestration">Data orchestration</a> is crucial for data lakes and warehouses. While Composer offers benefits, it doesn’t removes <a href="https://cloud.google.com/blog/products/data-analytics/scale-your-composer-environment-together-your-business?e=48754805">Airflow’s operational challenges</a>. A serverless, cost-effective alternative using Cloud Workflows with automatic scaling and pay-per-use model optimizes resource usage, reduces costs, and accelerates time to value for some use cases.</p><p>The AEF <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/tree/main?tab=readme-ov-file#domain-based-vs-central-orchestration">offers flexibility</a> to choose the better orchestration framework for each organization.</p><p><strong>Domain-Based Orchestration:</strong> Isolating orchestration by domain potentially simplifies IAM and networking management but may lead to increased operational overhead and complexity. This approach is preferred in multi-domain environments with distinct data access and processing needs. This is demonstrated in the <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/tree/main?tab=readme-ov-file#data-orchestration">Data Orchestration</a> repository, where one Composer environment is managed and deployed for each data domain team, with each team owning a copy of the repository.</p><p><strong>Central Orchestration: </strong>Consolidating orchestration into a single project centralizes Data Ops and potentially reduces management complexity. This approach may be simpler to understand and manage, particularly in single-domain environments or those with shared networks. However, it may necessitate IAM adjustments. This is easily managed when using Cloud Workflows, as its serverless nature enables deployment within a single centralized project for all data domain teams.</p><p>Both approaches are valid, and the “definitive” guide can be adapted based on specific organizational requirements and constraints. Factors such as the number of domains, data access patterns, and networking configurations should inform the decision. Simplifying the development of complex data pipelines.</p><h3>Data pipeline abstractions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*RbzvsppGgI9N-AHiJfPBVA.png" /></figure><p>One of the central components of the AEF is its approach to data pipeline orchestration. Recognizing the need for a simplified yet powerful orchestration abstraction, AEF introduces <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/tree/main?tab=readme-ov-file#data-orchestration">three core abstractions</a>:</p><ul><li><strong>Steps</strong>: Represent individual data transformations, such as executing a BigQuery saved query, running a Dataflow or serverless Dataproc job, or even triggering a Dataform repository run.</li><li><strong>Threads</strong>: Group a sequence of steps to be executed one after the other, enabling parallel execution of different sets of tasks.</li><li><strong>Levels</strong>: Allow for a combination of sequential and parallel execution, with multiple threads running concurrently within a level and subsequent levels executing only after all tasks in the previous level are completed.</li></ul><p>With these three simple concepts, declaratively defined as parameter files, end data practitioners can independently define complex data pipelines.</p><p>Translation to actual Cloud Workflows definitions or Airflow DAGs and subsequent deployment of these high-level orchestration definitions will be done as CI/CD pipelines steps.</p><p>Similarly, data practitioners will write simple parameter files to define their data transformations in the corresponding repository.</p><p>In the same way, the data model repository will store Dataplex metadata definitions to enable data governance, discoverability, and access control. Additionally, the data model repository will keep track of DDLs, schemas and datasets, including their deployment and version control.</p><h3>Hands on</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuPEC4_K5ars%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuPEC4_K5ars&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuPEC4_K5ars%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/20d03535775099f98778a36d7b93bf62/href">https://medium.com/media/20d03535775099f98778a36d7b93bf62/href</a></iframe><p>This <a href="https://github.com/GoogleCloudPlatform/aef-orchestration-framework/blob/main/AEF_DEPLOYMENT.md#deployment">demo</a> lets you easily deploy and test the AEF. It includes everything you need to get started, including sample data and sources. You’ll see how to:</p><ul><li><strong>Populate sample data:<br> </strong>— <a href="https://github.com/GoogleCloudPlatform/aef-data-model/blob/main/sample-data/terraform/main.tf#L93">Deploy mock on-prem JDBC data source DB.</a><br> — Populate sample <a href="https://github.com/GoogleCloudPlatform/aef-data-model/blob/main/sample-data/gcs-files/companies_data.dat">GCS Mainframe files</a>.<br> — Populate sample <a href="https://github.com/GoogleCloudPlatform/aef-data-model/blob/main/sample-data/gcs-files/sales_dt1.csv">GCS CSV files</a>.</li><li><strong>Deploy the AEF: </strong>Clone repositories and run initial terraform deployments including sample declarative parameter files for:<br> — Data model <a href="https://github.com/GoogleCloudPlatform/aef-data-model/blob/main/sample-data/gcs-files/raw_sales.sql">DDLs</a> and <a href="https://github.com/GoogleCloudPlatform/aef-data-model/tree/main/metadata">metadata</a>.<br> — Data Pipeline definitions. (Examples for both <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/blob/main/workflow-definitions/demo_pipeline_composer.json">Cloud Composer</a> and <a href="https://github.com/GoogleCloudPlatform/aef-data-orchestration/blob/main/workflow-definitions/demo_pipeline_cloud_workflows.json">Cloud Workflows</a>).<br> — <a href="https://github.com/GoogleCloudPlatform/aef-data-transformation/tree/main/jobs/dev">Data Transformations</a>.</li><li><strong>Run end-to-end data pipelines in the AEF:</strong> Using both Cloud Composer and Cloud Workflows:<br> — <strong>Extract data from different places:</strong> This includes <a href="https://github.com/GoogleCloudPlatform/aef-data-transformation/blob/main/jobs/dev/dataproc-serverless-job-executor/sample_serverless_spark_mainframe_ingestion.json">mainframe files using Dataproc</a>, and <a href="https://github.com/GoogleCloudPlatform/aef-data-transformation/tree/main/jobs/dev/dataflow-flextemplate-job-executor">databases using Dataflow flex templates</a>.<br> — <strong>Process the data:</strong> Use <a href="https://github.com/oscarpulido55/aef-sample-dataform-repo/blob/4a5492a3ed7de9307e91cf5b96cc6e72abec4f5f/definitions/sources/raw_locations.sqlx#L14">Biglake</a> to read GCS files,<a href="https://github.com/GoogleCloudPlatform/aef-data-transformation/blob/main/jobs/dev/dataform-tag-executor/run_dataform_tag.json"> join and transform data using dataform</a>.<br> — <strong>Create a data product: </strong>Make the <a href="https://github.com/oscarpulido55/aef-sample-dataform-repo/blob/4a5492a3ed7de9307e91cf5b96cc6e72abec4f5f/definitions/output/fact_sales.sqlx#L24">transformed data</a> available in BigQuery.</li></ul><p>This demo deploys the entire AEF in a single Google Cloud project and shows the complete lifecycle of a data product, from raw data to a final, usable table.</p><h3>Conclusion</h3><p>The AEF provides a blueprint for building modern, scalable, and cost-effective data platforms on GCP. Its multi-repository strategy, coupled with a robust CI/CD implementation, empowers data practitioners to independently build and manage complex data pipelines, accelerating time-to-insight and enabling organizations to focus on extracting value from their data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a2a4d72b3b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/stop-thinking-in-data-pipelines-think-in-data-platforms-introducing-the-analytics-engineering-2a2a4d72b3b4">Stop Thinking in Data Pipelines, Think in Data Platforms: Introducing the Analytics Engineering…</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ensuring data localization compliance on data movement between BigQuery regions]]></title>
            <link>https://medium.com/@oscarpulido55/ensuring-data-localization-compliance-on-data-movement-between-bigquery-regions-34e40fc88b73?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/34e40fc88b73</guid>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-loss-prevention]]></category>
            <category><![CDATA[gdpr-compliance]]></category>
            <category><![CDATA[etl]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Tue, 08 Aug 2023 13:37:34 GMT</pubDate>
            <atom:updated>2023-11-08T15:05:05.049Z</atom:updated>
            <content:encoded><![CDATA[<p>Global organizations need to analyze data coming from the different jurisdictions they operate in to generate important insights for their decision-making processes. On the other hand, data protection laws like the EU’s GDPR (General Data Protection Regulation), or India’s PDPB (Personal Data Protection Bill) include data sovereignty regulations that need to be carefully considered.</p><p>While many regulations have data residency requirements that restrict moving PII data out of a given jurisdiction, this generally not apply to anonymized or aggregated data, allowing it to be globally analyzed.</p><p>This post will introduce some opinionated best practices to facilitate cross-border transfers in a privacy-safe and compliant way.</p><p>For this approach we will leave aside important infrastructure and networking considerations to focus on the data movement process including resource hierarchy, the required data access controls, and PII detection to mitigate regulation breaching risks.</p><h3>Projects and Datasets</h3><p>A robust hierarchy using multiple folders and projects to organize the data would facilitate organizational policies enforcement, operations (billing, logging, monitoring), as well as simplify the implementation of data access controls and inspection for PII data. In the next example we are only considering environment, region and data products but a production-ready deployment should consider hierarchies like Data Domains or Data Marts, based on the defined analytics strategy i.e. (DWH, DataMesh or even a Lakehouse).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*dJz00CL2A7bG50Gj0fK8MA.png" /><figcaption>Projects and Datasets for cross-region data sharing</figcaption></figure><ol><li><strong>Source Dataset: </strong>One dataset per jurisdiction, Source Dataset will depend on the data warehouse model defined, and it refers to denormalized data, a star model with fact and dimension tables, a data mart or any other analytics schema. You can also think of Source Dataset as the existing Dataset with the source data to be globally analyzed.</li><li><strong>Isolated Dataset: </strong>One dataset per jurisdiction, holds locally aggregated data, could also be PII free data or anonymized data. Prefer new tables over Views/Authorized views to show clear evidence that no raw data is leaving perimeters, and to be able to use VPC Service Controls.</li><li><strong>Destination Dataset: </strong>One global dataset in the selected location in which analytical users will run global analytics, it is the destination dataset for the data coming from all the Isolated Datasets in the different regions.</li></ol><p>Source Dataset, Isolated Dataset, and Destination Dataset should each reside in different projects, providing the following advantages:</p><ul><li>Additional IAM layer for security.</li><li>Can use <a href="https://cloud.google.com/vpc-service-controls">VPC Service Controls</a> to prevent the local analytic dataset from being API accessible from outside the region.</li><li>Prevent global analytical Users/Service Accounts from reading non sharable data.</li></ul><h3>Access Control Strategy</h3><p>The end to end process of preparing global aggregated data should be achieved with 2 types of service accounts:</p><ol><li><strong>Source Service Account: </strong>One service account per jurisdiction that reads local analytical data and prepares local aggregate data.</li><li><strong>Sharing Service Account:</strong> One common service account that can read the minimum necessary local aggregated data in all jurisdictions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZIzP2PKF5w1qyFS_dnrBQ.png" /><figcaption>Service Accounts &amp; required accesses</figcaption></figure><p>As the Source Dataset is part of the existing data warehouse model, existing users/processes will keep reading/writing to it. No other service accounts or user accounts should be given permissions to read or write data in the Source Isolated Dataset or in the Destination Dataset. Global analytics users should impersonate service accounts to prevent the end user from joining data with other local analytics data.</p><p>It is important to prevent the Sharing Service Account from reading non-aggregated/non-anonymized data (Source Dataset) in the local jurisdiction.</p><h3>Cross-region Data Movement</h3><p>Data is moved in two steps. Data ready to be moved should sit in a dedicated/isolated BigQuery dataset or in a dedicated/isolated GCS bucket. So as a first step the data should be moved from the source BigQuery dataset to a dedicated/isolated Cloud Storage bucket or BigQuery dataset. The second step is the actual cross region data movement.</p><p><strong>Isolating data in the source region</strong></p><p>Data should arrive de-identified or aggregated to the isolated dataset. It can be already de-identified in the Source Dataset or could be de-identified as it is moved to the Isolated Dataset.</p><p><strong>A</strong>ssuming your source data is already de-identified in BigQuery Source Dataset, you can move it to an isolated BigQuery dataset or to an isolated GCS bucket before taking it out of the region. Here some options to do that:</p><ol><li><a href="https://cloud.google.com/bigquery/docs/exporting-data#bq">bq export</a> is the simplest way to extract data from BigQuery tables to Cloud Storage.</li><li>You can also use Composer/Airflow and the <a href="https://airflow.apache.org/docs/apache-airflow/1.10.12/_api/airflow/contrib/operators/bigquery_to_gcs/index.html#module-airflow.contrib.operators.bigquery_to_gcs">BigQueryToCloudStorageOperator</a> Airflow operator to move from BigQuery to Cloud Storage.</li><li><a href="https://cloud.google.com/bigquery/docs/table-snapshots-intro">Table snapshots</a> or <a href="https://cloud.google.com/bigquery/docs/table-clones-intro">table clones</a> could be also used to move data between source dataset and isolated dataset within BigQuery without physically duplicating data and reducing cost.</li></ol><p>If data will be de-identified as it is moved to the Isolated Dataset, then an ETL approach (Dataflow/Dataproc) will be necessary to move data to the Isolated Dataset.</p><p>Landing the data in GCS is preferred in order to leverage the <a href="https://cloud.google.com/storage-transfer/docs/cloud-storage-to-cloud-storage">Storage Transfer Service</a> or <a href="https://cloud.google.com/storage/docs/gsutil/commands/rsync">GCS rsync</a> for the following step.</p><p><strong>Moving Data between regions</strong></p><p>As of now (Nov 2023) there is no GA option to read data from BigQuery in one region and write it back to BigQuery in a different region directly. GCS will need to be used for staging in at least one region. We can move the data using no-code options like Storage Transfer Service (STS) or rsync or an ETL approach (Dataflow/Dataproc):</p><ol><li>Use <a href="https://cloud.google.com/storage/docs/gsutil/commands/rsync">gsutil rsync</a> for data sizes under 1TB, and use the default CMEK key set on the GCS source and destination buckets.</li><li>Use <a href="https://cloud.google.com/storage-transfer/docs/cloud-storage-to-cloud-storage">STS</a> for data sizes above 1TB, it scales to larger data sizes, and supports transferring data to and from CMEK protected buckets.</li><li>Both Dataproc and Dataflow ELT options support setting a temporal bucket when moving data between different BigQuery regions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v78ZgOQ3E4Lv0g10YzAvyg.png" /><figcaption>GCS temporary bucket location to move data cross regions, applies for ELT options only. gsutil rsync and STS will always be from and to GCS.</figcaption></figure><p>There are two in preview (Nov 2023) offerings that allows you moving data between different regions directly in BQ:</p><ol><li><a href="https://cloud.google.com/bigquery/docs/managing-datasets#copy-datasets">BigQuery cross-region dataset copy</a> allows you copying an entire datasets across regions without an ETL or moving data out of BigQuery, however there are several <a href="https://cloud.google.com/bigquery/docs/managing-datasets#limitations">limitations</a> because you can not move views, UDFs, External tables or CMEK encrypted tables, also appending data in the destination dataset is not supported and and the minimum frequency between copy jobs is 12 hours.</li><li>If the use case implies keeping a read-only replica in the destination region then <a href="https://cloud.google.com/bigquery/docs/data-replication">Cross-region dataset replication</a> could be considered as it is a simple setup configuration, however it is important to look at the <a href="https://cloud.google.com/bigquery/docs/data-replication#limitations">limitations</a> as this option is intended for for additional geo-redundancy, not cross region data sharing specifically.</li></ol><p>In this two cases the presented organization hierarchy and access control strategy should be also considered to guaranty jurisdiction data isolation and secure data movement.</p><h3>Mitigating cross-region PII data exfiltration risk</h3><p>The DLP (Data Loss Prevention) service is a fundamental tool in ensuring PII data is not transferred outside the local jurisdiction. Inspection jobs and inspection templates can be used to publish tags in Data Catalog at a <a href="https://cloud.google.com/dlp/docs/sending-results-to-dc">table level</a>, or at a <a href="https://cloud.google.com/community/tutorials/dataflow-dlp-to-datacatalog-tags">column level</a> using a Dataflow job.</p><p>DLP inspection jobs inspecting sampled data in the <strong>Isolated dataset</strong> could run in batch to improve cost effectiveness.</p><p>To avoid delaying data movement, inspection jobs can run in parallel to the cross-region data replication jobs, ensuring you identify the PII data at least at the same time it is being moved, so you can stop a data movement or delete already transferred data based on alerts.</p><p>Once DLP identifies sensitive data, a policy tag can be automatically created to further restrict access depending on the content.</p><p>If orchestrated using Composer a <a href="https://airflow.apache.org/docs/apache-airflow-providers-google/stable/operators/cloud/datacatalog.html">Data Catalog Airflow operator</a> could obtain entry details, including tags and values to be used as a control or validation step in the transferring pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*BQC64ViVyvQYy_lq" /><figcaption>PII validation step on Orchestrated data movement</figcaption></figure><h3>Conclusion</h3><p>At the time of writing this article, STS, <em>gsutil rsync</em> and <em>bq export</em> are no-code solutions to isolate and replicate data across regions that, in conjunction with the presented access control strategy, hierarchy design and DLP-based PII data identification process, provides jurisdiction data isolation to ensure data is moved in a secure way.</p><blockquote>Thanks to <a href="https://www.linkedin.com/in/himald/">Himal Dwarakanath</a>, <a href="https://www.linkedin.com/in/daryus-medora/">Daryus Medora</a> and <a href="https://www.linkedin.com/in/juliannecuneo/">Julianne Cuneo</a> who collaborated on this story.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34e40fc88b73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Single User Jupyter Notebooks at Google Cloud]]></title>
            <link>https://medium.com/google-cloud/single-user-jupyter-notebooks-at-google-cloud-a78670536b12?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a78670536b12</guid>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[jupyterlab]]></category>
            <category><![CDATA[jupyterhub]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 14:25:39 GMT</pubDate>
            <atom:updated>2023-07-20T01:53:04.661Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/personal-workbench-notebooks-deployer">professional-services/examples/personal-workbench-notebooks-deployer at main · GoogleCloudPlatform/professional-services</a></p><p>Enterprises need analytical users and data scientists to use their own identity (rather than generic service accounts) when querying and processing data on their experiments to make data usage monitoring and cost allocation easier in a governed environment.</p><p>Also notebook environments lifecycle automation is necessary to scale and serve enterprise level amount of users.</p><p>Data Scientists working with large amounts of data may need to run jobs in Spark or other distributed processing engines on Dataproc (managed Hadoop). For others, a Python kernel or single node Spark environment would be enough.</p><p>As a data platform central governance manager, you don’t need to provide analytical users with access to the GCP web Console, but to an on-demand self provisioned Jupyter environment.</p><p>The Terraform <a href="https://github.com/GoogleCloudPlatform/professional-services/blob/main/examples/personal-workbench-notebooks-deployer/modules"><strong>modules</strong></a> introduced here intend to help with the provisioning process of individual user analytical environments.</p><p>Google provides <a href="https://cloud.google.com/vertex-ai/docs/workbench/notebook-solution">two Jupyter notebook-based options</a> for your data science workflow:</p><h3>Managed Notebooks</h3><p><a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/introduction"><strong>Managed notebooks</strong></a><strong> </strong>are designed to manage provision, submission and decommission of resources via notebook instances running as Vertex AI managed VMs in a tenant project.</p><ul><li><strong>Identity impersonation:</strong> For Managed Notebooks to impersonate end-user identity when querying data across other GCP services (such as GCS and BigQuery), you can <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/manage-access-jupyterlab#access-modes">set Single User</a> access mode to grant access to an specific user only, so they can login in the Jupyter environment using their own credentials.</li><li><strong>Kernels: </strong>Managed notebooks are instances that can run Python, Spark standalone single node, R, and shell kernels.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*zfNkOl-eVLemh-va.png" /><figcaption>Single-user Vertex Workbench AI Managed Notebook</figcaption></figure><p>The <a href="https://github.com/GoogleCloudPlatform/professional-services/blob/main/examples/personal-workbench-notebooks-deployer/modules/personal-managed-notebook/README.md">personal-managed-notebook</a> module is intended to provide automation via Terraform to create individual managed notebooks for each end-user.</p><h3>User Managed Notebooks / Dataproc Hub</h3><p><a href="https://cloud.google.com/vertex-ai/docs/workbench/user-managed/introduction"><strong>User Managed notebooks</strong></a> allow heavy customization, and personalized images usage running as VMs in customer project.</p><ul><li><strong>Identity impersonation: </strong>For User Managed Notebooks / Dataproc Hub to impersonate end-user credentials when querying data, Dataproc clusters must have ‘<a href="https://cloud.google.com/dataproc/docs/concepts/iam/personal-auth">Personal Cluster Authentication</a>’ enabled.</li><li><strong>Kernels:</strong> User Managed notebooks / Dataproc Hub are naive instances that allow users to create Dataproc clusters that can run heavy Spark jobs as well as Python kernels.</li></ul><p>A specific type of User Managed Notebooks are Dataproc Hub instances, that don’t run <a href="https://jupyterlab.readthedocs.io/en/latest/">JupyterLab</a> but instead <a href="https://jupyter.org/hub">JupyterHub</a> serving as a bridge for users to create Dataproc Clusters on demand and run JupyterLab there using an administrator predefined cluster template.</p><p><a href="https://cloud.google.com/dataproc/docs/tutorials/dataproc-hub-overview">Dataproc Hub</a> notebooks are administrator-curated notebooks running on a <a href="https://cloud.google.com/dataproc/docs/concepts/components/jupyter#gcloud-command">Dataproc JupyterLab</a> cluster sit in the user’s project. Dataproc Hub helps on providing <a href="https://cloud.google.com/blog/products/data-analytics/administering-jupyter-notebooks-for-spark-workloads-on-dataproc">templated Dataproc notebook</a> environments to users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*n1XBS0WCZeq-mNNolEZ-zA.png" /><figcaption>User-managed notebook / Dataproc Hub high level diagram</figcaption></figure><p>JupyterHub itself runs in a Notebooks instance that never hosts a Notebook server. The Notebooks instance only works to leverage the Inverting Proxy and provide a secure URL to JupyterHub to the users. When a user selects a template and creates a cluster, JupyterHub redirects the user to Dataproc Notebooks through the Component Gateway.</p><p>Main components:</p><ul><li><strong>JupyterHub: </strong>UI + Web Server for users to pick Jupyter notebooks server templates and start Notebooks server somewhere.</li><li><strong>JupyterServer: </strong>Created as a Dataproc cluster by end-user from template defined by admin.</li><li><strong>JupyterLab: </strong>Web-based user interface for project Jupyter.</li></ul><h4><strong>Dataproc Clusters Templates</strong></h4><p>Dataproc cluster creation is triggered from Managed Notebook instance, by the end-user themselves, based on the YAML template that the Administrator makes available for them in a GCS bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*Ef67H77DIOPk6rBkjdOjnw.png" /><figcaption>Using URL received from Admin, end-<a href="https://cloud.google.com/dataproc/docs/tutorials/dataproc-hub-users">user</a> will access JupyterLab</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ri8tjySuuQKQuVjX" /><figcaption>end-user will trigger cluster creation without accessing GCP console</figcaption></figure><p>Here we have a challenge, because we want to use <a href="https://cloud.google.com/dataproc/docs/concepts/iam/personal-auth">Dataproc Personal Cluster Authentication</a> (so that data is accessed using end-user credentials), the user email needs to be referenced in the YAML template file. This means we cannot have a single template for all users; instead, we need a template for each user.</p><p>For User-Managed Notebooks, the <a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/personal-workbench-notebooks-deployer/modules/personal-user-managed-notebook">sample code</a> includes automation to generate cluster template files for each user based on a given list, or just adding new module usages.</p><h3><strong>Self-service notebooks provisioning flow</strong></h3><p>To make the notebook environment lifecycle management a self service process, you can develop a Web UI to allow users request the environment creation. This could include choosing between a single instance that will translate into a Managed Notebook, or a distributed environment that will translate into a User Managed Notebook/DataprocHub instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*oTWgaeOsCJawwAvzZOZ7mA.png" /><figcaption>Notebooks lifecycle automation pipeline</figcaption></figure><p>Once the user request is captured by the Web UI, a backend could generate a module invocation file and place it in a Terraform code repository.</p><p>Having a new Terraform file in the repository could trigger an automated CI/CD pipeline in charge of applying the Terraform changes, in this case a new Managed Notebook or User Managed Notebook instance creation.</p><p>Notebook instance deletion can be automated for <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/introduction">Managed Notebooks</a> using <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/idle-shutdown#:~:text=To%20help%20manage%20costs%2C%20managed,or%20turn%20this%20feature%20off.">idle shutdown parameter</a>, however for <a href="https://cloud.google.com/vertex-ai/docs/workbench/user-managed/introduction">User Managed Notebooks</a> it is a little more complex as it implies deletion of both the notebook instance and the Dataproc cluster.</p><h3><strong>Conclusion</strong></h3><p>For Data Scientists running single-node Python code, data platform administrators can rely on <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/introduction">Managed Notebooks</a> to guarantee end-user identity usage.</p><p>For Hadoop related workflows, <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/introduction">Managed Notebooks</a> are not the optimal solution, because <a href="https://cloud.google.com/vertex-ai/docs/workbench/managed/dataproc">Dataproc as external kernel</a> makes cluster lifecycle management difficult and <a href="https://cloud.google.com/dataproc-serverless/docs/overview">Dataproc/Spark Serverless</a> doesn’t support <a href="https://cloud.google.com/dataproc/docs/concepts/iam/personal-auth">Personal Authentication</a> yet.</p><p><a href="https://cloud.google.com/dataproc/docs/tutorials/dataproc-hub-users">Dataproc Hub</a> via <a href="https://cloud.google.com/vertex-ai/docs/workbench/user-managed/introduction">User Managed Notebook</a>, provides an alternative for Data Scientists to create their own Dataproc Clusters, using admin-curated templates that ensure end-user identity usage via <a href="https://cloud.google.com/dataproc/docs/concepts/iam/personal-auth">Personal Cluster Authentication</a>.</p><p>Thanks to <a href="https://www.linkedin.com/in/daryus-medora/">Daryus Medora</a> who collaborated on this story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a78670536b12" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/single-user-jupyter-notebooks-at-google-cloud-a78670536b12">Single User Jupyter Notebooks at Google Cloud</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dataproc lifecycle management orchestrated by Composer]]></title>
            <link>https://medium.com/google-cloud/dataproc-lifecycle-management-orchestrated-by-composer-a9a40371c250?source=rss-9a9ce48e9c6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9a40371c250</guid>
            <category><![CDATA[dataproc]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[hadoop]]></category>
            <dc:creator><![CDATA[Oscar Pulido]]></dc:creator>
            <pubDate>Wed, 19 Apr 2023 17:04:16 GMT</pubDate>
            <atom:updated>2023-07-20T01:53:22.185Z</atom:updated>
            <content:encoded><![CDATA[<p>Ephemeral Dataproc or EMR Hadoop clusters are infrastructure in the Cloud, however, we usually do not want to manage them as a part of the infrastructure provisioning CI/CD pipelines via a mix of tools like Terraform, Jenkins or GitHub Actions, but as a part of the data pipelines orchestration via Airflow or Composer.</p><p>Keeping the cluster lifecycle management as a part of the data pipelines orchestration allows the data pipelines to take advantage of the elasticity and scalability properties of the Cloud, as well as to use resources in a cost efficient way by sharing clusters between multiple jobs and by scaling already provisioned clusters instead of creating new ones. Overall jobs processing time reduction is another advantage of sharing and scaling the ephemeral clusters to run multiple jobs, as the cluster provisioning time is zero for the second and subsequent jobs running in a cluster.</p><p>Imagine you have multiple Spark jobs to be scheduled and run in Dataproc clusters. Internals of each Spark job are unique and related to a specific use case, but it is common that execution parameters are similar, changing only the values between them. Here it makes sense to dynamically generate DAGs based on a template.</p><p>I have put together a very simplistic code to illustrate those concepts:</p><p><a href="https://github.com/GoogleCloudPlatform/professional-services/tree/main/examples/dataproc-lifecycle-via-composer">professional-services/examples/dataproc-lifecycle-via-composer at main · GoogleCloudPlatform/professional-services</a></p><p>It is a terraform template that will create a Composer environment and a folder structure in the code that will read Json parameter files to generate Airflow DAGs and deploy them in the Composer environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*pgDHp1lcFdss-0qV.png" /></figure><p>Using this project you can deploy multiple Airflow DAGs which means you will create configuration files for DAGs to be automatically generated during the deployment.</p><pre>main.tf<br>...<br>dags/        (Autogenerated on Terraform Plan/Apply from /dag_config/ files)<br>├── ephemeral_cluster_job_1.py<br>├── ephemeral_cluster_job_2.py<br>jobs/<br>├── hello_world_spark.py<br>├── ...      (Add your dataproc jobs here)<br>include/<br>└── dag_config<br>   ├── dag1_config.json<br>   └── dag2_config.json<br>   └── ...   (Add your Composer/Airflow DAGs configuration here)<br>...</pre><p>Each DAG will have a task step to run a Dataproc Job referenced in the parameters file, and that Job will be executed in a Dataproc Cluster.</p><pre>{<br>    &quot;DagId&quot;: &quot;ephemeral_cluster_job_1&quot;,<br>    ...<br>    &quot;SparkJob&quot;:&quot;hello_world_spark.py&quot;<br>}</pre><p>The Dataproc Clusters can be reused for multiple Jobs/DAGs, and you can think of it as a queue. If you want two DAGs sharing a cluster, you only need to set the same cluster name parameter in both configuration files.</p><pre>{<br>    &quot;DagId&quot;: &quot;ephemeral_cluster_job_1&quot;,<br>    ...<br>    &quot;ClusterName&quot;:&quot;ephemeral-cluster-test&quot;,<br>    ...<br>    &quot;SparkJob&quot;:&quot;hello_world_spark.py&quot;<br>}</pre><p>The Dataproc cluster lifecycle management will be done by the automatically generated Airflow DAGs to reuse or create clusters accordingly. The cluster proposed configuration includes a scalability policy that allows it to scale out if multiple Jobs are running in a single cluster at a specific moment.</p><pre>resource &quot;google_dataproc_autoscaling_policy&quot; &quot;dataproc_autoscaling_policy_test&quot; {<br>  project = var.project_id<br>  policy_id = var.dataproc_config.autoscaling_policy_id<br>  location  = var.region<br>  worker_config {<br>    max_instances = 5<br>  }<br>  basic_algorithm {<br>    yarn_config {<br>      graceful_decommission_timeout = &quot;30s&quot;<br>      scale_up_factor   = 0.5<br>      scale_down_factor = 0.5<br>    }<br>  }<br>}</pre><p>This approach aims to use resources efficiently meanwhile minimizing provision and execution time.</p><h3>Prerequisites</h3><ol><li>This blueprint will deploy all its resources into the project defined by the project_id variable. Please note, that we assume this project already exists.</li><li>The user deploying the project <em>(executing terraform plan/apply)</em> should have admin permissions in the selected project, or permissions to create all the resources defined in the Terraform scripts.</li></ol><h3>Project Folder Structure</h3><pre>main.tf<br>...<br>dags/          (Autogenerated on Terraform Plan/Apply from /dag_config/ files)<br>├── ephemeral_cluster_job_1.py<br>├── ephemeral_cluster_job_2.py<br>jobs/<br>├── hello_world_spark.py<br>├── ...        (Add your dataproc jobs here)<br>include/<br>├── dag_template.py<br>├── generate_dag_files.py<br>└── dag_config<br>   ├── dag1_config.json<br>   └── dag2_config.json<br>   └── ...     (Add your Composer/Airflow DAGs configuration here)<br>...</pre><h3>Adding Jobs</h3><h4>Prepare Dataproc Jobs to be executed</h4><ol><li>Clone this repository</li><li>Locate your Dataproc jobs in the /jobs/ folder in your local environment</li></ol><h4>Prepare Composer DAGs to be deployed</h4><p>3. Locate your DAG configuration files in the /include/dag_config/ folder in your local environment. DAG configuration files have the following variables:</p><pre>{<br>    &quot;DagId&quot;: &quot;ephemeral_cluster_job_1&quot;,     --DAG name you will see in Airflow environment<br>    &quot;Schedule&quot;: &quot;&#39;@daily&#39;&quot;,                 --DAG Schedule<br>    &quot;ClusterName&quot;:&quot;ephemeral-cluster-test&quot;, --Dataproc Cluster to be Used/created for this DAG/Job to be executed in<br>    &quot;StartYear&quot;:&quot;2022&quot;,                     --DAG start year<br>    &quot;StartMonth&quot;:&quot;9&quot;,                       --DAG start month<br>    &quot;StartDay&quot;:&quot;13&quot;,                        --DAG start day<br>    &quot;Catchup&quot;:&quot;False&quot;,                      --DAG backfill catchup<br>    &quot;ClusterMachineType&quot;:&quot;n1-standard-4&quot;,   --Dataproc machine type to be used by master and worker cluster nodes<br>    &quot;ClusterIdleDeleteTtl&quot;:&quot;300&quot;,           --Time in seconds to delete unused Dataproc cluster<br>    &quot;SparkJob&quot;:&quot;hello_world_spark.py&quot;       --Spark Job to be executed by DAG, should be placed in /jobs/ folder of this project. (if other type of Dataproc jobs modify dag_template.py)<br>}</pre><p>4. (Optional) You can run python3 include/generate_dag_files.py in your local environment if you want to review generated DAGs before deploying(TF plan/apply) those.</p><h3>Deployment</h3><ol><li>set Google Cloud Platform credentials on local environment: <a href="https://cloud.google.com/source-repositories/docs/authentication">https://cloud.google.com/source-repositories/docs/authentication</a></li><li>You must supply the project_id variable as minimum in order to deploy the project. Default Terraform variables and example values in varibles.tf file.</li><li>Run Terraform Plan/Apply</li></ol><pre> $ cd terraform/<br> $ terraform init<br> $ terraform plan<br> $ terraform apply<br>##Optionally variables could be used<br> $ terraform apply -var &#39;project_id=&lt;PROJECT_ID&gt;&#39; \<br>-var &#39;region=&lt;REGION&gt;&#39;</pre><p>Once you deploy terraform plan for the first time and Composer environment is running, you can <em>terraform plan/apply</em> after adding new DAG configuration files, to generate and deploy DAGs to the existing environment.</p><p>First time it is deployed, resource creation will take several minutes (up to 40) because of Composer Environment provisioning. You should expect successful completion along with a list of the created resources.</p><h3>Running DAGs</h3><p>DAGs will run per Schedule, StartDate, and Catchup configuration in DAG configuration file, or it can be triggered manually trough the Airflow web console after the deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*99sozn0sPiSWJ0Ci.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9a40371c250" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/dataproc-lifecycle-management-orchestrated-by-composer-a9a40371c250">Dataproc lifecycle management orchestrated by Composer</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>