Packaging Liberty profile resources

Liberty profile resources can be packaged into one or more compressed (.zip) files for deployment by the WAS Network Deployment v8.5 job manager. The grouping of the resources within the compressed files affects the scope and sharing of the resources. For resources in the compressed files to deploy correctly, the path names of the resources must satisfy job manager rules.

"Packaging a Liberty profile server from the command prompt" describes how to run the package command to create a compressed file containing a Liberty profile runtime, files in the shared resources directory, one embedded server, and any applications embedded in the server. To deploy a Liberty profile installation of this type and we do not need to place the installation in a project directory, consider using the package command to create the compressed file. For other types of Liberty profile installations, you must manually create one or more compressed files.

Supported Liberty profile resource types include project, runtime, Liberty server, application binary, and SDK. For more information, read "Liberty profile resources."

The job manager distinguishes between the different types of Liberty profile resources in a compressed file using the following rules:

The job manager uses the directory name of a resource in the compressed file as its resource name. For example, if the directory name for the Liberty runtime is 08.05.00.00, then its resource name is 08.05.00.00, and its resource ID is runtime/08.05.00.00. When naming resources, consider the following guidelines:

Determine the type of Liberty profile installation that we need, and then create one or more compressed (.zip) files containing Liberty profile resources.


Example

The following examples illustrate the structure of Liberty profile resources for different deployment scenarios:

Example 1: Self-contained Liberty profile installation

This example first illustrates how to package a self-contained Liberty profile installation for deployment to one or more server hosts. It then illustrates how to package a new version of a server and the application that it supports.

The basic structure of the Liberty profile resources follows:

The following assumptions apply for this example installation:

  • The installation includes two servers.

  • Each server includes a bootstrap.properties file, a server.xml file, and one application.

  • Each server uses a previously installed SDK (JRE) that meets the minimum requirements for the Liberty profile. To use the job manager to install an SDK, see Example 2 for relevant packaging and server configuration information.

  • The Liberty profile installation is deployed to project directory samples in working directory /liberty/working, such as /liberty/working/samples.

Structure when deployed

This example Liberty profile installation has the following directory structure on the server hosts:
[-] liberty     [-] working         [-] samples
            [-] wlp-08.05.00.00
                [+] bin
                [ ] clients                 [+] dev
                [ ] lafiles
                [+] lib
                [+] templates
                [-] usr
                    [-] servers                         [-] SecuritySample-01.00-01
                                o bootstrap.properties
                                o server.env
                                o server.xml
                            [ ] apps
                                    o SecuritySample-01.00.war
                        [-] ServletSample-01.00-01
                                o bootstrap.properties
                                o server.env
                                o server.xml
                            [ ] apps
                                    o ServletSample-01.00.war

Structure of package for initial deployment

The following directories and files are included in the compressed (.zip) file for initial deployment of the Liberty profile installation. The project directory, samples, is located at the root of the compressed file.
[-] samples
    [-] wlp-08.05.00.00
        [+] bin
        [ ] clients         [+] dev
        [ ] lafiles
        [+] lib
        [+] templates
        [-] usr
            [-] servers                 [-] SecuritySample-01.00-01
                        o bootstrap.properties
                        o server.env
                        o server.xml
                    [ ] apps
                            o SecuritySample-01.00.war
                [-] ServletSample-01.00-01
                        o bootstrap.properties
                        o server.env
                        o server.xml
                    [ ] apps
                            o ServletSample-01.00.war

If a server must use an SDK (JRE) that is not the default, operating system-level JRE, specify the location of the appropriate JRE in a server.env file at the runtime or server level; for example:

    JAVA_HOME=/opt/jre-06.00.31

Structure of package containing new version of server and application

The following directories and files are included in a compressed (.zip) file for a new version of a server and the application that it supports. The project directory, samples, is located at the root of the compressed file.
[-] samples
    [-] wlp-08.05.00.00
        [-] usr
            [-] servers                 [-] SecuritySample-01.01-01
                        o bootstrap.properties
                        o server.env
                        o server.xml
                    [ ] apps
                            o SecuritySample-01.01.war

Example 2: Host-level sharing of SDK and Liberty profile runtime

This example first illustrates how to package the Liberty profile resources for an environment where each server host includes a single shared instance of an SDK (JRE), a single shared instance of the Liberty profile runtime, and two isolated working servers that rely on the shared SDK and the shared Liberty profile runtime. It then illustrates how to package a new version of a server and the application that it supports. Use of the job manager is mandatory for environments that include isolated Liberty profile servers; we cannot use the Liberty server script to manage the servers.

For information about sharing server configuration settings at the host and network levels, see "Using includes in the configuration."

The basic structure of the Liberty profile resources follows. Using this approach helps to simplify maintenance and to conserve disk space as additional servers are deployed in the future.

  • Server hosts

