Wednesday, April 19, 2017

Infrastructure As Code - Terraform

Web first! Cloud first! That's the mantra at work, where the goal is to eventually move all existing apps to the cloud. Woohoo! Toss in the need for the apps to be platform-agnostic after years of being wedded to Microsoft stack and it makes for exciting times. After a quick comparison of the major cloud vendors out there in terms of richness of  offerings for what we intended, it's no surprise AWS won hands down. Prototyping by hand and running commands from the AWS CLI is okay for the trivial stuff like launching an EC2 instance or updating security groups. However, for things like CloudFormation where there was the need to launch and deal with multiple instances, the dependencies amongst themselves, correctly configured security groups based on generated IPs and manage all this within some source control; Terraform was the answer.  It's incredible that it's open source meaning we have the ability to fork the code (which I have :) ) and tweak things as we see fit without waiting for the community to address them.

Monday, February 20, 2017

Optimized Builds with Docker

Toying with Docker in the past, it's true power wasn't really revealed until it became a necessity on a API project due to the need to ensure that installed dependencies were the same regardless of which machine - dev or the build server itself was used. Essentially, the process was to define two Dockerfiles - one for building the .Net Core app and another for hosting only the necessary "build bits" from the earlier build. The former reduced the need for the Jenkins server to have all the required packages installed on it, and the latter was as an immutable tiny but fast image one could run locally or in prod.   Here's a more detailed instruction on how to do the same: Building Optimized Docker Images with ASP.Net Core. Hats off to the guys in Redmond!