<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.5">Jekyll</generator><link href="https://jason-michael.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jason-michael.com/" rel="alternate" type="text/html" /><updated>2024-03-09T18:36:18+00:00</updated><id>https://jason-michael.com/feed.xml</id><title type="html">Jason Michael Dot Com</title><subtitle>Jason Michael Dot Com, my old blog, resurrected after a decade, to dazzle the world wide web.</subtitle><entry><title type="html">Terraform AWS API Gateway Invoke Lambda</title><link href="https://jason-michael.com/aws/coding/terraform/2024/03/09/terraform-aws-api-gateway-invoke-lambda.html" rel="alternate" type="text/html" title="Terraform AWS API Gateway Invoke Lambda" /><published>2024-03-09T18:02:00+00:00</published><updated>2024-03-09T18:02:00+00:00</updated><id>https://jason-michael.com/aws/coding/terraform/2024/03/09/terraform-aws-api-gateway-invoke-lambda</id><content type="html" xml:base="https://jason-michael.com/aws/coding/terraform/2024/03/09/terraform-aws-api-gateway-invoke-lambda.html"><![CDATA[<p>I need to master AWS API Gateway, how it functions, how it manages permissions and how it invokes other resources
like AWS Lambda.
<!--more--></p>

<p>I’d love to be able to use Lambda to perform AWS API functions, like scaling ASG’s or granting and revoking permissions to resources. A knock-knock model for access to an EC2, which adds and then removes X hours later a CIDR to a security group, 
so that you can gain access to the resource for a short time.</p>

<p>See: <a href="https://registry.terraform.io/providers/hashicorp/aws/2.33.0/docs/guides/serverless-with-aws-lambda-and-api-gateway">Tutorial</a></p>

<blockquote>
  <p><strong>Crucial</strong> Before we make this thing permanent, be sure to include an authorizer, otherwise the API Gateway endpoint is security-through-obscurity only.</p>
</blockquote>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="AWS" /><category term="coding" /><category term="Terraform" /><summary type="html"><![CDATA[I need to master AWS API Gateway, how it functions, how it manages permissions and how it invokes other resources like AWS Lambda.]]></summary></entry><entry><title type="html">Aws Health Quit Waking Me Up</title><link href="https://jason-michael.com/cloud/2024/02/27/aws-health-quit-waking-me-up.html" rel="alternate" type="text/html" title="Aws Health Quit Waking Me Up" /><published>2024-02-27T22:27:00+00:00</published><updated>2024-02-27T22:27:00+00:00</updated><id>https://jason-michael.com/cloud/2024/02/27/aws-health-quit-waking-me-up</id><content type="html" xml:base="https://jason-michael.com/cloud/2024/02/27/aws-health-quit-waking-me-up.html"><![CDATA[<p>I work for a big shipping company which uses AWS to host our nextgen platform. We run on a wide variety of AWS resources
and technologies, and thus we depend on AWS being Healthy in our region when our business is running the cash registers.
So, we build alerting out, paging our On-Call Guy whenever <a href="https://docs.aws.amazon.com/health/latest/ug/aws-health-concepts-and-terms.html#aws-health-events">AWS Health</a> tells us something is broken. The trouble
is, our alerting system catches anything and everything, up to and including notifications that a database will be upgraded
to the latest Aurora release two months from now. Woprse, those notifications come outr at very odd times, and our On-Call
Guy (who is often me), complains that he’s paged at 3:00am for such nonsense.
<!--more--></p>

<p>We rotate a one-week On-Call shift. The first few days, as the On-Call Guy, you’re either dumbstruck by how many nuisance
pages you get <em>all night long</em> or you don’t get bothered and sleep like a baby. It often takes several days before you’re
ready to be pissed off by the <em>all night long</em> nuisance pages, but by then, you’re so busy heads down working day-to-day
changes thta you don’t prioritize fixing the <em>all night long</em> nuisance pages. So, the system has stayed broke for <strong>years</strong>.</p>

<p>I keep threatening to fix it, but I never do. But I recently found this blog post <a href="https://aws.amazon.com/blogs/mt/using-tag-based-filtering-to-manage-health-monitoring-and-alerting-at-scale/">here</a>, that maybe outlines 
how to make a reasonable AWS Health Alerting System, so I’m going to spend some time now figuring this out.</p>

