What is VMware ThinApp Factory (TAF)?
TAF is a tool that simplifies generation of VMware ThinApps to an extent that it can be configured to keep generating ThinApps by picking up installers from multiple sources, apply recipes to customize ThinApp creation and across different Operating Systems.
What's in ThinApp Factory?
TAF comprises of multiple components and some of the functional units are:
- ThinApp Converter: REST service that manages the lifecycle of ThinApp projects and their settings to modify, rebuild, etc. System configuration backend also lives here.
- VMware Workpool manager (Legacy) Library to automatically install Windows templates from ISO, clone, and lease out VMs needed for conversion.
- Datastore manager Handles management of internal and external datastores.
- Workpool & ManualMode Manager Workpool service with a REST API that manages the lifecycle of conversion VMs
- Manual mode (in manualmode/) REST service that, despite its name, does both automatic as well as manual captures.
- Admin UI (webui) The main web interface to ThinApp Factory
- ThinApp Store and client. Client application and browser plugin used to download and thinreg applications from the ThinApp Store
- TAF Appliance and initial setup.
On a Ubuntu system (we used 12.04 LTS), you need these prerequisites:
build-essential libsqlite3-0 curl libcurl3 samba samba-common-bin cifs-utils tomcat6 openjdk-6-jdk postgresql-9.1 python-dev python-migrate python-psycopg2 python-sqlalchemy python-setuptools postgresql-server-dev-9.1 wine zip maven2 mingw-w64 mingw-w64-dev mingw-w64-tools
Running TAF requires the VIX SDK to be installed. You can download VIX from here.
You need a My VMware account to download and a EULA must be accepted. Once the installer is copied to your server, simply run it with:
(Note two things: your browser may download it as a text file, and that's OK -- you can still run sh on it. Second, VIX version 1.13.0 does not appear to work well with TAF.)
Assuming you have all the prerequisites, go into the source tree, type make and everything will be built for you. After editing
setup.cfg, you should then be able to
make setup as root. To refresh the Java webapps and Python eggs after the initial deploy, run
make deploy (also as root.)
The setup process deletes Tomcat's ROOT webapp and replaces it with TAF. It may be possible to run TAF in the future as a non-ROOT webapp, but we haven't had time to try that out yet. Keep this in mind if you have something important as a ROOT webapp.
Once you run the setup procedure, you should be able to hit Tomcat and get a TAF login screen. The default admin password is blank.
After deploying you are responsible for staging a ThinApp runtime here. Here are some tested versions we have used:
In the runtimes directory of your $install_dir (usually /var/lib/taf), create a directory named as the above (thinapp version-build number.) It should have the following files:
AppSync.exe boot_loader.exe Branding.dll CustomMsi.dll license.thinapp.4.0.e1.200805 os_exe.dat QualityAgent.exe QualityAgentPlugIn.dll runtime_res.dll sbmerge.exe scripting.dll snapshot.exe snapshot.ini template.msi templates/ thinreg.exe tlink.exe vftool.exe vregtool.exe logging.dll nt0_dll.dat nt0_dll64.dat
Once done, restart tomcat, then you should be able to see the runtime appear in TAF settings.
The 'tasks' view does not work, but conversions are fine.
When a conversion fails and you end up restarting Tomcat to unwedge it, the job may still appear to be in 'running' state forever. All running jobs should be set to 'failed' after the webapp restarts.
Incremental builds are dangerously nonfunctional. If you modify Java code a clean build is suggested.
The 'ThinApp store' does not work because of a missing setup.exe which is difficult to build at this time in an OSS environment. It requires proper code signing for its browser integration. OSS users will more likely be better served by designing a new delivery mechanism.
Is opensourcing complete?
The only part that is not currently open sourced is the ability to automatically provision a Windows work VM given an ISO file. Additionally, we require the 'vmrun' utility (part of the freeware VIX SDK) to interact with worker VMs.
You can use Eclipse / SpringSource Tool Suite(STS) / IntelliJ Idea. I used STS and here are some useful tips (The same can be used for Eclipse):
I was using STS Version: 2.6.1.RELEASE, (JUNO eclipse worked too). Configure eclipse: network, proxy, etc. Configure jvm params appropriately. (min-max: 0.25 - 1 GB)
(optional) Generate eclipse artifacts for TAF java projects:
mvn eclipse:eclipse, clean with
Plugins for working on scala, velocity, import maven projects, etc.
Remove some warnings on Eclipse by doing the following: Under Preferences > Maven > Warnings, check 2 checkboxes for
- "GroupId is duplicate of parent group",
- "Version is duplicate of parent version"
Import TAF maven projects into Eclipse
- In Eclipse, select "Import projects", and under maven, select "Maven generated projects"
- Browse to the thinapp_factory folder and select all projects.
- Click submit to finish.
m2eclipse, the classpath will point to the maven repo automatically.
- However, if
mvn eclipse:eclipseis used, the
.classpathfile contains references to
M2_REPO, and this will have to be set manually. See details here. Edit this in Preferences > Java > Build Path > Classpath Variables or:
mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
Test TAF WebUI in isolation
The webui Java module can be tested without the entire thinapp factory dependencies. The webui communicates with a backend service for datastores, workpools, conversion, etc. This can be simulated so the UI part of it can work in isolation. To do this, follow these steps:
appfactory\webui\src\resources\webui-local.properties. This file can be used to overwrite all the values in webui.properties.
- Overwrite the following entries:
Hibernate/datasource settings - Point webui to a local Postgres database:
my.datasource.username=taf-user my.datasource.password=taf-password my.datasource.url=jdbc:postgresql://localhost/appfactory my.hibernate.hbm2ddl=update
Set to debug mode:
Replace ThinApp factory service urls with local simulator url
cws.conversions_service_url = http://localhost:8080/webui/cws cws.service_url = http://localhost:8080/webui/cws datastore.service_url = http://localhost:8080/webui/ds workpool.service_url = http://localhost:8080/mm/workpool
You can find all configuration values from the source file:
Test TAF WebUI with existing instance
You'll need to enable to CWS to accept foreign connections. Edit
appliance.iniin the converter source and change
host = 127.0.0.1to
host = 0.0.0.0. Rebuild the egg and deploy using
On your local Admin UI, go to the Settings > Configuration tab, and set the service URLs to:
NOTE: This step can be done on webui-local.properties as well.
SONAR for TAF
You can also hookup sonar to these java projects by using sonar-pom.xml. Just run
NOTE: Some of this config needs work before we can get this up and running.
Proxy for tomcat setup
If you use ninite.com feed or download from other external source, and you have a proxy, ensure the following properties are set.
proxySet=true proxyHost=proxy.your.company.com proxyPort=port
A TODO is to make this settable in setup.cfg.