<?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 David Calavera on Medium]]></title>
        <description><![CDATA[Stories by David Calavera on Medium]]></description>
        <link>https://medium.com/@calavera?source=rss-ebe141a535c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kO3CB-KrdmjTCWGRG2LgYA.jpeg</url>
            <title>Stories by David Calavera on Medium</title>
            <link>https://medium.com/@calavera?source=rss-ebe141a535c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:46:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@calavera/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[Run WebAssembly everywhere]]></title>
            <link>https://medium.com/@calavera/run-webassembly-everywhere-609865262c82?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/609865262c82</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Thu, 25 Apr 2019 15:11:01 GMT</pubDate>
            <atom:updated>2019-04-25T15:11:01.401Z</atom:updated>
            <content:encoded><![CDATA[<p>In the past year, I’ve grown more and more interested in WebAssembly. There are many reasons to be excited about the possibilities that WebAssembly brings to modern computing. Milos Gajdos published an article today that outlines some of those reasons. I very much agree with what he writes there:</p><p><a href="https://cybernetist.com/2019/04/25/wasm-universal-application-runtime/">WASM: Universal Application Runtime</a></p><p>Most of the current conversations around WebAssembly as a universal runtime focus on IoT and Edge computing. It makes sense because some of the companies spearheading the early research in WebAssembly are very focused on those fields. But, there are many other opportunities for WebAssembly, and we’re not talking about them that much. So this quick post is a follow up to Milos’ with some ideas bouncing on my head.</p><p>Tyler McMullen, Fastly’s CTO, talks about their work on bringing WebAssembly to their edge network in the video below. Their challenges with VCL(Varnish Configuration Language) made them look into WebAssembly to extend how their customers interact with Varnish Cache, the cache server that powers their CDN network:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F273990809%3Fapp_id%3D122963&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F273990809&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F705925408_1280.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1280" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/f93e4aeb7395bbbe8b658d45a296350b/href">https://medium.com/media/f93e4aeb7395bbbe8b658d45a296350b/href</a></iframe><p>We take Varnish as a very specific use case for WebAssembly. When we try to generalize this use case, things start to look much more interesting. A cache server is a type of data storage, so, if we can run WebAssembly in this type of data storage, why can’t we run it on other general data storage software? can we find real use cases for doing that?</p><p>Let’s think about traditional database software for a moment, like MySQL and Postgres. They are already designed as event machines, you can write SQL statements that will be executed when events happen with the data stored in them. If those products embedded a WebAssembly runtime, we could execute safe and isolated programs to react to those events. Making those triggers much more powerful for the end user.</p><p>If we extrapolate the database example to something even bigger, like a Cloud provider, things become even more interesting. AWS popularized the Serverless model a few year ago, and other clouds have rapidly adopted very similar capabilities. One of the fun parts of Serverless is its evented nature. You can trigger actions when files are uploaded to S3, or when CloudWatch observes a specific behavior. Currently, you can attach Lambda functions to those occurrences, but you’re also loosing data locality. After all, AWS still needs to send those files from the S3 servers to the Lambda servers, no matter how fast the network is. With WebAssembly, you could run safe code directly on S3, without having to move files around, and use tools like <a href="https://github.com/wapm-packages/imagemagick">ImageMagick compiled to WebAssembly</a>. And we can expand that model into every single product that every Cloud provider offers.</p><p>All in all, WebAssembly is a very interesting project, and its future looks very bright. I’m looking forward to see how it develops during this year and the years to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=609865262c82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Splashed Pull Requests]]></title>
            <link>https://medium.com/@calavera/splashed-pull-requests-5e6adea1d12a?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e6adea1d12a</guid>
            <category><![CDATA[engagement]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[unsplash]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Thu, 07 Feb 2019 15:44:04 GMT</pubDate>
            <atom:updated>2019-02-07T15:44:04.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hZAcvsEHhshvnrU7" /><figcaption>Photo by <a href="https://unsplash.com/@frankiefoto?utm_source=medium&amp;utm_medium=referral">frank mckenna</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A few years ago, an ex-coworker mentioned that at the company he worked for had a curious Pull Request template. At the bottom, the template suggested people to include a picture of a cute animal. He mentioned that everyone at the company loved the small addition to their code review process.</p><p>I took that idea for Docker’s Pull Request template, and you still can see people adding <a href="https://github.com/moby/moby/pull/38614">cute kittens to Moby’s PRs</a>. That actually became a Twitter account where you can <a href="https://twitter.com/DockerCuties">see only the pictures</a>!</p><p>At Netlify, our Pull Request templates also include a similar suggestion:</p><blockquote>Relevant links (GH issues, traces, etc.) or a picture of a cute animal</blockquote><p>What started as a way to break the monotony of reviewing code, has become a recurrent topic that we have conversations about. Some people discover new repositories because they want to see all the pictures we post. Others talks about how they need to “level up” their picture game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*TCcM1EdY-71NIQZf-JpW3Q.png" /></figure><p>Looking for the perfect picture for a new Pull Requests is quite entertaining. Your mind wonders about which kind of animal that PR with three hundred new lines of code and no tests is. Those minutes are precious. Unfortunately, I’m usually annoyed with repetitive tasks, and this feels more like a chore some times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*rfyif1vi5YWvUavSkw8YgQ.jpeg" /></figure><p>So I woke up last Monday and I decided to automate the picture selection for our Pull Requests, and I probably took all the fun out of it, sorry.</p><p>I wrote a GitHub Action that gets random beautiful pictures from <a href="https://unsplash.com/">Unsplash’s API</a>. If you’ve never heard of Unsplash, it’s fantastic place where amazing photographers post gorgeous free pictures for you to use anywhere. I called this project <a href="https://github.com/calavera/splashed-prs">Splashed Pull Requests</a>. You can see it in action in the<a href="https://github.com/calavera/splashed-prs/pull/7"> Pull Requests</a> that I opened in private while I was writing the code. And now it’s open source, so you can enhance all your PRs.</p><p>Sadly, there are a bunch of caveats I have to tell you about before you start splashing all your code changes. At the time of writing this, GitHub Actions is still in private beta, so you might not have access to it yet. Actions only receive Pull Requests events in private repositories, so forget about getting 1 million stars in your open source project because it’s full of gorgeous puppy pictures. Unsplash doesn’t really allow automated use of their API, and your application won’t probably be promoted to their production status, so you’ll have to live with only getting 50 pictures per hour.</p><p>But besides all those problems, I’m super excited to see more cute animal pictures all over GitHub!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e6adea1d12a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spy on your Kubernetes cluster with BPF]]></title>
            <link>https://medium.com/@calavera/spy-on-your-kubernetes-cluster-with-bpf-b09032bd1cdc?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b09032bd1cdc</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[bpf]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Tue, 11 Dec 2018 14:58:00 GMT</pubDate>
            <atom:updated>2018-12-11T16:36:03.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xdpnm1HXFMQ5WYNb" /><figcaption>Photo by <a href="https://unsplash.com/@rzunikoff?utm_source=medium&amp;utm_medium=referral">Robert Zunikoff</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve been using Kubernetes for some time, you’ll know that the best thing you can do is to invite hundreds of thousands of your best acquaintances to run arbitrary commands on your cluster without adult supervision. At some point in the future, you might wonder what those people that you once knew are still doing on your cluster.</p><p>BPF (Berkeley Packet Filter) is a virtual machine inside the Linux Kernel that classifies events and triggers actions when it receives one of those events. It allows you to inject code into the kernel at runtime to handle those events; no kernel compilation required. There are two flavors of BPF. This article refers to the extended version, eBPF, but I just call it BPF.</p><p>So, getting back to those pesky friends hogging all the resources in your cluster. One of your options is to check all their pod definitions to determine the entry point for all their containers. This will only give you the first program that the container started. You’ll never know if their entry point spawned a million other processes that are actually mining the crypto currency of the week.</p><p>Another more interesting option is to use <a href="https://github.com/fntlnz/kubectl-trace">Kubectl Trace</a> to check what’s running in a container. This extension for Kubectl schedules one-time-only jobs to run BPF programs inside a container. So you can list all processes running in any container with a one line command:</p><pre>kubectl trace run container -e \<br>  &quot;tracepoint:syscalls:sys_enter_execve { @[comm] = count() }&quot;</pre><p>This command will wait for containers to execute new processes and will group as many of them that are running by their command name (comm). The problem is that you need to execute this command when you want to know what’s happening in there; it doesn’t allow you to supervise the cluster usage without you looking at it all the time.</p><p>My favorite option is to deploy <a href="https://github.com/iovisor/gobpf/blob/master/examples/bcc/execsnoop/execsnoop.go">BPF’s Execsnoop</a> as a <a href="https://hub.docker.com/r/calavera/execsnoop/">sidecar container</a> in each pod and let it log in real time all the processes running in the pod. Kubernetes 1.13 has a configuration flag called shareProcessNamespace that allows you to put all the processes spawned in the pod into the same namespace, so you can spy on all the containers within the pod from your sidecar. This is the beginning of your pod definition to do that:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: happy-borg<br>spec:<br><strong>  shareProcessNamespace: true</strong><br>  containers:<br>  - name: execsnoop<br><strong>    image: calavera/execsnoop</strong><br>    securityContext:<br>    - privileged: true<br>    volumeMounts:<br>    - name: sys # mount the debug filesystem<br>      mountPath: /sys<br>      readOnly: true<br>    - name: headers # mount the kernel headers required by bcc<br>      mountPath: /usr/src<br>      readOnly: true<br>    - name: modules # mount the kernel modules required by bcc<br>      mountPath: /lib/modules<br>      readOnly: true<br>  - name: container doing random work<br>  ...</pre><p>BPF opens the doors to better observability for Kubernetes. If you’re a Kubecon, don’t miss <a href="https://kccna18.sched.com/event/GrYw/ebpf-powered-distributed-kubernetes-performance-analysis-lorenzo-fontana-influxdata">Lorenzo’s talk on Kubernetes Performance Analysis</a>.</p><p><a href="https://twitter.com/jessfraz/">Jessie</a> and <a href="https://twitter.com/calavera/">I</a> are writing a book about BPF to teach people how to use it without having to become a kernel hacker. Follow us on Twitter to get updates. We just started, and we’re very excited to get it into your hands as soon as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b09032bd1cdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating Netlify’s Continuous Deployment infra to Kubernetes (and everything we learned along the…]]></title>
            <link>https://medium.com/netlify/migrating-netlifys-continuous-deployment-infra-to-kubernetes-and-everything-we-learned-along-the-1e5989254269?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e5989254269</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[incident-management]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Wed, 11 Jul 2018 19:53:13 GMT</pubDate>
            <atom:updated>2018-07-11T19:56:16.031Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S0GX2pn5YTaCf3ZH" /><figcaption>Photo by <a href="https://unsplash.com/@peppemessomalex?utm_source=medium&amp;utm_medium=referral">Giuseppe Murabito</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Migrating Netlify’s Continuous Deployment infra to Kubernetes (and everything we learned along the way)</h3><p>During 2017, Netlify suffered a series of incidents that made us reconsider the way a key component in our infrastructure works. This post is about the journey we took to make our service more resilient. I’ll also share some thoughts that hopefully will help you approach risk and safety management from new points of view.</p><h3>The need for certainty</h3><p>One common issue among the incidents I’ll describe is that we weren’t certain about what triggered each one of those events. Humans, in general, prefer simple explanations that point to specific causes because it means that a single change may be sufficient to correct the problem.</p><p>In Nietzshe’s words:</p><blockquote>Extracting something familiar from something unknown relieves, comforts and satisfies us, besides giving us a feeling of power.</blockquote><blockquote><em>— Friedrich Nietzsche, Twilight of the Idols.</em></blockquote><p>He was talking about his fellow philosophers here, however, I think we all can relate to this feeling when we talk about incident investigation and outages. We tend to stop when we find a reasonable explanation to the event with familiar terms. Having a good understanding of the issues make us also feel like we have the system under control again.</p><p>Unfortunately for us, we didn’t have simple and reasonable explanations for those events. Which led us to start thinking about ways to replace the whole system.</p><h3>Systems thinking</h3><p>For those of you not familiar with Netlify, it’s a platform for building, deploying, and managing JAMstack projects. We give frontend developers a modern workflow that combines globally-distributed deployments, continuous integration, and many other features for the modern web.</p><p>The system that concerns us here is the one in charge of building and deploying customer projects. Its only purpose is to take the source code that lives in a Git repository, run some build commands to generate all the files we need to deploy, and upload those files to our origin servers.</p><p>This diagram represents the architecture of the system that was in production between 2015 and January 2018.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TC-yYLP0DchSyd7V.png" /></figure><p>Our API receives events from different Git sources, like GitHub. It stores information about this event in a database, and sends a message to a broker queue. On the other end, a microservice deployed in a cluster of virtual machines listens for messages in the queue. Upon receiving a message, it starts a docker container that runs the build process necessary to generate a new deployment.</p><h3>Capacity Management</h3><p>The first challenge we faced with this architecture was capacity management. As our customer base increased exponentially, the demand for infrastructure resources increased in the same fashion. This new traffic in our build network caused degradation of service on several occasions, which made us consider the different strategies for capacity planning.</p><p>At the beginning, we started using a lead strategy. We increased the number of VMs with the goal of being over-provisioned, without paying attention to the traffic. That was a good solution to start with because we had several thousands of credits in different cloud providers and we didn’t have to be concerned about paying those bills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bev7cGD1s9ZoUqSm.png" /></figure><p>The problem with this strategy is that we used arbitrary numbers with the hope that it’d be enough to keep up with demand. This was also a waste of resources on a daily basis, because the traffic that goes through our network on a Monday morning is completely different from that on a Saturday night.</p><p>The bad news is that being over-provisioned today doesn’t mean anything tomorrow, and every now and then, we woke up to alarms of traffic spikes and build queues backed up as a result. Our responses to these events were always reactive to match the spike of traffic, without having simple explanations for why they happened.</p><p>Increasing capacity in this way is known as lag strategy. It’s a more conservative strategy that doesn’t yield good results, since you usually wait until there are delays in your system to add more capacity, eroding confidence in the service as a whole.</p><p>What we really needed was a system that could adjust the capacity to match demand in each situation, and do it in an automatic way, without us having to worry about how expensive it was, or how many customers were experiencing delays in their deploys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0Wx6qClWRelBLJvG.png" /></figure><h3>Observing Normal Accidents</h3><p>Delays in building and deploying projects was not the only problem we faced with this old system. Other issues landed in the area of what’s called <em>normal accidents</em>, or system accidents.</p><p>Charles Perrow presented this theory in his book <a href="http://www.worldcat.org/title/normal-accidents-living-with-high-risk-technologies/oclc/843204302"><em>Normal Accidents: Living with High-Risk Technologies</em></a>, where he proposed that technical systems become so complex that unanticipated interactions of small failures are bound to lead to unwanted accidents and disasters.</p><p>In the distributed systems world, we can see this theory in action in the work of Kyle Kingsbury with the <a href="https://jepsen.io/">Jepsen</a> project. The most clear examples of this type of accident are network partitions that trigger byzantine errors in distributed systems. Once again, we’re reminded that <a href="https://aphyr.com/posts/288-the-network-is-reliable">networks are not reliable</a> — we cannot count on having reliable message-passing through networks; therefore, we should <a href="https://codahale.com/you-cant-sacrifice-partition-tolerance/">design our systems to be partition tolerant</a>.</p><p>During 2017, our build system suffered several network partition accidents. These errors manifested in different ways, from lost messages in the queue, to split brain events in which we had to completely recreate our message queue cluster to recover from them. The worst part was that we could not find simple explanations to these events, which only increased the uncertainty of the system. The queue broker we were using didn’t provide any useful metrics, and even when we configured the system to always emit debug logs, we could not get any information whatsoever about the events.</p><p>These incidents were the main issue that made us consider migrating our build system to a completely different architecture. We needed a system that gave us stronger guarantees in case of normal accidents, and allowed us to observe and reason about them without the pressure of a customer-impacting incident in progress.</p><h3>Circuit Breakers</h3><p>The most common technique to handle these types of incidents is to put <em>circuit breakers</em> in place.</p><blockquote>You wrap a protected function call in a circuit breaker, which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips.</blockquote><blockquote><em>— Martin Fowler, </em><a href="https://martinfowler.com/bliki/CircuitBreaker.html"><em>CircuitBreaker</em></a></blockquote><p>A circuit breaker is an abstraction in your code that forces you to define how your code is going to behave in case of system errors. It includes heuristics to decide whether to run your intended code or to fall back to code that handles errors. For example, you can define that if an action fails 30% of the time, then you should stop trying to perform that action and instead do something else.</p><p>We added circuit breakers to decide what to do in case of network partitions — if a service cannot talk to another through the network, we need to decide how to handle that problem. In this particular scenario, we used circuit breakers to stop sending messages to the message broker if our API could not reach it. The code looked like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06a2f5040afd14f48ea747313f8ba9b5/href">https://medium.com/media/06a2f5040afd14f48ea747313f8ba9b5/href</a></iframe><p>During network partitions, we stored all messages in a secondary store until we recovered from the incident. At that point, we re-enqueued the messages in the order we received them. This gave us the confidence that we didn’t miss any messages during an outage, and we could recover from the incident by responding to those messages in a more controlled manner.</p><p>However, the big question that we still had to answer was how we could prevent all these incidents from happening in the first place.</p><h3>The rise of Kubernetes</h3><p>We evaluated different solutions to the problems we faced with our build system. For a more conservative approach, we could replace our queue system with a different one that had been proven more reliable. This could help us mitigate normal accidents, but it didn’t solve our capacity planning issues. We also considered writing a custom scheduler and load balancer that could adjust capacity based on user demand. This could solve our capacity issues, but of course, it wouldn’t help mitigate normal accidents. Plus, we’d have to spend time finding and developing the right solution, and it could also introduce new unknowns.</p><p>We needed a more pragmatic solution. Our team is not very big, so we had to consider the time we’d spend building and managing a new system. We re-assessed the problem as a whole, and looked for existing technologies to meet our needs. We had three requirements:</p><ul><li>- Proven stability against normal accidents.</li><li>- Ability to schedule jobs, maximizing CPU and memory efficiency.</li><li>- Automatic capacity adjustment, adding and removing resources on demand.</li></ul><p>This made us look into Kubernetes. Today, there is an enormous amount of information about Kubernetes out there, and the community is only growing. This gave us confidence that in the event of an accident, we could find good solutions. We also decided to use the managed service of one of our cloud providers, instead of managing Kubernetes ourselves. This meant that experts in the field could help us make it reliable while we focused on our own system problems.</p><p>After some experimentation, we were fairly certain that we could use the Kubernetes API to schedule pods to run our builds and deploys, and we could also leverage the Kubernetes Autoscaler to manage the cluster’s capacity automatically for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FY-jBznBtQvvu9Yl.png" /></figure><p>At Netlify, we’re not exactly fans of the idea of “build a huge new system, switch it on, and hope for the best. We had a migration plan in place to help us evaluate our progress and ensure that the new system could make our build service more resilient.</p><h3>The ETTO Principle</h3><p>Erik Hollnagel published a theory a few years ago on the trade-off of being efficient versus being thorough. In his book, he explained that it’s impossible to maximize efficiency and thoroughness at the same.</p><blockquote>The ETTO principle refers to the fact that people (and organizations) have to make a trade-off between the resources they spend on preparing an activity and the resources the spend on doing it.</blockquote><blockquote><em>— Erik Hollnagel, </em><a href="http://erikhollnagel.com/ideas/etto-principle/index.html"><em>The ETTO Principle</em></a></blockquote><p>In other words, we needed to make a trade-off between the time and effort we spent designing and testing the new system versus the time customers could be spending on the new, presumably better, system. If we chose thoroughness and took longer to migrate to the new system, we could face new accidents in our old system, which would erode the customer confidence and risk our SLAs. If we chose efficiency, we could have migrated to the new system quickly, but face many unknown system accidents, which would have risked our SLAs too.</p><h3>Feature flag all the thing</h3><p>We use feature flags across our platform extensively. They allow us to expose customers to new features in a controlled manner. But what’s more important to us is that they also allow us to put features in production and expose them for our use only. I’m a big proponent of testing in production when done right, and feature flags are a fundamental part of it.</p><blockquote>Once new code is deployed to production behind a feature flag, it can then be tested for correctness and performance as and when required in the production environment.</blockquote><blockquote><em>— Cindy Sridharan, </em><a href="https://medium.com/@copyconstruct/testing-in-production-the-safe-way-18ca102d0ef1"><em>Testing in Production the Safe Way</em></a></blockquote><p>A good feature flag system gives you the confidence that new parts of your code are only visible under certain conditions. It turns a feature on and off instantly on demand, and in a selective way. It should also tell you how many users a feature is enabled for and how often a customer reaches that feature.</p><p>At Netlify, we specify feature flags at three levels: global flags, account flags, and project flags. Those levels propagate on cascade — a flag enabled for an account applies to all projects within it, and a flag enabled globally applies to all projects in all accounts. We can also enable flags for a percentage of accounts and projects, as well as creating groups based on characteristics, like only accounts owned by teams.</p><p>The first step to migrate to our new build service was to define a feature flag that could route traffic to this service. At the beginning, the flag was only enabled for a few developers working on the service. When we started to get comfortable with the new service, we enabled it for the company web projects. The code for this feature flag looked like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb137dc3dfe1527c152adc144a297a11/href">https://medium.com/media/fb137dc3dfe1527c152adc144a297a11/href</a></iframe><h3>Planning rollbacks and recoveries</h3><p>Once we had a feature flag in place, we needed to consider our options to rollback traffic from the new service to the old service in case of unexpected accidents.</p><p>We started by storing metadata about which service had been used for each build, so we could identify affected customers. With that information at hand, our API could replay builds in the old service if we had to roll back and recover due to issues with the new service. From the point of view of an affected customer, they’d see Netlify failing to deploy one of their builds and automatically starting it again. The code for this logic looked like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/900be00b432a36abd98166a8ad48ee33/href">https://medium.com/media/900be00b432a36abd98166a8ad48ee33/href</a></iframe><h3>Challenges scaling the service</h3><p>At the same time we were building the service, we ran several load tests to ensure that Kubernetes’ autoscaler would work correctly, scaling up in the event of increasing build demands, and scaling down during low traffic times, like weekends.</p><p>This is the point were we bumped into our first complication. The autoscaler took too long to bring new nodes up when it needed to increase capacity. When Kubernetes adds additional capacity, the scheduler doesn’t send jobs to the new nodes until the docker images for those jobs are completely downloaded in the node. In our case, there is only one image to download, but that image’s size was 4 gigabytes, which took about 9 minutes to download. This was unacceptable as a capacity management measure, since many customers would be waiting for at least 9 minutes to get their builds started.</p><p><strong>Specialized vs. general-purpose Docker images</strong></p><p>If you’re familiar with Docker, you probably know that building images specialized for a specific purpose is usually a good practice. For example, you have an image for Nginx and its only purpose is to run Nginx. You also have an image for Go, and its only purpose is to run Go commands, and so on. In traditional Continuous Integration services, this is very convenient — if you want to run tests for your Rails application, you use an image with Ruby and Rails installed, and nothing else. This also helps keeping the image sizes small, which is more efficient when you have to download them many times from a container registry.</p><p>The nature of the projects our customers build on Netlify actually makes this less convenient. Usually, a web project will involve some JavaScript compilation, so we need Node. It might also need another programming language if you use a site generator, or libraries to process image files. Having a specialized Docker image would actually be a disadvantage for us because our customers would have to modify them for each one of their use cases.</p><p>However, we could improve how we installed packages in our image. At one point, we had five different versions of Ruby installed by default, and several versions of Python. To reduce size, we removed everything that didn’t need to be installed as root, and implemented several ways to lazy install those packages. For major the programming languages that we support, we use specific package managers like NVM and RVM to install Node and Ruby versions on demand. After the first installation, this version is stored in a local cache, so the next time this customer needs it, it doesn’t need to be installed — we fetch all the libraries from the cache, already compiled for the right system.</p><p>This work reduced the size of the image by about 2 gigabytes, but it still took several minutes to install the image. The problem was that even though Docker downloads layers in parallel, the process to build the image from those layers is sequential. As of this writing, our image includes 74 layers, and uncompressing those layers took much longer than downloading them. Fortunately, Docker includes a new squash utility that collapses all the layers in your image into a single layer. When we make changes to the image, we use Jenkins to squash the layers and push it to our private registry. Using a squashed image reduced the time it took for a new node to be ready to accept jobs from minutes to seconds.</p><p><strong>Disk saturation</strong></p><p>After some favorable results with the autoscaler, we decided to turn the feature flag on for a small percentage of our customers. This worked pretty well, and we started to see very promising results. Customer builds and deploys were going through the new service, and we even noticed a small drop in deploy times. So we enabled it for a higher percentage of customers.</p><p>At this point we started to see some very weird behavior. Every now and then, Kubernetes killed the Docker daemon along with all the containers running in that node, causing builds to be aborted in the middle of the process. We were very puzzled by this behavior.</p><p>We traced that behavior to a script for monitoring container runtime in GCE:</p><p><a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/gci/health-monitor.sh#L27">https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/gci/health-monitor.sh#L27</a></p><p>This health-monitor script uses the docker ps command to decide whether a node is healthy or not. If that command takes longer than 60 seconds to reply, Kubernetes considers the node unhealthy and restarts the Docker daemon. However, there was a known problem where docker ps would hang indefinitely for reasons that were never very well understood. If you google “Docker ps hangs”, you’ll get about 30,000 results back.</p><p>Docker solved the problem in version 1.13, but because our service provider managed our cluster, updating the Docker daemon was not an option. Instead, we would have to figure out why our docker ps commands were hanging, and prevent it. In our case, the cause was that the node’s disk was saturated due to jobs manipulating too many files.</p><p>We found an alternative solution by mounting two different disks in each node. We use one disk for the Docker filesystem, where Docker stores information about the containers running. We use the other disk for our own workloads, where customers run their build commands.</p><p>Once we moved to a double disk configuration, we stopped observing disk saturation and daemon restarting issues. With this change in place, we turned the new service on for all our customers. Weeks later, we decommissioned the old service and removed the code that scheduled builds in it from our production API.</p><h3>Afterthoughts</h3><p>At the beginning of this project, we estimated that it would take us two months to migrate to Kubernetes. In the end, it took us about four months to finally put it in full production. The main two causes for this delay were:</p><ul><li>- Bumping into unknown accidents that we had not planned for.</li><li>- Not having direct access to the Kubernetes cluster management.</li></ul><p>On the other hand, both of these issues had benefits as well. Some of the accidents we bumped into forced us to improve parts of our infrastructure that we had neglected for some time. Delegating cluster management to a service provider shielded us from other types of accidents that we didn’t have to worry about.</p><p>In the six months since we migrated our build service to Kubernetes, we’ve suffered zero system accidents in the service. The times where the cluster was under-provisioned, the autoscaler worked as expected and automatically increased capacity without customers noticing any impact. An interesting byproduct of this is that we can now observe and reason about these autoscaling events without the time pressure and communication requirements of a customer-impacting incident.</p><p>Also in the last six months, the number of builds we process has grown by 50%. However, the direct cost of our build service has remained stable — we’re spending only about $200 per month more than we were before. If we had kept the old service, our expenses would have increased at the same rate the traffic increased.</p><p>This is not the end of the journey for our build service, and we’re now in a better place to take it to the next level. If you’re interested in challenges like this, <a href="https://www.netlify.com/careers/">we’re hiring</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e5989254269" width="1" height="1" alt=""><hr><p><a href="https://medium.com/netlify/migrating-netlifys-continuous-deployment-infra-to-kubernetes-and-everything-we-learned-along-the-1e5989254269">Migrating Netlify’s Continuous Deployment infra to Kubernetes (and everything we learned along the…</a> was originally published in <a href="https://medium.com/netlify">Netlify</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Netlify’s deploying and routing infrastructure works]]></title>
            <link>https://medium.com/netlify/how-netlifys-deploying-and-routing-infrastructure-works-c90adbde3b8d?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c90adbde3b8d</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[wardley-maps]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Mon, 05 Mar 2018 19:00:28 GMT</pubDate>
            <atom:updated>2018-03-30T19:17:58.627Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5n8tevsZPhFAnWnJTzO3lA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/IUY_3DvM__w?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Matt Duncan</a> on Unsplash</figcaption></figure><p>Every now and then, people ask about the advantages of using Netlify before a traditional cloud provider’s file storage service. Cloud providers can serve static files from your own domain name, so why use something else? In fact, Netlify uses those services to store files too. The difference is in the value added by Netlify on top of those services.</p><p>If we were going to look at this difference on a map, we’d say that file storage is a commodity. Storage costs are very low, which turns those services into utilities. Anyone can take several files and upload them to the cloud. This presents us with some opportunities that we’re going to explore.</p><p>The first one is about what to show your visitors when they use different domains and subdomains. For instance, I want to show specific content for www.example.com and beta.example.com. This is usually solved by custom solutions. You can make that work with the right combination of DNS records and storage buckets.</p><p>Another interesting opportunity is efficient file uploads. Off the shelf tools usually upload all your files to a storage bucket every time you run them, even if there are files that have not changed. It makes this process slower than it should be if they only uploaded the files that have changed. This was one key advantage for Dropbox. Their desktop clients knew how to manage files to save bandwidth and time.</p><p>Off the shelf tools don’t offer bucket integrity either. If two visitors request the same file while you’re updating your bucket’s content, they can get different content. If that content requires new CSS and JavaScript, your visitors won’t see what you expect them to see. You can work around this with the right combination of CDN caching, expiration headers, and scripts to expire the cache after each upload.</p><p>Netlify solves these problems for you, and many others. We’ve created a real product from the experience of implementing those custom built solutions ourselves. The rest of this post explains some infrastructure details behind Netlify’s deploying and routing mesh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1ohYUjP4E0vQLmGRbAZDg.png" /><figcaption>Netlify’s situational map</figcaption></figure><p>We’ve built Netlify’s core around <a href="https://en.wikipedia.org/wiki/Merkle_tree">Merkle trees</a>, the same structures used in Git, ZFS file systems, and blockchain technology. A Merkle tree is a structure where each node is labeled with the cryptographic hash of the labels of all the nodes under it.</p><p>As you read earlier, we use cloud file storage to persist content. But, we use content addressable references rather than file names as identifiers. We don’t store files with the name jquery-3–31.js , we hash its content and we use that as the file name. This gives strong guarantees that we serve the same content regardless the file name. We don’t care if it’s named jquery-3–31.js and you decide to rename it later to jquery-3-latest-download.js. Each deploy calculates those hashes and generates a new tree based on the content that changed, and content that we already have stored. If you only change one file, we will only upload one file. If you rename a file, we will create a new node in the tree with that file name, without upload its content. If you remove a file, we won’t reference it in the new tree. That also means that each deploy is immutable. We always serve the contents of the same tree under a domain. When we finish processing new deploys, we only swap the tree to serve. Having immutable trees also prevents us from showing mixed content.</p><p>These immutable guarantees are also the base for many other features. The first one is <a href="https://www.netlify.com/docs/versioning-and-rollbacks/?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing">atomic and instant rollbacks</a>. As Murphy said, if something can go wrong, it will go wrong at some point. Immutability doesn’t prevent you from publishing content with broken markup, and content that you publish on accident. Since your previous deploy was never modified, we can revert to that state at any time. We only need to change the tree reference where your domain points again.</p><p>Another interesting advantage of immutable deploys is that we can point any name you want to any content you want. This is the base for what we call <a href="https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing">Deploy Previews</a> and <a href="https://www.netlify.com/docs/continuous-deployment/#deploy-contexts?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing">Branch Deploys</a>. Given a set of changes in a Git branch, a DNS subdomain entry, and some basic routing rules, it’s not hard to route traffic to a specific tree in a safe and reliable way. We can serve different content in beta.example.com and www.example.com by pointing each domain to a different tree. We can also build on top of these primitives to implement new features, like <a href="https://www.netlify.com/blog/2018/03/02/how-to-use-split-tests-to-give-users-access-to-private-features/?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=deploying-and-routing">Split Testing at the edge</a> by Git branch.</p><p>These are the foundations of why Netlify is different than using a cloud provider’s file service. We’ve taken an opportunity that those commodity services offer to build an awesome product.</p><p>If you’re excited about web and infrastructure engineering, we’re always looking to <a href="https://www.netlify.com/careers">grow our team</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c90adbde3b8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/netlify/how-netlifys-deploying-and-routing-infrastructure-works-c90adbde3b8d">How Netlify’s deploying and routing infrastructure works</a> was originally published in <a href="https://medium.com/netlify">Netlify</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Book Recommendations for Engineering Organizations]]></title>
            <link>https://medium.com/@calavera/my-book-recommendations-for-engineering-organizations-496cbc6fb9c7?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/496cbc6fb9c7</guid>
            <category><![CDATA[turn-the-ship-around]]></category>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[human-behavior]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Mon, 18 Dec 2017 16:41:51 GMT</pubDate>
            <atom:updated>2017-12-26T14:59:32.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Last week, we had the largest company get together at Netlify yet. On Thursday, I gave a short talk about human engineering, successes at the company during this year and the opportunities we face in the future.</p><p>This talk included three book recommendations. I thought it’d be interesting to share them in public.</p><p>1- <a href="https://www.goodreads.com/book/show/16158601-turn-the-ship-around">Turn the ship around!</a></p><p><a href="https://www.goodreads.com/book/show/16158601-turn-the-ship-around">Turn the Ship Around!: A True Story of Turning Follower...</a></p><p>This book quickly became a classic in management circles. I believe everyone could benefit of the lessons learned in this book. Helping other people to be successful is not only a manager’s job.</p><p>2- <a href="https://www.goodreads.com/book/show/376964.Field_Guide_to_Understanding_Human_Error">The field guide to understanding human error</a></p><p><a href="https://www.goodreads.com/book/show/376964.Field_Guide_to_Understanding_Human_Error">Field Guide to Understanding Human Error</a></p><p>This book is focused on industries where mistakes are paid with human lives. There is a lot to learn from the way we handle errors and what we do to prevent them from happening again.</p><p>Note from personal experience: Do not read it on a plane, unless you want to turn this book into a very realistic horror story.</p><p>3- <a href="https://www.goodreads.com/book/show/616875.The_Oregon_Experiment">The Oregon experiment</a></p><p><a href="https://www.goodreads.com/book/show/616875.The_Oregon_Experiment?from_search=true">The Oregon Experiment</a></p><p>One of my all time favorite books. I discovered it through Guy Steele’s wonderful lecture on <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=2&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwjSkLWs_JPYAhVJ0mMKHfV6CGYQtwIIMTAB&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_ahvzDzKdB0&amp;usg=AOvVaw2O_UUPpqxb-9E3p9F_LDwk">Growing a Language</a>.</p><p>There is something very powerful in the idea of letting people design the spaces where they live, and transform the communities they are part of. Open Source development is similar in many ways to the ideas in this book.</p><p>So, if you could only recommend me three books to read next year, which ones would them be?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=496cbc6fb9c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to map: towards a fully encrypted internet]]></title>
            <link>https://medium.com/@calavera/learning-to-map-towards-a-fully-encrypted-internet-ba73be3b6a17?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba73be3b6a17</guid>
            <category><![CDATA[wardley-maps]]></category>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Mon, 26 Jun 2017 14:08:24 GMT</pubDate>
            <atom:updated>2017-06-26T14:08:24.331Z</atom:updated>
            <content:encoded><![CDATA[<p>Mapping is a technique that improves situational awareness in business. The first time I heard about it was at the keynote <a href="https://twitter.com/swardley">Simon Wardley</a> gave at OSCON 2015. 20 minutes was not much time to explain all the concepts related to mapping, but, besides being a great presentation (<a href="https://www.youtube.com/watch?v=Ty6pOVEc3bA">that you should watch</a>), the topic got my attention.</p><p>I tried to learn more about mapping over the last couple of years, but the initial blog posts and related materials that I found still sounded very vague and foreign to me. Fortunately, Simon is writing <a href="https://medium.com/wardleymaps">a book about mapping</a> that has much more detail and clearer explanations. Telling the story about how he developed mapping for his own benefit also helps to bring the narrative together much better than other publications.</p><p>If I wanted to become better at situational awareness and mapping, I needed to start practicing with something familiar. What follows is my attempt to map the fundamental shift we’ve seen in recent years to make the internet fully encrypted and secure. It describes Netlify’s purpose towards TLS encryption (from my personal point of view), how we exploded the landscape, and the movement we’ve observed in the environment.</p><p>In 2014, Google announced that it was going to start using <a href="https://webmasters.googleblog.com/2014/08/https-as-ranking-signal.html">HTTPS as a ranking signal</a>. This meant that millions of website owners were about to start spending money every year in HTTPS certificates avoid scoring lower on Google’s results.</p><p>Before 2015, when someone wanted to use HTTPS connections on their website, they had to pay an annual fee to a Certificate Authority (CA), download a cryptic piece of text (aka the certificate), and upload that text to their provider of choice. This encrypted the connections between their website’s visitors and the servers hosted by the provider. Think about this for a second. You’re buying something to secure the communications between a server that’s not yours and people that you don’t know. The value proposition of a product like this is very low. Why would people care about how a platform secures the connections between their servers and their visitors?</p><p>Much like Simon anticipated the genesis of a new era on computing power, a small group of people started to anticipate the genesis of a new kind of CA.</p><p>Let’s Encrypt is a free, automated, and open CA. It launched at the end of 2015. The people involved proposed an internet standard to fully automate certificate provisioning, called <a href="https://tools.ietf.org/html/draft-ietf-acme-acme-06">ACME</a>. This movement facilitated Let’s Encrypt’s transition from genesis to custom build to an eventual product. For the first time, hosting providers and other platforms were able to provision HTTPS certificates for their customers completely for free. This meant, that a website owner would never again have to worry about the connections between a provider and their visitors, and that having a secure website could become a commodity.</p><p>Netlify started to offer HTTPS certificates via Let’s Encrypt in December of 2015. Back then, paying to have a custom domain on your site was the only requirement for getting a free certificate. We soon realized that if we wanted to help make the internet fully encrypted, we needed to help make certificates a commodity. In July 2016, we launched new prices that made custom domains and HTTPS certificates completely free. Other platforms have followed this tendency; Wordpress, Heroku, SquareSpace and Etsy offer certificates via Let’s Encrypt. My prediction is that GitHub will start offering them for GitHub Pages by the end of Q3 2017, if not earlier.</p><p>Considering all this information, my goal is to be able to map this part of our business and highlight how I see it evolving in the future. I use Simon’s steps below to organize the information before presenting the map.</p><p><strong>Step 1 — User Needs</strong></p><p>Our map includes two anchors. These are users at the top of the value chain: site owners and visitors. Obviously, web sites need visitors. The user needs for both anchors are different, but as we go down the value chain, we’ll see how they merge together.</p><p>User needs for the site owner:</p><ul><li>Certificate manipulation</li><li>Certificate distribution network</li></ul><p>User needs for the visitor:</p><ul><li>Secure browsing</li><li>Certificate distribution network</li></ul><p><strong>Step 2 — Value Chain</strong></p><p>We need a few components to fulfill the user needs. These components are at the bottom of the value chain:</p><ul><li>Certificate management platform</li><li>Secure certificate storage</li><li>Certificate Authority (this is where Let’s Encrypt gets into play)</li></ul><p><strong>Step 3 — Map</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDAyCD-Hi8K4lOgNEAIo7w.png" /></figure><p>The black lines and circles represent the current state of the system. The y-axis represents the value chain, and the x-axis represents the evolution of the system. The red parts of the map are possible changes in the environment.</p><p>As you can see, most of the components are in the custom build state. I believe this is not going to change much. However, I identified two possible opportunities. The first one at the bottom is the most obvious. As platforms adopt ACME and Let’s Encrypt, CAs are going to become a commodity. This is what’s going to allow the internet to be fully encrypted. The black box indicates “inertia” (opposition to the change), due to CAs’ past success in business. The second opportunity I identified is with the platform. Every company that integrates with Let’s Encrypt needs to implement some kind of platform to issue, renew, deliver, and store certificates. I believe a common implementation of a platform like this could be a great open source project. Companies that want to integrate with an ACME CA could leverage a project like this and significantly reduce costs of implementation.</p><p>This was my first attempt at mapping. Representing this part of our business in a map has actually helped me express some ideas that were previously more vague in my mind. The most important thing to remember is that “<a href="https://medium.com/wardleymaps/on-being-lost-2ef5f05eb1ec">All models are wrong, but some are useful</a>”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba73be3b6a17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“I like I wish” to get better feedback]]></title>
            <link>https://medium.com/@calavera/i-like-i-wish-to-get-better-feedback-e3a89fa21170?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3a89fa21170</guid>
            <category><![CDATA[feedback]]></category>
            <category><![CDATA[team-building]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[collaboration]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Tue, 02 Aug 2016 14:46:55 GMT</pubDate>
            <atom:updated>2016-08-05T07:04:19.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vmlgftHtqVS-2wOG_wmIJw.jpeg" /></figure><p>I recently read Camille Fournier’s article “<a href="http://www.elidedbranches.com/2016/07/the-virtue-of-hubris-and-value-of.html">The Virtue of Hubris and The Value of Complaining</a>” and this quote made me think about something we do at <a href="https://www.netlify.com/">Netlify</a> every other Friday and how it started:</p><blockquote>It’s great when people can bring problems AND solutions to you simultaneously, but it’s more likely that they will need help to see the best solution. Helping them see the best solution starts by helping them understand how to state the problem.</blockquote><p>I discovered a technique when I took the General Management Class at <a href="https://www.harrisonmetal.com/">Harrison Metal</a>. After every session, alumni share feedback with the instructors in a peculiar format.</p><p>Take a piece of paper and divide it in two columns: one column for “I like” and the other for “I wish”. In the “I like” column, write things you liked about the class. In the “I wish” column, write things you wished for that class and future classes.</p><p><a href="http://ilikeiwish.org/">I like I wish’s website</a> has a longer explanation and fantastic material to help people start with this activity.</p><p>When I joined Netlify, we didn’t have any structure in our company feedback. And to be honest, we still don’t have much. Then, we stared hiring people around the world. We thought it’d be a good idea to have informal meetings every other Friday, so we could talk about goals, accomplishments, and whatnot. It’s always great to catch up with people you work every day that you’re unable to see in the same office space.</p><p>We want to create an environment where people can feel empowered to give and receive feedback. But it didn’t cross my mind to use “I like I wish” until the morning of that first Friday. We didn’t have an agenda, so I explained this technique to everyone, and we decided to run with it.</p><p>That’s when someone decided to tell Matt and Chris, the two co-founders of Netlify, that he didn’t feel comfortable with them speaking in Danish when other people were around. It’s likely that this was on other people’s minds, but nobody wanted to say it. It made me very happy that even though this was the first time we ever tried “I like I wish”, it worked well enough to encourage someone to speak their mind.</p><p>Now, we start every Friday meeting with a round of “I like I wish”. We focus on the previous two weeks and the two weeks ahead of us. In some ways, I think it has helped us to be more open with each other. I’m sure there is a lot of room for improvement, but I’m quite pleased with this small step towards better feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3a89fa21170" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop saving credential tokens in text files]]></title>
            <link>https://medium.com/@calavera/stop-saving-credential-tokens-in-text-files-65e840a237bb?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/65e840a237bb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Fri, 01 Jul 2016 15:26:09 GMT</pubDate>
            <atom:updated>2016-07-01T15:26:09.466Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ve probably experienced this behavior if you’ve ever used a Command Line Interface (CLI) for a SaaS service:</p><ol><li>You download the CLI.</li><li>It asks you to login or generate an access token.</li><li>It stores those credentials in a hidden file in your file system.</li></ol><p>This might sound reasonable if, as the user, you encrypt your file system. You can guarantee that nobody has access to it when it’s not encrypted. However, the only point in time when the file system is guaranteed to be encrypted is when the computer is completely powered down. There are different techniques to recover encryption keys from memory when your computer is asleep, but I won’t go into those details in this post.</p><p>You cannot take any of those assumptions for granted if you’re developing a CLI. The only responsible way to store your user credentials is to store them is in a secure vault.</p><p>Modern Operating Systems provide tools and APIs to store secrets in a secure way. Apple’s secret manager is called <a href="https://en.wikipedia.org/wiki/Keychain_(software)">Keychain</a>, Windows has a Credentials Manager API, and Linux offers a standard API called <a href="https://standards.freedesktop.org/secret-service/">Secret Service</a>.</p><p>These tools are very well defined, offer strong guarantees to secure credentials, and are widely adopted by consumer software. Your Operating System uses them to store your WiFi passwords, your browser uses them to store credentials to access your Twitter account, and so on.</p><p>When we talk about CLI applications, developers seem to dismiss these tools completely, although there are exceptions. Git has the concept of <a href="https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage">credential stores and helpers</a>, and I added a similar concept (very inspired by Git’s implementation) to the <a href="https://github.com/docker/docker/pull/20107">Docker Engine in the 1.11 version</a>.</p><p>My intention when I wrote Docker’s implementation was to design a very simple proxy to the Operating Systems’ native stores. I did this with the goal of helping other developers adopt good practices for storing encrypted access tokens.</p><p>If you use The Go Programming Language to write CLI applications, accessing a native credential store is very easy with <a href="https://github.com/docker/docker-credential-helpers">Docker credential helpers</a>. This is the TL;DR for Linux’s Secret Service:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29948ab87dcaa93f2b249050a566aac9/href">https://medium.com/media/29948ab87dcaa93f2b249050a566aac9/href</a></iframe><p>Using other native stores is as easy as replacing the implementation of that `nativeStore` variable; the rest of the code remains the same. Swap that with `<a href="https://godoc.org/github.com/docker/docker-credential-helpers">osxkeychain.Osxkeychain</a>` and `<a href="https://godoc.org/github.com/docker/docker-credential-helpers/wincred">wincred.Wincred</a>` and you’ll be all set to target different operating systems.</p><p>Actually, you don’t even need that logic in your application. Very inspired by Git, again, Docker credential helpers provide encapsulated static binaries that you can use as sidekicks for your CLI to handle all the credential management. They use a more simple protocol than Git’s helpers, and the messages are plain JSON objects. The only requirement is to have the <a href="https://github.com/docker/docker-credential-helpers/releases">correct binary</a> in your system. Then, you can send and receive information between your application and that binary using standard inputs and outputs.</p><p>I wrote a fake credential store for Docker’s integration tests that can help you understand the protocol:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c242b5de7c5e438df355aae8bf007e69/href">https://medium.com/media/c242b5de7c5e438df355aae8bf007e69/href</a></iframe><p>You can use a simple shell script with a JSON document to store the credentials:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6497e06a727b1fafd7dd523f76281ada/href">https://medium.com/media/6497e06a727b1fafd7dd523f76281ada/href</a></iframe><p>And you can use an even simpler script to get credentials back from the store:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1787608a0430d4f5c28e16f47271fb3/href">https://medium.com/media/d1787608a0430d4f5c28e16f47271fb3/href</a></iframe><p>You can replicate that behavior with any programming language you prefer. If you use Go, grab the client that I wrote for the Docker Engine itself. Integrating it into your application is as simple as copying the code below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63da31085828a70cf8573726bcf7eff3/href">https://medium.com/media/63da31085828a70cf8573726bcf7eff3/href</a></iframe><p>From my own experience, I know that native APIs can look quite daunting. They could probably be more widely adopted with better integration examples. I hope this blog post helped you understand why it’s important to keep your user credentials safe and how easy that can be when we put simpler abstractions on top of those APIs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65e840a237bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[docker-flames, load testing the Docker Engine]]></title>
            <link>https://medium.com/@calavera/docker-flames-load-testing-the-docker-engine-51dfe4b1698a?source=rss-ebe141a535c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/51dfe4b1698a</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[David Calavera]]></dc:creator>
            <pubDate>Mon, 28 Mar 2016 16:47:51 GMT</pubDate>
            <atom:updated>2016-03-28T16:48:29.684Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Several people asked me if I had a way to reproduce the environment I set up to write the post about <a href="https://medium.com/@calavera/docker-flame-graphs-f9523e98d57d#.dgsn8yhnc">Docker’s flame graphs</a>. The upcoming release of Docker 1.11 gave me the perfect excuse to write those steps down.</p><p>I created <a href="https://github.com/calavera/docker-flames">docker-flames</a> to help other Docker developers write load tests that are hard to reproduce with our simple integration suite. It can also be used a base for a extensive QA scenarios where several actors interact with the Engine at the same time.</p><p>The repository is divided in two main directories. The directory called <strong>exercisers</strong> includes programs written in Go that interact with the Docker API. These programs are compiled into an image an distributed to several virtual machines located in different data-centers around the world. The directory called <strong>scripts</strong> contains bash scripts to run those programs.</p><p>Hopefully, this will be the start of a more accessible suite of performance tests for the Docker Engine. Do not hesitate to start a conversation in the repository if you have any <a href="https://github.com/calavera/docker-flames/issues">questions, comments</a> or <a href="https://github.com/calavera/docker-flames/pulls">contributions</a> to add.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51dfe4b1698a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>