<h3 id="design-ideas">Design Ideas</h3>
<p>I envision a Lambda which reads a json object from an S3 bucket or a record from Dynamodb which contains configuration
data, specifically, perhaps lists of alerts to ignore, convert to daily emails, alert on immediately etc. The Lambda 
would be inbvoked by AWS Health and would itself send the message onto SNS etc. to deliver to the On-Call Guy. Thus
we filter the messages AWS Health gives us into 4 quadrants.</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="cloud" /><summary type="html"><![CDATA[I work for a big shipping company which uses AWS to host our nextgen platform. We run on a wide variety of AWS resources and technologies, and thus we depend on AWS being Healthy in our region when our business is running the cash registers. So, we build alerting out, paging our On-Call Guy whenever AWS Health tells us something is broken. The trouble is, our alerting system catches anything and everything, up to and including notifications that a database will be upgraded to the latest Aurora release two months from now. Woprse, those notifications come outr at very odd times, and our On-Call Guy (who is often me), complains that he’s paged at 3:00am for such nonsense.]]></summary></entry><entry><title type="html">Pissing Contest</title><link href="https://jason-michael.com/work/2024/02/21/pissing-contest.html" rel="alternate" type="text/html" title="Pissing Contest" /><published>2024-02-21T15:45:00+00:00</published><updated>2024-02-21T15:45:00+00:00</updated><id>https://jason-michael.com/work/2024/02/21/pissing-contest</id><content type="html" xml:base="https://jason-michael.com/work/2024/02/21/pissing-contest.html"><![CDATA[<p>As IT professionals, we spend entirely too much time trying to one-up each other. While reading this post,
you might be thinking how your blog is cleaner, it has more features, it accepts comments! You can’t help
yourself, you just naturally critique other people’s work, because that’s part of your job. If I’m honest,
I’m probably as critical of my own work as I am of other people’s work, but that self-critique is not as
visible day-to-day. I’d argue, the critique of others should be similarly hidden. 
<!--more--></p>

<p>We have to remember that everyone is somewhere on the spectrum from idiot to expert</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="work" /><summary type="html"><![CDATA[As IT professionals, we spend entirely too much time trying to one-up each other. While reading this post, you might be thinking how your blog is cleaner, it has more features, it accepts comments! You can’t help yourself, you just naturally critique other people’s work, because that’s part of your job. If I’m honest, I’m probably as critical of my own work as I am of other people’s work, but that self-critique is not as visible day-to-day. I’d argue, the critique of others should be similarly hidden.]]></summary></entry><entry><title type="html">Stay Busy</title><link href="https://jason-michael.com/work,/personal/2024/02/19/stay-busy.html" rel="alternate" type="text/html" title="Stay Busy" /><published>2024-02-19T22:07:00+00:00</published><updated>2024-02-19T22:07:00+00:00</updated><id>https://jason-michael.com/work,/personal/2024/02/19/stay-busy</id><content type="html" xml:base="https://jason-michael.com/work,/personal/2024/02/19/stay-busy.html"><![CDATA[<p>If you’re working in cloud computing in 2024, you’re probably working from home, having maybe a daily
meeting with the team, feeling a bit disconnected with the company and it’s core goals, but pretty
confident that you play a critical role and you are <em>somehow earning</em> your salary. Or perhaps you’re 
marking your time, cashing the checks, but wondering when they’re gonna figure out how little you 
accomplish on a daily basis, how much dead weight you really are. If that’s you, congrats for the 
honesty, but you gotta listen carefully to what I’m gonna say here, it’s crucial.
<!--more--></p>

<p>Watch this video for a primer:</p>

<p><a href="https://www.reddit.com/r/videos/comments/1aunsar/girl_records_herself_getting_laidoff_cloudflare/?utm_source=share&amp;utm_medium=ios_app&amp;utm_name=iossmf">Tech layoff captured on film</a></p>

<p>Some takeaways from this experience:</p>

<ul>
  <li>the people who are firing you don’t know you, don’t know how many peers you’ve befriended, wooed, done favors for, owe you favors. They don’t know how many customers you have helped, how many veeps <em>you think</em> love you. They just have your name on a piece of paper, along with a script intended to communicate to you that you don’t measure up.</li>
  <li>no matter what you say, if this happens to you, your time on the clock is near it’s end.  No amount of argumentation can change that.</li>
  <li>your seniority may or may not have any relevance, but being there a short time won’t matter. You haven’t had enugh time to learn the job and show your unique skills? Too bad.</li>
  <li>you better be prepared. One week your working your JIRA tasks, the next week you hear that everybody on your team are getting HR calls and getting laid off.</li>
