Shared Ptr Pooling

Posted on 25 Sep 2013


At Navetas we're enjoying great success using the new features in C++11. Lambda's are probably the office favourite but range based loops, initializer lists, auto and the rest are being brought to bear to write high performance C++ that reads like Scala.

We do a lot of data processing, crunching through data structures filled with electrical measurements, and we've found that the Scala Collections API leads to beautiful, elegant code. We want the same but faster, so we have put together and released the Escalator library to bring the spirit of the Scala Collections API to C++.

It's early days yet but we're already using the Escalator library in our main product codebase to great effect. Here's an example:

You can also lift mutable collections, infinite streams and collections of non-copyables. The API isn't fixed yet but we're definitely open to pull requests!

It's been great fun, and a real learning experience, working on this with Alex Wilson. Thanks Alex!

Posted on 14 Jul 2013

GitHub on KVM

GitHub Enterprise is a version of GitHub that you can run locally on a company network. It comes as a virtual machine image in Open Virtualization Format and GitHub support it running on the VirtualBox and VMWare hypervisors. At Navetas we use the KVM hypervisor so I have recently been looking at how to convert the GitHub Enterprise VM image to run under KVM.

  1. Download the GitHub Enterprise VM Image in Open Virtualization Archive (.ova) format.
  2. Extract the contents of the archive with:
     tar -xf github-enterprise-11.10.270-i386.ova
    This will give you a set of files:
    • github-enterprise-11.10.270-i386-disk1.vmdk - The disk image
    • github-enterprise-11.10.270-i386.ovf - An XML description of the virtual machine
    • - Hashes of the other two files
  3. Install VMWare Workstation to get the vmware-vdiskmanager tool.
  4. Convert the GitHub disk image to use a preallocated virtual disk (watch out - this file will be 10GB!):
     vmware-vdiskmanager -r github-enterprise-11.10.270-i386-disk1.vmdk -t 2 github-enterprise-11.10.270-i386-disk1-preallocated.vmdk
  5. Convert the preallocated VMWare disk image to qcow2 format with qemu-img:
     qemu-img convert -O qcow2 github-enterprise-11.10.270-i386-disk1-preallocated-flat.vmdk github-enterprise-11.10.270-i386-disk1-preallocated-flat.qcow2
  6. You can now create a KVM virtual machine using the generated qcow2 disk image as a boot disk!

It's worth noting that GitHub do not support running GitHub Enterprise under the KVM hypervisor.

Expanding Disk Image (added 2012/07/20)

The disk image can also be converted to RAW format with qemu-img, and then written directly to an LVM volume (using dd), then the virtual machine can boot off that. If more space is required in the GitHub machine then you can:

  1. Copy the 10GB RAW image into a Volume Group that is bigger - say 100GB
  2. Boot up GitHub & log in with SSH
  3. Run ghe-grow-root -d /dev/vda6

This should make GitHub use all the available disk space.

Posted on 06 Jul 2012
With thanks to