The following assumptions apply for this example installation:

  • The SDK (JRE) and the Liberty profile runtime are deployed to shared directory /liberty/shared.

  • The two isolated working servers are deployed to project directory samples in working directory /liberty/working, such as /liberty/working/samples. Including a project directory is optional.

  • Each server includes a bootstrap.properties file, a server.env file, a server.xml file, and one application.

Structure when deployed

This example Liberty profile environment has the following directory structure on each server host:
[-] liberty     [-] shared         [-] jre-06.00.31
            [+] bin
            [+] lib
        [-] wlp-08.05.00.00
            [+] bin
            [ ] clients             [+] dev
            [ ] lafiles
            [+] lib
            [+] templates
    [-] working         [-] samples
            [-] servers                 [-] SecuritySample-01.00-01
                        o bootstrap.properties
                        o server.env
                        o server.xml
                    [ ] apps
                            o SecuritySample-01.00.war
                [-] ServletSample-01.00-01
                         o bootstrap.properties
                         o server.env
                         o server.xml
                    [ ] apps
                            o ServletSample-01.00.war

Each isolated server is configured to use the shared SDK (JRE) and the shared Liberty profile runtime. The locations of the shared resources are stored in each server.env file; for example:

JAVA_HOME=${WLP_SHARED_DIR}/jre-06.00.31
WLP_RUNTIME_DIR=${WLP_SHARED_DIR}/wlp-08.05.00.00
The paths include the WLP_SHARED_DIR WebSphere variable instead of a hardcoded path. When the isolated servers are deployed to the server hosts, the job manager replaces ${WLP_SHARED_DIR} with the actual shared directory path, in this case /liberty/shared.

Structure of packages for initial deployment

The following directories and files are included in the compressed (.zip) file for initial deployment of the SDK (JRE) and the Liberty profile runtime to the shared resources directory defined by the WLP_SHARED_DIR WebSphere variable. Because it is likely that the SDK and the Liberty profile runtime will be used across projects, these resources are not included in a project directory. In this example, the SDK and the Liberty profile runtime are packaged into a single compressed file. However, you might package them into two separate compressed files, and submit two separate installation jobs.
[-] jre-06.00.31
    [+] bin
    [+] lib
[-] wlp-08.05.00.00
    [+] bin
    [ ] clients     [+] dev
    [ ] lafiles
    [+] lib
    [+] templates

The following directories and files are included in the compressed (.zip) file for initial deployment of the Liberty profile servers and their applications to the working resources directory defined by the WLP_WORKING_DIR WebSphere variable. The project directory, samples, is located at the root of the compressed file.

[-] samples
    [-] servers         [-] SecuritySample-01.00-01
                o bootstrap.properties
                o server.env
                o server.xml
            [ ] apps
                    o SecuritySample-01.00.war
        [-] ServletSample-01.00-01
                o bootstrap.properties
                o server.env
                o server.xml
            [ ] apps
                    o ServletSample-01.00.war

Structure of package to update server and application

The following directories and files are included in a compressed (.zip) file for later deployment of a new version of a server and its application to the working resources directory defined by the WLP_WORKING_DIR WebSphere variable. The project directory, samples, is located at the root of the compressed file.
[-] samples
    [-] servers         [-] SecuritySample-01.01-01
                o bootstrap.properties
                o server.env
                o server.xml
            [ ] apps
                    o SecuritySample-01.01.war

Example 3: Network-level sharing of SDK, runtime, and applications

Restriction: Example 3 does not work on the Windows operating system.

This example first illustrates how to package the Liberty profile resources for an environment where the SDK (JRE), the Liberty profile runtime, and several applications are stored on shared disk, and two isolated (working) servers are stored on each server host. It then illustrates how to package a new version of a server and the application that it supports. Use of the job manager is mandatory for environments that include isolated Liberty profile servers. We cannot use the Liberty server script to manage the servers. For information about sharing server configuration settings at the host and network levels, see "Using includes in the configuration."

The basic structure of the Liberty profile resources follows. Using this approach helps to simplify maintenance and to conserve disk space when additional servers are deployed in the future.

  • Shared disk

  • Server hosts

    • Work resources

      • Project

        • Liberty profile server 1

        • Liberty profile server 2

The following assumptions apply for this example installation:

  • The SDK (JRE), Liberty profile runtime, and applications are installed to shared disk at path /liberty/shared.

  • On each server host, the shared resources directory (on shared disk) is mounted at the same path, /liberty/shared.

  • On each server host, the two isolated (working) servers are deployed to project directory samples in working directory /liberty/working, such as /liberty/working/samples. Including a project directory is optional.

  • Each server includes a bootstrap.properties file, a server.env file, and a server.xml file.

Structure when deployed

