This Hackday at DiUS was based around our Special Interest Groups (SIGs), each of which focus on one area of research and hold regular meetings, talks and presentations. Each of the SIGs ran their own Hack Day project, within the theme of education, particularly STEM Science, Technology, Engineering, Maths) based classes, courses, and careers. We started with breakfast, and a kickoff, then divided into SIG groups, to decide what we wanted to do.
Daryl Wilding-McBride, our CTO, briefing us at breakfast.
All things Cloud Computing
I’m a member of a number of SIGs, but for Hack Day, I chose to work with the Cloud Computing SIG. In this, we look at all things cloud-based, mostly in AWS; EC2, Lambda, and deployment and infrastructure creation via CloudFormation, as well as Docker, and Fig, among other things. The challenge for us, was to make something that was related to both the Hack Day theme, and our primary interest of cloud computing.
We decided to create something based on Uplink, a 2001 game that simulates ‘hacking’, as seen in movies. You know the scene: the nerdy hacker frantically types into a command line, trying to get past a firewall, only to encounter a big, red, flashing screen saying “Access Restricted”. The hacker then cunningly gets around this security by typing ‘override’, and hitting enter with a flourish. Uplink is that scene, as a game. So, we decided to make our version and “creatively” named it: Downlink.
Ian and I at the beginning of the day.
We thought Downlink would be a good way to introduce kids to the power of the command-line and to some basic networking concepts. In Uplink, you dial into servers, looking for information. Our servers would actually be real servers. Each of them would be a separate Docker container, linked and orchestrated by Fig, running a tiny custom login shell, which we called DShell. The idea was that each level would introduce more complexity, starting with simple commands like ‘cd’, ‘ls’, and ‘cat’, on a minimal virtual file system, and working up to a full file-system, on a server running a real shell, like Bash or Z shell.
We didn’t want to introduce too much complexity all at once, but rather to take the classic game approach of building up complexity incrementally. This would, hopefully, allow kids to learn real commands, without overwhelming them at the start. We talked through the problem, and decided on our approach. We divided up into two small teams. The first team was to create the base Docker container, a couple of sample levels, and a minimal orchestration script. The second was to create an initial version of DShell.
In order to implement DShell, we chose Ruby, as it allowed us to develop quickly and we had a lot of experience with it. We created a Gem skeleton, using bundler, for ease of installation. We started off simple: build a small framework which would handle getting input, and routing to the correct command, leaving us able to focus separately on adding the actual commands via a DSL. By mid-morning, we had the skeleton of a command parser and router. It was time to add some commands. The first commands we needed would be simple: ‘cd’, ‘ls’, and ‘cat’ would give players the ability to navigate around the filesystem, to see the contents of directories and to read files. We added a simple ‘help’ system, which would list available commands and provide details on individual commands as well as a command history. We added Readline support, which allowed us to add simple tab-completion for the major commands. To be honest, this was mostly because I kept hitting tab and it didn’t work and it was driving me nuts.
We then added the command ‘ssh’, which would allow players to move the next level, by ssh-ing to the next server. As Fig exposes linkages via DNS, using the /etc/hosts file, going to level two was as simple as ‘ssh level2’. We also needed a username and password, which the user would discover on the file system on level one. We wanted the password to be visible while typing, so we made all ssh access password-less, private key only and built a simple login system into DShell. The login, as well as the list of allowed commands and the root of the virtual file system would all be controlled by a config file which DShell would load when starting up. We also provided a configurable message of the day, which we would use to provide hints to solving the problem on the level.
In parallel, the infrastructure team created a downlink Docker container, which would be used as the base container for all the levels. In the Dockerfile, we started with ubuntu:trusty. We added ruby and sshd support and exposed port 22 for ssh access. We then installed Dshell from the Gemfury repo and added the downlink user with their login shell set to the local Dshell executable.
Using this container as a base, we created two sample levels; level1 and level2. Our run script would bring up and link the levels using Fig. We added a simple puzzle to the filesystem of level1, which would tell you where to go next and the credentials you would need to access it. Suddenly, we had a game. Not a very good one(at least not yet), but a game that exposed some of the basic concepts of networking and the command line.
In keeping with the theme of the SIG, we used cloud-based solutions for pretty much every step of development. Code was stored on Github, built on Wercker, and we used Gemfury as a private gem server. It was even partially developed and tested on Nitrous, the cloud-based dev platform.
TA DA! The final showcase
The UX SIG looked at the work involved in providing a platform for teachers to put together lesson plans and content for the new digital technology curriculum being introduced in the near future. The Big Data SIG created a visualisation of data on a virtual 3-D globe, based on the theory that children understand maps much earlier than other forms of visualisation.
All of us had a great time, worked with some interesting technologies, and, hopefully, made things that might one day help kids learn. I’d say Hack Day was a great success. I can’t wait for the next one.
Downlink and other DiUS Hackday projects are open source and are available on the DiUS GitHub repository at https://github.com/DiUS.