Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 294344

Application packages - How are you doing it?

$
0
0

I woke a couple of days ago, and decided I wanted to make a virtual appliance.  Found the cool tool provided by VMware called Studio, and after installing it on my instance of Workstation 8 and looking it over, I thought..."Hmm.  This looks simple enough", and then I started down the long path of application packaging.  I'm not sure I'm doing things right, but I've tackled it from several angles.

 

First

 

I added the TAR's for Apache2, PHP5, and MySQL to the default application repository.  Come to find out it's not that simple.  Installed doesn't mean "installed".  I guess I had a Windows moment.  Things still needed compiling, and none of the tools are available by default.

 

Second:

 

I downloaded the Eclipse plug-in in my instance of Aptana 3, and found a good tutorial online on how to package the application I was interested in virtualizing.  It described how to reference the dependancies and all, and figured it would make things way easier.  No go.

 

Third:

 

I decided the include the applications dependencies (PHP, Apache, and MySQL), and those applications dependencies from the OS install media.  Making sure I got all the dependies was not very fun, but even then, still no go.

 

Fourth:

 

I just created a basic virtual appliance, and used a boot script to install all the applications dependencies with apt-get, compile my app against it, configure, and clean up.  This is definitely not ideal as a virtual appliance, but it gets the end result without much input.  A MySQL password is prompted for twice during the initial boot to change the root, and then to log in for the applications SQL script run.

 

I know I'm missing something.  I gather I can compile all the required apps (make/make install from source, and TAR the /usr/local directories of all the apps), and use the Eclipse plug-in to actually install the various components to their appropriate locations by configuring it under the Files tab (including startup scripts at boot).  Then I can run an initial boot script to aid in the custom and OS specific configurations.  I'm sure there are better ways.

 

How is everyone else handling this.

 

 

UPDATE:

 

So here's a simple step-by-step on what I belive to be a good virtual appliance build:

 

1. Download OS ISO

     * In my case Ubuntu 10.04.3 (This required me to get updated VMware Tools packages)

     * Created a new template for 10.04.3 with the new VMware Tools packages

2. Created a vanilla profile in VMware Studio

3. Using apt-get --download-only --yes install lamp-server^ I download the packages for Apache, MySQL, and PHP

4. Created a project in Aptana called lamp-server and sourced the directory containing the packages I previously downloaded

     * I had to determine the order these packages should be installed to ensure there were no dependency issues, and placed the ones that needed to be installed first into a directory labeled "installfirst"

5. Compiled the app, and created another project for it with the appropriate file structure, and a post-install script to make specific files executable and create the appropriate symbolic links.

6. Created a First Boot Script to install all the packages in the appropriate order, configure and populate the MySQL database with a custom root password provided by the user, and restart a couple of services.

 

This gives me an appliance that anyone can download, and get working even without internet access.  There is only one prompt during the initial boot to change the root password.  I assume now I can make changes to the application and increment the package version to advertise an update, and do the same for the dependencies package which can be updated without forcing an update to the application package.

 

UPDATE 2:

 

Ok, I can't seem to leave well enough alone.  I've streamlined the above a little, in a sense.

 

1. Same as above

2. Same as above

3. Same as above except I downloaded each dependency individually the application nees to run (ie. Apache, MySQL, and PHP)

3. Created an individual project for each dependency, and an individual repository for those applications dependencies.

     * It appears the packages have to be named exactly what they would be if using apt-get to perform the install in order for them to be installed during the VM build process (eg. apache2, mysql-server, etc.)

     * A separate repository is only needed to place dependencies in front of packages that require them (eg. mysql-server dependencies are placed in a repository that is higher on the list of application repositories in the VM profile)

5. Same as above

6. Same as above except all that is needed now is to change the root password for security purposes


Viewing all articles
Browse latest Browse all 294344

Trending Articles