Skip to content

Instantly share code, notes, and snippets.

@Azolo
Created May 24, 2012 17:46
Show Gist options
  • Save Azolo/2783045 to your computer and use it in GitHub Desktop.
Save Azolo/2783045 to your computer and use it in GitHub Desktop.
Travis-CI on Windows stuff

Travis CI on Windows (Box Building)

Why not use Vagrant?

  • Bare Box takes 20 minutes to Build
  • While licensing itself is not an issue, activation is
    • Boxes would require maintiance every 30 days and rebuilding every 120 days
  • No easy remote commands
    • ssh is through cygwin and cygwin doesn't present a clean environment
    • winrm is a HUGE PAIN if you're not on an Active Directory Domain
  • Bare Box is HUGE (7 gigs with nothing installed)
  • Box building isn't possible with VeeWee (no ssh)
    • Unattended Windows Installation is pretty good (this might be worth looking into)

Windows Azure Worker Role (PaaS)

Advangtages

  • On demand VMs
  • No building Boxes
  • Windows "like" environment

Disadvantages

  • Only Windows Server 2008
    • Not a big deal
  • Windows "like" environment
  • Built for static applications
  • Hard to install applications
  • Not a lot of documentation on tasks Travis-CI would need to perform

What do you mean Windows "like" environment"?

The environment itself looks, acts, and actually is a Windows environment, just not a Windows environment setup like I would expect on a normal Windows Box. (In other words, I don't know how to make things work)

After the Meet Windows Azure event, it was announced that the VM Role would become much more of a IaaS product.

Advantages

  • Microsoft provides bare Windows Server 2008 (and 2012) boxes
    • Plus some supported Linux distros
    • No HUGE box uploads (seriously this is awesome)
  • Boxes are persisted! (IaaS)
    • Also, boxes state can be saved as an windows image (sysprep) for other boxes
  • Custom Tailored Windows boxes

Disadvantages

  • Still not easy to remote into
    • However, can join a Active Directory during VM provisioning
      • Setup and maintenance would require some knowledge into Microsoft technologies
  • Currently a lot of the VM management is handled by Vagrant, that wouldn't be possible in this situation
    • knife-azure looks promising, but many of the Windows machine configuration options don't appear to be present

I'm focusing on my efforts VM Role

So, What Now?

Well, here's the deal. I haven't set the time aside to figure out how to put this altogether.

  • A lot of the functionality in Travis-Worker isn't designed for this type of environment
  • chef recipes need to be added for Windows
    • Likewise we need to figure out how to script box setup
  • Need to figure out how to correctly setup the Active Directory Domain Services
    • This is crucial for remote commands *
    • The Active Directory Domain Controller would likely be the system that run Travis-Worker as well
  • Use Virtual Networks to allow machines to communicate
    • Maybe not necessary
      • I understand networking well enough that it actually makes it easier
      • Other people may not

I'll try to keep this updated the more I find out.

[ * ] Ok, maybe not crucial for remote commands. However, crucial for my sanity and overall well being.

Also I suck at markdown

@Azolo
Copy link
Author

Azolo commented May 24, 2012

@luislavena I don't think that any changes will need to be made to RubyInstaller since it can be silently installed and DevKit installation can be scripted.

But I would Imagine that would be done with Chef, which leads to the greater question how to get that going?
I don't know how you would script things after that (maybe more answer files?), but since Azure supports vhd differencing disks changes wouldn't be a huge upload (I hope).

Either way, the windows VeeWee template does some installation of programs automagically, I want to look more into how that works.

Too bad winrm still hates me.

@luislavena
Copy link

@Azolo what about deploy a remote agent inside the VM/machine that connects with Travis?

I thinking spawning a child process from this agent and strip permissions so can't elevate or do things outside a sandboxed environment.

Since we can tweak the ENV given to a child process, changing PATH or other environment variables is possible, for example, to mimic rvm.

A compiler toolchain (like MinGW) can be provided easily too, also Git.

I'm not familiar with all the Travis platform to comment more on how to connect things (or the isolation part given by the VMs), just sharing my thoughts 👅

@Azolo
Copy link
Author

Azolo commented Jul 15, 2012

@luislavena Here's a pretty good run down on the basics of a Travis build.

I think that would require a pretty big architecture change in Travis Worker and the way it works.
Basically the way it works right now, from what I understand, is

  1. Travis-Worker will start a VM from a pre-built image
  2. ssh into that VM and run the tests
  3. VM reports tests results to Travis Worker
  4. Travis Worker reports the test results to Travis Hub

I have some thoughts from what I have tried to do. I'll try to share them tomorrow when I'm not sleepy

@activescott
Copy link

I've seen issue #216 (travis-ci/travis-ci#216) , but I still can't figure out the status of windows+travis. What's the latest?

@sundhaug92
Copy link

Could Windows containers/Hyper-V containers be a solution for this? That'd support Windows Server 2016 (which is essentially Windows 10, either core or nano)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment