<?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 Gold Pushpendra on Medium]]></title>
        <description><![CDATA[Stories by Gold Pushpendra on Medium]]></description>
        <link>https://medium.com/@gold.pushpendra?source=rss-58b78fb9fa02------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9MEH2DkUC36NHWER</url>
            <title>Stories by Gold Pushpendra on Medium</title>
            <link>https://medium.com/@gold.pushpendra?source=rss-58b78fb9fa02------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:36:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gold.pushpendra/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[Complexity to Clarity — “Our Journey to Standardised Container Images for Spark Applications”]]></title>
            <link>https://engg.inmobi.com/complexity-to-clarity-our-journey-to-standardised-container-images-for-spark-applications-86383a3abde7?source=rss-58b78fb9fa02------2</link>
            <guid isPermaLink="false">https://medium.com/p/86383a3abde7</guid>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[kubernetes-deployment]]></category>
            <dc:creator><![CDATA[Gold Pushpendra]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 08:06:27 GMT</pubDate>
            <atom:updated>2026-03-02T08:06:27.008Z</atom:updated>
            <content:encoded><![CDATA[<p>In the rapidly evolving landscape of big data, managing container images for Spark applications on Kubernetes can become a major operational challenge. At InMobi where we process over 200TB of data daily across hundreds of Spark jobs. We faced a critical question:</p><blockquote><strong>How do we build and deploy container images that support multiple Spark runtimes while managing dependencies from diverse sources with conflicting release cycles?</strong></blockquote><p>This challenge was compounded by several technical pain points that made our existing approach unsustainable:</p><ol><li><strong>Fat image bundles</strong> locked down user’s application code to specific library versions, making evolution and updates difficult.</li><li><strong>Runtime artifact fetching</strong> significantly increased executor startup by 3–5 minutes, creating slower start &amp; wastage of resources.</li><li><strong>Reproducibility issues -</strong> Debugging production failures becomes impossible without guaranteed consistency in dependency versions and executable application code across environments.</li></ol><blockquote><strong>This is the story of our journey from a complex, manual process to a robust, scalable, automated build solution. This approach transformed how we handle container image standardization, resulting in faster builds, more reliable deployments, and a clearer path for developer innovation.</strong></blockquote><h3>Chapter 1: “The Challenge”: A Tale of Two Dependencies</h3><p>Our journey began with a seemingly simple requirement that quickly revealed underlying complexities. We needed to create container images for Spark applications that depended on two very different types of artifacts:</p><ul><li><strong>Scala applications/JARs:</strong> These are built from Git repositories with a formal artifact generation process (maven, sbt etc) complete with versioning and tagged releases. These follow traditional software engineering practices with semantic versioning (e.g., v1.2.3) and are published to artifact repositories like JFrog.</li><li><strong>PySpark packages:</strong> These are also git repositories which includes Python scripts/notebooks or modules that contain Spark application logic written in PySpark (Python API for Apache Spark). Unlike the Scala JARs, these Python files resided in these repositories with no formal release process, they were simply collections of .py files committed directly to Git without any versioning scheme, packaging, or formal release artifacts.</li></ul><p>This disparity created a perfect <strong>storm</strong> of challenges, including:</p><ul><li><em>How to ensure version consistency across different artifact types and runtimes?</em></li><li><em>How to maintain automated builds when dependencies for same application have different release cycles?</em></li><li><em>How to enable experimentation, production usages with different spark versions, different frameworks like Velox, Comet etc?</em></li><li><em>How can we provide reproducible builds to simplify development and debugging cycles</em>?</li></ul><h3>Chapter 2: “Design Thinking” — Exploring the Solution Space</h3><p>Our systematic approach involved exploring four distinct approaches, each with its own unique trade-offs.</p><h4>1. Artifact-Coupled Image Building</h4><ul><li><strong>Concept:</strong> Establish automated container builds triggered directly by application artifact publication. Each Scala/Python application generates dedicated container images for all configured base runtimes (e.g., Spark 3.3.1, Spark 3.5 + Velox accelerator, Spark 3.5 + Comet).</li><li><strong>Trade-offs:</strong> While operationally simple, this approach creates rigid coupling between application release cycles and container availability. Additionally, it leads to container image proliferation, each application X runtime combination creates separate images, resulting in hundreds of images to manage, version and secure.</li></ul><h4>2. Runtime Fetching (Dynamic Initialization)</h4><ul><li><strong>Concept:</strong> Keep images lightweight by downloading dependencies at runtime during container startup.</li><li><strong>Trade-offs:</strong> Introduced significant startup latency (3–5 minutes per executor) and potential runtime failures if artifact repositories were unavailable during job execution. For jobs with hundreds of executors, this approach became prohibitively slow.</li></ul><h4>3. Monolithic Image (One image for all)</h4><ul><li><strong>Concept:</strong> Create comprehensive images containing all application artifacts in a single monolithic image.</li><li><strong>Trade-offs:</strong> Resulted in larger images (often &gt;2GB) and forced complete rebuilds even when only one application’s code changed, leading to unnecessary CI/CD overhead and storage costs.</li></ul><h4>4. Micro Images (DAG-Level Precision)</h4><ul><li><strong>Concept:</strong> Individual Airflow DAGs would specify application artifact mappings, with DAG releases triggering mapped application container builds with tightly coupled dependencies.</li><li><strong>Trade-offs:</strong> This approach created unnecessary complexity by coupling entirely different repositories and development cycles, requiring DAG authors to understand and coordinate with multiple application development teams.</li></ul><h3>Chapter 3: “The Decision Matrix”: A Comprehensive Evaluation</h3><p>To make an informed decision, we evaluated each approach across critical operational criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8tf0NyCA3GG8gY0ji3AbwA.jpeg" /></figure><h3>Chapter 4: The Decision — “Artifact-Coupled Image Building” for Maximum Control</h3><blockquote><em>After careful evaluation, we selected Approach 1 (Artifact-Coupled Image Building) for our production implementation, but with significant modifications to address the tight coupling issues. Our final approach triggers automated container builds through Github action workflows (commits to main branch, tagged releases, pull request merges).</em></blockquote><p>This decision was driven by several critical advantages that aligned perfectly with our operational requirements and developer needs:</p><h4><strong>Developer-Centric Benefits</strong></h4><ul><li><strong>Proximity to Code:</strong> Build processes remain close to application code, giving developers direct control over release cycles through familiar Git workflows</li><li><strong>Familiar Tooling:</strong> Developers use standard Git operations rather than learning new deployment mechanisms</li></ul><p><strong>Operational Excellence:</strong></p><ul><li>Reproducible Artifacts: Every container image is tied to a specific Git commit SHA, creating traceable artifacts essential for debugging production issues.</li><li>Performance Optimization: Build-time dependency resolution achieved 80% reduction in executor startup times (from 3–5 minutes to 30–45 seconds).</li><li>Flexible Versioning: Multiple DAGs can reference different versions of the same application code, enabling gradual rollouts and instant rollbacks.</li></ul><h3>Chapter 5: “Implementation” — Transforming Design to Reality</h3><blockquote>Our solution implements an automated container building process triggered by Git events (commits, tags, pull requests). This automation is enabled by a standardized container specification file that developers maintain in their repositories.</blockquote><h4><strong>Container Specification Contract</strong></h4><p>This specification file acts as a contract between the developer and the platform, allowing developers to declare exactly what their application needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*QlcaBawjX4mFN_AluRzbRg.png" /></figure><p>The platform automatically parses this specification to select appropriate base images, download artifacts, install dependencies, and apply configurations.</p><h4><strong>The Automated Build Pipeline Triggered by Git Events</strong></h4><p>When developers commit changes, an automated build pipeline is triggered. This pipeline is a key part of our solution, ensuring consistency and quality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvPjGO6gQfVTsZWHs0FUug.png" /></figure><h4>Architecture Overview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ZVOYNo3OKtE2kZgvK3FAQ.png" /></figure><h3>Chapter 6: The Developer-Platform Contract</h3><p>Our approach established a clear and collaborative contract between our developers and the platform team, defining responsibilities for both sides.</p><h4>Platform Responsibilities</h4><ul><li>Base Infrastructure: Lightweight, security-hardened base images with common Spark dependencies</li><li>Automation: Fully automated build and deployment pipelines triggered by Git events</li><li>Observability: Standardized monitoring, logging, and alerting across all applications</li><li>Security: Automated vulnerability scanning, compliance checks, and security policy enforcement</li><li>Multi-Runtime Support: Maintained compatibility across Spark versions and emerging engines</li></ul><h4>Developer Responsibilities</h4><ul><li>Specification Maintenance: Well-defined container specifications kept in sync with application requirements</li><li>Dependency Management: Application-specific dependencies declared through standard files (requirements.txt, pom.xml)</li><li>Code Quality: Adherence to platform coding standards and containerization best practices</li><li>Testing: Unit and integration tests that validate application behavior across target runtimes</li></ul><p>This separation of concerns ensures that developers can focus on business logic while the platform handles the complexities of containerization.</p><h3>“The Production Impact “ — Measuring Success</h3><p>The Git-driven artifact-coupled approach delivered measurable improvements across all key performance indicators:</p><h4>Developer Productivity Gains</h4><ul><li>90% faster container builds through parallel multi-runtime compilation</li><li>Complete release autonomy via familiar Git workflows (tag, commit, merge)</li><li>Zero manual intervention required for standard deployments</li></ul><h4>Operational Performance</h4><ul><li>80% reduction in executor startup times (from 3–5 minutes to 30–45 seconds)</li><li>Reproducible debugging capabilities through commit-linked container artifacts</li><li>99.8% build success rate with automated quality gates</li></ul><h4>Platform Reliability</h4><ul><li>Build-time dependency resolution eliminated runtime download failures</li><li>Automated compatibility testing across all supported Spark runtimes</li><li>Immutable artifacts tied to specific release for reliable rollbacks</li></ul><h3>“Case Study”: Independent Version Management in Production</h3><p>A concrete example demonstrates the architectural benefits of our approach. When our critical ETL pipeline team needed to test new performance optimizations without affecting production workloads, our solution enabled seamless parallel development:</p><p><strong>Production Environment:</strong> DAGs continued referencing stable Git tag v2.1.4 of the application, ensuring zero disruption to business-critical pipelines.</p><p><strong>Experimental Environment:</strong> Test DAGs used the latest development image built from the feat/develop branch, allowing comprehensive validation of optimizations.</p><p><strong>Results:</strong> Teams validated 100% of experiments in staging environments before production rollout, maintaining complete traceability. When ready, the changes are promoted to production.</p><h3>Key Takeaways</h3><p>The journey from complexity to clarity required careful analysis, thoughtful design, and pragmatic implementation choices that prioritized developer experience through familiar Git workflows.</p><ol><li><strong>Developer Experience Drives Adoption:</strong> Keeping build processes close to application code through Git workflows provides teams the autonomy they need without sacrificing standardization. Developers adopt solutions that enhance rather than disrupt their existing workflows.</li><li><strong>Build-Time vs. Runtime:</strong> Resolving dependencies at build time dramatically improves operational reliability and performance. The trade-off of slightly larger images for significantly faster startup times proved overwhelmingly positive in production.</li><li><strong>Reproducibility Enables Operational Excellence: </strong>Container artifacts tied to specific Git commits are essential for production debugging, rollback scenarios, and compliance requirements. This traceability becomes invaluable when troubleshooting complex distributed system issues.</li><li><strong>Architectural Decoupling Enables Independent Evolution</strong>: Decoupling application releases from DAG releases through automated build workflows enables independent evolution while maintaining dependency clarity.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86383a3abde7" width="1" height="1" alt=""><hr><p><a href="https://engg.inmobi.com/complexity-to-clarity-our-journey-to-standardised-container-images-for-spark-applications-86383a3abde7">Complexity to Clarity — “Our Journey to Standardised Container Images for Spark Applications”</a> was originally published in <a href="https://engg.inmobi.com/">InMobi Technical Blogs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>