Last week a Dutch site reliability engineer at Wehkamp Labs shared a way to combine Docker container management with the video game Half-Life 2. The labs created an exotic hybrid where applications are represented in the game-world as virtual people who all need defending from an attack of zombies.
“We’ve all heard about the incredible Chaos Monkey from Netflix, killing instances at scale. At Wehkamp, we have something similar to attack our microservices clusters: Half-Life2,” Wehkamp technical lead Harm Weites explained, in a blog post detailing the project.
Netflix’s Chaos Monkey intentionally attacks running instances to verify that load balancers and rebuilding processes are all running smoothly. The approach is somewhat similar to Wehkamp’s hack.
Basically, Wehkamp Labs offers a microservices platform called Blaze, and Blaze is built on Mesos and Marathon, which offers an API for making REST calls over HTTP. So writing some code in Lua, the lab researchers taught Half-Life 2 to fetch the names of all currently-running applications and their container counts. And that’s where the fun begins.
Using the “Garry’s Mod” version of Half-Life 2, each application gets represented as an in-world character — a chosen few of which are randomly armed with virtual crowbars.
And then the game starts spawning zombies…
When the development teams join the game, they each get a group of container-representing characters to defend against zombies. Lots of zombies. “Because we’re wrapped inside a big _while(forever)_ loop…you’ll get a new free zombie every 5 seconds!” Weites wrote. (Cheat sheet: Judging from the source code, the purple team gets the game’s RPG — the rocket-propelled grenade launcher).
When one of your characters dies, so does one of your containers, thanks to an HTTP call. This death inevitably triggers the deployment of fresh containers on the platform — which of course means a new container-representing character will suddenly appear in the game.
Weites calls it “A fun way of interacting with API’s and testing resiliency of our platform.”
Wehkamp Labs is sharing their code on GitHub — the readme file describes it as “managing your Mesos platform with style!” — and it’s surprising how simple it is. Just copy two files into the appropriate directory, launch the game, and then paste in two additional parameters into the console. “Remember, after loading this everything will start moving – so watch out ;)”
Of course, it’s not the first time geeks have combined systems management and video games. There’s the 2001 project that used the game Doom as an interface for process management. There are also projects that use Minecraft to visualize Docker containers and Kubernetes pods. The code for both are available on GitHub — and both use a plugin which was also written using Lua.
Who says that visualizing your data can’t be fun?
- Rap group singing about credit card fraud gets indicted — for credit card fraud.
- Code school decides Little Rock, Arkansas isn’t the best fit.
- User perceptions of a password’s security don’t always match the reality.
- Q&A with a Google robot-car tester.
- At least one Tesla driver is already asleep at the wheel.
- Microsoft says it can recognize undiagnosed cancer sufferers by their Bing queries.
- Vice President Biden unveils a massive public database for cancer research.
- The U.S. could save $200 billion a year by abandoning cash.
- Google’s Magenta AI tries to make art.
- “A computer tried (and failed) to write this article.”
- Tesla says its Model X did not accelerate by itself.
- When happens when your neural network watches Blade Runner?
Docker is a sponsor of The New Stack.
The New Stack is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: Docker.