</ul>

<p>I’ve never been laid off or fired. I’ve always lept from one tree to another like that old iPhone game Doodle Jump, 
stasis for years, then sudden action, then stasis again. I’ve always managed to gain at least 20% in increases in 
compensation as I have moved, which has led to my current position where, were I to be let go now, my family would
<em>suffer</em>. I’ve forgotten how to live on one income. Its been a long time since I had to control my appetites to make
ends meet. I’m being painfully honest here.</p>

<p>But that being said, <em>I know I will survive</em>. That is the First Pillar in Tech Layoffs Land. You must retain confidence 
in your core skills, because those core skills are marketable. If you’re a COBOL programmer, <em>getthefuckouttahere</em>, OR
get into legacy mergers and conversions. COBOL was a hot commodity 24 years ago, and you might still be able to find
an old VAX system needing maintenance. But chances are, you have some coding skills, or you know how to do database
normalization and sql queries, or you know JavaScript. You probably know your way around one or two cloud consoles.
Your skills don’t suck. Don’t freak out.
rake new_post[]
But having skills is not enough. Potential employers need to be made aware of those skills somehow. So, keep that
Resume up to date. You need to review that document every quarter, making sure new things you learned in the past
months are in the Skills section. You need to keep a list of skills and accomplishments ready for your yearly
performance review anyway, so you might as well keep it in your Resume.</p>

<p>Second Pillar: you can’t afford to find work, if you’re broke. So, right now, go open a new savings account in some 
weird web bank you will promptly forget about, and setup direct deposit to put $100 a month in it. You’re gonna 
need liquid cash if the HR lady comes calling. DO NOT expect a beefy severance. On that fateful day, the HR lady 
may forget to mention the beefy severance, because all it amounts to is a weeks salary or less.</p>

<p>Third Pillar: be social. You’ll get that next job more easily if you make your self and your skills known to the most
people. I always move from job to job based on recommendations from friends. Hiring on to a new industrial cold, with 
little knowledge of the company culture, is a recipe for a future layoff. Instead, hire on to a company staffed with 
friends who are asking you to apply. When your current company is laying off, chances are there’s another company
hiring, and perhaps your friends are going there, and perhaps they will invite you in. So be nice to your coworkers
and ensure that your skills are well known to them.</p>

<p>Final Pillar: have fun. One of these days, they’re going to carve a rectangle in the ground, and place the remains of 
<em>you</em> in it. So, try to find some joy in the right-now. Who knows? Maybe if you were more friendly and seemed to enjoy 
yourself more at your last job, they might have kept you around.</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="work," /><category term="personal" /><summary type="html"><![CDATA[If you’re working in cloud computing in 2024, you’re probably working from home, having maybe a daily meeting with the team, feeling a bit disconnected with the company and it’s core goals, but pretty confident that you play a critical role and you are somehow earning your salary. Or perhaps you’re marking your time, cashing the checks, but wondering when they’re gonna figure out how little you accomplish on a daily basis, how much dead weight you really are. If that’s you, congrats for the honesty, but you gotta listen carefully to what I’m gonna say here, it’s crucial.]]></summary></entry><entry><title type="html">I Love My Wife</title><link href="https://jason-michael.com/personal/2024/02/18/i-love-my-wife.html" rel="alternate" type="text/html" title="I Love My Wife" /><published>2024-02-18T23:19:00+00:00</published><updated>2024-02-18T23:19:00+00:00</updated><id>https://jason-michael.com/personal/2024/02/18/i-love-my-wife</id><content type="html" xml:base="https://jason-michael.com/personal/2024/02/18/i-love-my-wife.html"><![CDATA[<p>Gosh I love my wife!
<!--more--></p>

