Automating Application Lifecycles For Developer Happiness At Wayfair

The Python Podcast.__init__

Episode | Podcast

Date: Sun, 20 Mar 2022 16:00:00 -0400

<div class="wp-block-jetpack-markdown"><h2>Summary</h2> <p>A common piece of advice when starting anything new is to &quot;begin with the end in mind&quot;. In order to help the engineers at Wayfair manage the complete lifecycle of their applications Joshua Woodward runs a team that provides tooling and assistance along every step of the journey. In this episode he shares some of the lessons and tactics that they have developed while assisting other engineering teams with starting, deploying, and sunsetting projects. This is an interesting look at the inner workings of large organizations and how they invest in the scaffolding that supports their myriad efforts.</p> <h2>Announcements</h2> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python&#8217;s role in data and science.</li> <li>When you&#8217;re ready to launch your next app or want to try a project you hear about on the show, you&#8217;ll need somewhere to deploy it, so take a look at our friends over at Linode. With the launch of their managed Kubernetes platform it&#8217;s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/linode</a> and get a $100 credit to try out a Kubernetes cluster of your own. And don&#8217;t forget to thank them for their continued support of this show!</li> <li>So now your modern data stack is set up. How is everyone going to find the data they need, and understand it? Select Star is a data discovery platform that automatically analyzes &amp; documents your data. For every table in Select Star, you can find out where the data originated, which dashboards are built on top of it, who’s using it in the company, and how they’re using it, all the way down to the SQL queries. Best of all, it’s simple to set up, and easy for both engineering and operations teams to use. With Select Star’s data catalog, a single source of truth for your data is built in minutes, even across thousands of datasets. Try it out for free and double the length of your free trial today at <a href="https://www.pythonpodcast.com/selectstar?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com/selectstar</a>. You&#8217;ll also get a swag package when you continue on a paid plan.</li> <li>Your host as usual is Tobias Macey and today I&#8217;m interviewing Joshua Woodward about how the application lifecycle team at Wayfair uses Python to</li> </ul> <h2>Interview</h2> <ul> <li>Introductions <ul> <li>Josh Woodward, for the past year have been managing the application lifecycle team at Wayfair. Prior to that, IC on python platforms team. Embed with teams looking to decouple from monolith. See pain points first hand.</li> </ul> </li> <li>How did you get introduced to Python? <ul> <li>High school physics class, TI84 Calculator, friend wrote a program to solve vector problems, I thought it was amazing.</li> <li>Used TI-Basic to solve specific physics problems for me. (Give fixed inputs, run through equation, get outputs)</li> <li>Approaching college, thinking about student loans.</li> <li>Heard about python and decided to give it a shot.</li> <li>Wrote program to simulate various payback / interest scenarios.</li> <li>Went to college for ME, switched to SE when I found out my dorm neighbors were using python to draw cool images with python + turtle</li> </ul> </li> <li>Can you describe what the role of the application lifecycle team is and the story behind it? <ul> <li>Story behind it: <ul> <li>Around 2018, in a state where we had deploy congestion, challenging to iterate and ship changes. tech org invested in containerization and decoupling to directly combat this problem. Teams incentiviced to decouple.</li> <li>While on python platforms, the team had already been experimenting with code templating.</li> <li>Standard cookiecutter template for flask apps.</li> <li>Wayfair experimenting with Kubernetes late 2017.</li> <li>Spent 1 year embedding with 4 different teams to help knowledge transfer re: k8s, containers, application setup, python best practices, testing, linting, etc &#8211; through that we got a lot of great feedback on our tooling.</li> <li>Took senior engineers weeks to get something setup. <ul> <li>Know who to contact, click the right buttons, file the right ticket</li> </ul> </li> <li>Approach: Counted manual steps. Something like 60 distinct / atomic activities that had to be performed to get a &quot;hello world&quot; response from a basic flask app in production.</li> <li>Focus on reduce manual steps</li> <li>Released product (Mamba, on theme of snakes)</li> <li>Initially, supporting one main user story.</li> <li>User story: &quot;As an engineer, I would like to create a production ready application in 10 minutes so that I can have a reliable and standardized application setup that follows best practices.&quot;</li> <li>grew out of python platforms, created own team with own scope, that was about 1.5 years ago.</li> </ul> </li> </ul> </li> <li>What is your team&#8217;s scope now? <ul> <li>Team Scope is to facilitate the creation, maintenance, and decommissioning of decoupled applications at Wayfair.</li> </ul> </li> <li>What are the interfaces that your team has to the rest of the organization? <ul> <li>People Interfaces:</li> <li>We value getting feedback on our work to build strong products.</li> <li>Make assumptions, Willing to be wrong. Validate assumptions with customers.</li> <li>Software Interfaces:</li> <li>for mamba, CLI at first</li> <li>Backstage (open sourced from spotify)</li> <li>Lots of Github</li> </ul> </li> <li>What is your method of determining what projects to work on? <ul> <li>(See above). Known pain points. Intuition, Free day fridays. Being comfortable taking risk (using friday time). Vet solution with customers.</li> <li>How do you measure the impact of your work on the rest of the organization? <ul> <li>We don&#8217;t force use of our products. Adoption of tooling. <ul> <li>Number of microservices being spun up.</li> <li>Number of automated pull requests being created, merged.</li> </ul> </li> <li>DORA metrics throughput (deployment frequency, lead time for changes) and stability (change failure rate, mean time to recovery)</li> </ul> </li> </ul> </li> <li>What is the role of Python in your work? <ul> <li>we use it and love it! <ul> <li>existing skillset from incubation phase within python platforms</li> </ul> </li> <li>right tool for the job <ul> <li>lightweight automation</li> <li>hitting lots of APIs</li> <li>define lots of user facing specifications (json, yaml)</li> <li>pydantic has been great for creating descriptive, human and machine specifications.</li> </ul> </li> <li>open source (we rely on it, we also have some presence) <ul> <li>cookiecutter -&gt; columbo</li> <li>gitpython -&gt; pygitops</li> </ul> </li> </ul> </li> <li>Can you tell me more about your application creation solution. Who can use it, and what does it actually do? <ul> <li>Written in python, though it templates out code for any language.</li> <li>Runs automation to onboard an application to production <ul> <li>git repo, build pipeline, calling out to various APIs to signal a new app is present</li> </ul> </li> <li>Wayfair has a variety of applications (python, java, .net, php, javascript, some go)</li> <li>Team interested in integrating with our solution will create a github repository containing 1..* cookiecutter template(s)</li> <li>Provide a specification for what questions to ask users. <ul> <li>Limitation with cookiecutter where the approach to ask questions isn&#8217;t dynamic. lack of validation.</li> <li>Pat Lannigan -&gt; Columbo (open sourced). Python DSL to describe the set of questions to ask users.</li> <li>python fastapi application will have a completely different set of questions than a java library for example.</li> </ul> </li> </ul> </li> <li>You had mentioned that another part of your team scope is to facilitate the maintenance of applications. Can you tell me more about that? <ul> <li>Reduce engineering toil around keeping applications up to date.</li> <li>Average engineer owns several, dozens of repos</li> <li>Create automated pull requests: <ul> <li>Versioned dependencies (Renovate)</li> <li>Propagating platform changes (Gator)</li> <li>Ex1: python apps use &quot;black&quot; to format code and our python platform team would like to prescribe a line length. Our tooling can be used to declare desired changes. yaml specification -&gt; pr automation at scale.</li> <li>Ex2: shared library, new version released, breaking interface change. Code instructions for performing AST manipulation and resolving breaking change for people.</li> <li>Shift from: &quot;We need you to do this&quot;, &quot;I am proactively letting you know that something needs to change, and I also made the change for you!&quot;</li> </ul> </li> </ul> </li> <li>How do you actually go about creating automated pull requests? <ul> <li>manual steps would involve cloning, checking out feature branch, applying code changes, staging / committing, pushing up branch, creating the PR</li> <li>gitpython is an existing and extremely powerful tool, but its api is fairly involved and (by design) doesn&#8217;t provide the type of high level abstractions that we need.</li> <li>created pygitops (open sourced), built completely on top of gitpython</li> <li>high level abstractions for the workflow I described.</li> <li>coolest / most pythonic part about it is the &quot;feature branch&quot; context manager.</li> <li>code changes are made in the context of a feature branch</li> <li>when you intentionally or accidentally leave the context of a feature branch, we want certain things to be true (default / main branch, clean workdir, no unstaged changes)</li> <li>when writing PR automation, don&#8217;t have to worry about this!</li> </ul> </li> <li>Can you describe some of the more technical details about how your change propagation system (Gator) works? <ul> <li>heavily inspired by kubernetes resource model (resources are defined via a declarative specification)</li> <li>Kubernetes itself ships with resources that implement behaviors of common resources (pods, services, etc)</li> <li>Gator&#8217;s execution model is broken up into two parts: <ul> <li>what repos to act on (Source)</li> <li>what are the changes that need to be applied. (Output)</li> </ul> </li> <li>Ex: Source to proxy github search. write github search query to get back list of repos</li> <li>Output to scan a repo for regex pattern at specified paths and replace with some fixed term. Very popular, engineers love find and replace.</li> </ul> </li> <li>What are the most interesting, innovative, or unexpected ways that you have seen mamba / gator used? <ul> <li>resource model of gator supports the idea of we don&#8217;t know, what we don&#8217;t know</li> <li>reference k8s, CRDs, resource model.</li> <li>container execution</li> <li>log4j identification and remidiation <ul> <li>automate some of the work for identifying vulnerabilities</li> <li>java platform team was able to use java native tooling in the environment of their choosing to identify vulnerable apps.</li> </ul> </li> </ul> </li> <li>What are the most interesting, unexpected, or challenging lessons that you have learned while working on application lifecycle concerns?</li> <li>What do you have planned for the future of application lifecycle management/developer experience improvements at Wayfair? <ul> <li>Hope to start open sourcing interesting aspects of our change propagation tool (Gator)</li> <li>As someone who maintains many open source projects, or even at the enterprise level, we think that some of our patterns and approaches can be shared! yaml -&gt; code changes</li> </ul> </li> </ul> <h2>Keep In Touch</h2> <ul> <li><a href="mailto:jwoodward@wayfair.com">Email</a></li> <li><a href="https://github.com/jdw6359?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Github</a></li> <li><a href="https://www.linkedin.com/in/joshua-woodward-06383b61/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Linkedin</a></li> </ul> <h2>Picks</h2> <ul> <li>Tobias <ul> <li><a href="https://www.rigonidiasiago-usa.com/nocciolata/nocciolata/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Nocciolata</a> hazelnut spread</li> </ul> </li> <li>Joshua <ul> <li><a href="https://store.steampowered.com/app/255710/Cities_Skylines/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Cities Skylines Game</a></li> <li><a href="https://www.youtube.com/watch?v=A2FhKMLRays&amp;list=PLXdi-Ns7w3jinCyFeq5KlZYhUBdR3tl8s&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Cities Skylines &#8211; Cities Planner Plays: Verde Beach</a></li> </ul> </li> </ul> <h2>Links</h2> <ul> <li><a href="https://github.com/wayfair-incubator/pygitops?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">pygitops</a></li> <li><a href="https://github.com/wayfair-incubator/columbo?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">columbo</a></li> <li><a href="https://backstage.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">backstage</a></li> <li><a href="https://github.com/renovatebot/renovate?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">renovate</a></li> <li><a href="https://jellyfish.co/blog/dora-metrics-101/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">DORA metrics</a></li> <li><a href="https://education.ti.com/en/products/calculators/graphing-calculators/ti-84-plus?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">TI-84</a> Calculator</li> <li><a href="https://en.wikipedia.org/wiki/TI-BASIC?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">TI BASIC</a></li> <li><a href="https://www.pythonpodcast.com/python-adoption-wayfair-episode-236/?pk_vid=fb84a1794289966116477403157fb151&amp;utm_source=rss&amp;utm_medium=rss">Wayfair Python Platforms Team Podcast Episode</a></li> <li><a href="https://pydantic-docs.helpmanual.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Pydantic</a> <ul> <li><a href="https://www.pythonpodcast.com/pydantic-data-validation-episode-263/?utm_source=rss&amp;utm_medium=rss">Podcast Episode</a></li> </ul> </li> <li><a href="https://helm.sh/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Helm</a></li> <li><a href="https://pyup.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PyUp</a></li> <li><a href="https://gitpython.readthedocs.io/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GitPython</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a></p> </div> <img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.pythonpodcast.com%2Fwayfair-application-lifecycle-automation-episode-357%2F&amp;action_name=Automating+Application+Lifecycles+For+Developer+Happiness+At+Wayfair+-+Episode+357&amp;urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&amp;utm_source=rss&amp;utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" />