This example Liberty profile environment has the following directory structures on shared disk and on the server hosts:
Shared disk
 [-] liberty     [-] shared         [-] jre-06.00.31
            [+] bin
            [+] lib
        [-] wlp-08.05.00.00
            [+] bin
            [ ] clients             [+] dev
            [ ] lafiles
            [+] lib
            [+] templates
        [-] samples
            [ ] apps
                    o SecuritySample-01.00.war
                    o ServletSample-01.00-01.war
Server hosts
 [-] liberty     [-] working         [-] samples
            [-] servers                 [-] SecuritySample-01.00-01
                        o bootstrap.properties
                        o server.env
                        o server.xml
                [-] ServletSample-01.00-01
                         o bootstrap.properties
                         o server.env
                         o server.xml

Each isolated server is configured to use the shared SDK (JRE) and the shared Liberty profile runtime. The locations of the shared resources are stored in each server.env file; for example:

JAVA_HOME=${WLP_SHARED_DIR}/jre-06.00.31
WLP_RUNTIME_DIR=${WLP_SHARED_DIR}/wlp-08.05.00.00
The paths include the WLP_SHARED_DIR WebSphere variable instead of a hardcoded path. When the isolated servers are deployed to the server hosts, the job manager replaces ${WLP_SHARED_DIR} with the actual shared directory path, in this case /liberty/shared. On each server host, the remote shared resources directory is mounted at /liberty/shared.

Because the applications are in shared storage that is apart from the servers, the application element in each server.xml file must include the full path to the corresponding WAR file; for example:

<application id="SecuritySample"
             location="/liberty/shared/apps/SecuritySample-01.00.war"
             name="SecuritySample" type="war"/>

To minimize changes to the server.xml file, the application directory and version information can be stored in two properties in each server bootstrap.properties file; for example:

    apps.dir=${WLP_SHARED_DIR}/${CURRENT_PROJECT}/apps security.sample.version=1.00

You then can include both the WLP_SHARED_DIR WebSphere variable and the CURRENT_PROJECT built-in job manager variable in the application element in each server.xml file; for example:

<application id="SecuritySample"               location="${apps.dir}/SecuritySample-${security.sample.version}.war"
             name="SecuritySample" type="war"/>

Structure of packages for initial deployment

The following directories and files are included in the compressed (.zip) file for initial deployment of the SDK (JRE), Liberty profile runtime, and applications to the shared disk location defined by the WLP_SHARED_DIR WebSphere variable. Because it is likely that the SDK and the Liberty profile runtime will be shared across projects, these resources are not included in a project directory. The applications are included in project directory samples. In this example, you package all the shared resources into a single compressed file. However, you might package them into three separate compressed files, and submit three separate installation jobs.
[-] jre-06.00.31
    [+] bin
    [+] lib
[-] wlp-08.05.00.00
    [+] bin
    [ ] clients     [+] dev
    [ ] lafiles
    [+] lib
    [+] templates
[-] samples
    [ ] apps
            o SecuritySample-01.00.war
            o ServletSample-01.00.war

The following directories and files are included in a compressed (.zip) file for initial deployment of the Liberty profile servers to the working resources directory defined by the WLP_WORKING_DIR WebSphere variable:

[-] samples
    [-] servers         [-] SecuritySample-01.01-01
                o bootstrap.properties
                o server.env
                o server.xml
        [ ] ServletSample-01.00-01
                o bootstrap.properties
                o server.env
                o server.xml

Structure of packages for update to application and server

The following directories and files are included in a compressed (.zip) file for later deployment of a new version of an application to the shared disk location defined by the WLP_SHARED_DIR WebSphere variable. The project directory, samples, is located at the root of the file:
[-] samples
    [ ] apps
            o SecuritySample-01.01.war

The following directories and files are included in a compressed (.zip) file for later deployment of a new version of a server to the working resources directory defined by the WLP_WORKING_DIR WebSphere variable. The project directory, samples, is located at the root of the compressed file.

[-] samples
    [-] servers         [-] SecuritySample-01.01-01
                o bootstrap.properties
                o server.env
                o server.xml

We must change the application element in the server.xml file to include Version 1.01 of the WAR file; for example:

<application id="SecuritySample"
             location="/liberty/shared/apps/SecuritySample-01.01.war"
             name="SecuritySample" type="war"/>

Alternatively, if the bootstrap.properties file contains the application version information, you must change the file accordingly; for example:

    security.sample.version=1.01

Use updated version information in the application element in the server.xml file; for example:

<application id="SecuritySample"               location="${apps.dir}/SecuritySample-${security.sample.version}.war"
             name="SecuritySample" type="war"/>


What to do next

Set variables that enable the job manager to install and search for Liberty profile resources.


Related concepts

  • Liberty profile resources


    Related tasks

  • Packaging a Liberty profile server from the command prompt
  • Set variables for Liberty profile servers
  • Install Liberty profile resources using the job manager
  • Use includes in the configuration

  • Administrative job types