<p>She is so great.</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="personal" /><summary type="html"><![CDATA[Gosh I love my wife!]]></summary></entry><entry><title type="html">Projects Forever</title><link href="https://jason-michael.com/2024/02/18/projects-forever.html" rel="alternate" type="text/html" title="Projects Forever" /><published>2024-02-18T22:11:00+00:00</published><updated>2024-02-18T22:11:00+00:00</updated><id>https://jason-michael.com/2024/02/18/projects-forever</id><content type="html" xml:base="https://jason-michael.com/2024/02/18/projects-forever.html"><![CDATA[<p>I have projects forever. I have so many projects, I find myself arranging my projects in dependency trees which are
so long, complex, computationally intensive that my brain gets lost wondering where to start. And I dare not pick
a particular project to favor, because when I think about accomplishing it, I get lost in the dependencies, I really
can’t figure out where it belongs. How to start? Hell, how do you define The First Step? <br />
<!--more--></p>

<p>And I’m a dad. Being a dad means I already have daddy-dos and honey-dos numerous enough to occupy my time from here till
my natural death all on their own. But as an honest, red-blooded American who grew up in the age of Woz and DHH and 
Spock and Dominic Giampaolo and Cyril Meurillon, I can’t just confine my aspirations to simple tasks. That’s why I
have more prototype boards than I’ll ever solder, more wire than I’ll ever need for bodges, more technical manuals
than I’ll ever read, not to mention kindle files outlining White Hat Hacking, how-to-build-a-robot guides, etc. etc. 
etc.</p>

<p>I’m into coding. I’m into speelunking and tunneling. I like woodworking and metal working and concrete working and house
building. I like to read, and write, and compose music, and dungeon master. I’m addicted to Youtube and Podcasts and 
Kindle and Reddit. I have to set an alarm to go to bed, otherwise I’d find myself tinkering at 4:00am and getting no
decent sleep for weeks at a time. Once I spent an entire month building sawhorses.</p>

<p>I have a 5HP 10” Grizzly table saw, I want a 12” one. I just bought a dual 48-core XEON workstation with 256Gb of RAM, 
based on the Skylake platform, I want one with a newer processor. I want a metal lathe and mill. I want a dump truck
and an excavator and a hundred acres in the Rockies where I can dig tunnels and underground chambers. I drink two
pots of coffee each morning, I want to learn how to make the coffee taste better than burned sadness.</p>

<p>Hoarding? I’m way past that! I have more beryllium (in the form of magnetrons) than the EPA would probably allow if they
knew. I’m <em>inspired</em>, not repulsed, by The Radioactive Boyscout. I have a special way I shimmy through my piles and 
stacks so as to not fall into them and never be heard from again. And I dream of building the warehouse at the end of 
Raiders, where I can build shelves as far as the eye can see, and stash all my junk.</p>

<p>Anyway, I say all that to say this: fear not, if you’re just like me. I’ve figured out that life has meaning only if 
you lose yourself in your projects. One day, they’ll have to clean up all this mess. I’m hoping they find some
value in my treasures.</p>

<p>And all the boxes marked DO NOT DROP - don’t drop them, seriously.</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><summary type="html"><![CDATA[I have projects forever. I have so many projects, I find myself arranging my projects in dependency trees which are so long, complex, computationally intensive that my brain gets lost wondering where to start. And I dare not pick a particular project to favor, because when I think about accomplishing it, I get lost in the dependencies, I really can’t figure out where it belongs. How to start? Hell, how do you define The First Step?]]></summary></entry><entry><title type="html">Time Machine</title><link href="https://jason-michael.com/personal/2024/02/18/time-machine.html" rel="alternate" type="text/html" title="Time Machine" /><published>2024-02-18T11:44:01+00:00</published><updated>2024-02-18T11:44:01+00:00</updated><id>https://jason-michael.com/personal/2024/02/18/time-machine</id><content type="html" xml:base="https://jason-michael.com/personal/2024/02/18/time-machine.html"><![CDATA[<p>Hello!  I’m back.  This weekend for some reason I decided to rebuild my github pages personal website.<br />
<!--more-->
I spent all morning while the wife and kids were sleeping trying to recover my github pages personal
website. I started out trying to make the old site work, then I decided, why not just start from scratch?
So I did.</p>

<p>I discovered how complex the setup of a github pages website can be, but eventually I conquered it, which
is encouraging, since I am 10 years older that I was when I setup the original site.  10 years, you say?</p>

<p>Oh yeah, so I was poking around on my old site, and I notice that the last Post’s creation date was Aug 22, 
2013!  This was startling, to say the least.</p>

<p>A lot has happened in the past 10 years. I changed jobs, got promoted to Principal, My kids graduated High
School, or are in striking distance, anyway.  My oldest daughter is a year away from graduating college!</p>

