Building Vagrant Boxes with VeeWee on TravisCI

by on December 5, 2012 1:21 pm

(Pro Tip: you can safely skip the first 3 paragraphs)

We’ve all been there: You push some .travis.yml commits and your clone gets parachuted into VM Land – only to find that things don’t go quite as expected. As the credits roll, you can’t help but feel a little anger towards your clone. How could it just blindly follow the script when things went wrong and not even try to improvise or troubleshoot? You wonder – how can I get a Pastrana-level of confidence before I push that clone out the door?

How can I run the Travis box locally, before I push my commits? (Let’s pretend I didn’t just spend days investigating this and then just now find a blog entry from 3 months ago which had a more polished solution for most of this topic and then I had to switch gears at the last minute and only cover an obscure corner of the topic, mmmkay? Embarrassed but undeterred, I move forward…)

We will continue by reviewing the original problem I faced that drove me to explore running a Travis box locally. You will probably never run across the problem. But hey – at least it’s unlikely that someone has already blogged about this topic!

The Goal: I wanted to build Vagrant boxes with VeeWee on TravisCI.

Q: Why run VeeWee on Travis? A: The transparency offered by Travis would allow people to trust the published binaries. The binary boxes would be published by Travis at the end of the build to the GitHub repo’s “download” section.

So, I started by proving out that I could run VirtualBox inside Travis - https://travis-ci.org/veewee-community/travis-vagrant-up/builds/3427898/#L293 (compare the before/after directory listings).

Encouraged, I continued.

I added VeeWee to the mix, and ran into this:

It kept sticking on the “Starting a webserver :7122″ line until the Travis time limit kicked in and stopped the build. Either the step was legitimately taking too long or there was some kind of error that didn’t show up in the log. What was the build trying to tell me? I needed to get inside the box’s head. But wait, the box had no head – it was headless.

Lending Travis a helping head:

I needed to run Travis locally and see what might be trying to pop up on the GUI. So, I started by upping this Vagrantfile:

(coffee break: that Vagrant box download is over 3 gig)

After studying Travis’ GUI testing documentation, I SSHed-in to my newly upped box and ran some stuff to enable a virtual X session and publish it over VNC. I also enabled a applet-based browser-view of the VNC session:

Then, I started running the commands from my .travis.yml file:

Once I ran the “veewee vbox build” command, it just sat there. I browsed to the virtual X session in my browser and watched to see what popped up. Ah, finally I was getting somewhere:

vbox-warning

I spun my wheels for a while thinking I needed to fork VeeWee and suppress the warning to continue the build process, but ran into a snag revealed by the VirtualBox code:

Translation: no “pcszAutoConfirmId” means no way to suppress! Actually, it didn’t matter that I couldn’t suppress the message because the VM really couldn’t have run anyways – here’s what happens if I actually select “continue” to proceed past that dialogue:

it_refuses

I was so dumb because when I first did the proof-of-concept for running VirtualBox in Travis, Vagrant upped a 32-bit box, and now I was trying to create a 64-bit box. Well, the Travis box is 32-bit (for now) and VirtualBox has decided not to offer nested VT. (Nested VT, afaik, would allow the 64-bit inside 32-bit scenario) Bummer.

So, I changed the VeeWee template choice to request a 32-bit box… Hoorah! After 65 minutes the Vagrant box was all built. But when I ran it in the actual Travis service instead of locally, this is what I saw:

Oh well, it timed out! But at least it got past the earlier snag and would have built given enough time. I’m not complaining though, I can completely understand the reasoning behind the time limits Travis enforces. A 65 minute build on a free Travis account type is a burden on the other people trying to build stuff.

So, that’s where I got stuck. I’m just glad I didn’t actually promise you a real solution, in which case you might have been angry at me. Thanks.

– Luke Patterson, asktheteam@keyholesoftware.com

  • Share:

Leave a Reply

Things Twitter is Talking About
  • code smell: dev practices that leave a stench of inexperience. Avoid it in method implementation with these tips - http://t.co/b7A884BnXb
    April 23, 2014 at 9:20 PM
  • Tech Night is now! Mark D is presenting to the group on #Grunt 101. Good technology talk, food & team makes for a fantastic night.
    April 23, 2014 at 5:10 PM
  • Single Page Application architectures allow for rich, responsive UIs. #JavaScript is a must-know for SPA - http://t.co/6sfk3kt1k3 #tutorial
    April 23, 2014 at 2:15 PM
  • Vacuole #Encapsulation aims to minimize the code necessary for routinely verbose data tasks -http://t.co/fJQzz731rZ
    April 23, 2014 at 9:45 AM
  • DYK? We translate our hands-on experience to custom courses to train your dev teams. Our new course on #AngularJS: http://t.co/Bf3UuClj4Z
    April 23, 2014 at 8:45 AM
  • Interested in #Backbone & #Marionette but not sure where to start? Check out the Marionette-Require-Boilerplate: http://t.co/XDj43BwSS3 #SPA
    April 22, 2014 at 4:50 PM
  • Responsive Design can help in giving your users a consistent app experience across devices. Quick tutorial - http://t.co/BDrT5LvgRo
    April 22, 2014 at 2:31 PM
  • Tips & tricks to save time in the #Eclipse IDE - http://t.co/uGgCkchwNk (keystroke combos, navigation, time tracking & more)
    April 22, 2014 at 8:40 AM
  • Join us! Looking to add to our team a developer w/ advanced #JavaScript & #NodeJS exp (& love of tech variety). Info: http://t.co/cC9CU1RCF9
    April 21, 2014 at 7:35 PM
  • Looking into #ExtJS but don't know where to start? Check out our video tutorial series to find your way around - http://t.co/XFYDT6YNWA
    April 21, 2014 at 4:35 PM
  • We've been tinkering with JS library Famo.us since its public release 4/10. What we've learned so far via a POC app - http://t.co/S77TSKHDKd
    April 21, 2014 at 2:03 PM
  • RT @CompSciFact: Rivest, Shamir, and Adleman published the RSA public key cryptography algorithm in 1978.
    April 21, 2014 at 11:13 AM
  • DYK? When we share/RT/blog/etc, it doesn't mean that Keyhole endorses it - we just like variety of opinions! Info: http://t.co/MXhB9lE9tV
    April 19, 2014 at 3:01 PM
  • A huge welcome to Justin Graber who joined the Keyhole team this week!
    April 18, 2014 at 3:25 PM
  • Pssst... @kc_dc early bird pricing ends on Sunday. Shoot us a note if you want to save 10% off of your ticket with our sponsor promo code!
    April 18, 2014 at 2:49 PM
  • Join our team! Looking for a developer w/ advanced #JavaScript & #NodeJS experience (& love of tech variety). Info: http://t.co/cC9CU1RCF9
    April 18, 2014 at 11:21 AM
  • .@befamous has huge potential to make HTML5/JS/CSS web pages feel as native apps. Here's our inital tech takeaways - http://t.co/S77TSKHDKd
    April 18, 2014 at 9:50 AM
  • Why to use AngularUI Router instead of ngRoute - http://t.co/tBnj5ZCkOw
    April 17, 2014 at 7:55 PM
  • RT @joemccann: Total Number of GitHub Repositories by Programming Language http://t.co/30cekDsE4s
    April 17, 2014 at 4:25 PM
  • JSF + AngularJS = AngularFaces? http://t.co/mXvOTwVbb6 // Interesting insight. Thoughts?
    April 17, 2014 at 3:45 PM
Keyhole Software
8900 State Line Road, Suite 455
Leawood, KS 66206
ph: 877-521-7769
© 2013 Keyhole Software, LLC. All rights reserved.