Development infrastructure: Hosted Macs
12 Jan 2016
(by Tom Reynolds)
When you develop a cross-platform game like MegaGlest, while some cross-compiling tools exist, it is still much better if you at least have the opportunity to also build natively and - as important - test on the target platform.
One of the platforms MegaGlest compiles on is Mac OS X. However, so far we can only build there natively, which means we require an actual system running OS X. Now, unfortunately, and this hampers this platform as a whole, Apple makes it difficult to develop Open Source software on this platform. Probably not intentionally, but effectively. One things which makes it difficult to develop open source software on OS X is the license terms. Still in 2015, the only way you are allowed to run OS X is on Apple hardware.
Virtualization is allowed in some cases, but only when you run it on a computer you bought from Apple, and one running OS X as the host system. So effectively you can run OS X on Apple hardware, or in a VM which runs on OS X on Apple hardware. Unfortunately this hardware is quite expensive (and, from a plain technical point of view, overpriced), and this operating system is very not well suited as a small virtualization layer. Which is why you will hardly come across any affordable and well working OS X in the cloud offers - like there are for the other relevant operating systems. Also, when you have a need to test 3D graphics (such as we need to do for MegaGlest), you usually need to run it on bare metal to get acceptable performance. So even if there were affordable cloud hosting options, it would still not work for us.
So open source developers have to either buy and run a full Apple computer, or rent one. Either way, this means spending a lot of money just to be able to build and test for an extra platform which is not even the most relevant one. For anyone with a small budget, be it the average open source development team or an Indie developer who may or may not be able to get returns on their spendings, this effectively rules out OS X development. (Unless you already own the hardware for other reasons and can dual-use it - which is not the case for us.)
So we looked at several options to find a way to test MegaGlest on OS X, as affordable as possible but still allowing us to test the software on bare metal with proper OpenGL acceleration. The best option we could find is an offer by U.S. (Atlanta, GA) company MacStadium. Their most affordable offer today is a dedicated Mac Mini with an Intel i5-3210m (a 2-core, 4-thread CPU which can increase frequency up to 3.1 GHz) with 4GB DDR3 RAM. In their "PRO" plan (which is definitely sufficient for our needs, providing access to a 100 Mbit/s switch port) it costs $59/mo. While this is a very affordable dedicated server, this is still a lot of money for our project, which is why we are very happy that they support us.
Even without the support we kindly receive from MacStadium, I think this offer is worth a closer look, simply because it is a well-engineered solution, providing good support (24x7 remote hands and spare part replacement) at an affordable price. When we ordered we received full access to the working system within just a few hours. This means SSH access, but, more importantly on a Mac, MacStadium's offer includes an IRAPP license so you can also use graphical RDP and VNC access. (This is - by the time we ordered, please check with them to learn whether they still include IRAPP in their current offerings.)
Unfortunately these two options do not provide sufficient frame updates for us to test an OpenGL application (these protocols are simply not meant to be used for this purpose). In fact you would not be able to make use of OpenGL acceleration if it was not for MacStadium's 'GPU enabler', a small piece of hardware they plug into your Mac (free of cost) which enables you to use of hardware accelerated graphics remotely. You still need a software which can transport the OpenGL output to your local computer with speed. We have found that NoMachine NX works very well for this purpose, providing up to 30 frames per second while playing MegaGlest. This is just enough for testing and (proprietary) NoMachine NX can be used for free for this purpose. WinSwitch may be another option achieving the same as an open source software (using the XPRA protocol), but I have not yet gotten around to test it.
Now development on OS X is still not a lot of fun if you compare it to Linux or even Windows (using Visual Studio). But using the fine MacStadium Mac Mini server we have been able to make good progress on the OS X side. The game is now much more usable than it was initially when single community members built their own development builds and sometimes shared them. Now, for the most part thanks to MegaGlest developer Filux, we have real-time builds on OS X whenever we commit changes to Git. Once builds are complete, they are automatically transferred to http://snapshots.megaglest.org/mac for further testing by the wider community.
This is how we like to work. And this is what a dedicated Mac Mini server enables us to do. Using the Mac and upgrading it to the latest OS X version, we found that there can be issues where the Mac does not boot up to the point where you can remotely control it. This happens more or less regularly when we reboot - I suspect that it shows a message or login window which simply requires user interaction early in the boot process - a property of OS X, not an error on MacStadium's part. We could surely work this out with MacStadium support - just have not spent time on this so far. After all, there is an easy enough workaround. Thanks to MacStadium's simplified web panel we can easily trigger a remote reboot which will then happen within just a few minutes.
So altogether, based on the features provided, a good price-performance ratio and fast + friendly support, MacStadium's hosting is really recommendable.