If you at least partially live in the Amazon Web Services (AWS) world, then you know that re:INVENT is coming up in just a few weeks. That's the big show for the industry with 50,000+ expected attendees this year. The company I work for has an enormous presence, and for the 3rd year in a row, I have a speaking slot. Last year I had 1800 folks in the room listening to me introduce AWS Lambda to them. This time I am taking the next step to talk about orchestration with AWS Step Functions.
Last year my demo was pretty cool. But this year I want to do something even better. I am still building it out but wanted to start giving you some hints about (and self document) the components I am using. At the heart of it all is a GatsbyJS-based statically generated website. Setting up the site is easy enough. Even compiling it is super easy. But getting that compile to happen in the cloud is a little more involved.
The primary reason for setting this up is that I need a cool demo. But recently I was in Italy for vacation. My wife was so proud of me for leaving the laptop home, but that meant I could not publish any of the blog posts I wrote till I returned to the laptop that had the Hugo source code on it. And then I forgot I wrote them until 20 minutes ago. Having a service in the cloud to do this for me would have solved the problem. Now there are many ways to solve this, but this is for a re:INVENT demo and I live in that world.
OK, so what is CodeBuild? Well CodeBuild is a serverless offering from AWS for running code builds. Essentially serverless just refers to any service where you don't need to worry about the infrastructure, but you have the power and flexibility to do almost anything you like. And perhaps most importantly, you don't pay for it when it's not doing anything for you. If you run it for an entire month, an EC2 is going to be cheaper, but this is for workloads you use for seconds every hour or day.
CodeBuild is priced per minute of use and the cost starts at half a penny per minute. Thats over $200 a month if its running 24/7, but you are only using this for a few minutes a day. And the first 100 minutes per month are free.
What can you do with a CodeBuild instance? Anything you like. There are preconfigured environments for Docker, NodeJS, PHP, Ruby, Android, Go, Java, Python and more. You point it at your code repository on GitHub, BitBucket, AWS CodeCommit. Heck, I think you could even do a KeyBase git repo. You aren't going to want to run a PHP website from here because it takes a few seconds to spin up. But if you are doing a compile, it's perfect.
My use case is a NodeJS static website generator. My source code is hosted on AWS CodeCommit. When I start a compile, it spins up the environment, clone's the repo, installs any needed NPM modules, and runs the build command. When it's done it pushes the results to an S3 bucket. And for me, S3 is the storage for my demo website, via AWS CloudFront.
There are a bunch of environments you can choose from, but to make things cooler, you can provide your own environment in the form of a Docker image. And that image can be hosted on Docker Hub, AWS ECS, or any other image repository (it's re:INVENT, can you guess where my image is).
The big benefit for me to use my own Docker image is that the prerequisite NPM modules are already installed so I don't have to wait an extra minute or two for that step. So I was able to drop a 3+ minute build down to less than one minute.
I'll show you how I built all this out in the next post and in future posts I'll automate the build using a Lambda listening to the CodeCommit repo, and add automated testing with other Lambdas via Step Functions.
If you want to see the full demo done in my super stylish way, then register for my session at re:INVENT. It's full now, but that happened last year too and they kept bumping me up to bigger rooms. Hopefully it will happen again this year, so sign up for the waitlist. My talk is SRV335 - Best Practices for Orchestrating AWS Lambda Workloads
Wordpress is a great service if you have the time to maintain (or have someone doing it for you). And its great to host a lot of different sites on a single server. And its a great dynamic site engine. I hear a lot of folks say it limited and has a lot of issues, but they tend to be folks that don't invest the time in doing Wordpress right.
Wordpress has one of the same big weaknesses of Windows: it's too easy to use. Folks see that ease and think its easy all the way through. Below the surface, it's hard...and it's surprisingly easy to really screw things up. One misplaced semicolon, even in a plugin, and the site is down.
The reason I went to Wordpress is that after leaving Placester I decided to do my own thing. I had been helping Placester partners build on the Placester Wordpress plugin, so decided it would be easy to start building Wordpress themes. And so I needed to host a Wordpress site to show that I knew what I was doing.
But Wordpress, if you are doing it all on your own, means hosting a server and maintaining it. I am now in a phase where I don't really want to maintain a little server to host Wordpress. And every few days the server was falling down.
Digital Ocean is also a great service. I used them a lot at Placester (I think the founders might have been in the same Techstars class or something like that). Then there was the deal where if you subscribed to the Changelog podcast, you got 50 bucks credit at DO. So that paid for a lot of months at $5 per month.
Droplets on DO are amazing. I set one up 6 years ago and its still going strong. But even $5 is a bit to pay if you aren't really doing anything with it. And the thing I was doing kept falling down.
My site is nothing special. I do nothing dynamic. I sell nothing. I have no need for Wordpress or Drupal or anything else with a database behind the scenes. A static site would serve all my needs quite well. There are plenty of choices for static site generators. Datadog's marketing site and now our docs are built with Hugo, so it makes a lot of sense to use.
A colleague uses surge for his site and hadn't nothing but good things to say about it. It's a cli only service and it fits in with the Hugo workflow. I can run
hugo;surge public and a few seconds later the site is up and out there. It's pretty amazing, and for the level of service I need, it's free.
We shall see how well it performs, but I am pretty happy with it so far. And that is where things are.
Looking back on 2016, I think there are many accomplishments to be proud of. Speaking in front of 1800 at re:Invent is a specific highlight, but there is something else that is even more magnificent in my eyes. This past year saw my awakening to reading.
OK, I could read before. But I read for information, to learn something specific. This year I read for fun. Reading became something I enjoyed. And even better, this year was the year I discovered the power of the Public Library. Yes, I had been to libraries before, but I did not love them like I do now. Today my local library is the Connolly branch of the Boston Public Library system and in a few months I will be able to start using the library almost across the street in Jamaica Plain (it’s been under renovation since we moved in to the neighborhood). I am so excited.
This year I think I read about 50-60 books. Before, the average for the year might be 1 or 2. But I couldn’t tell you what most of this year’s books were. Sure, “Fire in the Valley” and “Deep Work” stick out in my mind. So does the amazing story of a possible CIA agent captured in the Iranian revolution called “Off the Radar”, written by his son. Yes, those stick out, but the rest are mostly gone. Boston Public Library has a feature that will record your checkout history, but it doesn’t work. GoodReads has an integration with the BPL app, but its a manual step that I forget to click. I need to get better at this.
So that is a goal for 2017. The goal is to write a little summary of what I read. This will force the memory to last a bit longer than it does today. And the corollary goal is to read the books that I have. Sure, the library will continue to tempt me with stories and facts but I have my own library that I have neglected for years. So I have created a list of books that I want to tackle for 2017. Some are books that are currently checked out from the library, others are books we own. Some came from me, others from my wife. Some I have read a few chapters of, others have sat unopened for decades. I intend to read them. All of them?? I don’t know. But I would like to review this list in a year and see how I did. So here is the list for the me of 12 months forth:
Whew, thats a lot of books. I think if I tackle half of these plus a few dozen others I find at the library as I go, I will be quite happy. If you would like to follow along with my progress, I started using Libib to track this stuff: https://technovangelist.libib.com/