Sales DemoImagine you have a Java web application that you deploy via a WAR file to a Tomcat server, and you want your sales staff to be able to demo that application from their laptops. The sales folks often times go onsite to customers offices, where they don't have internet access. What options are available for running these kinds of sales demos?
Option #1 - Run Web Server DirectlyOne way to solve this is for the sales staff to install Tomcat and Java on their laptops, and deploy the WAR file by hand. That can work, but if your sales staff aren't that technical, having them configure web servers isn't a good use of their time. Not to mention that if your application requires a database as a dependency, then they must also install a database server such as Postgres, and configure the security settings properly to allow the app to connect.
There's too many moving parts here for sales staff to configure a demo in this way. Clearly, we want to automate this process.
Scripting the setup is one way to go about this. This wouldn't be too bad, but what if you're sales staff use a mixture of Windows, Mac and Ubuntu? Maintaining those scripts for all the different environments would be a bit of work. But doable.
Option #2 - DockerA better approach would be to virtualize the sales demo. Docker is an option, but if there's a mix of different OSes, Docker might not be the best fit. Also, Docker is geared more towards developers than to sales folks, so Docker might be a bit much to expect sales folks to have running on their personal laptops.
Option #3 - VirtualBoxIf Docker isn't a viable option for the sales demo, there's always the traditional virtualization using products such as VirtualBox. VirtualBox makes setting up VMs very simple. Having sales folks install VirtualBox and Vagrant and run a single "vagrant up" command (perhaps wrapped with a simple start.bah or start.sh script) is pretty simple.
Configuring VagrantfileCreating of a Sales Demo with Vagrant is pretty simple. We'll need 4 files: Vagrantfile, configure.sh, tomcat7, and SalesDemo.war.
After installing VirtualBox and Vagrant on your machine, create a folder to contain these 4 files, say Sales-Demo.
To start the demo, run the command
from the Sales-Demo folder.
Once that finishes, open http://192.168.50.4:8080/ in your browser to access the demo.
Vagrantfile DetailsThe Vagrantfile shown above is pretty straightforward. It results in a VM in VirtualBox called Sales-Demo, and runs Ubuntu 16.04, Java 8, and Tomcat 7. The VM is using private networking so that sales folks don't have to open any ports on their computers, although it can easily be switched to port forward port 8080 so the demo could run at http://localhost:8080/ instead.
In the configure.sh script that configures the Ubuntu server, I've chosen to manually explode the WAR file, overwriting ROOT in the Tomcat7/webapps folder. This allows for easy customization of the demo via scripts, say if you need to update the web.xml file, configure connection strings, etc.
The tomcat7 file overwrites the default tomcat7 configuration in /etc/default/tomcat7, using Java 8, increases the max JVM heap to 1GB, and uses the G1 garbage collector. This allows for the JVM to be tuned to suit your needs.
Potential Issues With VirtualBox
If sales folks are installing VirtualBox and Vagrant on their own, they could run into issues if their computers do not have Hardware Virtualization enabled in the BIOS. For developers and technical folks, it's quite straight forward to enable this in the BIOS, but for the less technically inclined they might need a little help.
I've seen private networking cause grief for some people, and in those cases I switched from private networking to just using port forwarding.
Running sales demos on sales folks personal laptops is a challenge. Keeping the demos up to date, ensuring everything is configured properly, diagnosing issues are all challenges, and it really isn't a good use of sales folks time to be configuring demos.
But in the case where sales folks use the sales demo on-site where internet connection isn't available, then running sales demos on personal laptops is sometimes necessary. Virtualization ensures that all the sales folks have the demos configured in the same manner, and takes some of the pain away of having to configure web servers by hand.