Consensus based directories are the core of many distributed systems. People use tools like zookeeper, etcd and consul to manage distributed state, elect leaders, and discover services. Building a robust cluster of these services in a chaotic environment was trickier than I thought, so I’m documenting what I figured out here. The source for all this is available on github. Goals Use cloudformation to establish a three node autoscaling group of etcd instances.
At work, we’ve been long-time users of Gerrit for code review. We recently started a new project with a new team and had an opportunity to reevaluate that choice against other workflows, particularly Github Pull Requests. Collectivist Approach I’m a strong believer in a collective approach to team decision making (you could call it the anarchist (with a capital “A”), but that freaks people out). Particularly around tooling, leaders should not be perscriptive.
At work we use Gerrit for pre-commit code review. I described the reasons previously. Here are some handy shell helpers to make working with gerrit reviews a bit quicker. The full script is here Assumptions: These examples assume you have a code review server at review.example.com, although obviously yours will be somewhere else. These examples assume you have a git remote named review that defines your code review server. A partial .git/config might look like: [remote "review"] url = ssh://[email protected]/project fetch = +refs/heads/*:refs/remotes/review/* push = HEAD:refs/for/master You have git (obviously), ssh, and jq (from here) in your path.
Docker is a handy way to deploy applications, and Go is handy way to build them. Here is how we build Docker containers for small apps.
Withebs runs a command with the specified EBS volume attached to the currently running EC2 instance. The source is available on Github. Usage: withebs --volume=$VOLUME_ID docker run -v /ebs/$VOLUME_ID:/data training/webapp The volume is mounted at /ebs/$VOLUME_ID. If the volume does not contain a recognized filesystem, it is formatted with mkfs before mounting. Options: -volume - which volume to mount. -attach-timeout - how long to wait for the EBS volume to successfully attach to the instance.
In which we point that maintaining user accounts sucks, avoiding it is hard, and share a tool to make it a tiny bit easier (I hope).
Random notes that might be useful, but probably are not.