<?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 Martino Fornasa on Medium]]></title>
        <description><![CDATA[Stories by Martino Fornasa on Medium]]></description>
        <link>https://medium.com/@mfornasa?source=rss-f9f8740b9987------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NX1Zh-5Sp7sPxhufrQ8A_g.jpeg</url>
            <title>Stories by Martino Fornasa on Medium</title>
            <link>https://medium.com/@mfornasa?source=rss-f9f8740b9987------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 04:19:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mfornasa/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[Node.js development with Skaffold file sync]]></title>
            <link>https://medium.com/hackernoon/node-js-development-with-skaffold-file-sync-99c687b906d5?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/99c687b906d5</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[skaffold]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Fri, 12 Oct 2018 11:40:19 GMT</pubDate>
            <atom:updated>2019-05-23T05:33:30.580Z</atom:updated>
            <content:encoded><![CDATA[<h3>Node.js development on Kubernetes with Skaffold file sync</h3><h4><a href="https://github.com/GoogleContainerTools/skaffold">Skaffold</a> team recently <a href="https://matt-rickard.com/fast-kubernetes-development/">announced</a> an exciting new feature that allows to sync files between your machine and the development container, making a big step forward in supporting interpreted languages like Node.js.</h4><p><a href="https://github.com/GoogleContainerTools/skaffold">Skaffold</a> is a command line tool to develop applications against a Kubernetes cluster (either a local Minikube or a remote cluster). Skaffold handles the build, push and deploy process of the image upon code change. Until today, Skaffold was (IMHO) not well-suited to interpreted languages like <a href="https://hackernoon.com/tagged/nodejs">Node.js</a>, due the inherent slowness of the process. With version 0.16.0, Skaffold <a href="https://matt-rickard.com/fast-kubernetes-development/">supports</a> an hybrid approach, allowing to take advantage of the usual auto-reload mechanisms used by Node.js developers (e.g.: nodemon):</p><ul><li>When a js file changes, Skaffold syncs it with the container and the app is restarted by nodemon</li><li>When a file change requires to rebuild the container (for example, a change to package.json), Skaffold does the full rebuild, push and deploy</li></ul><p>This hybrid approach is perfectly suited to a large class of technology stacks, like Node.js, React, Angular, Python, etc.</p><h3>Quick tutorial</h3><p>Code available in the <a href="https://github.com/GoogleContainerTools/skaffold/tree/master/integration/examples/nodejs">Skaffold </a><a href="https://github.com/GoogleContainerTools/skaffold/tree/master/integration/examples/nodejs">master branch</a>.</p><h4>Install Skaffold</h4><ul><li><a href="https://github.com/GoogleContainerTools/skaffold#installation">Installing Skaffold</a> requires a Kubernetes cluster. A good local choice is Minikube or a recent (edge) <a href="https://hackernoon.com/tagged/docker">Docker</a> for Mac or Docker for Windows.</li></ul><h4>Create a Node.JS app</h4><ul><li>Init npm:</li></ul><pre>npm init</pre><ul><li>Add the Express web framework to package.json:</li></ul><pre>npm install express nodemon --save</pre><ul><li>Remove node_modules locally:</li></ul><pre>rm -rf node_modules</pre><ul><li>Add the nodemon run command to the scripts section in package.json:</li></ul><pre>&quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;nodemon index.js&quot;<br>},</pre><ul><li>Create index.js:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a643aa96381f3d8c7a197537de35db3d/href">https://medium.com/media/a643aa96381f3d8c7a197537de35db3d/href</a></iframe><h4>Dockerize it</h4><ul><li>Create a Dockerfile:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef62a3e661e55d02c75559f9d85f1c95/href">https://medium.com/media/ef62a3e661e55d02c75559f9d85f1c95/href</a></iframe><ul><li>Create a Kubernetes pod definition k8s-pod.yaml:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4d803d25d0b232ade241e93c27f369c/href">https://medium.com/media/c4d803d25d0b232ade241e93c27f369c/href</a></iframe><p>If you use an editor that writes temporary files (like vim) you need a .dockerignore file to make sure that temporary files do not trigger a container build:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9265cda60701c0c4427551afcdf4e8f7/href">https://medium.com/media/9265cda60701c0c4427551afcdf4e8f7/href</a></iframe><h4>Skaffold configuration</h4><ul><li>Create a skaffold.yaml:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5c60fdf6badfd7b8a9731a01e6cf374/href">https://medium.com/media/d5c60fdf6badfd7b8a9731a01e6cf374/href</a></iframe><p>The deploy section points to the pod definition, while the build section points to current directory, where the Dockerfile is located. The sync clause disables the full rebuild/push/deploy for *.js file changes and enables the sync process of those files to the container.</p><h4>Running Skaffold</h4><ul><li>skaffold dev</li></ul><p>This command starts the Skaffold file watcher, builds the image and deploys it on the cluster; it also shows you the application logs and it handles port forwarding for you. When you see:</p><pre>...<br>[node] Example app listening on port 3000!</pre><p>You’re ready to access the application:</p><pre>$ curl localhost:3000<br>Hello World!</pre><h4>Development workflow</h4><p>Make some changes to index.js. You will see that the modified file is synced to the container and nodemon restarts the application:</p><pre>Syncing 1 files for gcr.io/k8s-skaffold/node-example:dirty-11d1880<br>Watching for changes every 1s...<br>[node] [nodemon] starting `node index.js`<br>[node] Example app listening on port 3000!</pre><pre>$ curl localhost:3000<br>Hello World - changed!</pre><p><strong>Fast and easy!</strong></p><p>If you change a file that requires rebuilding the container (like adding a dependency in package.json) the full build/push/deploy mechanism is triggered:</p><pre>Starting build...<br>Found [minikube] context, using local docker daemon.<br>Building [gcr.io/k8s-skaffold/node-example]...<br>Sending build context to Docker daemon  10.34MB<br>Step 1/5 : FROM node:8.12.0-alpine<br> ---&gt; df48b68da02a</pre><pre>...</pre><pre>Build complete in 8.236026621s</pre><pre>...</pre><pre>[node] Example app listening on port 3000!</pre><p>The time it takes depends on the complexity of your package.json.</p><h4>Future Improvements</h4><p>Even if changing package.json does not happen that often, rebuilding a complex app can be lengthy. A mechanism is needed to make use of npm cache to speed up the process.</p><h3>My talk</h3><p>If you want to lean more about local development with Kubernetes, you can watch my <a href="https://m.fornasa.it/talk/alldaydevops2018/">talk</a> at the All Day DevOps conference 2018.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99c687b906d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/node-js-development-with-skaffold-file-sync-99c687b906d5">Node.js development with Skaffold file sync</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker FastPath: Only Build Your Images Once]]></title>
            <link>https://medium.com/hackernoon/docker-fastpath-only-build-your-images-once-a4c3beeae7d3?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4c3beeae7d3</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Mon, 24 Apr 2017 15:58:05 GMT</pubDate>
            <atom:updated>2019-05-23T05:35:06.287Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Use your preferred Git workflow to achieve fast and error free environment promotion with Docker</h4><p><em>TL;DR Deploy </em><a href="https://github.com/mfornasa/docker-fastpath"><em>Docker FastPath</em></a><em> in your build system.</em></p><p>One of the most useful piece of information that I learned from the classic <a href="https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912/"><em>Continuous Delivery</em></a> by Humble and Farley (got get your copy now!) is to <strong>Only Build Your Binaries Once</strong>.</p><blockquote>Many build systems use the source code held in the version control system as the canonical source for many steps. The code will be compiled repeatedly in different contexts […]. Every time you compile the code, you run the risk of introducing some difference<br>[J. Humble, D. Farley, Continuous Delivery, p. 133]</blockquote><p>You can notice that the book has been written in 2011 by the use of the word “compiled”. Fast forward in 2017, and Javascript-based technologies reach a staggering 85% preference in the last <a href="https://stackoverflow.com/insights/survey/2017">StackOverlow Developer Survey</a> and dynamic languages are dominating <a href="https://hackernoon.com/tagged/web-development">web development</a>. Unsurprisingly that advice is still valuable today: you just need to change “compile” with your preferred build method (npm install, bundle install, webpack, etc.).</p><p>In a <a href="http://mcis.polymtl.ca/publications/2014/icsm14_noureddine.pdf">study</a> researchers found out that:</p><blockquote>[…] typical circumstances under which a build breaks are missing referenced files, mistakenly checking in work-in-progress, and transitive dependencies.</blockquote><p>Also, building again and again the same codebase is time expensive and it makes harder for developers to get timely feedback.</p><p>So, nowadays it’s even more necessary to “Only Build Your Binaries Once”. In a <a href="https://hackernoon.com/tagged/docker">Docker</a> development pipeline this translates into:</p><blockquote><strong>Only Build Your Images Once</strong></blockquote><h3>Your typical Git + Docker Continuous Integration pipeline</h3><p>The typical continuous integration process using Docker is:</p><ul><li>A code push to the git repository triggers the build process(Jenkins, TravisCI, GitLab, etc.)</li><li>A Docker image is built, (tagged) and pushed to a Docker Registry</li><li>The image is automatically tested</li><li>The image is deployed on your favourite Docker orchestrator (Kubernetes, ECS, Swarm, etc.) in a testing environment</li><li>The process is repeated for the following environments in the pipeline (staging, production, etc.)</li></ul><p>Usually, you have more than one server environment. Environment labelling varies a lot; popular choices being development, qa, staging. When the goals for a given environment are fulfilled, there’s the need to promote the change to a higher environment.</p><p>The goal here is to push our artifact (the Docker image) from one environment to he next one. One possibility is to decouple this process from the code repository: the image promotion happens on an external system. This approach is not easy to integrate with common git workflows (G<a href="http://nvie.com/posts/a-successful-git-branching-model/">itflow</a>,<a href="https://help.github.com/articles/about-pull-requests/">GitHub Pull Requests</a>, <a href="https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.html">GitLab Merge Requests</a>, <a href="http://endoflineblog.com/gitflow-considered-harmful">something else</a>), where the control stays in the hand of the developers. But, as Humble and Farley taught us, promoting at the code level is <strong>bad</strong> (and I agree).</p><h3>Introducing Docker FastPath</h3><p>I advocate here to keep control in the hand of developers by letting them use their preferred Git workflow and enjoy the power of <strong>only building their images once</strong>. The method is independent of the particular Git workflow in use and it is based on two simple rules:</p><ol><li>Tag the image with the Git commit ID from which the image has been built.</li><li>Do not rebuild on code push if the codebase is identical to an existing image: deploy that image instead.</li></ol><p>To apply rule number 2 it is necessary to examine the Git history and cross check the result with the Docker registry tag list for the image. Note that in most cases you can have two identical codebases with different Git commit IDs: so comparing Git IDs is not enough, you need to diff the two codebases. <a href="https://github.com/mfornasa/docker-fastpath">Docker FastPath</a> does that.</p><p>Let’s see some examples.</p><h4>Example #1: Merging a feature-branch</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*FhxmYbIpSS2L1M65WNjlOg.png" /></figure><p>This is the default behaviour for GitHub Pull Requests. All commits from the feature branch are added to the base branch master using a merge commit (using the --no-ff option). In this case, commit 1044aee is identical to commit e51acc3 and it does not need to be rebuilt. Image tagged 1044aee can be deployed directly.</p><h4>Example #2: Squash and merge</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*6L1RVo2oDCDH4dXQ6lCaOQ.png" /></figure><p>This is the behaviour for GitHub Pull Request when you select “Squash and merge”. All feature branch commits are squashed into a single commit and added to the base branch using Git fast forward. In this case, commit af49f3d is identical to commit e51acc3 and it does not need to be rebuilt. Image tagged e51acc3 can be deployed directly.</p><h4>Example #3: Rebase and merge</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*Mef4_kbdbfeJO3V2oWmabQ.png" /></figure><p>This is the behaviour for GitHub Pull Request when you select “Rebase and merge”: all commits from the feature branch are added to the base branch, without a merge commit. In this case, commit 1eb55b3 is identical to commit e51acc3 and it does not need to be rebuilt. Image tagged e51acc3 can be deployed directly.</p><h3>Try it</h3><p><a href="https://github.com/mfornasa/docker-fastpath">Docker FastPath</a> code is available on GitHub as a command line tool. You can download an executable for MacOS or Linux which can be easily deployed on most build systems, but you can build it from source code if you wish.</p><p>Two deployment examples are provided: one using <a href="https://github.com/mfornasa/docker-fastpath-jenkins">Jenkins</a>, and another one using <a href="https://github.com/mfornasa/docker-fastpath-travis">Travis CI</a>. It should be easy to use those examples to adapt FastPath to your existing software project based on Docker.</p><blockquote>If you enjoyed this piece click the “♥︎” button below. For more pieces on DevOps and Docker, join my <a href="http://eepurl.com/clAQDb">mailing list</a>.</blockquote><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4c3beeae7d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/docker-fastpath-only-build-your-images-once-a4c3beeae7d3">Docker FastPath: Only Build Your Images Once</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Yarn with Docker]]></title>
            <link>https://medium.com/hackernoon/using-yarn-with-docker-c116ad289d56?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/c116ad289d56</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[yarn]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 16:51:21 GMT</pubDate>
            <atom:updated>2019-05-23T05:34:11.911Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p><a href="https://hackernoon.com/tagged/facebook">Facebook</a> recently <a href="https://code.facebook.com/posts/1840075619545360">released</a> <a href="https://yarnpkg.com/">Yarn</a>, a new <a href="https://hackernoon.com/tagged/nodejs">Node.js</a> package manager built on top of the npm registry, massively reducing install times and shipping a deterministic build out of the box.</p><p>Determinism has always been a problem with npm, and solutions like npm shrinkwrap are not <a href="http://jonnyreeves.co.uk/2016/npm-shrinkwrap-sucks/">working</a> <a href="https://github.com/npm/npm/issues/11736">well</a>. This makes hard to use a npm-based system for multiple developers and on continuous integration. Also, npm slowness in case of complex package.json files causes long build times, representing a serious blocker when using Docker for local development.</p><p>This article discuss how to use Yarn with Docker for Node.js development and deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*dlutGqw-8yKyVFtWmtXVMg.png" /><figcaption><a href="https://xkcd.com/1742/">xkcd</a> take on installing code</figcaption></figure><h3>TL;DR</h3><ul><li>Clone the boilerplate:</li></ul><pre>git clone <a href="https://github.com/mfornasa/DockerYarn.git">https://github.com/mfornasa/DockerYarn.git</a></pre><ul><li>Enter the directory:</li></ul><pre>cd DockerYarn</pre><ul><li>Build the container:</li></ul><pre>./build.sh</pre><ul><li>Run it:</li></ul><pre>docker run yarn-demo node -e &quot;console.log(&#39;Hello, World&#39;)&quot;</pre><p>The first time your build the container, Yarn fetches npm dependencies for you. After that, Yarn is executed only when you modify your package.json, and it uses cache from previous executions. On top of it, you have <strong>determinism</strong>: the same dependency tree is installed every time and on every machine. And<strong> it’s blazing fast</strong>!</p><h3>Let’s get started</h3><p>The procedure works on Mac and Linux. We are going to the <a href="https://hub.docker.com/r/risingstack/alpine/tags/">Risingstack</a> Node.js Docker image for Node 6. Please <a href="https://yarnpkg.com/en/docs/install">install Yarn</a> on your machine before proceeding.</p><ul><li>Download Yarn installation package in a local folder:</li></ul><pre>wget <a href="https://yarnpkg.com/latest.tar.gz">https://yarnpkg.com/latest.tar.gz</a></pre><ul><li>Create a new Dockerfile:</li></ul><pre>FROM risingstack/alpine:3.4-v6.7.0-4.0.0</pre><pre>WORKDIR /opt/app</pre><pre># Install yarn from the local .tgz<br>RUN mkdir -p /opt<br>ADD latest.tar.gz /opt/<br>RUN mv /opt/dist /opt/yarn<br>ENV PATH &quot;$PATH:/opt/yarn/bin&quot;</pre><pre># Install packages using Yarn<br>ADD package.json /tmp/package.json<br>RUN cd /tmp &amp;&amp; yarn<br>RUN mkdir -p /opt/app &amp;&amp; cd /opt/app &amp;&amp; ln -s /tmp/node_modules</pre><p>This is based on a <a href="http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/">well-known</a> trick to make use of Docker layer caching to avoid to reinstall all your modules each time you build the container. In this way, Yarn is executed <strong>only when you change </strong><strong>package.json</strong> (and the first time, of course).</p><ul><li>Init package.json</li></ul><pre>yarn init</pre><ul><li>Add your first package:</li></ul><pre>yarn add react</pre><ul><li>Build and run your new container:</li></ul><pre>docker build . -t yarn-demo<br>docker run yarn-demo node -e &quot;console.log(&#39;Hello, World&#39;)&quot;</pre><p>Congratulations! You’re using yarn with Docker.</p><h3>Wait! What about &quot;yarn.lock”?</h3><p>Yarn stores the exact version of each package and sub-package in order to be able to reproduce exactly the same dependency tree on each run. Both package.json and yarn.lock must be checked into source control. As we run Yarn inside the container, we need to retrieve yarn.lock. Luckily, it’s not hard to extract yarn.lock after each run. Simply change the ADD line in the Dockerfile with the following:</p><pre>ADD package.json yarn.lock /tmp/</pre><p>and build the container using the following command:</p><pre>docker build . -t yarn-demo; docker run --rm --entrypoint cat yarn-demo:latest /tmp/yarn.lock &gt; yarn.lock</pre><p>After the build, yarn.lock is copied to your working directory, and it will be reused on next Docker run, installing the same dependencies each time.</p><p>Congratulations! Now you have <strong>deterministic</strong> Yarn execution.</p><h3>Wait! Now Yarn is executed at each container build</h3><p>That is correct, we are now running Yarn at each build, even if package.json has not been modified. This is because yarn.lock is copied from the container to your working directory each time, even if it’s not changed, thus invalidating Docker layer caching. To solve this, we need to copy yarn.lockonly if it’s really changed. To do so:</p><ul><li>Create a build.sh file:</li></ul><pre>#!/bin/bash</pre><pre>docker build . -t yarn-demo</pre><pre>docker run --rm --entrypoint cat yarn-demo:latest /tmp/yarn.lock &gt; /tmp/yarn.lock<br>if ! diff -q yarn.lock /tmp/yarn.lock &gt; /dev/null  2&gt;&amp;1; then<br>  echo &quot;We have a new yarn.lock&quot;<br>  cp /tmp/yarn.lock yarn.lock<br>fi</pre><ul><li>Make it executable:</li></ul><pre>chmod +x build.sh</pre><ul><li>Use it to build the container:</li></ul><pre>./build.sh</pre><ul><li>Then run the container:</li></ul><pre>docker run yarn-demo node -e &quot;console.log(&#39;Hello, World&#39;)&quot;</pre><p>Congratulations! You have now a <strong>deterministic </strong>Yarn execution, and Yarn is executed <strong>only when you change </strong><strong>package.json</strong>.</p><h3>What about Yarn package cache?</h3><p>Another powerful feature of Yarn is package cache, which is stored on the local filesystem, to avoid downloading packages again. Our procedure so far does not maintain cache over container builds. This could be an issue for big package.json files.</p><p>The following build.sh solves the issue by saving Yarn cache on your working directory.</p><pre>#!/bin/bash</pre><pre># Init empty cache file<br>if [ ! -f .yarn-cache.tgz ]; then<br>  echo &quot;Init empty .yarn-cache.tgz&quot;<br>  tar cvzf .yarn-cache.tgz --files-from /dev/null<br>fi</pre><pre>docker build . -t yarn-demo</pre><pre>docker run --rm --entrypoint cat yarn-demo:latest /tmp/yarn.lock &gt; /tmp/yarn.lock<br>if ! diff -q yarn.lock /tmp/yarn.lock &gt; /dev/null  2&gt;&amp;1; then<br>  echo &quot;Saving Yarn cache&quot;<br>  docker run --rm --entrypoint tar yarn-demo:latest czf - /root/.yarn-cache/ &gt; .yarn-cache.tgz<br>  echo &quot;Saving yarn.lock&quot;<br>  cp /tmp/yarn.lock yarn.lock<br>fi</pre><p>You also need to add this to your Dockerfile , after the ADD package.json... line:</p><pre># Copy cache contents (if any) from local machine<br>ADD .yarn-cache.tgz /</pre><p>The cache file is not meant to be pushed to the repo, so it should be added to a.gitignore file.</p><p>Congratulations, again! You have now a <strong>deterministic</strong> Yarn execution, which is executed<strong> only when you change </strong><strong>package.json</strong>, and it uses <strong>Yarn caching</strong>. Try this with a complex package.json file from a real project, you will be amazed!</p><blockquote><em>If you enjoyed this piece click the “</em><strong><em>♥︎</em></strong><em>” button below. </em>For more pieces on DevOps and Docker, join my <a href="http://eepurl.com/clAQDb">mailing list</a>.</blockquote><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><a href="https://goo.gl/Ahtev1"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></a></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c116ad289d56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/using-yarn-with-docker-c116ad289d56">Using Yarn with Docker</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote working: Is your Internet connection good enough?]]></title>
            <link>https://medium.com/clevertechbiz/remote-working-is-your-internet-connection-good-enough-7e5c8d4f59b2?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e5c8d4f59b2</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[remote-working]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Thu, 09 Jun 2016 12:42:46 GMT</pubDate>
            <atom:updated>2016-06-09T12:42:46.465Z</atom:updated>
            <content:encoded><![CDATA[<h4>Speed matters, up to a point</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCH51NgTUuvXyiIldUtIPg.png" /><figcaption><a href="http://www.opte.org/maps/">The Internet</a></figcaption></figure><p>A rock-solid internet connection is the essential prerequisite for effective remote working. But what constitutes a <strong>good</strong> connection? As you can imagine, speed is important, but that’s not the whole picture. Several factors contribute to your remote working experience, not all of them are captured by speed as measured using online tools.</p><h4>Speed</h4><p>The faster, the better, as people reached by <a href="https://fiber.google.com/">Google fiber</a> can attest. The rest of us need some minimum requirements to rate our connection. Your mileage may vary, but in short, as a remote worker you need a fast connection to:</p><ol><li>Download or upload bulky content (design files, video files, audio files, etc.)</li></ol><p>2. Video calls</p><p>Number 1 is easy to evaluate: if uploading and downloading stuff takes too long, you need an upgrade! Number 2 is trickier, as video call applications make a good job in <em>adapting </em>to the connection quality, but they do that at the expense of video and audio quality, for example by lowering resolution and frame-rate. Low audio and video quality has severe effects on communication quality. In particular, <a href="https://www.researchgate.net/publication/3412684_Review_of_Low_Frame_Rate_Effects_on_Human_Performance">several</a> <a href="http://ieeexplore.ieee.org/xpl/login.jsp?tp=&amp;arnumber=4342787&amp;url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D4342787">studies</a> pointed out that low frame-rate video causes the loss of important visual cues, thus hindering an effective face-to-face communication.</p><p>So, what are the requirements for crystal-clear audio and video-conferencing? Let’s take Skype. Skype <a href="https://support.skype.com/en/faq/FA1417/how-much-bandwidth-does-skype-need">requirements</a> for HD video calling are 1.5 Mbps download speed and 1.5 Mbps upload speed while large group video calls require up to 8 Mbps download speed. In summary:</p><blockquote>The minimum requirements for effective video calls is 8 Mbps download / 1.5 Mbps upload.</blockquote><h4>Measuring your speed</h4><p>There are several test services out there: you can try <a href="http://www.speedtest.net/">speedtest.net</a>, <a href="http://speedof.me/">SpeedOf.me</a> and <a href="http://www.bandwidthplace.com/">Bandwidth Place</a>. You should also repeat the test on different times of the day, as Internet infrastructure experiences peak hours. The results are two numbers: a Download and an Upload speed, expressed in Mbps (Megabit per second).</p><p>The path from your home to a destination on the Internet is composed by several links. Usually, the weakest link it’s the <a href="https://en.wikipedia.org/wiki/Last_mile">last mile</a> (the line that reaches your home). So, if your connection speed is too low, you may need to upgrade it. If you can’t upgrade your line, try another technology, for example a 4G/LTE mobile connection.</p><p>In summary, if download is better than 8 Mbps and upload is better than 1.5 Mbps, congratulations, you’re all set to work remotely… or not?</p><h4>Packet loss</h4><p>Connections speed is only a part the of the whole picture. <strong>Connection stability</strong> can be even more important. Internet data is carried around in small chunks called <a href="https://en.wikipedia.org/wiki/Packet_switching">packets</a> and your connection could be experiencing <a href="https://en.wikipedia.org/wiki/Packet_loss">packet loss</a>. Packet loss makes your browsing slow, and it causes a decrease in audio/video quality. Checking your connection for packet loss is easy.</p><p>If you’re on a <strong>Mac</strong>, open your Applications folder, then open the Utilities folder, and finally open the Terminal application. On the Terminal, type the following command and hit Enter:</p><pre>ping -c 50  8.8.8.8</pre><p>After one minute, you should see something like:</p><pre>50 packets transmitted, 50 packets received, <strong>0.0% packet loss</strong><br>round-trip min/avg/max/stddev = 58.761/59.494/60.527/0.413 ms</pre><p>Here we can see a 0% packet loss. Brilliant!</p><p>If you’re on <strong>Windows, </strong>open the terminal by selecting the Search box in the Start menu, typing “<em>cmd</em>” and pressing Enter. In the Terminal, type the following command and hit Enter.</p><pre>ping -n 50 8.8.8.8</pre><p>After one minute, you should see something like:</p><pre>Ping statistics for 8.8.8.8:<br>    Packets: Sent = 50, Received = 50, Lost = 1 (<strong>2% loss</strong>).  </pre><p>In this case, packet loss is 2%.</p><p>A good packet loss rate is <strong>zero per cent. </strong>That’s correct: networks are very reliable nowadays, and decent Internet connections should not loose packets.</p><h4>Go wired!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYYY8zWVlEuOTs6DTL5yFQ.jpeg" /><figcaption>Your Internet connection is no stronger than its weakest link</figcaption></figure><p>If you experience packet loss, the first move is to connect your computer directly to your Internet router using an Ethernet cable. WiFi is handy, but it can be unreliable due to interference or bad reception. Try to connect your compute directly to the route and run again the packet loss test, you will be surprised! Restarting the Internet router could help too.</p><p>If direct connection does not solve the packet loss, you may need to contact your Internet Service Provider. Good luck!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*3G_97gZ1U8X0R8LqtdzDZA.png" /><figcaption><a href="https://xkcd.com/806/">https://xkcd.com/806/</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e5c8d4f59b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clevertechbiz/remote-working-is-your-internet-connection-good-enough-7e5c8d4f59b2">Remote working: Is your Internet connection good enough?</a> was originally published in <a href="https://medium.com/clevertechbiz">clevertechbiz</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effective Software Delivery using Docker Containers]]></title>
            <link>https://medium.com/clevertechbiz/effective-software-delivery-using-docker-containers-ff6cad347e90?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff6cad347e90</guid>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Wed, 01 Jun 2016 09:51:01 GMT</pubDate>
            <atom:updated>2016-06-07T20:27:05.914Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3yX0HRaHkAWI9Zd4qYAlA.jpeg" /></figure><p>At <a href="https://clevertech.biz/">Clevertech</a>, we built an integrated technology stack based on <a href="https://www.docker.com/">Docker</a> containers that provides local application development, building, testing, and deploy in the cloud. Containers offer big advantages in software development, quality assurance and software deployment: namely consistency, reliability and scalability. In particular, scalability is implemented from the beginning, and the system is ready to grow as the application get traction.</p><h3>What are containers?</h3><p><a href="https://www.docker.com/">Docker Containers</a> are an evolution of the virtual machines, which are the base of the cloud environments like Amazon AWS, providing similar benefits in a lightweight and efficient way. While virtual machines take up to several minutes to start, containers can start in a couple of seconds.</p><p>A container wraps up a software application in a small complete filesystem that contains all the components that the application needs to run: tool, libraries, configuration files: all the pieces that you usually install on a server. In this way, a container guarantees that the application will run in the same way when you move it from the developer machine, to a testing server, to the live site.</p><h3>What we accomplish with containers</h3><h4>Fast Developer Onboarding</h4><p>We remove the time waste for a developer to setup the application environment. The application runs entirely inside a container, so developers do not need to install anything on their system and they can start to code in 15 minutes. All application dependencies (software version, library version, tool stack) are provided by the container.</p><blockquote>Anyone in my team can delete their entire project setup and reinstall everything again in 15 minutes” — Aurelien Bottazini — Sr. Full Stack Developer</blockquote><p>We maintain our container images as minimal as possible in order to minimize download times during local development and during remote deploy. Our application containers are based on <a href="http://gliderlabs.viewdocs.io/docker-alpine/">Alpine Linux Docker Image</a>, a fully-fledged Linux environment which is only 130 MB, while providing a complete package repository.</p><h4>Remove Environment Inconsistencies and Fast deployment</h4><p>The application is going to work as designed locally on every environment (development server, QA server, live site). No more “it works on my machine” issues, or faults in moving from development to production environment.</p><blockquote>With Docker there is no more: <em>it happens only on my computer</em>. Everyone has the same environment” — Aurelien Bottazini — Sr. Full Stack Developer</blockquote><blockquote>It does bring to me some piece of mind that I can more closely mimic the prod env on my own machine before pushing anything” — James Nadeau — Sr. Developer</blockquote><p>The build process happens only once, when a new version is deployed to the development environment. A deploy to production is performed simply by moving the same container image to the live site, removing the main source of environment inconsistency. And it’s blazing fast! We deploy a new version to production in 30 seconds.</p><blockquote>With Docker any improvement to the work environment is shared with everyone.” — Aurelien Bottazini — Sr. Full Stack Developer</blockquote><h4>Scalability from day one</h4><p>A Docker application is scalable by design from day one, and scalability is simple as bringing up a new container (20 seconds). In this way, the application can grow without additional effort.</p><p>We selected <a href="https://aws.amazon.com/ecs/">Amazon EC2 Container Service</a> (ECS) to host our application in the cloud. ECS provides a container management service and a private Docker registry, fully integrated in the Amazon EC2 infrastructure. ECS allows to configure clusters of EC2 machines, and provides easy scalability: at deploy you can configure how many instances of your application you want to run on the cluster.</p><h4>Quickly recover from mishaps</h4><p>If an issues reaches the production site, the container system allows to roll-back to a previous working version by simply pressing a button. The process is about rolling back to a well-known existing container, it does not involve rebuilding or testing again the application: this leads to a very quick process (30 seconds).</p><p>I like the flexibility of control it brings to production scaling and the build step/process, and the immediate rollback abilities — James Nadeau — Sr. Developer</p><h4>Centralized logging</h4><p>Log messages from all the application modules are collected in a single point, which allows for an effective debugging of application issues. We use the <a href="http://www.fluentd.org/">fluentd</a> Docker driver to collect logs and <a href="https://www.elastic.co/products/kibana">Kibana</a> to perform log visualization and analysis. Each developer is always able to consult the logs in real time and to perform historical analysis.</p><h4>Testing</h4><p>Application testing is integrated in the container workflow, and happens inside the container, making the tests efficient and reliable. When a test fails, the container is not deployed on the server, thus avoiding to deploy faulty software.</p><blockquote>I now know, that what is working on my Linux machine in front of me, is going to work on someone’s Mac on the other side of the world, because Docker is going to build it the same way” — James Nadeau — Sr. Developer</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff6cad347e90" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clevertechbiz/effective-software-delivery-using-docker-containers-ff6cad347e90">Effective Software Delivery using Docker Containers</a> was originally published in <a href="https://medium.com/clevertechbiz">clevertechbiz</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Faster Node.js builds with Travis CI]]></title>
            <link>https://medium.com/clevertechbiz/faster-node-js-builds-with-travis-ci-41aa275015e7?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/41aa275015e7</guid>
            <category><![CDATA[travis-ci]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Mon, 29 Dec 2014 15:19:21 GMT</pubDate>
            <atom:updated>2016-08-03T13:05:53.675Z</atom:updated>
            <content:encoded><![CDATA[<h4>Speed up the building process of your Node.js project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NipQdKouuTvqYhZwpvUwLA.jpeg" /></figure><p>There are a lot of <a href="http://docs.travis-ci.com/user/languages/javascript-with-nodejs/">tutorials</a> about using Travis CI to build a Node.js project. However, when I started using Travis for our projects, what I really wanted to read about was <strong>performance issues</strong>, that is, how to achieve a <strong>fast</strong> <strong>build</strong>.</p><p>This post details the best practices you can use to speed up the building process. In particular, you are able to move faster by using new Travis’ container-based infrastructure and by caching the npm dependencies. It is possible to cut your build time by more than half, using these techniques.</p><h4>The basics: Project boilerplate + Github repo</h4><p>We start by creating a <strong>boilerplate Node.js project</strong>, and by creating a Github repository for it. In this tutorial we will be using <a href="http://eskimo.io/">Eskimo</a>, a Node.js boilerplate. However, this approach is valid for every Node.js application so, feel free to skip this part if you already have a Node.js project on a Github repository.</p><p>The following will create an application boilerplate inside directory “test”.</p><pre>sudo npm install -g eskimo<br>sudo npm install -g gulp<br>eskimo create test<br>cd test<br>npm install<br>gulp postinstall</pre><p>You can test the application by running “node app” and visiting “http://localhost:3000&quot;.</p><p>Now we can create a <strong>Github</strong> repository using GitHub web interface and commit our project to the repository.</p><pre>git init<br>git add .<br>git commit -m &quot;first commit&quot;<br>git remote add origin $YOUR_REPO_URL_HERE$<br>git push -u origin master</pre><h4>Your First Build</h4><p>Travis CI, like several other <strong>continuous integration</strong> <strong>tools</strong>, is free for Open Source projects and it provides several <a href="https://travis-ci.com/plans">plans</a> for Private repos, on free trial for a limited period of time.</p><p>First, you need to sign in on Travis and activate the GitHub webook, as explained <a href="http://docs.travis-ci.com/user/getting-started/#Step-one%3A-Sign-in">here</a>. This will enable you to trigger a build each time you push on your repository or you create a Pull Request.</p><p>Second, create a “.travis.yml” file inside your project root directory with the following contents:</p><pre>language: node_js<br>node_js:<br>  - &quot;0.10&quot;<br>services:<br>  - redis-server<br>  - mongodb</pre><p>This will make the build against a recent stable Node release. By default, <strong>Travis CI</strong> will run “npm install” to install dependencies and “npm test” to run the test suite. Our boilerplate already adhere to such conventions, so we are done. We also ask Travis to startup Redis and Mongo services, as we need them for testing.</p><p>Finally, add your “.travis.yml” and push to the repo:</p><pre>git add .travis.yml<br>git commit -m &quot;Travis build&quot;<br>git push</pre><p>This will start the Travis <strong>continuous integration build</strong>. On the web interface you can see the real time log and the status, which will go from <em>started</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*7vzOZ1Nw1oXWnUYf.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*8skvHMs2KEt9aO1Q.PNG" /></figure><p>I measured a build process bootstrap time of 28 seconds, plus an actual running time of 2 minutes 12 seconds. <strong>Total: 2 minutes 40 seconds</strong>. Not bad, but we can do better.</p><h4>Speed up (1): Using the new build infrastructure</h4><p>Travis recently switched to a faster <a href="http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/">build system</a> based on <strong>Docker containers</strong> and <strong>container based infrastructure</strong>. The main limitation in the new approach is that you can’t use “sudo”. This is not an issue if you don’t need to install OS additional packages. So, we add the following line to our “.travis.yml”:</p><p>Triggering a new build (add, commit, push), we obtain a 6 seconds bootstrap time, plus 1 min 56 sec run. <strong>Total: 2 minutes 2 seconds</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pGNfK2t5Zz7bKz5P.PNG" /></figure><h4>Speed up (2): Caching dependencies</h4><p>Build logs show that a large amount of the running time is taken by dependency install. We can use the Travis <a href="http://docs.travis-ci.com/user/caching/">caching</a> to avoid such a lengthy phase.</p><p>So, we simply add the following lines to “.travis.yml”, asking <strong>Travis CI</strong> to cache the npm “node_modules” directory:</p><pre>cache:<br>  directories:<br>    - node_modules</pre><p>We obviously need two build runs to see the performance improvement, as only the second one will start to benefit from npm caching. (Please note that you can repeat the same build by using the restart button on the top-right of the interface).</p><p>This allow us to obtain a total time of <strong>1 minute 5 seconds</strong>. That’s good!</p><h4>Freezing your dependencies</h4><p>During the project development phase, it could be ok to let npm fetch the latest versions of node libraries. However, maintaining this approach when the project is at production stage can be a problem, as a changing library could introduce bugs and unexpected behaviour. This also breaks build reproducibility: we can obtain a different byproduct without changing the source code.</p><p>For this reason, on later stages of development it could be useful to use “<a href="https://docs.npmjs.com/cli/shrinkwrap">npm shrinkwrap</a>”, which allows freezing the node dependency exact versions. Don’t forget to add the generated “npm-shrinkwrap.json” to git. To be on the safe side, I also suggest to perform a clean build by deleting cache (on the web interface, Settings -&gt; Delete all repository caches), in order to make sure that we get rid of all the npm artifacts.</p><p><em>Originally published at </em><a href="http://blog.clevertech.biz/post/faster-node-js-builds-with-travis-ci"><em>blog.clevertech.biz</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41aa275015e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clevertechbiz/faster-node-js-builds-with-travis-ci-41aa275015e7">Faster Node.js builds with Travis CI</a> was originally published in <a href="https://medium.com/clevertechbiz">clevertechbiz</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling DevOps in MVP Development]]></title>
            <link>https://medium.com/@mfornasa/handling-devops-in-mvp-development-a43b38c5b60c?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/a43b38c5b60c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mvp]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Thu, 04 Dec 2014 13:12:22 GMT</pubDate>
            <atom:updated>2016-06-01T16:29:56.333Z</atom:updated>
            <content:encoded><![CDATA[<h4>Lean methodologies allow us to develop reliable software, and to do so more quickly. This must be coupled with a software delivery process that runs smoothly and keeps the pace with software development.</h4><p><strong>DevOps</strong> (Development + Operations) is an interdisciplinary approach that encompasses software development and IT infrastructure operations. DevOps advocates for an holistic approach: lean methodologies are implemented in every aspect of company activity, from software development, to cloud service operations, to maintenance and support.</p><p>The common goal is <strong>automation</strong>. By automating processes it is possible to reduce the time spent on handling basic operations, like manually deploying the latest version of the application on the development server, preparing a cloud server for live release, or monitoring the application’s health. This allows team members to focus solely on development and testing.</p><p>A core concept in the DevOps approach is to promote better collaboration between everyone involved in software building and delivery, in order to release valuable software faster and more reliably. The main aim of <strong>Lean</strong> <strong>DevOps</strong> is supporting the rapid release and feedback cycle (Agile) by putting in place a fast and predictable deployment process.</p><h4>There is no ‘one size fits all’ solution</h4><p>You may think that DevOps practices are overkill when developing a 30–90 day Minimum Viable Product. But development speed does not mean development chaos, and a rapid application development process is the best candidate for the right choice of Lean DevOps solutions and tools. The aim is:</p><ul><li>To allow developers to be effective from day one, without having to deal with a lengthy and error-prone deployment process.</li><li>To allow developers to test their code easily on an exact replica of the production environment.</li><li>To push developers to maintain a releasable product, i.e., a product that fulfils in every moment the automated test suite.</li></ul><h4><strong>Do not scale prematurely, but be prepared to scale</strong></h4><p><em>Premature scaling is bad</em>. This is true for startups, and it’s even more true for a startup’s software delivery infrastructure. Building complex scaling procedures in your application is a time consuming activity, and you don’t really know how users are going to react to your application.</p><p>However, <em>be prepared to scale</em>. You need to achieve the right balance between rapid application development and robustness for future scaling. You can achieve that by writing code that can be run on multiple cloud servers, and by using cloud providers that grant top-notch support for scalability, like <a href="http://aws.amazon.com/">Amazon Web Services</a>.</p><h4>Pick the right tool for the job</h4><p>DevOps success heavily depends on selecting the right tools. For this reason, Clevertech built a <strong>dedicated DevOps team</strong>, which advises developers on the software building and deployment process and provide them with the right <strong>DevOps tools</strong> for the job. All of DevOps’ automation tools are put in place within the <strong>project’s first week</strong> in order to have them continuously refined during the development process. This approach guarantees the project will go live with the full spectrum of automation, customized monitoring and alerting already operational.</p><p>At Clevertech we use <a href="https://travis-ci.com/">Travis CI</a>. Travis CI allows automating the process of software development and deployment. With Travis CI we can accomplish:</p><ul><li><strong>Continuous Integration</strong>, meaning that each developer working on the project can keep its contributions continually integrated with the rest of the team. Travis CI help us by running the complete test suite every time a developer make a code contribution, thus assuring quality from early development stages.</li><li><strong>Continuous Delivery</strong>, meaning that each contribution is immediately made available to the stakeholder for review, thus tremendously easing the build-measure-learn feedback cycle which is at the basis of Lean methodologies. When the application reaches the live stage, the continuous delivery best practices help us to push new features and fixes to the users in a matter of minutes.</li></ul><p>This approach allows us to avoid deploying broken software on the server. If there is a problem, an automatic rollback to the latest working version is performed. This gets extremely useful when the project goes live, allowing to maintain a fast application development cycle without tampering with the application’s reliability.</p><p><em>Originally published at </em><a href="http://blog.clevertech.biz/post/handling-devops-in-mvp-development"><em>blog.clevertech.biz</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a43b38c5b60c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bounded latency spanning tree reconfiguration]]></title>
            <link>https://medium.com/@mfornasa/bounded-latency-spanning-tree-reconfiguration-a8957efd9dec?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8957efd9dec</guid>
            <category><![CDATA[rstp]]></category>
            <category><![CDATA[spanning-tree]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Tue, 25 Nov 2014 10:00:00 GMT</pubDate>
            <atom:updated>2016-06-01T16:55:53.256Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*BESL9hVTlecn5WC3UZnKlw.png" /></figure><p>One of the main obstacles to the adoption of Ethernet technology in carrier-grade metropolitan and wide-area networks is the large recovery latency, in case of failure, due to spanning tree reconfiguration. In this paper we present a technique called Bounded Latency Spanning Tree Reconfiguration (BLSTR), which guarantees worst case recovery latency in the case of single faults by adopting a time-bounded bridge port reconfiguration mechanism and by eliminating the bandwidth-consuming station discovery phase that follows reconfiguration. BLSTR does not replace the Rapid and Multiple Spanning Tree reconfiguration protocols, which remain in control of network reconfiguration, whereas it operates in parallel with them.</p><blockquote>Martino Fornasa, Michele Stecca, Massimo Maresca, Pierpaolo Baglietto, “Bounded latency spanning tree reconfiguration”, <em>Computer Networks</em>, Volume 76, 15 January 2015, Pages 259–274.</blockquote><p>Get the full paper at: <a href="http://www.sciencedirect.com/science/article/pii/S1389128614003934">http://www.sciencedirect.com/science/article/pii/S1389128614003934</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8957efd9dec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Computing Goes To Sea: Ship Design Around Software Defined Networking (SDN) Systems]]></title>
            <link>https://medium.com/@mfornasa/cloud-computing-goes-to-sea-ship-design-around-software-defined-networking-sdn-systems-7578b1a7b1f8?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/7578b1a7b1f8</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Thu, 25 Sep 2014 10:00:00 GMT</pubDate>
            <atom:updated>2016-06-01T17:32:01.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Cloud computing has taken over many areas of computing/communication systems, in particular in companies with large distributed computer systems and databases. Cloud computing is based on both dynamic computer system virtualization and dynamic network virtualization. In this article we focus on dynamic network virtualization and more specifically on Software Defined Network technology, which basically involves a shift from increasingly “smart” routers/switches to much simpler routers/switches only providing data plane functionalities, whereas the network control plane functionalities are provided by software platforms hosted in computer systems possibly distant from the actual networks.</p><blockquote>Philip A. McGillivary, Martino Fornasa, Pierpaolo Baglietto, Michele Stecca, Giovanni Caprino and Massimo Maresca, “Cloud Computing Goes To Sea: Ship Design Around Software Defined Networking (SDN) Systems”, <em>Ocean News &amp; Technology</em>, <em>September 2014</em></blockquote><p>Read the <a href="https://www.oceannews.com/news/2014/09/25/september-cloud-computing-goes-to-sea">full article</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7578b1a7b1f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Platform for Spreadsheet Composition]]></title>
            <link>https://medium.com/@mfornasa/a-platform-for-spreadsheet-composition-4a797742385?source=rss-f9f8740b9987------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a797742385</guid>
            <category><![CDATA[google-spreadsheets]]></category>
            <category><![CDATA[spreadsheets]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Martino Fornasa]]></dc:creator>
            <pubDate>Fri, 01 Jul 2011 10:00:00 GMT</pubDate>
            <atom:updated>2016-06-01T17:08:50.995Z</atom:updated>
            <content:encoded><![CDATA[<p>A huge amount of data is everyday managed in large organizations in many critical business sectors with the support of spreadsheet applications. The process of elaborating spreadsheet data is often performed in a distributed, collaborative way, where many actors enter data belonging to their local business domain to contribute to a global business view. The manual fusion of such data may lead to errors in copy-paste operations, loss of alignment and coherency due to multiple spreadsheet copies in circulation, as well as loss of data due to broken cross-spreadsheet links. In this paper we describe a methodology, based on a Spreadsheet Composition Platform, which greatly reduces these risks. The proposed platform seamlessly integrates the distributed spreadsheet elaboration, supports the commonly known spreadsheet tools for data processing and helps organizations to adopt a more controlled and secure environment for data fusion.</p><blockquote><em>Pierpaolo Baglietto, Martino Fornasa, Simone Mangiante, Massimo Maresca, Andrea Parodi, Michele Stecca</em>, A Platform for Spreadsheet Composition, <em>Proc. European Spreadsheet Risks Int. Grp. (EuSpRIG) 2011.</em></blockquote><p>Read the <a href="http://arxiv.org/pdf/1111.6884.pdf">full paper</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a797742385" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>