<?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 Snap CI on Medium]]></title>
        <description><![CDATA[Stories by Snap CI on Medium]]></description>
        <link>https://medium.com/@snap_ci?source=rss-a2cfa46a42------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5Vq5Zw3mMF8ILb7pbH4SLw.jpeg</url>
            <title>Stories by Snap CI on Medium</title>
            <link>https://medium.com/@snap_ci?source=rss-a2cfa46a42------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:36:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@snap_ci/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[Lessons learned as Snap CI Product Manager]]></title>
            <link>https://medium.com/continuous-delivery/lessons-learned-as-snap-ci-product-manager-483d7dd07505?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/483d7dd07505</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 17 Jan 2017 21:15:54 GMT</pubDate>
            <atom:updated>2017-01-17T21:15:54.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*17EM0z5Nn1TC2cRgsiSupw.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/suzie-prince/">Suzie Prince</a></p><p>Prompted and inspired by the thoughtful and retrospective questions asked on the <a href="https://roadmunk.com/blog/8-product-managers-share-trends-goals-2017">Roadmunk blog</a> I wanted to take a look at my first year as the product manager for the Snap CI team and share with you my top 5 lessons learned from 2016.</p><h3>CI/CD remains unclear to many</h3><p>Highlighted <a href="https://blog.snap-ci.com/blog/2016/07/26/continuous-delivery-integration-devops-research/">by the study</a> that Emily and I conducted during 2016 where we saw that there was no consensus on the definitions of continuous integration (CI), continuous delivery (CD), or continuous deployment, it became clear to me this year that the level of understanding about how and what these practices are was much lower than I had previously thought. This insight was also compounded by the value that people found <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/">in our blog posts</a> and <a href="https://speakerdeck.com/suziejprince">conference talk about CI and CD</a>, as well as the continuing success of conferences like <a href="https://www.devopsdays.org/">DevOpsDays</a> for those new to the practices.</p><h4>Takeaway:</h4><p>My hope for 2017 is that the understanding of, not only what these processes and practices are, but also how they can be valuable to all roles and organizations large and small increases. Let’s make 2017 the year we all understand and practice <a href="https://martinfowler.com/bliki/ContinuousDelivery.html">continuous delivery</a>.</p><h3>Developers are regular people too</h3><p>I have created products for software development teams for the last 8 years, but this was the first year the primary user of the software was a developer or software engineer. Although I am a great believer in checking your assumptions and biases — it doesn’t mean that I don’t have them! And this year revealed that I had quite a lot about developers; I had made a bunch of assumptions about how and what they knew about other roles and practices in the product development process.</p><p>As an example; when asking developers to help me with customer development, a usability study or a contextual inquiry, I had assumed they understood these terms. As creators of software I assumed that they would not only have been aware of these practices but would also understand why, as a product manager for a developer tool, I would want to ask them questions about how they work or watch them use their dev tools. This was not the case and I was surprised to be met with responses such as “I just do normal coding stuff” or “why don’t you send me the tasks and I’ll write my feedback up for you?”</p><h4>Takeaway:</h4><p>These responses taught me that I still needed to articulate the value and benefit of what I was doing. It also highlighted that I could not rely on developers, as software creators themselves, to articulate feedback to me in a way that was valuable, rather than feature driven. I still needed to do the deep diving to get a good understanding and do analysis to get to the heart of what our users were saying and sharing.</p><p>Not only is that personally relevant to me and the products we build, but it is also a reminder to us all to get to know the people we are building our products for. In-depth conversations and observations can reveal nuances that we cannot assume we know. Although I see many teams dogfooding their own software to “test it” I do not believe this is enough because it is based on an assumption that you are your user — and you are not. I highly recommend that all creators of software for developers use techniques such as usability tests and contextual inquiry research to learn more.</p><h3>Serverless is changing how we build products</h3><p>One of the biggest trends that stood out to me last year in terms of new technology was “<a href="https://martinfowler.com/bliki/Serverless.html">serverless</a>.” We saw more and more of <a href="https://blog.snap-ci.com/categories/serverless-architecture/">our customers</a> using internet based systems where their application did not use the usual server process but rather relied on a third-party service, client-side logic, and/or service hosted remote procedure calls. The ability for these technologies to reduce cost, save time and allow smaller organizations to handle load and act like larger organizations is why many are turning to serverless to help them build their business. For software developers like those who use products like Snap, that embrace the cloud and work on lean, fast moving teams, I think the serverless trend is empowering and industry changing.</p><h4>Takeaway:</h4><p>In 2017 I hope to see more growth in serverless vendors and more thought into the testing and deployment of these serverless architectures to better enable teams to move quickly and effectively while still producing quality software.</p><h3>A truly agile team is a team practicing DevOps</h3><p>Although I have worked with and ran agile teams who have SaaS based products before, this was the first year that I worked with a completely cross functional team who truly were all the things a DevOps team should be. The Snap team runs everything from idea to deployment and operation. Every team member has been at the forefront of a new feature, seen it evolve in development, deployed it and watched it grow in use once in production. Everyone is an analyst, a developer and an ops person. We do ideation and we do support. We all know and love PagerDuty. The powerful learnings we gain from being such a cross-functional team are that: we are very empathic to each role, we all have a high level of understanding about why features are built, how the product is used in production and what could be improved at any given time. The shared understanding that we have created with this way of working means that, more than at any other time in my career, I know that the decisions we are all making everyday are correct and aligned. I truly trust that when one of us calls to resolve something they do so understanding the impact on the full team, process and end user.</p><h4>Takeaway:</h4><p>Creation of cross functional teams takes time and patience. It can feel overwhelming that everyone is aware of and responsible for so much. However, the benefits outweigh the effort. I will continue to focus on working with and growing truly cross functional DevOps teams as I believe they are the best product teams there can be.</p><h3>Build it and they will come is a myth technologists need to get over</h3><p>The saying “build it and they will come” is something many people in the tech industry say and believe. It has long been something I do not believe. However last year, after working closely with many small businesses with great technology ideas that did not succeed, it became solidified in me the naivety of our industry. Many software developers believe that if you have this great idea that the hard work is done. The failure of so many startups and small businesses mean that it should be clear to us all by 2017 that you can’t just make this magical thing and hope that people will come use it.</p><h4>Takeaway:</h4><p>You need to invest in understanding your user, building the right product and telling the right people. Without a holistic and complete plan for your business, your great idea might never get off the ground. And 2017 doesn’t need any of those disappointments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=483d7dd07505" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/lessons-learned-as-snap-ci-product-manager-483d7dd07505">Lessons learned as Snap CI Product Manager</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Snap CI articles to bring with you to a desert island]]></title>
            <link>https://medium.com/continuous-delivery/10-snap-ci-articles-to-bring-with-you-to-a-desert-island-9482d0adcae7?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/9482d0adcae7</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 13 Dec 2016 21:21:11 GMT</pubDate>
            <atom:updated>2016-12-13T21:21:11.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CmmDZYLt82TvhpE7xjWxMA.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/louda-pe%C3%B1a/">Louda Peña</a></p><p>We’ve compiled our top 10 articles from 2016. Our <a href="https://blog.snap-ci.com/categories/serverless-architecture/">serverless architecture</a> series was extremely popular, along with tips on faster deployments, how we compare to Jenkins, and how different people define CI and CD terms. We’ve learned a lot, and are excited to bring more tips, tricks, and trends to you in the new year.</p><h3>#10 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/03/22/fail-fast/">How to get faster feedback now</a> — Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NiwPADvWkDYhAMwZ.png" /></figure><h3>#9 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/10/10/why-thoughtworks-tech-radar-snap-ci-jenkins-mess/">Flipping the Switch on Jenkins</a> — Louda Peña</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*k-LBPC1w_zHa6BFd.png" /></figure><h3>#8 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/09/13/snap-ci-different-better-than-jenkins/">Snap CI &gt; Jenkins</a> — Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Hsp1jF44ljHoxZnF.jpg" /></figure><h3>#7 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/06/28/continuous-delivery-product-managers/">The Product Managers’ Guide to Continuous Delivery and DevOps</a> — Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*1qidAgEHTe2uV88r.png" /></figure><h3>#6 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/01/20/why-we-dont-use-estimates/">Why we don’t use estimates in our day-to-day</a> — Andrei Tognolo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gFZ_w0U8YRrssh19.jpg" /></figure><h3>#5 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/04/19/serverless-architecture/">An Introduction to Serverless Architecture</a> — Badri Janakiraman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*RO-mzOy2dnNrUeQ-.png" /></figure><h3>#4 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/08/30/5-ways-build-test-deploy-software-fast/">5 CI/CD Strategies for Faster Software Deployments and Better Automation</a> — Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U3xhCthgerME7T7d.jpeg" /></figure><h3>#3 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/05/03/serverless-architecture-burst-traffic-applauze/">Tuesdays at 10am: Serverless Architecture and Bursty Traffic</a> — Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*TMGgcXmkkluAe9FK.jpg" /></figure><h3>#2 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/07/26/continuous-delivery-integration-devops-research/">No one agrees how to define CI or CD</a> — Emily Luke &amp; Suzie Prince</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*PRrZ1i6IxjjPSuLC.png" /></figure><h3>#1 <a href="https://blog.snap-ci.com/blog/2016/12/13/top%20articles-continuous-integration-delivery-serverless-architecture-2016/blog.snap-ci.com/blog/2016/05/30/serverless-architecture-aws-lambda-dynamodb-applauze/">Building Serverless Architecture with AWS Lambda, Snap CI and DynamoDB</a> — Badri Janakiraman</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*rWb1pPYsoylTMKZp.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9482d0adcae7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/10-snap-ci-articles-to-bring-with-you-to-a-desert-island-9482d0adcae7">10 Snap CI articles to bring with you to a desert island</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The challenge to go faster: Ways we make this happen with Snap CI]]></title>
            <link>https://medium.com/continuous-delivery/the-challenge-to-go-faster-ways-we-make-this-happen-with-snap-ci-46dfdfe26baf?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/46dfdfe26baf</guid>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 06 Dec 2016 17:39:18 GMT</pubDate>
            <atom:updated>2016-12-06T17:39:18.322Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*0-cbGjhQvXbCGZih.jpg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/suzie-prince/">Suzie Prince</a></p><p>Because we know you want to go faster we are always looking for ways to improve the speed of your builds. Caching is a very common way to speed up builds by storing local files and dependencies that are needed for your builds instead of getting them from their respective mirrors on the internet each time one runs a pipeline. Snap CI has had caching for a while but it was largely an ephemeral cache that was either removed by a deployment or when the storage got too full. Therefore, although it was faster than without a cache, the experience was variable — being fast sometimes and slow others — leading to an inconsistent and sometimes unexpected experience.</p><p>As a way to provide stable “fastness” and consistency in our builds time we wanted to move to a persistent storage mechanism whereby our cache would be longer lived. After spiking a number of solutions we decided to move our caches to AWS S3 storage and began to work on the solution. However, during design and implementation we had two questions we wanted to answer.</p><ul><li>Would cache download times at the start of a pipeline run be increased?</li><li>Would cache upload times at the end of a pipeline run be increased?</li></ul><p>If both were true, the desire to have speedier builds may not have been met by our new implementation. Keeping business goals, and not implementation in mind, we needed to know if builds times were improved or not to consider our new implementation a success.</p><p>In order to answer these questions we chose to use feature toggles and canary releasing to try the new caching implementation in production with a small set of real builds. This allow us to try our new solution with real builds in a real production in environment while still running our old solutions and avoiding disruption if our new implementation did not prove successful.</p><p>Answering “Would cache download times at the start of a pipeline run be increased?”</p><p>We implemented the solution and then rolled it out to our own internal builds and accessed the stage durations. These times were not increased using the new implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TFnXC6o36rkUrbyd.png" /></figure><p>We then continued to roll this out to more and more builds and observed improved stage durations for most users. We also informed a few users that they had been experiencing this new caching and asked for their feedback about the experience. The general consensus was “stable and quick“ which is obviously what we wanted to hear.</p><p>Based on this mix of qualitative and quantitative data our conclusion to “Would cache download times at the start of a pipeline run be increased?” was no.</p><p>Answering “Would cache upload times at the end of a pipeline run be increased?”</p><p>We had a much stronger sense that we would see a negative impact here just because the nature of S3 storage is not like copying to the ECS file system storage. However, we wanted to understand what the extent of the change would be. Basically, would we lose any benefit of moving to persistent storage by uploading to S3?</p><p>In this case we found that pipeline runs were increased by ~2–20 seconds due to the upload of cache at the end of the run pipeline. In combination with qualitative data we received user feedback which was generally that “no difference” was noted at the end of the pipelines after we made the change.</p><p>Our conclusion to #2 then was that yes, cache upload times at the end of a pipeline run were increased in absolute terms but they were not in relative terms significantly higher. Compared to the average pipeline run the increase was very minimal and didn’t outweigh the other speed and stability improvements we had seen.</p><p>Given these conclusions we rolled out the changes to the complete production stack. We would not have been able to achieve this outcome and confidence that our changes would have the desired business goal without implementing feature toggles, continuous delivering our solution to production, gathering data about the impact of the change and using canary releasing techniques to test with a small number of users.</p><p>I hope this example has shown you how these techniques can help prove out product management and business decisions as well as provide feedback into the technical solutions product teams make.</p><p>Go forth, deliver and learn, with speed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46dfdfe26baf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/the-challenge-to-go-faster-ways-we-make-this-happen-with-snap-ci-46dfdfe26baf">The challenge to go faster: Ways we make this happen with Snap CI</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snap CI Deployments to DigitalOcean via SCP and SSH]]></title>
            <link>https://medium.com/continuous-delivery/snap-ci-deployments-to-digitalocean-via-scp-and-ssh-3c02b4b6f8?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c02b4b6f8</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[digitalocean]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 22 Nov 2016 19:20:43 GMT</pubDate>
            <atom:updated>2016-11-22T19:20:43.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*oZQMhVg1gTM1hMBXb2TJ8A.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/ankit-srivastava/">Ankit Srivastava</a></p><p>Currently, Snap <a href="https://docs.snap-ci.com/deployments/heroku-deployments/">supports</a> Heroku and <a href="https://docs.snap-ci.com/deployments/aws-deployments/">AWS</a> deployments. DigitalOcean is a cloud infrastructure provider that has recently gained popularity, and lately we’ve gotten many requests for Snap CI integration with it.</p><p>(If you’re unfamiliar with DigitalOcean, you can read more about it <a href="https://www.digitalocean.com/help/">here</a>)</p><p>While a DigitalOcean integration is in our backlog, I would like to share my experience working on a sample node project and deploying it onto DigitalOcean Droplet.</p><p>I’m using a <em>Hello world</em> example below for testing on Snap CI and deploying it on DigitalOcean.</p><p>GitHub repo url can be found here: <a href="https://github.com/ankitsri11/node_project_digitalocean">https://github.com/ankitsri11/node_project_digitalocean</a></p><h3>Hello.js file content</h3><pre>#! /usr/bin/env nodejs<br>var http = require(&#39;http&#39;);<br>http.createServer(function (req, res) {<br>  res.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});<br>  res.end(&#39;Hello World\n&#39;);<br>}).listen(8080, &#39;localhost&#39;);<br>console.log(&#39;Server running at <a href="http://localhost:8080/%27%29;">http://localhost:8080/&#39;);</a></pre><h3>Setting up DigitalOcean Droplet for Ubuntu machine:</h3><p>a. Create a deploy user with sudo access<br>$ adduser deploy $ gpasswd -a deploy sudo $ su - deploy</p><p>b. Installation of required packages<br>$ apt-get -y install node $ apt-get -y install nodejs-legacy $ apt-get update $ apt-get -y install npm $ npm install -g pm2</p><h3>Setup ssh authentication for deploy user:</h3><p>a. Generate ssh key pair locally<br>$ ssh-keygen -t rsa</p><p>You can also refer our <a href="https://docs.snap-ci.com/getting-started/ssh-keys/">help docs</a> for ssh key generation.</p><p>b. Create <em>authorized_keys</em> file under /home/deploy/.ssh folder for deploy user (in DigitalOcean server) and add the locally generated public key to that file.</p><h3>Setting up Snap CI for build, test and deployment of nodejs code</h3><p>For this, let’s just create two stages: one for build+test and another one for DigitalOcean deployment. If required, we can always create more.</p><p>a. In Stage 1, I’m just running <em>hello.js</em> file and testing if I get the desired output.<br>$ chmod +x ./hello.js $ nohup node hello.js &amp; $ sleep 20 $ curl <a href="http://localhost:8080/">http://localhost:8080</a></p><p>b. Stage 2 or deployment stage:<br>$ scp hello.js deploy@droplet_ip:/home/deploy/node_project/ $ ssh deploy@droplet_ip &#39;pm2 start /home/deploy/node_project/hello.js&#39;</p><p>c. Add locally generated private key as a secure file and click on save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x-v57SclVpufxL9d.png" /></figure><p>In this example I’m using a sample <em>hello world</em>, pushing the hello.js file, and deploying to DigitalOcean Droplet. Ideally, you should generate all the deploy files <a href="https://docs.snap-ci.com/pipeline/#artifact">as an artifact</a> and then use <em>scp</em> command for uploading. You can also store your deploy script in your GitHub repository.</p><p>Hope this has been helpful. If you have questions, please comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c02b4b6f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/snap-ci-deployments-to-digitalocean-via-scp-and-ssh-3c02b4b6f8">Snap CI Deployments to DigitalOcean via SCP and SSH</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WTF are Deployment Pipelines?]]></title>
            <link>https://medium.com/continuous-delivery/wtf-are-deployment-pipelines-b09d5f798bc0?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/b09d5f798bc0</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 15 Nov 2016 19:01:39 GMT</pubDate>
            <atom:updated>2016-11-15T19:01:39.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*Cs1tP8PUKPzzd3mX1tQdTw.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/erin-snyder/">Erin Snyder</a></p><p>Let’s do a mindfulness exercise. Apparently they’re all the rage now! Close your eyes and picture your code being built, tested and deployed. What do you see?</p><p>Maybe you see a bunch of 1’s and 0’s like in The Matrix? Maybe a bunch of connected lines like a transit map? Or maybe a plate of spaghetti if code integration and deployment tend to be really messy at your workplace?</p><p>I picture a pipeline, similar to the green pipes in Super Mario Bros. My latest commit hops into a pipe, runs some tests (and collects some coins and avoids some piranha plants), turns green, and pops out the other end into another part of the world (the world of production).</p><h3>Why a pipeline?</h3><p>The <a href="https://www.amazon.com/dp/0321601912">pipeline concept</a> makes it easier to split up your work into stages and quickly spot breaking changes. A simple pipeline might have a build stage, followed by a test stage, followed by a deploy stage. The build stage creates a binary and/or downloads artifacts that can be used in later stages. The test stage can run all of your automated tests, and then you can choose to automatically or manually deploy to the environment of your choice.</p><p>You could get a bit more complex by breaking up your tests into multiple stages to get faster feedback. Are my smoke tests passing? What about my rspec or jasmine tests? It’s important to be able to tell at a glance where the pipeline has stopped so that you can quickly fix the problem and get moving again.</p><h4>Move faster</h4><p>Speaking of speed, that’s another good reason for choosing a pipeline over other concepts such as something that looks like a bar graph or a bunch of checkboxes. Try dividing up your test suite and run tests in parallel for even faster feedback. The faster your deployment pipeline, the easier it is for your team to deploy a bug fix or push out a new release.</p><p>Pipelines also reduce the risk of your deployment breaking something, because you can test each commit in increasingly more production-like environments. By the time the commit makes it to the end of the pipeline, you can feel confident about deploying to prod. No more waking up at 3am in a cold sweat because someone’s latest commit “worked on their local machine.”</p><p>Have we won you over yet? Are you ready to set up your first deployment pipeline? <a href="https://youtu.be/N9Lgapjt7hE"><em>cue Mario music</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b09d5f798bc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/wtf-are-deployment-pipelines-b09d5f798bc0">WTF are Deployment Pipelines?</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using LXD and cgroups]]></title>
            <link>https://medium.com/continuous-delivery/using-lxd-and-cgroups-ddd2c2223de6?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddd2c2223de6</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[lxd]]></category>
            <category><![CDATA[lxc]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Wed, 02 Nov 2016 16:41:44 GMT</pubDate>
            <atom:updated>2016-11-02T16:41:44.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kKR93wuSSyHt0Ju8ZQCS_Q.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/kyle-olivo/">Kyle Olivo</a></p><p>Let’s have a little fun with LXC containers and cgroups. We’ll create a container and then constrain the number of processes that container can spawn so a rogue user can’t create a fork bomb inside of it!</p><p>First, let’s create a vagrant box to serve as our playground for this activity. If you aren’t familiar with Vagrant, take a look at <a href="https://www.vagrantup.com/docs/">their documentation</a> to learn how to install it.</p><pre>$&gt; vagrant init bento/ubuntu-16.04<br>...<br>$&gt; vagrant up<br>...<br>$&gt; vagrant ssh</pre><p>Now let’s install the LXD package.</p><pre>$&gt; sudo apt-get install lxd</pre><p>If you read the <a href="https://blog.snap-ci.com/blog/2016/10/25/how-linux-containers-work/">previous blog post</a> you know that LXC consists of a set of tools that allows you to manage containers on a Linux system. <a href="https://linuxcontainers.org/lxd/introduction/">LXD</a> is a daemon that allows management of <a href="https://linuxcontainers.org/lxc/introduction/">LXC</a> containers through a REST interface either over the network or via a redesigned ‘lxc’ command line experience (which actually also communicates with the daemon via the REST API).</p><p>Next we’ll need to add ourselves to the ‘lxd’ group and initialize lxd.</p><pre>vagrant@vagrant:~$ sudo usermod -a -G lxd vagrant<br>vagrant@vagrant:~$ exit<br>...<br>$&gt; vagrant ssh<br>vagrant@vagrant:~$ groups<br>vagrant adm cdrom sudo dip plugdev lpadmin sambashare lxd<br>vagrant@vagrant:~$ sudo lxd init<br>Name of the storage backend to use (dir or zfs): dir<br>Would you like LXD to be available over the network (yes/no)? no<br>Do you want to configure the LXD bridge (yes/no)? yes<br>... # note: just hit enter on the questions about configuring the network<br>LXD has been successfully configured.</pre><p>If you just type the ‘lxc’ command, you’ll see a list of subcommands.</p><pre>vagrant@vagrant:~$ lxc<br>Usage: lxc [subcommand] [options]<br>Available commands:<br>       	config     - Manage configuration.<br>       	copy       - Copy containers within or in between lxd instances.<br>       	delete     - Delete containers or container snapshots.<br>       	exec       - Execute the specified command in a container.<br>       	file       - Manage files on a container.<br>       	help       - Presents details on how to use LXD.<br>       	image      - Manipulate container images.<br>       	info       - List information on LXD servers and containers.<br>       	launch     - Launch a container from a particular image.<br>       	list       - Lists the available resources.<br>       	move       - Move containers within or in between lxd instances.<br>       	profile    - Manage configuration profiles.<br>       	publish    - Publish containers as images.<br>       	remote     - Manage remote LXD servers.<br>       	restart    - Changes state of one or more containers to restart.<br>       	restore    - Set the current state of a resource back to a snapshot.<br>       	snapshot   - Create a read-only snapshot of a container.<br>       	start      - Changes state of one or more containers to start.<br>       	stop       - Changes state of one or more containers to stop.<br>       	version    - Prints the version number of this client tool.</pre><pre>Options:<br>  --all              Print less common commands.<br>  --debug            Print debug information.<br>  --verbose          Print verbose information.</pre><pre>Environment:<br>  LXD_CONF           Path to an alternate client configuration directory.<br>  LXD_DIR            Path to an alternate server directory.</pre><p>Many of the commands are quite intuitive. The most important subcommands for now are ‘launch’, ‘start’, ‘stop’, and ‘delete’. Let’s try to launch a container and connect to it.</p><pre>vagrant@vagrant:~$ lxc launch ubuntu:<br>Creating irreplaceable-madie<br>Retrieving image: 100%<br>Starting irreplaceable-madie<br>vagrant@vagrant:~$ lxc list<br>+---------------------+---------+-----------------------+-----------------------------------------------+------------+-----------+<br>|        NAME         |  STATE  |         IPV4          |                     IPV6                      |    TYPE    | SNAPSHOTS |<br>+---------------------+---------+-----------------------+-----------------------------------------------+------------+-----------+<br>| irreplaceable-madie | RUNNING | 10.150.198.185 (eth0) | fd63:a75e:9d73:78ff:216:3eff:fe94:b32c (eth0) | PERSISTENT | 0         |<br>+---------------------+---------+-----------------------+-----------------------------------------------+------------+-----------+</pre><p><a href="https://blog.snap-ci.com/blog/2016/11/01/using-lxd-cgroups/"><strong><em>(click here for a better view of the above code snippet)</em></strong></a></p><p>This command indicates that we want to launch an ubuntu container, and since the name after the colon was omitted, we’ll be given the latest version of the ubuntu container. The container’s name is generated and will be different for every container. This one happens to be called ‘irreplaceable-madie’. Now let’s look at some information about the container.</p><pre>vagrant@vagrant:~$ lxc info irreplaceable-madie<br>Name: irreplaceable-madie<br>Architecture: x86_64<br>Created: 2016/08/22 04:59 UTC<br>Status: Running<br>Type: persistent<br>Profiles: default<br>Pid: 3852<br>Ips:<br>  eth0:	inet   	10.150.198.185 	vethEKODR3<br>  eth0:	inet6  	fd63:a75e:9d73:78ff:216:3eff:fe94:b32c 	vethEKODR3<br>  eth0:	inet6  	fe80::216:3eff:fe94:b32c       	vethEKODR3<br>  lo:  	inet   	127.0.0.1<br>  lo:  	inet6  	::1<br>Resources:<br>  Processes: 24<br>  Memory usage:<br>    Memory (current): 59.80MB<br>    Memory (peak): 166.42MB<br>  Network usage:<br>    eth0:<br>      Bytes received: 2.12kB<br>      Bytes sent: 1.44kB<br>      Packets received: 20<br>      Packets sent: 12<br>    lo:<br>      Bytes received: 264 bytes<br>      Bytes sent: 264 bytes<br>      Packets received: 4<br>      Packets sent: 4</pre><p>Two items are worth noting here. First, we have the process id (pid) of the container (3852). Second, we also get a count of the number of processes currently running in the container (24). What we’re going to do is place an upper limit on the number of processes that can run, because we want to be able to prevent a fork bomb from running on our system. <a href="https://en.wikipedia.org/wiki/Fork%E2%80%93exec">Fork-exec</a> is the mechanism used in Linux to create new processes, by chaining an unending chain of fork-execs together, we can <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack">deny service</a> to anyone that might actually want to use our container. We won’t prove that the fork bomb works, because that would likely crash your container and even your vagrant box (because the container has unconstrained access to the resources on the vagrant host it is running on). Let’s place a limit on the number of processes so that this is no longer possible.</p><p>Before we set this limit, let’s explore cgroups (control groups) a little. Cgroups are implemented as data structures within the Linux kernel, so we need a way to manipulate something that is running in the kernel. Linux provides a few mechanisms for reading/writing to the kernel. The first is the read-only interface of the /proc filesystem. If we ‘ls’ that directory just like any other filesystem, we see a list of files that are actually live representations of data from the kernel. For instance, let’s look at some information about our memory usage.</p><pre>vagrant@vagrant:~$ cat /proc/meminfo<br>MemTotal:         500192 kB<br>MemFree:          244388 kB<br>MemAvailable:     410848 kB<br>Buffers:           17284 kB<br>...</pre><p>By simply issuing the ‘cat’ command on any of these files, we can see what the kernel’s current understanding of the system is. Interestingly, there is a cgroups file in /proc as well.</p><pre>vagrant@vagrant:~$ cat /proc/cgroups<br>#subsys_name   	hierarchy      	num_cgroups    	enabled<br>cpuset 	9      	3      	1<br>cpu    	4      	136    	1<br>cpuacct	4      	136    	1<br>blkio  	7      	136    	1<br>memory 	8      	191    	1<br>devices	10     	136    	1<br>freezer	3      	3      	1<br>net_cls	5      	3      	1<br>perf_event     	11     	3      	1<br>net_prio       	5      	3      	1<br>hugetlb	6      	3      	1<br>pids   	2      	137    	1<br>vagrant@vagrant:~$</pre><p>It’s telling us what subsystems (also called controllers) are defined in the kernel. A subsystem is just a grouping of resources for accounting and control purposes. For instance, the ‘cpuset’ subsystem above controls individual CPU cores in the system, while ‘cpu’ controls cpu cycles, and ‘pids’ controls process information. The other information here isn’t critical for what we’re trying to accomplish, but this document is the best resource I’ve found for a really in-depth, yet digestible explanation of what cgroups are. It also provides descriptions of each of the subsystems listed above. With the above information from /proc/cgroups, we now know there is a subsystem called ‘pids’ which contains the information we need. We can combine this with the pid of our container (shown to be 3852 earlier) to gain more knowledge about the cgroups for our process.</p><pre>vagrant@vagrant:~$ cat /proc/3852/cgroup<br>11:perf_event:/lxc/irreplaceable-madie<br>10:devices:/lxc/irreplaceable-madie/init.scope<br>9:cpuset:/lxc/irreplaceable-madie<br>8:memory:/lxc/irreplaceable-madie/init.scope<br>7:blkio:/lxc/irreplaceable-madie/init.scope<br>6:hugetlb:/lxc/irreplaceable-madie<br>5:net_cls,net_prio:/lxc/irreplaceable-madie<br>4:cpu,cpuacct:/lxc/irreplaceable-madie/init.scope<br>3:freezer:/lxc/irreplaceable-madie<br>2:pids:/lxc/irreplaceable-madie/init.scope<br>1:name=systemd:/lxc/irreplaceable-madie/init.scope</pre><p>The /proc filesystem provides information about every process running in the system, so by simply looking in /proc/[YOUR_PID] we can learn a lot about the environment surrounding our process. But we only care about the cgroup information for now. By issuing ‘cat’ on this file, we see information in this format, id:subsystems:path. Our goal again is to control the number of processes, so let’s focus on the ‘pids’ line. Just as there is a read path (/proc) for kernel information, there is another filesystem path for manipulating data in the kernel (/sys). If you issue a ‘mount’ command, you can see the subsystems mounted on the filesystem.</p><pre>vagrant@vagrant:~$ mount | grep cgroup<br>tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)<br>cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)<br>cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)<br>...</pre><p>Great! We can see where the pids subsystem is mounted on the filesystem, and which options were used to mount it. If we dive into that directory, we can find the file that manipulates the maximum number of processes available in our container. We just need to combine the subsystem mount point with the pids path we found for our specific process above (which was /lxc/irreplaceable-madie/init.scope). There is one ‘gotcha’ though, we need to disregard the ‘init.scope’ subdirectory and apply our cgroup change at the level of the container name itself.</p><pre>vagrant@vagrant:~$ cat /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max<br>max<br>vagrant@vagrant:~$ sudo su -c &#39;echo &quot;1000&quot; &gt;&gt; /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max&#39;<br>vagrant@vagrant:~$ cat /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max<br>1000</pre><p>We saw that the previous value was ‘max’ and now we’ve reduced that to 1000. This should stop our rogue user from fork bombing our container!</p><pre>vagrant@vagrant:~$ lxc info irreplaceable-madie | grep Processes<br>  Processes: 26<br>vagrant@vagrant:~$ lxc exec irreplaceable-madie -- perl -e &#39;fork while fork&#39; \&amp;<br>vagrant@vagrant:~$ lxc info irreplaceable-madie | grep Processes<br>  Processes: 26</pre><p>It looks like nothing happened, and that’s great. The processes spawned out of control until they hit our limit, and then they were were terminated. At this point you may object to this test, after all, I never proved that the fork bomb worked when the limit was set to max. If you are feeling adventurous, you can try that now, but will likely lose control of the container and vagrant box and have to restart them (possible even through the virtualbox interface). Before we make that change, I have a confession. There is a much easier way to control cgroup limits than by editing the /sys/fs filesystem directly (thankfully).</p><pre>vagrant@vagrant:~$ cat /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max<br>1000<br>vagrant@vagrant:~$ lxc config set irreplaceable-madie limits.processes 100<br>vagrant@vagrant:~$ cat /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max<br>100<br>vagrant@vagrant:~$ lxc config unset irreplaceable-madie limits.processes<br>vagrant@vagrant:~$ cat /sys/fs/cgroup/pids/lxc/irreplaceable-madie/pids.max<br>max</pre><p>How did I know that I should provide ‘limits.processes’ as the value to the get and set subcommands? Well, by <a href="https://github.com/lxc/lxd/blob/master/doc/configuration.md">reading the documentation</a> of course! So the ‘config’ subcommand to ‘lxc’ provides a nice interface to the cgroup filesystem, and with this we were able to change and remove the original process limit that we had placed on the container. At this point you could try the fork bomb again in the container if you really want to see what happens without limits. Warning though, it isn’t pretty! By the way, if you want to drop down into the container, you can do so like this.</p><pre>vagrant@vagrant:~$ lxc exec irreplaceable-madie bash<br>root@irreplaceable-madie:~#</pre><p>Now you are free to issue any command you want within the confines of the container you created.</p><p>So just to recap, we were able to launch an LXC container and set a limit on the number of processes that could be spawned inside of it using cgroups. We gained some additional insight into what the kernel is doing my looking at the /proc filesytem, and saw that we could manipulate the kernel in realtime using the /sys filesystem. Now I encourage you to spend some time trying to place other limits on the container. For instance, are you able to constrain the amount of memory or cpu available to it? And what are all those other lxc subcommands about? Go and explore!</p><p><em>This post was originally published on </em><a href="http://kyleolivo.com/dev/2016/08/21/lxd-and-cgroups/"><em>Kyle Olivo’s Blog</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddd2c2223de6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/using-lxd-and-cgroups-ddd2c2223de6">Using LXD and cgroups</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Linux Containers Work]]></title>
            <link>https://medium.com/continuous-delivery/how-linux-containers-work-17a7553afedb?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/17a7553afedb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[lxc]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 25 Oct 2016 23:26:52 GMT</pubDate>
            <atom:updated>2016-10-25T23:26:52.360Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ffoG3UJ04u0xqWiBlYKdvA.jpeg" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/kyle-olivo/">Kyle Olivo</a></p><p>I’ve had the opportunity to use a few different container technologies at work, so I thought I’d write a few blog posts explaining what containers are and go into some depth on how LXC works in particular.</p><h3>What are containers?</h3><p>It is sometimes useful to partition computing resources on a single <a href="https://en.wikipedia.org/wiki/Bare_machine">bare metal</a> host. Perhaps you want to isolate processes for security, or just want to make the most efficient use of the computing resources available on your machine. Unix systems have had isolation capabilities from as far back as 1979 with <a href="https://en.wikipedia.org/wiki/Chroot">chroot</a>, and 2005 marked a resurgence of interest in <a href="https://en.wikipedia.org/wiki/Virtualization">virtualization</a>. Chroot environments allowed a system administrator to limit a processes access to only a particular subdirectory tree on the filesystem, but provided no support for limiting access to other resources (CPU, memory, network, etc). Virtualization introduced a <a href="https://en.wikipedia.org/wiki/Hypervisor">hypervisor</a> layer on top of the primary operating system that allowed for the creation of a new, virtual, machine on top of the existing system.</p><p>While this provided isolation, it also introduced overhead by requiring another copy of the operating system to be installed on the guest virtual machine. In comparison to these two approaches, you can think of a container as an extension of the chroot concept. It limits access to a particular part of the host filesystem, but also provides mechanisms to limit access to other computing resources on the host. In contrast to virtual machines, a container uses the host operating system and kernel to provide the isolation and limits, so you avoid the overhead of the hypervisor and the guest operating system layers entirely. The folks at Docker have created a really nice graphic comparing the <a href="https://www.docker.com/what-docker#/VM">differences between virtual machines and containers</a>. The result is that more computing resources are available for the processes you actually care about, and the setup of the container environment is much simpler than the creation of a similar virtual machine environment.</p><h3>How do containers work?</h3><p>Containers work through four main components: <a href="https://en.wikipedia.org/wiki/Linux_namespaces">namespaces</a>, <a href="https://en.wikipedia.org/wiki/Cgroups">cgroups</a>, <a href="https://images.linuxcontainers.org/">images</a>, and userspace tools like <a href="https://en.wikipedia.org/wiki/LXC">LXC</a> or <a href="https://www.docker.com/">Docker</a>.</p><p>In a traditional Linux system, the <a href="https://en.wikipedia.org/wiki/Init">init</a> process is started on machine boot, and each subsequent process is <a href="https://en.wikipedia.org/wiki/Fork%E2%80%93exec">fork-execed</a> from its parent process (with init at the root of the process tree). Every running process exists in one common environment and is able to access all resources on that machine. Namespaces allow you to group resources together in a common collection. Processes can then be associated with that namespace, thereby giving them a more limited view of the resources available on that machine. There are currently six namespaces in the Linux kernel. These can be roughly categorized as: mount, process, network, interprocess communication, hostname, and user. The value of namespacing should be clear: if one process needs to make changes to the network, for instance, then it would be free to do so without affecting processes in other namespaces. How does this relate to containers? Recall that all processes on a Linux system descend from the init process. One main component of a Linux container is the creation of a new init process under a new namespace. Without the namespacing functionality, it would not be possible to have multiple init processes running on the host. So with namespaces alone, we have the ability to spawn a process tree and manipulate some underlying system resources without impacting the host system. If one of the primary benefits of containers is isolation, what prevents a newly spawned container from overwhelming the host’s resources? Such as consuming too much disk, memory, or processing power? This is where cgroups come in.</p><p>Cgroups (or “control groups”) are responsible for placing limits and recording usage of system resources. This functionality became available in the Linux kernel in 2008. With cgroups, we can limit CPU usage, memory, disk and much more. It’s beyond the scope of this overview to describe how to configure cgroups, but you can look at the <a href="https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt">kernel documentation</a> if you want to learn more. With the combination of namespacing and cgroups, we’re able to spawn a separate process hierarchy with a limited view of system resources, and we can constrain how much access this process hierarchy has to the resources that it can see. We’re still missing one major component of the container ecosystem though, and that is the contents of the filesystem that it has access to.</p><p>One of the most common misconceptions about containers is that they are “just like a mini virtual machine”. The confusion is understandable. When you are inside of a Linux container, it looks just like any other Linux distribution. You see the familiar filesystem layout, devices, and system software that you are used to. But the contents of the container’s filesystem is not a full operating system, but rather a slimmed-down representation of the target operating system. The underlying resources and kernel are provided by the host, and the system software and devices are provided by the image. A host Linux distribution is therefore able to run a container that appears to be an entirely different Linux distribution. The images themselves were created by taking a slim version of the target distribution and manipulating it in a way that reduces its size and makes it runnable in a container. It’s beyond the scope of this article to describe exactly how these images are built, but you can see how the LXC images are created by looking at the <a href="https://github.com/lxc/lxc/tree/master/templates">LXC github repository</a>. Namespaces, cgroups, and images thus provide the three major building blocks that make containers work. The last remaining technology is the set of user tools that allow you to seamlessly manipulate these concepts and create your own environments inside of a container. In the next post, I’ll go into some detail on how you can use LXC to accomplish this.</p><p>This article originally appeared on <a href="http://kyleolivo.com/dev/2016/08/15/containers-how-do-they-work/">Kyle Olivo’s blog</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17a7553afedb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/how-linux-containers-work-17a7553afedb">How Linux Containers Work</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flipping the Switch on Jenkins]]></title>
            <link>https://medium.com/continuous-delivery/flipping-the-switch-on-jenkins-6bf3b2a82a6b?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bf3b2a82a6b</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 11 Oct 2016 23:16:13 GMT</pubDate>
            <atom:updated>2016-10-11T23:16:13.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*V5n3JaeVzpBqDtLd.png" /></figure><p>Posted by <a href="https://blog.snap-ci.com/authors/louda-pe%C3%B1a/">Louda Peña</a></p><p>ThoughtWorks said “HOLD” regarding Jenkins as a deployment pipeline on their <a href="https://www.thoughtworks.com/radar/tools">Tech Radar</a> earlier this year. We think that Snap CI is a great alternative to Jenkins. But why?</p><p>Snap’s Product Manager, Suzie Prince, <a href="https://blog.snap-ci.com/blog/2016/09/13/snap-ci-different-better-than-jenkins/">wrote a great article</a> recently outlining a handful of reasons why you should consider Snap over Jenkins. Of course, there are always appropriate use cases for every tool, including Jenkins, but you should use the best fit for your needs.</p><p>Jenkins has historically been the “go-to” tool for CI, grandfathered into new projects because it seems to be the easy solution. The plug-in ecosystem is their shining beacon in the dark night of CI tools, but once you flip on the switch, you’ll find a massive tangle that’s nearly impossible to manage.</p><p>At some point in your deployment process, you’re going to need more. It doesn’t take long to realize the benefits of an integrated deployment pipeline. It’s the foundation of <a href="http://martinfowler.com/bliki/ContinuousDelivery.html">continuous delivery</a>, and requires a tool that is built with this in mind. Using a plugin for something that should be inherent is the equivalent of putting a Honda Accord engine into a Ferrari: it will fit, it may even run for a short time, but I guarantee you’ll spend endless hours getting it to run properly or at all on a regular basis. If you practice CI, you might understand the problem here: <a href="https://blog.snap-ci.com/blog/2016/07/26/continuous-delivery-integration-devops-research/">speed</a> and reliability are big requirements for any dev doing CI/CD.</p><p>Native deployment pipelines are also necessary to create a complete and vital experience for the software engineer. ThoughtWorks prioritizes not just making excellent software, but industry changing software — that’s why Snap has a deployment pipeline built in and not created from a tangled mess of plugins.</p><p>So why not try Snap over Jenkins and see why ThoughtWorks (and us at Snap!) says “Hold” to Jenkins as a deployment pipeline.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf3b2a82a6b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/flipping-the-switch-on-jenkins-6bf3b2a82a6b">Flipping the Switch on Jenkins</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Takeaways from GitHub Universe]]></title>
            <link>https://medium.com/continuous-delivery/5-takeaways-from-github-universe-782e10c337a8?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/782e10c337a8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 04 Oct 2016 18:17:13 GMT</pubDate>
            <atom:updated>2016-10-04T18:17:13.135Z</atom:updated>
            <content:encoded><![CDATA[<p>Posted by <a href="https://blog.snap-ci.com/authors/kiera-radman/">Kiera Radman</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*Dl7GwSKZxf0zQ_uJ.jpg" /></figure><p>I’m a developer for Snap CI who, like many of you, uses GitHub daily. Here are the favorite quotes I heard while attending GitHub Universe last month. Hopefully you will find them as useful, inspiring, and interesting as I did.</p><h3>1. “The curse of knowledge is that you are blind to what you already know”</h3><p>Jim Kohl from Great American Insurance identified this as one of the most difficult things about spreading <a href="http://githubuniverse.com/program/sessions/#tribal-knowledge">tribal knowledge</a>among developers. The irony is that from the perspective of the unknowledgeable, you don’t know what you don’t know. I can’t tell you how many times throughout my journey to become a better developer I’ve discovered how much I don’t know. It’s one of the things that makes developing software so fun: there’s always an opportunity to learn more. To Jim’s point, it’s one of the things that makes teaching other people so difficult.</p><h3>2. “If it’s not written down, it doesn’t exist”</h3><p>This quote, from Mathias Meyer of Travis CI, is something I think that all distributed teams should keep in mind. It’s clear you can’t rely on oral communication when you have a team like Mathias described in his session on <a href="http://githubuniverse.com/program/sessions/#distributed-inclusive">Building and Scaling a Distributed and Inclusive Team</a>. With 40 team members spread across 15 different countries and many time zones, it’s just not feasible if you want to include everyone. However, I think most teams often rely too heavily on oral communications. Don’t get me wrong, it has its advantages, but you trade speed and efficiency for impermanence and exclusivity when you don’t write things down. We should be more thoughtful when determining if in-person is the most appropriate means of communication. As Mathias noted, less oral communication (and more written communication) has lead to incidental documentation that his teams began compiling into a “builder’s manual” for new team members. That’s another potential benefit to consider.</p><h3>3. “This isn’t our data. It’s the people’s data” -Austin Police Chief Art Acevedo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DIfBxf2oelCKKmDa.png" /></figure><p>Clarence Wardell of the White House’s U.S. Digital Services division shared this quote as part of his featured talk on <a href="http://githubuniverse.com/program/sessions/#police-data">the Police Data Initiative</a>. The data he’s referencing is the <a href="https://publicsafetydataportal.org/all-data/">machine readable data</a> that more than 53 police departments across the country have commited to releasing to the public. Clarence’s ask of developers is that we use this data in creative ways to help drive conversations in the community. The hope is releasing this data will increase transparency and build trust. This quote struck me because it <em>is</em> our data and we have the right to know what is happening with our police departments. That said, we also have the obligation to inform ourselves with it.</p><h3>4. “The first follower turns a lone nut into a leader”</h3><p>This quote is from Jim Kohl. Trying to drive change on a team or in an organization can be overwhelming. Jim <a href="http://githubuniverse.com/program/sessions/#tribal-knowledge">broke down the daunting task</a> by reminding us that making changes begins with one follower. If there is something that you’ve been wanting to do, but haven’t been able to get traction, start by recruiting a follower to help perpetuate your idea. Not convinced? Watch this Ted talk on <a href="https://www.ted.com/talks/derek_sivers_how_to_start_a_movement">How to Start a Movement</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fembed.ted.com%2Ftalks%2Fderek_sivers_how_to_start_a_movement&amp;url=https%3A%2F%2Fwww.ted.com%2Ftalks%2Fderek_sivers_how_to_start_a_movement&amp;image=https%3A%2F%2Fpe.tedcdn.com%2Fimages%2Fted%2F425380b52828533d71593d5e514b6f7f49caee99_240x180.jpg%3Flang%3Den&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=ted" width="560" height="315" frameborder="0" scrolling="no"><a href="https://medium.com/media/e26ef395df53afed33e7e9c97ef125d0/href">https://medium.com/media/e26ef395df53afed33e7e9c97ef125d0/href</a></iframe><h3>5. “Ask for clarification”</h3><p>This was from Jason Chen of Quill. Enlightening, right? The quote itself isn’t much to write about, yet I am writing about it. Why? In practice, it is actually pretty powerful. Jason referenced it as <a href="http://githubuniverse.com/program/sessions/#pains-gains">a lesson he learned</a> as a maintainer of an <a href="https://github.com/quilljs/quill">open source project</a>. He found GitHub issues have the classic characteristics of a <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack">Denial of Service attack</a> since anyone can create them and it often takes time and effort for maintainers to craft thoughtful responses. This left him spending more time addressing issues than actually contributing to his project. Until one day he asked someone to elaborate. Asking for clarification prevented him from wasting time answering the wrong question. He began doing this more often and found he was actually able to more effectively answer people in a shorter amount of time. As a bonus, prodding people further often lead them to answer their own question. While Jason’s case seems very specific, I actually think the concept is applicable in so many situations. I personally find it incredibly helpful when answering support requests.</p><p><em>Top image via CreativeCommons / Flickr user </em><a href="https://www.flickr.com/photos/highlander411/"><em>highlander411</em></a><em>. Map image via </em><a href="https://medium.com/the-white-house/the-police-data-initiative-year-of-progress-how-we-re-building-on-the-president-s-call-to-leverage-3ac86053e1a9#.yicazd45s"><em>White House and Police Data Initiative</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=782e10c337a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/5-takeaways-from-github-universe-782e10c337a8">5 Takeaways from GitHub Universe</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero, One, Infinity]]></title>
            <link>https://medium.com/continuous-delivery/zero-one-infinity-38238dc07102?source=rss-a2cfa46a42------2</link>
            <guid isPermaLink="false">https://medium.com/p/38238dc07102</guid>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 27 Sep 2016 23:20:48 GMT</pubDate>
            <atom:updated>2016-09-27T23:20:48.815Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*t19iCRqPgjfO5V-sPpMD2A.jpeg" /></figure><p><em>Posted by </em><a href="https://blog.snap-ci.com/authors/badri-janakiraman/"><em>Badri Janakiraman</em></a></p><p><a href="https://en.wikipedia.org/wiki/Zero_one_infinity_rule">Zero, one, infinity</a> is a <a href="http://c2.com/cgi/wiki?ZeroOneInfinityRule">fairly well documented</a> design rule-of-thumb that nonetheless seems less well-known than some of its counterparts.</p><blockquote>“Allow none of foo, one of foo, or any number of foo” — Willem Louis van der Poel (paraphrased)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lu3gNan7eulQ4l17.png" /></figure><p>The rule suggests that when considering a design element, arbitrary numbers greater than 1 should be eschewed, if at all possible. That is, if more than one of something can exist, there should be no logical reason that there can’t be infinitely many of them. For example, consider a web application that is fronted by a load-balancer. The application may be designed to work only when running on a single server. Limitations such as storage of session state, local disk-based operations, etc., might prevent this application from running correctly on more than one machine. However, if those issues are resolved and the application is made truly stateless with all durable state extracted out of the application itself, then the application can be scaled by launching as many servers as needed. I.e., once the limit of having a single copy of the application server is removed, there can be an arbitrary number of servers running the application to which incoming requests can be directed.</p><p>Of course, the real world has real constraints. Machines have fixed word lengths, algorithms come with complexity metrics, network interfaces and data buses have bandwidth limits and these practical considerations will constrain how closely reality matches the design ideal. The rule doesn’t make these limits disappear in practice. What it does provide, though, is a way to detect when something is fishy. If a design is dependent on a key arbitrary number, it should make you pause and question what the origin of that number is — and perhaps even find the reason documented in something other than tribal memory.</p><p>For a couple of slightly less pedagogical examples, here are a couple of ways in which we have used this on Snap in the past and how they worked out.</p><h3>Build host count</h3><p>When we initially launched Snap, we had exactly one build host. All our workers ran on the single host. The worker names, IP addresses, and all other details were configured without ever taking into account the fact that the workers could live and process builds on multiple hosts. This worked well enough until we needed to scale to the second host. At that point, we could have chosen to have done just enough work to make sure that we had a second build host. However, we decided to bite the bullet and make it possible to have an arbitrary number of build hosts on the backend. This worked perfectly well for the first few hosts we brought up.</p><p>Fast forward a few months to a deployment that was launching new build hosts. During this deployment, as we were creating the workers, we had a few failures that manifested themselves that when the workers started processing builds. Turns out, the algorithm we had used to assign IP addresses to the workers was flawed. It would, in certain cases, assign invalid IP addresses — such as 10.0.100.415. The design only blew up when the last octet filled past the 255 mark which is the highest valid value to have.</p><p>So how could thinking about ‘zero, one, infinity’ have helped in this case? Turns out there were a couple of better options that would have prevented us from hitting the magic 255 number.</p><p>The first, if we wanted to keep static IP allocation, would be to just mod the last octet’s value by 255 to prevent overflow. Turns out that in our network that would have been a perfectly valid thing to have done. If we wanted to move away from static IP allocation, we could have set up a DHCP server that allocated the IP addresses. Now — to be fair, this too would have a limit. We might have run into issues when we allocated the complete range for the third and fourth octets, i.e. approximately 65,000 addresses. However, firstly, that limit is a lot larger than we are likely to encounter soon (famous last words). Secondly, this addresses the caveat I mentioned — which is that the real world has limits. It would be good to find solutions that don’t rely on arbitrary numbers as far as possible, but when practical considerations force your hand, it would be good to have the design constraints and limits documented.</p><h3>Caching</h3><p>The second example happened more recently when we were discussing the implementation of the durable cache that we are in the process of building in Snap. The question came up as to what parts of a Snap worker should be cached to speed up builds. The obvious responses we had were:</p><ul><li>Nothing — no caching. The workers would start from scratch every time. This would result in the most reliable builds since there would be no accumulated cruft between builds that lead to unreliable build results. However, this would also lead to the longest build times.</li><li>The entire worker — cache everything. This way, the entire machine state would be persisted and restored for each build. This was attractive because it gave the best impression of Snap behaving like the “build machine under your desk” or “the developer workstation” which rarely changed state. On the flip side, the build results would be highly unreliable and prevent the Snap team from ever upgrading packages or maintaining your build systems.</li><li>Cache the $HOME directory — cache just one well known directory. This provided the best midway point between the two prior options. A lot of systems such as Maven and SBT already use the $HOME directory and by picking that location, we met a lot of the expectations that people had about what state would be maintained across builds.</li></ul><p>In the above example, the three options correspond to the zero (no cache), infinity (everything cached) and one (just the $HOME) conditions respectively. As you can see, sometimes it turns out that picking “one and only one” is a perfectly valid option.</p><p>If you have had examples where you have deployed this thinking, do share it in the comments. We would love to hear from you.</p><p><em>This article was originally published on Snap CI’s </em><a href="https://blog.snap-ci.com/blog/2016/09/27/zero-one-infinity/"><em>The Pipeline blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38238dc07102" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-delivery/zero-one-infinity-38238dc07102">Zero, One, Infinity</a> was originally published in <a href="https://medium.com/continuous-delivery">Continuous Delivery</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>