Overview

While working at Intel, I was part of an Android tablet project for a large UK retailer. As part of this, we worked on building versions of the Android Operating System with custom patches. The turnaround for the whole build process was around 40 minutes, which at times was extremely unforgiving. Therefore, I was tasked with setting up a server internally that would allow us to build Android much more quickly.

I used Docker to set up isolated environments which would contain all necessary dependencies for the version of Android needed for different Intel devices, to ensure easy setup of environments in the future.

I found that when initially running Docker instances, I would have to enter a long command such as docker run -v /path/to/volume:/android -ti kk-intel-444 /bin/bash in order to spin up and connect, which got very tiresome, and was not very user friendly to other users on my team. Therefore, I set up a login system, pictured, which would list the images available, and run all of the required plumbing to set up the user with their Docker image.

However, an issue with this was that multiple users could then log in to two separate containers, and try to write to the same source folder, without knowing another user was using it. Therefore, I set up integration with Tmux via the Python bindings to programatically check existence of, create, or connect to different Tmux sessions. This then prevented accidental overwriting of key files, and the headaches it would no doubt cause.

I also added a wrapper script to map the make command with an email script, allowing the user who had set the build off to be notified as soon as the build was finished, as these builds take up to 40 minutes.

The server was also set up with Samba, which had shares for each Docker image type, providing an easy way in which to get access to the final zip file which could then be flashed onto a device.

Overall, this setup was so impressive for the company behind the tablet project that they then took upon the Docker setup, as well as took parts of the infrastructure such as Samba.

Tech Stack

This project was built using the following technologies:

  • Docker: A platform for containerising and distributing applications.
  • Python: A high-level, general-purpose programming language with emphasis on readability.
  • Exim: A message transfer agent backend, which provides the ability to send and receive emails.
  • Samba: A free software server to provide Active Directory integrated file-sharing for Linux.
  • Tmux: A terminal multiplexer to allow switching between different applications within a single terminal window.