<p>We dealt with a Trump Administration, we had a Pandemic that killed millions and still lingers, infecting 
new folks and keeping others sick with Long Covid. We shifted pretty much all tech work to Work at Home, which
is an extraordinary event in itself. Truly, it is hard to comprehend just how much has changed in the past
10 years.</p>

<p>Check out the <a href="https://www.youtube.com/watch?v=zijOXpZzdvs&amp;list=PLWzwUIYZpnJuT0sH4BN56P5oWTdHJiTNq">github-pages-with-docker Youtube Video</a> for a hella good video detailing
how you should setup a github pages using jekyll.  It’s an excellent walkthrough.</p>]]></content><author><name></name></author><category term="personal" /><summary type="html"><![CDATA[Hello! I’m back. This weekend for some reason I decided to rebuild my github pages personal website. I spent all morning while the wife and kids were sleeping trying to recover my github pages personal website. I started out trying to make the old site work, then I decided, why not just start from scratch? So I did.]]></summary></entry><entry><title type="html">Welcome to Jekyll!</title><link href="https://jason-michael.com/jekyll/update/2024/02/18/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2024-02-18T00:35:33+00:00</published><updated>2024-02-18T00:35:33+00:00</updated><id>https://jason-michael.com/jekyll/update/2024/02/18/welcome-to-jekyll</id><content type="html" xml:base="https://jason-michael.com/jekyll/update/2024/02/18/welcome-to-jekyll.html"><![CDATA[<p>You’ll find this post in your <code class="language-plaintext highlighter-rouge">_posts</code> directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run <code class="language-plaintext highlighter-rouge">jekyll serve</code>, which launches a web server and auto-regenerates your site when a file is updated.</p>

<p>To add new posts, simply add a file in the <code class="language-plaintext highlighter-rouge">_posts</code> directory that follows the convention <code class="language-plaintext highlighter-rouge">YYYY-MM-DD-name-of-post.ext</code> and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.</p>

<p>Jekyll also offers powerful support for code snippets:</p>

<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">print_hi</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  <span class="nb">puts</span> <span class="s2">"Hi, </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">print_hi</span><span class="p">(</span><span class="s1">'Tom'</span><span class="p">)</span>
<span class="c1">#=&gt; prints 'Hi, Tom' to STDOUT.</span></code></pre></figure>

<p>Check out the <a href="https://jekyllrb.com/docs/home">Jekyll docs</a> for more info on how to get the most out of Jekyll. File all bugs/feature requests at <a href="https://github.com/jekyll/jekyll">Jekyll’s GitHub repo</a>. If you have questions, you can ask them on <a href="https://talk.jekyllrb.com/">Jekyll Talk</a>.</p>]]></content><author><name></name></author><category term="jekyll" /><category term="update" /><summary type="html"><![CDATA[You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.]]></summary></entry><entry><title type="html">Building A Dev Machine</title><link href="https://jason-michael.com/2023/08/22/building-a-dev-machine.html" rel="alternate" type="text/html" title="Building A Dev Machine" /><published>2023-08-22T04:12:00+00:00</published><updated>2023-08-22T04:12:00+00:00</updated><id>https://jason-michael.com/2023/08/22/building-a-dev-machine</id><content type="html" xml:base="https://jason-michael.com/2023/08/22/building-a-dev-machine.html"><![CDATA[<p>Over the past year, I have worked to build a self-service deployment machine for a Fortune 500 Online Travel Agency.</p>

<p>The product would integrate with puppet and activemq, and provide a secure, fault-tolerant self-service system for users (developers) who were not specifically trained to do puppet deployments to production servers.  Since the developers are prone to make bonehead mistakes, and since the cloud environment was inherently a bit chaotic and non-deterministic (more on this later), the machine had to be able to filter out noise from the user end, and handle static on the server end with grace.  It had to be designed from inception with these constraints in mind.  It was a challenge and I’m happy with the results.
<!-- more --></p>

<h2 id="a-word-on-puppet-and-activemq">A Word on Puppet and ActiveMQ</h2>

