<?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 Aaron Brock ☂️ on Medium]]></title>
        <description><![CDATA[Stories by Aaron Brock ☂️ on Medium]]></description>
        <link>https://medium.com/@AutomateAaron?source=rss-3756fc5adc81------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5Nti_jkpU3VApE99cAnd1g.jpeg</url>
            <title>Stories by Aaron Brock ☂️ on Medium</title>
            <link>https://medium.com/@AutomateAaron?source=rss-3756fc5adc81------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:01:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@AutomateAaron/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[Generally not recommended: Docker in Docker in Docker…]]></title>
            <link>https://engineering.sada.com/generally-not-recommended-docker-in-docker-in-docker-6fe4d7edae95?source=rss-3756fc5adc81------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fe4d7edae95</guid>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[recursion]]></category>
            <dc:creator><![CDATA[Aaron Brock ☂️]]></dc:creator>
            <pubDate>Wed, 25 May 2022 13:03:34 GMT</pubDate>
            <atom:updated>2022-05-25T13:03:34.381Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By Aaron N. Brock, SADA Pre-sales Cloud Engineer</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXuwZjxbgpbUAkTLT_DtGg.png" /></figure><h3>Introduction</h3><p>So, you need to run Docker inside Docker for your CI server, or some other legitimate reason? Sorry, this isn’t the article for you. If that’s what you’re looking for, might I suggest <a href="https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/">this blog</a>?</p><p>Normally, in this space we talk about interesting solutions to challenges that we’ve encountered and other useful technical topics. This time, we’re going in a different direction.</p><p>In this industry, we often hear the phrase “best-practices” to describe activities or techniques that are recommended for any number of practical reasons. What about the other stuff? The stuff that everybody with a curious mind tries out at one time or another, simply to see what happens? Sometimes you learn something in the process, or maybe not. <em>It’s the experimentation that matters.</em></p><p>Perhaps a particular exercise doesn’t yield any practical result, but the exploratory mindset is extremely valuable, nonetheless. It’s part of developing an aptitude for creative problem solving that can yield surprising results in your work.</p><p>It should be obvious (but we’ll state it outright anyway), that this experiment is specifically for exploring what’s theoretically possible with Docker, and not meant to be a practical use of it. Don’t perform this experiment in a production environment.</p><p>This is the first in an on-going, sporadic series of articles in which we will explore practices that are definitely not the “best”. While they may not necessarily be the <em>worst</em>-practices, they’re definitely “not generally recommended”. Will we learn something along the way? Maybe. Maybe not. Let’s take a look.</p><h3>Goal</h3><p>I wanted to know whether it’s possible to recursively run Docker-in-Docker. I’m not talking about running sibling containers via mounting the /var/run/docker.sock or anything sane. I want proper containers inside containers inside containers. Success for this experiment is defined as being able to run a command that indefinitely spins up a child container until my computer dies.</p><h3>Part 1: Proving the Concept</h3><p>So, first things first, let’s mosey on over to the official <a href="https://hub.docker.com/_/docker">Docker-in-Docker image on the Docker hub</a>. Feel free to ignore the bothersome:</p><blockquote><em>“Docker inside Docker is generally not recommended”</em></blockquote><p>Let’s give it a whirl with:</p><pre>docker run -it — privileged docker:dind</pre><p>Amazingly, I actually got a running Docker daemon inside of a Docker container on the first try (this used to take quite a bit of doing):</p><pre>INFO[2021–10–22T15:41:30.567729100Z] Loading containers: done.<br>INFO[2021–10–22T15:41:30.584627900Z] Docker daemon<br>INFO[2021–10–22T15:41:30.584825900Z] Daemon has completed initialization<br>INFO[2021–10–22T15:41:30.648761900Z] API listen on /var/run/docker.sock<br>INFO[2021–10–22T15:41:30.653327200Z] API listen on [::]:2376</pre><p>Now, let’s verify that this is a functional Docker instance <em>and </em>is not running sibling containers.</p><h4>Functional Docker instance</h4><p>In a new shell, let’s enter a quick command to check it out:</p><pre>docker exec -it strange_kalam /bin/sh</pre><p>Then I can test that it does, in fact, run an Ubuntu image:</p><pre>/ # docker run -it ubuntu bash<br>Unable to find image &#39;ubuntu:latest&#39; locally<br>latest: Pulling from library/ubuntu<br>7b1a6ab2e44d: Pull complete<br>Digest: sha256:626ffe58f6e7566e00254b638eb7e0f3b11d4da9675088f4781a50ae288f3322<br>Status: Downloaded newer image for ubuntu:latest<br>root@4b8dc3537c11:/#</pre><p>This shows us that it’s working properly!</p><h4>Verify that it’s not running a sibling container</h4><p>With the ubuntu image still running from above, I can open yet another new shell and double check that that container isn’t running on the host’s Docker instance:</p><pre>❯ docker ps<br>CONTAINER ID   IMAGE         COMMAND                  CREATED         STATUS         PORTS           NAMES<br>d509c72b66d2   docker:dind   &quot;dockerd-entrypoint.…&quot;   6 minutes ago   Up 6 minutes   2375-2376/tcp   strange_kalam</pre><p>No other containers are running on the host beyond docker:dind. Wonderful! That means the Ubuntu image is, in fact, running inside the container.</p><p>Now we’re cooking.</p><h3>Part 2: It’s all about execution</h3><p>What I’d like is a <em>single</em> Docker run command to start off this insanity. To do this, I’m going to create <em>my own</em> image based on the docker:dind image which only adds one small change: recursion.</p><p>Let’s start by looking at the existing <a href="https://github.com/docker-library/docker/blob/8baa881aab85f8398d2edbbcc0da4bd1f556dd98/20.10/dind/Dockerfile">docker:dind Dockerfile</a>, all I really care about is the bit at the end where the entrypoint is defined, since I’ll need to wrap the existing entrypoint with my entrypoint:</p><pre>ENTRYPOINT [&quot;dockerd-entrypoint.sh&quot;]</pre><p>With this knowledge, I can write a quick little Dockerfile:</p><pre>FROM docker:dind</pre><pre># Because I&#39;m not brave enough to write vanilla /bin/sh<br>RUN apk add bash</pre><pre># Copy in entrypoint-wrapper.sh<br>COPY entrypoint-wrapper.sh /usr/local/bin/</pre><pre>ENTRYPOINT [ &quot;entrypoint-wrapper.sh&quot; ]</pre><p>And entrypoint-wrapper.sh</p><pre>#!/bin/bash</pre><pre># turn on bash&#39;s job control<br>set -m</pre><pre># Start the dockerd daemon and put it in the background<br>dockerd-entrypoint.sh &amp;</pre><pre># Wait until the daemon comes up<br>while ! docker ps<br>do<br>echo &quot;Waiting for docker daemon...&quot;<br>sleep 2<br>done</pre><pre># Run this image again inside the container<br>docker run --privileged aaronnbrock/docker-in-docker-in-docker</pre><p>(<a href="https://github.com/AaronNBrock/docker-in-docker-in-docker">github repo</a>)</p><p>Build and <a href="https://hub.docker.com/r/aaronnbrock/docker-in-docker-in-docker">push it to the Docker hub</a>. So… does it work? Well, only one way for <em>you</em> to find out, give this command a try:</p><pre>docker run --privileged aaronnbrock/docker-in-docker-in-docker</pre><p>Rather than tell you, I’ll let this interpretive gif explain what happens next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*drKkRr9B-UfQ7kob" /></figure><p>(Also, if you do plan on running this you may want to be prepared with a kill command in another terminal window)</p><h3>Conclusion</h3><p>So, what did we learn today? Arguably nothing. Have a great day!</p><p><a href="https://engineering.sada.com/move-your-kubernetes-stack-to-istio-a-simple-example-250e415ef02">Move Your Kubernetes Stack to Istio: A Simple Example</a></p><h3>About Aaron Brock</h3><p>Aaron N. Brock, known for <a href="http://linkedin.com/in/aaronnbrock">cloud-related memes on LinkedIn</a> &amp; always wearing purple, began his journey programming when he was 12 years old developing his programming skills while working for the largest Minecraft server. Then, with some friends from Princeton University he co-founded a cloud gaming startup… which eventually flopped. Since then, he’s found success everywhere from DevOps engineering at a telecommunications company to creating data pipelines for a self-driving bus startup in Tianjin, China. Aaron now uses this learning as a Google Cloud Engineer to empower transformations at some of the most innovative startups in the world!</p><h3>About SADA</h3><p>At SADA, we climb every mountain, clear every hurdle, and turn the improbable into possible — over and over again. Simply put, we propel your organization forward. It’s not enough to migrate to the cloud, it’s what you do once you’re there. Accelerating application development. Advancing productivity and collaboration. Using your data as a competitive edge. When it comes to Google Cloud, we’re not an add-on, we’re a must-have, driving the business performance of our clients with its power. Beyond our expertise and experience, what sets us apart is our people. It’s the spirit that carried us from scrappy origins as one of the Google Cloud launch partners to an award-winning global partner year after year. With a client list that spans healthcare, media and entertainment, retail, manufacturing, public sector and digital natives — we simply get the job done, every step of the way. Visit <a href="https://sada.com/">SADA.com</a> to learn more.</p><p>If you’re interested in becoming a part of the SADA team, please visit our <a href="https://sada.com/careers/">careers page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fe4d7edae95" width="1" height="1" alt=""><hr><p><a href="https://engineering.sada.com/generally-not-recommended-docker-in-docker-in-docker-6fe4d7edae95">Generally not recommended: Docker in Docker in Docker…</a> was originally published in <a href="https://engineering.sada.com/">The SADA Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins + GitHub = ]]></title>
            <link>https://medium.com/contino-engineering/jenkins-github-da70ab1a7362?source=rss-3756fc5adc81------2</link>
            <guid isPermaLink="false">https://medium.com/p/da70ab1a7362</guid>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Aaron Brock ☂️]]></dc:creator>
            <pubDate>Tue, 28 Apr 2020 17:45:53 GMT</pubDate>
            <atom:updated>2020-04-28T17:54:54.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Empowering Versioned Scripted Pipelines.</p><h3>Overview</h3><h4>Introduction</h4><p>In this tutorial, we’ll be walking through configuring Jenkins to automatically listen to changes to the GitHub repository and trigger a job to run the pipeline defined in the Jenkinsfile of the repo.</p><h4>Prerequisites</h4><p><strong>Jenkins Server</strong> For this tutorial it will be assumed that you already have a Jenkins server up and running and that you have administrator privileges on it. If you don’t have a server all ready, head over to the official documentation to <a href="https://jenkins.io/download/">get started</a>.</p><p>(<strong>Note:</strong> if you’re familiar with Terraform take a look at <a href="https://github.com/AaronNBrock/terraform-aws-jenkins">my terraform module</a> for standing up a simple Jenkins server on an EC2 instance 😉)</p><p><strong>GitHub Account</strong> You’ll need either a GitHub account on github.com (which you can create at <a href="https://github.com/join">github.com/join</a>) or a GitHub account on your company’s GitHub Enterprise server. If you’re using a GitHub Enterprise server the instructions, for the most part, will be the same except in a few instances where I’ll notate the difference.</p><p>(<strong>Note:</strong> Your Jenkins server needs to be accessible from GitHub (or accessible from your GitHub Enterprise server)</p><h3>Part 1: Create Github Personal Access Tokens</h3><h4>Introduction</h4><p>In this section we’re going to be creating two GitHub Personal Access Tokens and use them to authorize our Jenkins server to perform two separate tasks:</p><ol><li>Create WebHooks for your repositories.</li><li>Clone repositories.</li></ol><p>Although these can be the same token, I suggest keeping them separate following the <a href="https://en.wikipedia.org/wiki/Principle_of_least_privilege">Principle of least privilege</a>.</p><h4>Navigate to “Personal Access Tokens”</h4><ol><li>In the upper-right press your icon.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/0*Grg48S4a8YDn2EJU" /></figure><p>2. Then Press “Settings”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/0*A4ODa8JDjQ8cVU7G" /></figure><p>3. Then Press “Developer Settings”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/0*7hQ1b3__pMzJyOss" /></figure><p>4. Then Press “Personal access tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/0*mWfJdXS85r05uONM" /></figure><h4>Generate a Token for Jenkins to “Pull” Repositories</h4><p>1. Press “Generate new Token” then fill in your password when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/143/0*v97-uZSuJpbCMVtl" /></figure><p>2. For the “Note” you put a descriptive name (e.g. “my-jenkins-pull”)</p><p>3. For the “Select scopes” check “repo”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*TIEfjANUdJO1gzw1" /></figure><p>4. Press “Generate token”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/137/0*WTfqkMt1yqvqxU-i" /></figure><p>5. On the next page you’ll see your personal access token, put it somewhere safe we’re going to use it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/0*6xUlZMrUTDo0ZYti" /></figure><p>6. Now, in Jenkins, on the left sidebar press “Credentials”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/0*oyL1Ve6d9j4k-5-U" /></figure><p>7. Then press “Jenkins”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/144/0*Mb9uVTc8DbLIQg65" /></figure><p>8. Now press “Global credentials (unrestricted)”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/0*ErfWi1-2H1uLKTg8" /></figure><p>9. In the left sidebar press “Add Credentials”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/0*4FewDUZir0br1DfC" /></figure><p>10. In the Credentials form:</p><ul><li>For “Kind” select “Username with password”</li><li>For “Scope” select “Global (Jenkins, nodes, items, all child items, etc)”</li><li>For “Username” put your GitGub Username</li><li>For “Password” put the token you generated above.</li><li>For “ID” put a descriptive all-lowercase ID (e.g. “github-pull”)</li><li>For “Description” put whatever you like.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*ZzMvjFB_g5nL_T-x" /></figure><p>11. Finally press “OK” 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/83/0*dWLYi3sstaH0JIHG" /></figure><h3>Create “Hooks” Personal Access Token</h3><p>1. Next, let’s create the Personal Access Tokens for Jenkins to Create Hooks (This will feel familiar)</p><p>2. Back in GitHub press “Generate new Token” again and then fill in your password when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/143/0*YzYaAPp1DK8JwwRY" /></figure><p>3. For “Note” you put a descriptive name (e.g. “my-jenkins-hooks”)</p><p>4. For “Select scopes” check “repo”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*lxzkQgCdUsWMQnuI" /></figure><p>5. (<strong>This is different then before</strong>) And check “admin:repo_hook”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*0uUywyB__4NwEcLn" /></figure><p>5. Finally, press “Generate token”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/137/0*qIK7-bWXAYDlajDt" /></figure><p>6. On the next page you’ll see your personal access token, put it somewhere safe we’re going to use it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*FxhbrsEb8prUODrL" /></figure><p>7. Now, back in Jenkins (assuming your still on the credentials page) press “Add Credentials” again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/0*2AZyOuQiwJNvPTB9" /></figure><p><strong>8. (This is different than before</strong>) In the Credentials form:</p><ul><li>For “Kind” select “Secret text”</li><li>For “Scope” select “Global (Jenkins, nodes, items, all child items, etc)”</li><li>For “Secret” put the token you generated above.</li><li>For “ID” put a descriptive all-lowercase ID (e.g. “github-hooks”)</li><li>For “Description” put whatever you like.</li><li>Finally press “OK” 🥳</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/0*gAysntCSWal23w5q" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/83/0*CJmHswcY7DDl1Z9R" /></figure><h3>Part 2: Configure Jenkins to Manage Hooks</h3><h4>Introduction</h4><p>In the last section, we created the personal access token authorizing jenkins to manage our github repositories hooks, so, now in this section we are going to configure Jenkins to create those hooks.</p><h4>Configure Jenkins to Manage Hooks</h4><p>1. In Jenkins on the left sidebar press “Manage Jenkins” then “Configure System”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/0*Le_PvvUlZtSbWZSS" /></figure><p>2. Then press “Configure System”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/0*r3b04OW94yGJQZTE" /></figure><p>3. Under the “GitHub” heading (Hint: Ctrl+f and type “GitHub”) press “Add GitHub Server” then “GitHub Server”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/0*IFt-uHgVTWIsDV0c" /></figure><p>4. In the “GitHub Server” form:</p><ul><li>For “Name” put a descriptive name (e.g. “github.com”)</li><li>For “API URL”:</li><li>If you’re using github.com, leave this as it’s the default: “<a href="https://api.github.com/">https://api.github.com</a>”</li><li>If you’re using GitHub Enterprise, set it to your GitHub Enterprise instances <a href="https://developer.github.com/enterprise/2.20/v3/enterprise-admin/#endpoint-urls">REST API endpoint</a>.</li><li>For “Credentials” select the ID of for the GitHub Hooks token above.</li><li>Press “Test Connection” to verify your credentials are working.</li><li>Check the “Manage hooks” checkbox.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/0*vSlfGFm0qk_BLdin" /></figure><p>5. Press “Save”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/76/0*BqfweIbgYVQCFH9X" /></figure><h3>Part 3: Add a Repository to Jenkins</h3><h4>Introduction</h4><p>In the last section, we configured Jenkins to manage the hooks for the git repositories we add but we haven’t yet added a repository. So, in this section, we’re going to create and add an example repository, but you can use this procedure to add any repository.</p><h4>Create Git Repository</h4><ol><li>In GitHub create a git repository with a file named Jenkinsfile that has the following content:</li></ol><pre>node {<br>    checkout scm<br>    stage(&#39;Build&#39;) {<br>        echo &#39;Building...&#39;<br>    }<br>    stage(&#39;Test&#39;) {<br>        echo &#39;Testing...&#39;<br>    }<br>    stage(&#39;Deploy&#39;) {<br>        echo &#39;Deploying...&#39;<br>    }<br>}</pre><p>(<strong>Tip:</strong> A quick way to create this repo is forking my <a href="https://github.com/AaronNBrock/jenkinsfile-example">jenkinsfile-example</a> repo 😉)</p><h4>Create Multibranch Pipeline in Jenkins</h4><p>1. Back in Jenkins, on the left sidebar press “New Item”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/107/1*FYqiVb3OG6kVoKCtw6IStw.png" /></figure><p>2. In the “New Item” form:</p><ul><li>For “Enter an item name” put a descriptive name. (I <strong>strongly recommend</strong> using your repo name here.)</li><li>Select “Multibranch Pipeline”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*wLXtHAeJ_oHTpoja" /></figure><p>3. Press “OK”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/68/0*BFjj-95bMXbhrsx2" /></figure><p>4. In the following “configure” under the “Branch Sources” heading, select “Add Source” then “GitHub”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/203/0*RmeX40zAC7xlP01j" /></figure><p>5. In the “GitHub” form:</p><ul><li>For “Credentials” select your github username/******<br>(<strong>Note:</strong> if you’re using GitHub Enterprise it will say your credentials are invalid even if they aren’t since credentials are always tested against github.com here)</li><li>For “Repository HTTPS URL” put your Repository’s HTTPS URL (e.g. “<a href="https://github.com/AaronNBrock/jenkinsfile-example.git">https://github.com/AaronNBrock/jenkinsfile-example.git</a>”)</li><li>Press “Validate” to verify that your credentials are working properly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/0*PLsR5eDIhD_vo7N7" /></figure><p>6. Press “Save”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/76/0*8vCeD1XZQwlXbNQb" /></figure><p>7. You’re technically done! 🎉🥳🎉 Jenkins will start a job immediately, and any time you push a commit to that repository it will trigger a job.</p><h3>Part 4: Further Exploration</h3><h4>Introduction</h4><p>In the last section we added a repo for Jenkins to run jobs based on, and while that is technically everything you need to do there are a few last things to explore.</p><h4>Blue Ocean</h4><p><a href="https://jenkins.io/projects/blueocean/">Blue Ocean</a> is the new UI/UX for Jenkins and lets you view your job runs in a much more understandable manner, you can view your pipeline runs in Blue Ocean by:</p><p>1. Pressing “Open Blue Ocean” on the left sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/0*9mjmab41WxQxDvhn" /></figure><p>2. Selecting the Run you’d like to view, for example, the newest run on master.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/0*m6jXBJFGFNul9wzg" /></figure><p>3. Now you can see the different stages from your Jenkinsfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/0*dkjMaXB-qaKaEdvR" /></figure><p>4. If you’d like to view the output for a given step, simply select the stage then press the dropdown on the step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/0*BUk-s7PTzlQ4z1x5" /></figure><h4>The Webhook Jenkins Created</h4><p>Since we authorized and configured Jenkins to create the webhook in Jenkins we don’t need to manually create it! But, we can view the hook that Jenkins created by:</p><p>1. On your GitHub Repository’s page press “Settings”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/93/0*EFYHU3rgl5ZgkPma" /></figure><p>2. Then on the left sidebar press “Webhooks”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/0*nmeTV6Ou_uBylrUZ" /></figure><p>3. From here you can see the webhook Jenkins Created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*c1j52vLsfA9zNeo7" /></figure><h4>Commit Status</h4><p>Awesomely, Jenkins will automatically set the <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-status-checks">status of commits on GitHub</a>. So, on your GitHub Repository’s page, most places commits are shown you’ll now see a ✔️ or ❌. We can see an example by:</p><p>1. On your GitHub Repository’s page press “commit”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/114/0*9qffsyD_48LTBWfz" /></figure><p>2. You should see a ✔️ next to your newest commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/0*NoJzoQWxQG-irxIz" /></figure><p>3. And, if you click on the ✔️ you’ll see a little more info about the commit’s status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*dFNS3gIlj1Meu_-O" /></figure><p>4. <em>And</em>, if you press the “Details” link in the “more info” card it will take you to the Pipeline’s run in Blue Ocean!😲</p><h4>Summary</h4><p>In this tutorial we created Personal Access Tokens to authorize Jenkins to create GitHub webhooks, we configured Jenkins to automatically create these webhooks, and we added an example repository to Jenkins and saw the job run in Jenkins. We also explored some of the other features offered by the Jenkins-GitHub integration. Exciting!</p><h3>Further Reading</h3><h4><a href="https://jenkins.io/doc/book/pipeline/jenkinsfile/">Using a Jenkinsfile</a></h4><p>In this tutorial we didn’t go into all the possibilities and functionality offered in the Jenkinsfile, so I suggest this Official documentation for using a Jenkinsfile.</p><h4><a href="https://medium.com/contino-engineering/splunk-my-logs-please-428787e3823b">AWS Splunk + Terraform</a></h4><p>While enabling Splunk for your AWS accounts isn’t directly related to this article, in that article I show a real-world example of using the integration I demonstrated here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da70ab1a7362" width="1" height="1" alt=""><hr><p><a href="https://medium.com/contino-engineering/jenkins-github-da70ab1a7362">Jenkins + GitHub = 💖</a> was originally published in <a href="https://medium.com/contino-engineering">Contino Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Splunk my logs please”]]></title>
            <link>https://medium.com/contino-engineering/splunk-my-logs-please-428787e3823b?source=rss-3756fc5adc81------2</link>
            <guid isPermaLink="false">https://medium.com/p/428787e3823b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Aaron Brock ☂️]]></dc:creator>
            <pubDate>Tue, 28 Apr 2020 17:43:24 GMT</pubDate>
            <atom:updated>2020-04-28T17:43:24.317Z</atom:updated>
            <content:encoded><![CDATA[<p>Using Terraform to configure AWS Logging to Splunk</p><h3>Part 1: Overview</h3><h4>Introduction</h4><p>Logging is vital for visibility inside an organization, but when dealing with 100s of AWS accounts spanning multiple teams manually ensuring that logging is properly configured goes from difficult to borderline impossible.</p><p>This is <em>exactly</em> the problem Contino faced when working with a massive global financial ratings and intelligence firm. With a few added constraints:</p><ul><li>Since the AWS accounts were actively in use we needed a solution which wouldn’t interrupt their workflow and would allow for incremental adoption (an often overlooked <em>but important </em>quality when architecting any solution).</li><li>Contino’s goal is to empower the existing teams, to do this we decided to integrate with tooling they were already familiar with, mainly Splunk, Terraform, GitHub &amp; Jenkins.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSwbTScSzKcggYos8MP8HA.png" /></figure><p>The solution we designed is storing a definition of the infrastructure needed to enable logging to Splunk and the list of accounts to enable it for in a single centralized git repository, then using a CI/CD Pipeline automatically provision/configure the infrastructure in those accounts whenever changes are made. This solution allows our client to:</p><h3>Add a new account by simply adding it to the list in the git repository</h3><ul><li>Change logging configuration for <em>all </em>accounts in a single location.</li><li>It lets the client reuse their existing workflow for changes to git repositories.</li></ul><h4>Demonstration</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeHOOQ-YcgoE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeHOOQ-YcgoE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeHOOQ-YcgoE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a45f25b964c8bf7f5a1c652e27860fe3/href">https://medium.com/media/a45f25b964c8bf7f5a1c652e27860fe3/href</a></iframe><h4>Tooling</h4><p><strong>Logging</strong> Our client already had a Splunk instance in place and due to Splunk’s powerful log aggregation &amp; analysis tooling it seemed like the natural choice here.</p><p><strong>IaC Tool</strong> Terraform lets us declaratively define our resource’s desired state in a configuration files, which Terraform can then use to update the existing resources to match this state. While <a href="https://www.terraform.io/intro/vs/cloudformation.html">there are other options available</a> we went with Terraform because it would be adaptable to a multi-cloud approach in the future, and because it was already being used by our client.</p><p><strong>Git Server</strong> For git repositories, it honestly didn’t matter much, anything that can trigger a Jenkins build will suffice, our client used GitHub Enterprise so we went with that!</p><p><strong>CI/CD</strong> Despite my love-hate relationship with Jenkins, it continues to be the most widely used and understood CI/CD platform, which gives you larger knowledge base to pull from as well as making it easier to find support.</p><h3>Part 2: Logging Resources</h3><h4>Splunk’s “Trumpet”</h4><p>Our first goal was to write a Terraform Module which defines the resources needed to send logs into Splunk. Traditionally this is difficult task which touches many AWS services, luckily Splunk has an open-source project called <a href="https://github.com/splunk/splunk-aws-project-trumpet">Trumpet</a> which generates a CloudFormation template that defines these resources and will send the logs to a specified HTTP Event Collector (HEC) in Splunk.</p><p>You can create an HEC in Splunk by navigating to “Settings” → “Data Inputs”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dr5ldArrE6-vFgyxq_o6g.png" /></figure><p>This will create the following input:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytwRI4gbuO1uC5IueKegFQ.png" /></figure><p>Use the “Token Value” as a param to generate the Trumpet Json.</p><p><strong>Awesome! But…</strong> As you may have noted above Trumpet creates a <em>CloudFormation template</em> not a <em>Terraform Config</em>, so to manage these resources in Terraform we needed to to either manually translate all of the resources created by in the Template in Terraform, or to wrap the Template in Terraform’s <a href="https://www.terraform.io/docs/providers/aws/r/cloudformation_stack.html">CloudFormation Stack</a> resource. We went with the latter, our Terraform CloudFormation Stack definition looked like:</p><pre>resource &quot;aws_cloudformation_stack&quot; &quot;trumpet&quot; {<br>  name = &quot;trumpet-stack&quot;<br>  template_body = file(&quot;${path.module}/trumpet.json&quot;)<br>}</pre><h4>Parameterizing Trumpet’s Stack</h4><p>This is great, however, at the moment, trumpet’s generated CloudFormation template is static and Terraform has no way to control the Splunk endpoint URL or the HTTP Event Collector Token. For this, we leveraged <a href="https://www.terraform.io/docs/providers/template/d/file.html#vars">Terraform’s template_file resource</a>, and the fact that Trumpet will actually take in any string for it’s parameters, so we could simply put “${HEC_TOKEN}” for the HTTP Event Collector Token and then pass in the Terraform parameter for example:</p><pre>data &quot;template_file&quot; &quot;trumpet&quot; {<br>  template = file(&quot;${path.module}/templates/trumpet.json&quot;)<br>  vars = {<br>    HEC_TOKEN = var.hec_token<br>  }<br>}</pre><pre>resource &quot;aws_cloudformation_stack&quot; &quot;trumpet&quot; {<br>  name = &quot;trumpet-stack&quot;<br>  template_body = data.template_file.trumpet.rendered<br>}</pre><p>The full list of parameters are:</p><ul><li>ENDPOINT_URL — This is the full url (i.e.: <a href="https://dns_name:port_number)">https://dns_name:port_number)</a> that is used to access the HTTP Event Collector.</li><li>HEC_TOKEN — This token is generated when you create the HTTP Event Collector endpoint in splunk.</li><li>VPCFLOWLOGS — This is the name of the cloudwatch log group that will host the flowlogs for the VPCs in the account. In our situation we had all VPCs pushing the flowlogs to the same cloudwatch log group.</li><li>CLOUDWATCHLOGS — This is the name of the cloudwatch log group where other log file will be flowing to. We used one to capture all miscellaneous logs so that it would be easier to push the logs into Splunk.</li></ul><p>These parameters can to be inputted into trumpet like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Zoh4hsVCiMF3Z-wDed0dw.png" /></figure><p>Awesome Possum! Now we have a Terraform module which will enable logging to Splunk, which we can leverage in the next section:</p><h3>Part 3: Multiple Accounts</h3><h4>The “Multiple Accounts” Problem</h4><p>Now, managing multiple accounts in Terraform <a href="https://serverfault.com/questions/929745/deploying-to-multiple-accounts-with-terraform">is</a> <a href="https://www.reddit.com/r/Terraform/comments/cpwxad/moving_terraform_to_manage_multiple_aws_accounts/">a</a> <a href="https://www.inovex.de/blog/terraform-in-an-aws-multi-account-environment/">hotly</a> <a href="https://lightthief.io/engineering/terraform-aws-multi-account/">debated</a> <a href="https://medium.com/slalom-build/aws-multi-account-architecture-with-terraform-yeoman-and-jenkins-7fd42ddcdda8">topic</a> <a href="https://tech.westwing.de/aws-multi-account-architecture-with-terraform-30f9f6f0098f">with</a> <a href="https://github.com/hashicorp/terraform/issues/12283">multiple</a> <a href="https://st6.io/blog/crafting-secure-and-maintainable-multi-account-setup-in-aws-3">approaches</a>, each with its own pros and cons. So, we needed to clearly define our goal in order to choose the appropriate approach. For this, we came up with the following requirements:</p><ul><li>Manageable through a sibling account. (we didn’t have org root access)</li><li>Easily add new accounts. (preferably with a single line)</li><li>Centrally update resources in all accounts.</li><li>A DRY (don’t repeat yourself) approach.</li></ul><h4>Multiple Providers</h4><p>To achieve these goals, we decided to leverage the Terraform AWS Provider’s <a href="https://www.terraform.io/docs/providers/aws/index.html#assume-role">assume role</a> option, alongside the ability to <a href="https://www.terraform.io/docs/configuration/modules.html#passing-providers-explicitly">explicitly pass in providers to modules</a>.</p><p>So, first we created an IAM role inside of each account we intended to manage (named arn:aws:iam::ACCOUNT_&lt;NUM&gt;_ID:role/ROLE_NAMEbelow) and authorized our account to assume it following <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html">AWS’s documentation</a>. Then we defined multiple providers, each assuming one of these roles:</p><pre>provider “aws” {<br>  alias = &quot;account_1&quot;<br>  assume_role {<br>    role_arn = &quot;arn:aws:iam::ACCOUNT_ONE_ID:role/ROLE_NAME&quot;<br>  }<br>}<br>provider “aws” {<br>  alias = &quot;account_2&quot;<br>  assume_role {<br>    role_arn = &quot;arn:aws:iam::ACCOUNT_TWO_ID:role/ROLE_NAME&quot;<br>  }<br>}</pre><pre>module “account_one_enable_splunk” {<br>  providers = {<br>    aws = aws.account_1<br>  }<br>  source = “./modules/enable_splunk”<br>  /* other params */<br>}<br>module “account_two_enable_splunk” {<br>  providers = {<br>    aws = aws.account_2<br>  }<br>  source = “./modules/enable_splunk”<br>  /* other params */<br>}</pre><p>This is great! But to add a new account we’d need to write a new “provider” block and a “module” block, also we’d have some duplication in each of the provider blocks. But luckily we can:</p><h4>Wrap it in a module</h4><p>Although it’s may be a bit of a anti-pattern you can define providers inside of modules and even use module variables inside your provider definitions. For example:</p><pre>provider &quot;aws&quot; {<br>  alias   = &quot;managed_account&quot;<br>  assume_role {<br>    role_arn = var.role_arn<br>  }<br>  /* other params */<br>}</pre><pre>module &quot;enable_splunk&quot; {<br>  providers = {<br>    aws = aws.managed_account<br>  }<br>  source = &quot;../enable_splunk&quot;<br>  /* other params */<br>}</pre><p>Allowing us to define each account as a single module:</p><pre>module &quot;account_one_managed_account&quot; {<br>  source   = &quot;./modules/managed_account&quot;<br>  role_arn = &quot;arn:aws:iam::ACCOUNT_ONE_ID:role/ROLE_NAME&quot;<br>  /* other params */<br>}<br>module &quot;account_two_managed_account&quot; {<br>  source   = &quot;./modules/managed_account&quot;<br>  role_arn = &quot;arn:aws:iam::ACCOUNT_TWO_ID:role/ROLE_NAME&quot;<br>  /* other params */<br>}</pre><h4>A Note about the future! (terraform v0.13)</h4><p>Now, you may notice that even wrapping the provider in a module, to add a new account we do still need to Copy + Paste the “managed_account” module definition, which isn’t quite the “one line” we were looking for. Luckily in <a href="https://github.com/hashicorp/terraform/issues/17519">terraform v0.13 “for_each” will work on modules!</a> Which will allow us to be even more concise:</p><pre>module “managed_accounts” {<br>  for_each = {<br>    &quot;arn:aws:iam::ACCOUNT_ONE_ID:role/ROLE_NAME&quot;,<br>    &quot;arn:aws:iam::ACCOUNT_TWO_ID:role/ROLE_NAME&quot;,<br>  }<br>  source   = “./modules/managed_account”<br>  role_arn = each.key<br>  /* other params */<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*VUuktrmYTOgrKJA366XdpA.gif" /></figure><h3>Part 4: Connecting to CI/CD</h3><p>Since everything is defined as a single terraform repo, all we need CI/CD to do is apply it, which luckily is quite straightforward! We stood up a Jenkins server and connected it to GitHub <a href="https://docs.google.com/document/d/1owbfcd6e6QlN4cDrTBu0KsVBwdbUmPR9HNzCBLuHIr4/edit?usp=sharing">using the strategy outlined in this post</a> (Link TBD). And then wrote a fairly simple Jenkinsfile based on a workflow which resembles <a href="https://trunkbaseddevelopment.com/">trunk based development</a>:</p><pre>import org.jenkinsci.plugins.pipeline.modeldefinition.Utils</pre><pre>node {<br>    cleanWs() // Clean workspace <br>    checkout scm<br>    docker.image(&#39;hashicorp/terraform:0.12.23&#39;).inside(&#39;--entrypoint=&quot;&quot;&#39;) {<br>        withEnv([&#39;TF_IN_AUTOMATION=true&#39;]) {<br>            stage(&#39;initialize&#39;) {<br>                sh &#39;terraform init&#39;<br>            }<br>            stage(&#39;plan&#39;) {<br>                sh &#39;terraform plan&#39;<br>            }<br>            stage(&#39;apply&#39;) {<br>                if (env.BRANCH_NAME == &#39;master&#39;) {<br>                    sh &#39;terraform apply -auto-approve&#39;<br>                } else {<br>                    Utils.markStageSkippedForConditional(&#39;apply&#39;)<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>This Jenkinsfile will run a terraform initand terraform plan for every commit on every branch and then runs terraform apply only if the commit is on the master branch.</p><h4>Attaching a role</h4><p>This is great, except one little hiccup which is up until this point we’ve been using our own AWS credentials to apply these changes. But to get it working on a Jenkins server we need to authorize the Jenkins server to perform these actions, now you <em>could </em>do this by generating an Access Key and adding it as a <a href="https://jenkins.io/doc/developer/security/secrets/">Jenkins Secret</a> but dealing with keys introduces many risks which can be avoided by <a href="https://aws.amazon.com/premiumsupport/knowledge-center/assign-iam-role-ec2-instance/">assigning the role directly to the instance</a>.</p><h3>Part 5: Wrap Up</h3><h4>Overview</h4><p>By codifying our clients logging we’ve empowered them to:</p><ul><li>Enable logging for a given AWS account by updating a file in GitHub.</li><li>Update logging configuration for all accounts in a single place.</li><li>Leverage their existing git workflow to make these changes.</li><li>Leverage their existing knowledge to maintain the system in the future.</li></ul><h4>Next Steps</h4><p>As with anything in life, perfection is a direction rather than a destination and there are still a few shortcomings of this solution</p><p><strong>Managing Roles:</strong> In order to provision resources inside the “sibling” aws accounts, we do first have to create a role in that account manually. Now automating this is a bit of a catch 22 since in order to create the role we’d first need a role with permission to create it, but there are a few approaches that can be taken here:</p><ul><li>Configure an <a href="https://aws.amazon.com/blogs/aws/new-use-aws-cloudformation-stacksets-for-multiple-accounts-in-an-aws-organization/">Organizational wide CloudFormation StackSet</a> once to automatically create this role in <em>every account</em> with some predictable naming convention.</li><li>Depending on who controls this log enablement in your company, it may make sense to instead leverage the existing <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html">OrganizationAccountAccessRole</a> inside each account.</li></ul><p><strong>Adding Multiple Accounts:</strong> While we can programmatically add new accounts (which is awesome!) even that may be a bit tedious if you have to enable 10s or 100s of accounts at a time. So, rather than manually adding account id’s you could leverage <a href="https://www.terraform.io/docs/providers/aws/d/organizations_organization.html#list-all-account-ids-for-the-organization">Terraform’s aws_organizations_organization</a> to list all of the accounts in a given org, then dynamically pass that into the `managed_account` module. This largely comes down to your organizations preference for rolling out logging.</p><h4>Acknowledgements</h4><p>I’d like to thank:</p><ul><li><strong>Joe Bennett </strong>for his work on the Splunk/Trumpet integrations, his assistance writing this article.</li><li><strong>Jason Lutz</strong> for his assistance with Security Best Practices.</li><li><strong>Scott Shulman </strong>for keeping us on track and proofreading.</li><li><strong>Contino</strong> for being an awesome place to work! (<a href="https://www.contino.io/join-us">we’re hiring</a> 😉)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=428787e3823b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/contino-engineering/splunk-my-logs-please-428787e3823b">“Splunk my logs please”</a> was originally published in <a href="https://medium.com/contino-engineering">Contino Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install TensorFlow GPU on Windows 10 (2017)]]></title>
            <link>https://medium.com/@AutomateAaron/how-to-install-tensorflow-gpu-on-windows-10-2017-d9a5dcd91124?source=rss-3756fc5adc81------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9a5dcd91124</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[tensorflow]]></category>
            <dc:creator><![CDATA[Aaron Brock ☂️]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 06:45:17 GMT</pubDate>
            <atom:updated>2017-08-29T06:45:17.873Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Prerequisites:</strong></p><ul><li>Windows 10</li><li>Python 3.5</li><li>GPU that supports CUDA 3.0 or higher. (See: <a href="https://developer.nvidia.com/cuda-gpus">Cuda-GPUs</a>)</li></ul><p><strong>Step 1: Install Visual Studio Community 2015</strong></p><ol><li>Join the <a href="https://www.visualstudio.com/dev-essentials/">Microsoft Dev Essentials program</a>. (Don’t worry, it’s free)</li><li>Download and Install <a href="https://my.visualstudio.com/Downloads?pid=2086">Visual Studio Community 2015 with Update 3</a>. It might take awhile.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*CuFHDw7qCykLKSlZhgL0NQ.png" /></figure><p><strong>Step 2: Install CUDA 8.0</strong></p><ol><li>Download and Install <a href="https://developer.nvidia.com/cuda-downloads">CUDA Toolkit 8.0</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*HS-ZWzDJuLn0qjEFc-CugQ.png" /></figure><p><strong>Step 3: Install cuDNN v6.0 for CUDA 6.0</strong></p><ol><li>Join the <a href="https://developer.nvidia.com/developer-program/signup">NVIDIA Developer Program</a>.</li><li>Download <a href="https://developer.nvidia.com/rdp/cudnn-download">cuDNN v6.0 for CUDA 8.0</a> for Windows 10.</li><li>Unzip the contents of cuDNN into the CUDA installation directory. (Default: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*SCtiqML68pKJ_TKMFuf8_g.png" /></figure><p><strong>Step 4: Install Tensorflow-GPU</strong></p><p>Install Tensorflow GPU via pip using:</p><pre><strong>pip install --upgrade tensorflow-gpu</strong></pre><p><strong>Step 5: Check installation</strong></p><pre>&gt;&gt;&gt; import tensorflow as tf<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; hello = tf.constant(&#39;Hello, Aaron!&#39;)<br>&gt;&gt;&gt; sess = tf.Session()<br>&gt;&gt;&gt; print(sess.run(hello))<br>b&#39;Hello, Aaron!&#39;</pre><p><strong>Step 6: Rethink your choice of breakfast.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9a5dcd91124" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s Machine Learning?]]></title>
            <link>https://medium.com/@AutomateAaron/whats-machine-learning-d7d6bbd888d5?source=rss-3756fc5adc81------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7d6bbd888d5</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Aaron Brock ☂️]]></dc:creator>
            <pubDate>Sun, 26 Mar 2017 03:38:56 GMT</pubDate>
            <atom:updated>2017-03-26T05:53:05.046Z</atom:updated>
            <content:encoded><![CDATA[<p>Programs can rudimentarily be defined as something that takes in input, performs some mutation on this input and produces some output. For example, imagine a program that takes in a number and returns the square, <em>2 </em>becomes <em>4</em>,<em> 3 </em>becomes <em>9 </em>and so on. But what if we don’t get to see what mutation is preformed? What if it’s just a black box and all you get to see is what goes in and comes out? If I told you that a program mutates data such that:</p><ul><li><em>4 -&gt; 6</em></li><li><em>6 -&gt; 9</em></li><li>5 -&gt; 7.5</li><li><em>2 -&gt; 3</em></li></ul><p>What operation do you think the program applied to the data? Just looking at it you can surmise that what happens is you take the number and add half of it to itself; <em>x+(x/2).</em> But, how did you do that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*aOkEaCteEsCD5B1ezrkL8Q.png" /></figure><p>Machine learning is a way to teach a computer to find these patterns without being explicitly programmed what they are. There are many ways to go about doing this, but today I’m going to look at <a href="https://en.wikipedia.org/wiki/Perceptron">Perceptron</a>s. A perception is simply something that takes inputs and multiplies each of them by a modifier (or a weight) then adds all of them together, as shown in Fig 1,</p><p>This alone doesn’t allow us solve the problem from earlier, we need a few more tools, one of them is knowing how <strong>wrong</strong> our output is, this is called our error. The error is the different between the output of our Perceptron and the correct output. In order to see this, let’s look at our last example again but this time, we know that the correct output is supposed to be 7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*7PwHOVyKftYWPM8bl_tFxg.png" /></figure><p>Great! Now, all we need to do to adjust the weights so that the error is as low as possible. To do this, we need to know what affect each weight has on the error. Let’s take the blue weight from Figure 2 and change it to 0.25 how would it affect the error?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*jBwuif3o9EL1ABm8ho3_Ig.png" /><figcaption>Figure 3</figcaption></figure><p>Oh no! The error is higher! That’s no good, it’s clear we need to figure out which direction to change the weight <em>before</em> we change it. To do this, we need to find the relationship between the error and that weight, if you look at this equation:</p><p>|7-(4 * w)+3|= <strong>error</strong></p><p>You can see that if you make the weight higher (up until 1.0) the error will go down.</p><p>So, let’s try this again, but this time, we know that increasing the weight will lower the error, so let’s change the weight to 0.75 and see what happens!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*Mc63-qW8UVBKbtsy6m2nSg.png" /></figure><p>Great! The error is lower! Our network is more accurate! As you can guess, if repeat this process several times weights will make the network more and more accurate. But, we still have a problem, the weights (1.0, 1.0) and the weights (2.0, 0.25) will both work! The network won’t be able to figure out which weights to use because they are both right. So, how do we solve this problem? <strong>MORE DATA!</strong> If we also train on on say: (5, 16) -&gt; 14 the network would be able to figure out that the correct weights are indeed (2.0, 0.25).</p><p>In a very simple form, this is what machine learning is. But imagine if instead of 2 numbers as input you gave it millions of pictures of cats and if instead of one Perceptron, you hooked up thousands and thousands of neurons. Well, that’s what <a href="https://googleblog.blogspot.com/2012/06/using-large-scale-brain-simulations-for.html">Google Deep Mind</a> did! And, they were able to identify whether or not if a picture had a cat in it with amazing accuracy!</p><p>Machine learning is all around us, from which Youtube videos are suggested to what posts we see of Facebook to self driving cars! But, Machine Learning is still a fast progressing field, so get ready it’s only just begun!</p><p>~Aaron N. Brock</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7d6bbd888d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>