Advancing Toward the Mirage

I left off last time telling you about getting Mirage to not work. I’m still working hard to get this blog – yes, this one you’re reading now – up and running as a unikernel on EC2.

It became clear to me last week that I needed to fork my own instance of the mirage-tcpip repository and compile my kernels with it, if I were to make any progress in debugging the DHCP problems I was having. A few naive attempts to monkey with version of mirage-tcpip downloaded by opam weren’t successful, so I set about to figure out how actual OCaml developers develop in OCaml with opam.

First stop: the opam documentation on doing tricky things. This is a little short of a step-by-step “do this, dorp” guide, unfortunately; here’s what I end up doing, and it sorta seems to work.

It's a mirage! (Or, how to shave a yak.)

A week or so ago, I heard about the Mirage project, a library OS project that makes tiny virtual machines running on top of Xen to run a given application, and do nothing else. I was intrigued, and started working through the excellent intro documentation, and got to the point where I wanted to replace my ho-hum statically-compiled blog hosted from Ubuntu LTS with a unikernel that would serve my static site and do nothing else.

There are excellent instructions on doing this with a Jekyll site on Amir Chaudhry’s blog. Octopress, which I use to generate this site, is built on top of Jekyll, and I only had a few extra goodies to throw in before I was able to make a unikernel that would run my blog with a few rake invocations. After getting the first unikernel up and running via Xen on my laptop, I entertained myself by throwing a few nmap commands at it; I was particularly curious to see whether my unikernel knew what to do with UDP packets:

sudo nmap -sO 192.168.2.13

Starting Nmap 6.40 ( http://nmap.org ) at 2014-03-14 23:26 EDT
Nmap scan report for 192.168.2.13
Host is up (0.00037s latency).
Not shown: 254 open|filtered protocols
PROTOCOL STATE SERVICE
1        open  icmp
6        open  tcp
MAC Address: 00:16:3E:53:E0:1B (Xensource)

Nmap done: 1 IP address (1 host up) scanned in 17.72 seconds

Hee hee hee.

Finding Kitten

Robot Finds Kitten

Sometime way back in the past, a human who wanted me to feel joy introduced me to Robot Finds Kitten, a Zen simulation which is pretty close to exactly what it says on the tin. There are already quite a lot of ports of the original POSIX implementation, but none of them were written in Elm. Obviously this is a problem that needs fixing.

Before I get into the gory details of learning Elm via robots, I should tell you that my implementation is available for free play (edit: sorry, this has bitrotted too much to be included anymore), and you can also go look at the source code.

Elm

I got a really wonderful introduction to Elm when Evan Czaplicki came to Hacker School in our second week. We got a slightly adapted version of this talk from StrangeLoop 2013, which moved me to make a browser game (something I’ve never wanted to do at any previous point in life). The language seemed elegant and expressive, for lack of less cliched words, and I thought it might be relatively simple to make a succinct Robot Finds Kitten clone.

Early Thoughts on Hacker School

I got my acceptance notification for the winter 2014 batch of Hacker School on January 3rd, six weeks ago. Right after being accepted, I wrote a bit in the same directory where I’d saved my application answers:

Secret Project Glow Cloud (Embroidery)

All of the stitches in the wearable circuit elements of Secret Project Glow Cloud were simple running stitches, which I tried to keep as consistent as possible. The real embroidery work for the Glow Cloud was concentrated in two decorative elements: the Welcome to Night Vale logo in front of the light sensor, and the cloud design in front of the light circuit.

Secret Project Glow Cloud (Electronics)

The author wearing a T-shirt with a glowing cloud design

Glow Selfie

A few months ago I ordered this Glow Gloud T-shirt, one of the first pieces of merchandise available promoting Welcome to Night Vale. A lot of other people love Welcome to Night Vale, and so the shirts were massively oversold for their first printing; as a result, I wasn’t sure when I was going to get my shirt. With a determination born of despondency, I turned to a big box of stuff I had ordered from Adafruit and a pile of fabric, and I said “Okay, I’ll make my own T-shirt. With glowy bits! And I’ll bet I can get it done before this T-shirt everyone else is going to have arrives!”

Four months later (and about three and a half months after the mass-produced T-shirt arrived), I wore my shirt for the first time. Here’s how I made it.