<p>Normally, people configure their instances to have puppet agents that kick off at regular intervals, enforcing configurations and policies like sentries marching in a circle around their post.  The benefit of this kind of system is that it makes management feel warm and fuzzy - it’s a set it and forget it strategy.  At any point in time, you can ask ‘what does this configuration look like on that bank of instances there?’ and the answer is always, ‘Lets look at the manifests.’  And if there is any question about a particular instance, that it might be somehow showing symptoms of differing from the policy, you can either wait for the next puppet refresh or trigger the refresh now.   Further, puppet logs can give you a good view into the operation of the servers.  You can add the puppet log to your syslog/graylog server and have a nice story to watch unfold in front of you.</p>

<p>However, if you don’t like the idea of a poke in the eye at regular intervals (especially in production), you might want some control on when the puppet agent runs.  Having the puppet agent triggering every 15 minutes works if and only if your process is well-tested and well-known and if your puppet manifests are spot on.  If any non-determinism lives comfortably in your process, you might want to consider turning that puppet agent daemon off.</p>

<p>Confession time: we had less testing that we were comfortable with, and we had more non-determinism that we would like to admit.  And we had a huge, monolithic application to deploy with a lot of ghetto code.  So we wrapped the puppet agent refresh in an activemq listener so we could trigger refreshes to one or many instances with pretty good control when we wanted.  We then added in-service/out-of-service control to the scripts by integrating with the F5’s SOAP interface.  We had the whole thing scripted and it worked great.  But the only people who could work it were engineers who knew how it worked.  In the end, for us, it was all work work work.</p>

<h2 id="enter-rails-and-sidekiq">Enter: Rails and Sidekiq</h2>

<p>I know how to build Rails apps.  I can spin one up in 15 minutes.  I can roll a rails app into an RPM and deploy it anywhere in the snap of a finger.  I thought I’d try to build a rails interface into this puppet/activemq system, so we could allow developers and managers who didn’t have our puppet training to deploy software - even to production.  It ought to ‘just work’, it ought to protect the company’s services and the client experience, but be able to take action when we wanted.</p>

<p>In order to model the deployment of a package to our environments, I had to map out the state machine we had created.  I used the Workflow gem for this.  In order to enable fault-tolerance, retry’s and run time customization, I added the Sidekiq gem and service.  Sidekiq uses Redis on the backend, and allows you to run ruby scripts in a multi-threaded non-blocking fashion.  It all runs pretty well.</p>

<h2 id="further-improvements">Further Improvements</h2>

<p>As we ran the system for a while (174 thousand deployments to date), we started running continuous integration with some applications.  This involved triggering builds with Jenkins which generated an RPM, then detecting if new RPM’s were available, and if so, building a deployment for them and starting it automatically.  We can now deploy from certification, through a variety of Unit tests, UI testing using selenium, sanity checks etc. all the way to production in 11 minutes.  It beats all the work we had to accomplish once upon a time just to put a package in orbit.</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><summary type="html"><![CDATA[Over the past year, I have worked to build a self-service deployment machine for a Fortune 500 Online Travel Agency.]]></summary></entry><entry><title type="html">Virtual Home</title><link href="https://jason-michael.com/personal/old/maker/2019/08/11/virtual-home.html" rel="alternate" type="text/html" title="Virtual Home" /><published>2019-08-11T21:46:00+00:00</published><updated>2019-08-11T21:46:00+00:00</updated><id>https://jason-michael.com/personal/old/maker/2019/08/11/virtual-home</id><content type="html" xml:base="https://jason-michael.com/personal/old/maker/2019/08/11/virtual-home.html"><![CDATA[<p>I bought a Dell Precision Workstation with dual xeon’s and added 64 gigs of RAM.  I intend to turn it into a VM host using
KVM (it’s running CentOS 7.x).  I’m struggling with this because it seems every thing I try, I find issues I have to trouble
shoot, and spending all day troubleshooting and not building is a real pain. 
<!-- more --></p>

<h2 id="automation">Automation</h2>

<p>I created a ‘build a VM’ script, containing the following:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># /setup/deploy_vm.bash</span>

<span class="nb">source</span> /setup/lib.bash

