OpenSolaris IPS Packages for GlassFish V2:

Introduction:

This document briefly describes about OpenSolaris Image Packaging System (IPS), a new generation of packaging system that will be used for the OpenSolaris Binary Distribution (project Indiana) and how to create GlassFish V2 IPS packages.

OpenSolaris project: http://opensolaris.org/os/ is the an open source community around OpenSolaris technology.
IPS stands for image packaging system. Also known as pkg(5), the image packaging system, is an attempt to design and implement a software delivery system with interaction with a network repository as its primary design goal. Other key ideas are: safe execution for zones and other installation contexts, use of ZFS for efficiency and rollback, preventing the introduction of incorrect or incomplete packages, and efficient use of bandwidth.

GlassFish V2 product has platform specific native packages to deliver in JES 5 U1 IFR. SVR4 packages are created for Solaris platform. Currently we publish SVR4 packages into IPS network repository, so users can install it using pkg retrieval client.

Details:

Here are the detailed steps for trying out the IPS repository and packages for GlassFish V2

  1. Start an IPS repository
  2. Publish packages to that repository
  3. Install packages from that repository
  4. Publish an update to the repository
  5. Uninstall IPS packages

Pre-requisite:

You will need the following IPS Tools:

pkg.depotd: The IPS package repository server (This utility is located on opensolaris at /usr/lib/pkg.depotd)

pkg: The command used by users to install/update/inventory packages

pkgsend: The command used by package developers to publish packages to the IPS repository (pkg.depotd)

You can install OpenSolaris, Indiana distribution on your solaris platform. If you install opensolaris, you have all the required files to try out IPS steps above. If you want to try out on your existing system, you must have access to an IPS build for your platform. You can get a demo IPS build from: http://wiki.updatecenter.java.net/Wiki.jsp?page=MultiPlatformIPSPrototype

These steps should work on any system that has the IPS tools installed. It has been tested on Solaris 10u4 (sparc/x86), Ubuntu 7.04, Windows 2000
and Windows XP. Python 2.4 is required to run IPS.

Start <a name="start">IPS</a> Repository

The IPS repository stores IPS packages and makes them available to clients for installation. Before performing this demo you must start the
IPS repository and load it with packages.

  1. Decide where you want the repository data to live. In this example: we use /export/IPS/repo.
  2. Start pkg.depotd (you may be any user):

$ PKG_REPO=/export/IPS/repo

$ pkg.depotd

By default pkg.depotd listens on port 10000. At this point the repository server is up and running and ready to accept packages.

Publish <a name="publish">Packages </a>

After the repository is up and running you need to publish IPS packages to the repository. This is performed by executing pkgsend commands to
upload files to the repository.

For publishing GlassFish V2 UR1 packages, following commands are run from the produced SVR4 packages:

$ pkgsend -s http://localhost:10000 send SUNWasu

$ pkgsend -s http://localhost:10000 send SUNWasac

After the packages are published you can point your browser at the repository and browser it's contents by pointing your browser at:

http://hostname:10000

To test GlassFish V2, we have published following JDK6, JavaDB, MQ and GlassFish V2 SVR 4 packages into IPS repository.

Install <a name="install">Packages</a>

Once the repository is up and running you can install packages on a client. First you need to create an "image" for the packages to install into:

  • For opensolaris, you may not need to create a image. But for other OSs, create the user image to install the packages into:

$ pkg image-create -U -a sun.com=http://localhost:10000 $HOME/glassfish

Replace "localhost" with the name of the system you are running pkg.depotd on. If you are doing all this on the same system then you can leave it as "localhost". The "-a" option is what ties the image to the repository that should be used for subsequent pkg commands.

  • Go into the user image you just created and do an inventory of what is available in the repository:

$ cd $HOME/glassfish

$ pkg status -a |grep SUNWas

FMRI STATE UFIX

pkg://glassfishv2/SUNWasac@0-1 known ----

pkg://glassfishv2/SUNWasac@0-1 known ----

pkg://glassfishv2/SUNWascmn@0-1 known ----

. . .

Note that you just need to 'cd' into the user image and all subsequent pkg commands will operate on the image you are in.

  • Install GlassFish V2 packages one-by-one

$ pkg install pkg://glassfishv2/SUNWasac

DOWNLOAD PKGS FILES XFER (MB)

Completed 1/1 7/7 4.11/4.11

PHASE ACTIONS

Install Phase 15/15

  • Show status of packages now that they are installed

$ pkg status -a |grep SUNWas

FMRI STATE UFIX

pkg://glassfishv2/SUNWasac@0-1 installed ----

. . .

Note the STATE is now installed.

Update <a name="update">IPS</a> Package

You have new updated files in the package, so you can create the package, and publish it again in IPS repository using "pkgsend" command.

Once you publish it, lets see if update is available.

Back in the install image:

$ pkg refresh

$ pkg status -a

FMRI STATE UFIX

pkg://glassfishv2/SUNWasac@0-2 known ----

pkg://glassfishv2/SUNWasac@0-1 installed u---

. . .

Note that you have version 0-1 installed in your image, and it is upgradable to 0-2

Now let's install updated package.

$ pkg install pkg://glassfishv2/SUNWasac

Note this returns almost immediately since only the one file is downloaded from the repository (not the entire package).

Show update is now installed

$ pkg status -a

FMRI STATE UFIX

pkg://glassfishv2/SUNWasac@0-1 known u---

pkg://glassfishv2/SUNWasac@0-2 installed ----

. . .

Uninstall <a name="uninstall">IPS </a> Package

You can uninstall IPS packages using following uninstall command:

$ pkg uninstall SUNWasac

PHASE ACTIONS

Removal Phase 15/15

Re-setting the Repository

To repeat the steps from scratch you may want to reset the repository:

  1. Stop pkg.depotd (^C if you ran it in the foreground).
  2. Remove the repository directory:

$ rm -rf $PKG_REPO

You can now restart pkg.depotd and run the whole process again.