bryantrobbins / qgrid

A Vagrant-backed Selenium Grid with support for Windows nodes
Apache License 2.0
5 stars 0 forks source link

Script creation of Windows box #2

Open bryantrobbins opened 9 years ago

bryantrobbins commented 9 years ago

Right now, we are using a handcrafted Windows box for the Grid. We are likely not authorized to distribute this box, even though it was built from completely legal images (VMs from modern.ie and freely available software like Cygwin, Cygwin packages, and fart.exe).

What we need is a way to build this box from scratch for Vagrant. Packer (http://packer.io) should enable us to do this.

bryantrobbins commented 9 years ago

First, I'll attempt to do this with the VirtualBox OVF builder from Packer: http://www.packer.io/docs/builders/virtualbox-ovf.html

And the Vagrant post-processor: http://www.packer.io/intro/getting-started/vagrant.html

bryantrobbins commented 9 years ago

The steps here will probably be: 1) Download Virtualbox VM in platform-specific parts 2) Build OVF 3) Use Packer builder to provision 4) Use Packer post-processor to convert to Vagrant

This brings up the question of what we want the user experience to be. The strange thing is that an OVF should be portable (and not platform-specific) but the stupid dividing-into-parts messes things up.

Maybe we should have a Linux VM in which we download and assemble the OVF and save to local. This would allow us to not care about the type of downloads, and the new sequence is:

1) Provision downloader VM from public Vagrant Ubuntu box. 2) Download Linux VirtualBox parts to downloader VM. 3) Run executable within downloader VM to build OVF. 4) Save OVF back to host OS via shared folder. 5) Build our Selenium-specific slave node from existing OVF using Packer builder. 6) Convert to Vagrant format using Packer post-processor.

This is about to get really interesting!

bryantrobbins commented 9 years ago

One problem I am running into is that Packer will have no way of communicating with the box for provisioning purposes until Cygwin and SSH are installed.

One possible workaround: There are Vagrant boxes of the Microsoft VMs also. We could use these instead, and try to use Vagrant's WinRM support to install Cygwin and SSH. Then we could export the box back to OVA and pick up from Packer. This feels like an incredible hack.