<span class="k">if</span> <span class="o">[</span> <span class="nv">$# </span><span class="nt">-eq</span> 0 <span class="o">]</span><span class="p">;</span> <span class="k">then
    </span><span class="nb">echo</span> <span class="s2">"No arguments supplied!"</span>
    <span class="nb">echo</span> <span class="s2">"REQUIRED: 1 = instid [example: centos-git], 2 = insthost [example: centos-git]"</span>
    <span class="nb">exit </span>1
<span class="k">fi

</span><span class="nv">instid</span><span class="o">=</span><span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span>
<span class="nv">insthost</span><span class="o">=</span><span class="s2">"</span><span class="nv">$2</span><span class="s2">"</span>
<span class="nv">tzone</span><span class="o">=</span><span class="s2">"US/Central"</span>
<span class="nv">domain</span><span class="o">=</span><span class="s2">"atomic.org"</span>
<span class="nv">discsize</span><span class="o">=</span><span class="s2">"20G"</span>
<span class="nv">memsize</span><span class="o">=</span><span class="s2">"2048"</span>

normallog <span class="s2">"grab centos 7 cloud image"</span>

<span class="nb">cd</span> /var/lib/libvirt/boot

<span class="k">if</span> <span class="o">[</span> <span class="nt">-f</span> <span class="s2">"CentOS-7-x86_64-GenericCloud.qcow2"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
    </span>errorlog <span class="s2">"qcow file exists, Skipping"</span>
<span class="k">else
    </span>detaillog <span class="s2">"qcow file does not exist.  Download it"</span>
    wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
<span class="k">fi

</span>normallog <span class="s2">"setup directories"</span>

<span class="nv">D</span><span class="o">=</span>/var/lib/libvirt/images
<span class="nv">VM</span><span class="o">=</span><span class="nv">$instid</span>
<span class="nb">mkdir</span> <span class="nt">-vp</span> <span class="nv">$D</span>/<span class="nv">$VM</span>

normallog <span class="s2">"setup metadata"</span>

<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>

<span class="nb">rm</span> <span class="nt">-f</span> meta-data
<span class="nb">touch </span>meta-data

<span class="nb">echo</span> <span class="s2">"instance-id: </span><span class="nv">$instid</span><span class="s2">"</span> <span class="o">&gt;&gt;</span> meta-data
<span class="nb">echo</span> <span class="s2">"local-hostname: </span><span class="nv">$insthost</span><span class="s2">"</span> <span class="o">&gt;&gt;</span> meta-data

normallog <span class="s2">"current meta-data:"</span>

<span class="nb">cat </span>meta-data

normallog <span class="s2">"setup user-data"</span>

<span class="k">if</span> <span class="o">[</span> <span class="nt">-f</span> ~/.ssh/id_<span class="nv">$insthost</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
    </span>errorlog <span class="s2">"~/.ssh/id_</span><span class="nv">$insthost</span><span class="s2"> exists.  Skipping"</span>
<span class="k">else
    </span>ssh-keygen <span class="nt">-t</span> ed25519 <span class="nt">-C</span> <span class="s2">"VM Login ssh key foo"</span> <span class="nt">-f</span> ~/.ssh/id_<span class="nv">$insthost</span> <span class="nt">-P</span> <span class="s2">""</span>
<span class="k">fi

</span><span class="nv">tmpkey</span><span class="o">=</span><span class="si">$(</span><span class="nb">cat</span> ~/.ssh/id_<span class="nv">$insthost</span>.pub<span class="si">)</span>

<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>

<span class="nb">rm</span> <span class="nt">-f</span> user-data
<span class="nb">touch </span>user-data

<span class="nb">cat</span> <span class="o">&gt;</span> user-data <span class="o">&lt;&lt;</span> <span class="no">ENDOFFILE</span><span class="sh">
#cloud-config

# Hostname management
preserve_hostname: False
hostname: </span><span class="nv">$insthost</span><span class="sh">
fqdn: </span><span class="nv">$insthost</span><span class="sh">.</span><span class="nv">$domain</span><span class="sh">

# Users
users:
    - default
    - name: jason
      groups: ['wheel']
      shell: /bin/bash
      sudo: ALL=(ALL) NOPASSWD:ALL
      ssh-authorized-keys:
        - </span><span class="nv">$tmpkey</span><span class="sh">

# Configure where output will go
output:
  all: "&gt;&gt; /var/log/cloud-init.log"

# configure interaction with ssh server
ssh_genkeytypes: ['ed25519', 'rsa']

# Install my public ssh key to the first user-defined user configured
# in cloud.cfg in the template (which is centos for CentOS cloud images)
ssh_authorized_keys:
  - </span><span class="nv">$tmpkey</span><span class="sh">

# set timezone for VM
timezone: </span><span class="nv">$tzone</span><span class="sh">

# Remove cloud-init
runcmd:
  - systemctl stop network &amp;&amp; systemctl start network
  - yum -y remove cloud-init
</span><span class="no">ENDOFFILE

</span><span class="nb">cat </span>user-data

normallog <span class="s2">"Copy cloud image"</span>
<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>
<span class="nb">cp</span> /var/lib/libvirt/boot/CentOS-7-x86_64-GenericCloud.qcow2 <span class="nv">$VM</span>.qcow2

normallog <span class="s2">"Create </span><span class="nv">$discsize</span><span class="s2"> disc image"</span>
<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>
<span class="nb">export </span><span class="nv">LIBGUESTFS_BACKEND</span><span class="o">=</span>direct
qemu-img create <span class="nt">-f</span> qcow2 <span class="nt">-o</span> <span class="nv">preallocation</span><span class="o">=</span>metadata <span class="nv">$VM</span>.new.image <span class="nv">$discsize</span>
virt-resize <span class="nt">--quiet</span> <span class="nt">--expand</span> /dev/sda1 <span class="nv">$VM</span>.qcow2 <span class="nv">$VM</span>.new.image
<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>
<span class="nb">mv</span> <span class="nv">$VM</span>.new.image <span class="nv">$VM</span>.qcow2

normallog <span class="s2">"Creating cloud-init iso"</span>

mkisofs <span class="nt">-o</span> <span class="nv">$VM</span><span class="nt">-cidata</span>.iso <span class="nt">-V</span> cidata <span class="nt">-J</span> <span class="nt">-r</span> user-data meta-data

normallog <span class="s2">"Create a pool"</span>

virsh pool-create-as <span class="nt">--name</span> <span class="nv">$VM</span> <span class="nt">--type</span> <span class="nb">dir</span> <span class="nt">--target</span> <span class="nv">$D</span>/<span class="nv">$VM</span>

normallog <span class="s2">"Install VM"</span>

<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>
virt-install <span class="nt">--import</span> <span class="nt">--name</span> <span class="nv">$VM</span> <span class="se">\</span>
<span class="nt">--memory</span> <span class="nv">$memsize</span> <span class="nt">--vcpus</span> 1 <span class="nt">--cpu</span> host <span class="se">\</span>
<span class="nt">--disk</span> <span class="nv">$VM</span>.qcow2,format<span class="o">=</span>qcow2,bus<span class="o">=</span>virtio <span class="se">\</span>
<span class="nt">--disk</span> <span class="nv">$VM</span><span class="nt">-cidata</span>.iso,device<span class="o">=</span>cdrom <span class="se">\</span>
<span class="nt">--network</span> <span class="nv">bridge</span><span class="o">=</span>virbr0,model<span class="o">=</span>virtio <span class="se">\</span>
<span class="nt">--os-type</span><span class="o">=</span>linux <span class="se">\</span>
<span class="nt">--os-variant</span><span class="o">=</span>centos7.0 <span class="se">\</span>
<span class="nt">--graphics</span> spice <span class="se">\</span>
<span class="nt">--noautoconsole</span>

normallog <span class="s2">"Cleanup"</span>

<span class="nb">cd</span> <span class="nv">$D</span>/<span class="nv">$VM</span>
virsh change-media <span class="nv">$VM</span> hda <span class="nt">--eject</span> <span class="nt">--config</span>
<span class="nb">rm </span>meta-data user-data centos7-vm1-cidata.iso

normallog <span class="s2">"Get IP Address"</span>

virsh net-dhcp-leases default
</code></pre></div></div>
<h2 id="test">Test</h2>

<p>I tested the script a few times:</p>

<!-- see https://github.com/Shopify/liquid/wiki/Liquid-for-Designers for stuff 
# H1
## H2
[I'm an inline-style link](https://www.google.com)
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 1')
```javascript
var s = 'JavaScript syntax highlighting';
alert(s);
```
   * an unordered list item (note a newline is required before the list begins)
   1. an ordered list item
| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
-->]]></content><author><name></name></author><category term="personal" /><category term="old" /><category term="maker" /><summary type="html"><![CDATA[I bought a Dell Precision Workstation with dual xeon’s and added 64 gigs of RAM. I intend to turn it into a VM host using KVM (it’s running CentOS 7.x). I’m struggling with this because it seems every thing I try, I find issues I have to trouble shoot, and spending all day troubleshooting and not building is a real pain.]]></summary></entry></feed>