Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Hudson-ci/Containers/IBM WebSphere"

Line 1: Line 1:
{{hudson|pageTitle=Using IBM WebSphere as a Container}}
+
{{hudson|pageTitle=Using IBM WebSphere as a Container}}  
  
{{stub}}
+
{{warning|Requirements|Hudson 1.291 or above requires WebSphere 7.0.0.7 or above. Hudson will NOT work on WebSphere versions 7.0.0.0 - 7.0.0.5.}}  
 +
 
 +
__toc__
 +
 
 +
<br>
 +
 
 +
= Installation procedure  =
 +
 
 +
There are two ways to install Hudson on WAS:
 +
 
 +
*Manually through the Admin console
 +
*Automated through the WAS scripting interface
 +
 
 +
== Admin console installation  ==
 +
 
 +
The installation instructions are simple as for each WAR Module.
 +
 
 +
*Start the installation wizard under Applications - Install new application.
 +
*Select hudson.war and enter the context root for the application - for example hudson
 +
 
 +
After finishing the wizard go to the installed application (hudson_war for example) and perform the following steps to change the classloader mode:
 +
 
 +
*Click Manage Modules
 +
*Click Hudson
 +
*From the "Class loader order" drop-down select "Classes loaded with application class loader first"
 +
*Save the changes
 +
*Restart the server - this is necessary to apply the changed class loader mode. You need to restart only the server onto which hudson is installed
 +
 
 +
== Installing through wsadmin  ==
 +
 
 +
{{note|Information Needed|This section needs to be verified / checked for WAS 7. The old wiki indicated that this only works for 6.1}} A jacl script called {{code|hudson.jacl}} and configuration file {{code|config.properties}} are provided to install and configure hudson on WAS 6.1 ND.
 +
 
 +
Before running hudson.jacl make the necessary changes in the config.properties file - adjust the server envoronment, the context root, the virtual host mapping and optional the hudson home directory. After that run following command from the deployment manager bin directory:
 +
 
 +
<pre>
 +
 
 +
wsadmin(.sh) -f &lt;path_to_hudson.jacl&gt;/hudson.jacl &lt;path_to_config.properties&gt;/config.properties &lt;command&gt; &lt;path_to_hudson.war&gt;/hudson.war
 +
 
 +
</pre>
 +
 
 +
where the &lt;command&gt; is:
 +
 
 +
*deploy - use it for first time installation. it performs installation only
 +
*redeploy - use it to upgrade hudson. It uninstalls previously installed hudson instance and installs the new version from the hudson.war
 +
*undeploy - use to uninstall hudson. In this case the last parameter is not necessary.
 +
 
 +
The paths must be provided in UNIX style even on Windows - d:/test/hudson/hudson.war instead of d:\test\hudson\hudson.war
 +
 
 +
After successfully installation the server must be restarted manually - the script doesn't provide this functionality at the moment, but the stopServer and startServer commands can be used for this purpose.
 +
 
 +
If security is enabled on the server either provide \-user and \-password arguments to the command or adjust the soap.client.props file with the login information in order to be able to connect to the server's admin interface.&nbsp;
 +
 
 +
The script is not tested with the base server edition, but should work on it - the only change is to disable the node synchronization in the saveConfigAndSync procedure - the line to comment can be found in hudson.jacl - search for BASE or for saveConfigAndSync.&nbsp;
 +
 
 +
== Installation using Jython Scripts ==
 +
 
 +
{{note||These scripts make heavy use of 'wsadminlib.py', a large monolithic jython library for WebSphere Administration. The original scripts can be found here [http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html Sample Scripts for WebSphere Application Server]. The 'wsadminlib.py' file that is included here has been modified to include some extra functions that were not present in the original.}}
 +
 
 +
There are four script files that have been provided. They have been tested under WAS 6.1 and AIX. Feedback is sought for WAS 7.0 and other platforms.
 +
 
 +
*createHudsonServer.py
 +
*deleteHudsonServer.py
 +
*installHudson.py
 +
*wsadminlib.py
 +
 
 +
They are executed using the wsadmin.sh tool:
 +
<pre>
 +
/was61/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f &lt;&lt;&lt;script file&gt;&gt;&gt;
 +
</pre>
 +
 
 +
==== Attachments ===
 +
 
 +
*[createHudsonServer.py - wsadmin script to create the Hudson Server.|http://wiki.hudson-ci.org/download/attachments/14942211/createHudsonServer.py]
 +
*[deleteHudsonServer.py - wsadmin script to delete the Hudson Server.|http://wiki.hudson-ci.org/download/attachments/14942211/deleteHudsonServer.py]
 +
*[installHudson.py - wsadmin script to install the Hudson Application into the Hudson Server.|http://wiki.hudson-ci.org/download/attachments/14942211/installHudson.py]
 +
*[wsadminlib.py - The wsadmin Über library.|http://wiki.hudson-ci.org/download/attachments/14942211/wsadminlib.py]
 +
 
 +
=== Additional Setup ===
 +
 
 +
Please remember that a 64-bit JVM takes about 60% more heap space than a 32-bit JVM does. Size your VM, if using 64-bit, accordingly. I'm using 1Gb (-Xmx1024M) heap, as 512Mb was causing regular heap dumps due to out of memory errors.
 +
 
 +
=== Notes ===
 +
 
 +
This is simply how I do it. It does require additional machine resources, as it takes a complete JVM, but I prefer to create a server per application which provides for better application isolation and tuning capabilities.
 +
 
 +
= CVS SSH authentication =
 +
 
 +
For CVS ssh authentication the following environment entry is required in the application server: {{code|CVS_RSH=ssh}. This can be set in the admin console in:
 +
 
 +
Application Servers / &lt;server&gt; / Java and Process Management / Process Definition / Environment Entries
 +
 
 +
= Upgrading =
 +
 
 +
Changing the WAR file to reference the newest dom4j library ([http://www.nabble.com/Issue-1680-td18383889.html see here]):
 +
 
 +
*Unpack hudson.war and navigate to WEB-INF/lib directory.
 +
 
 +
*Download dom4j-1.6.1.jar and copy it to the WEB-INF/lib directory.
 +
 
 +
*Delete dom4j-1.5.jar
 +
 
 +
*Zip the war file again.
 +
 
 +
{{warning||Do not remove dom4j-1.6.1-hudson-1.jar}}
 +
Following steps should be done upgrading running hudson instance:
 +
 
 +
*Backup the current configuration
 +
<pre>
 +
tar -cvf hudsonXX.tar &lt;hudson_home_dir&gt;
 +
</pre>
 +
* Redeploy hudson with the provided scripts as follows:
 +
 
 +
Edit config.properties to the environment and run (see Installing through wsadmin above for further information):
 +
<pre>
 +
wsadmin.sh -f hudson.jacl config.properties redeploy hudson.war
 +
</pre>
 +
The above command assumes that wsadmin.sh is in PATH and hudson.jacl, config.properties and hudson.war are in the current dir.
 +
 
 +
*Restart the application server.
 +
 
 +
= Setting up WAS for the update center to work =
 +
 
 +
As of version 1.23x? hudson provides update center. In order to be able to use it with the WebSphere's JDK a trusted certificate must be imported in the server's keystore. To acomplish this following steps are necessary:
 +
 
 +
#Download the RapidSSL root certificate from [https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Global_eBusiness_CA-1.cer here] .
 +
#Install the certificate using '''keytool''' (command-line mode) or IBM Key Management (GUI mode).
 +
#After importing the certificate the application server must be restarted. After that it should be possible to upgrade your plugins from the Update Center in Hudson (don't forget to set the proxy if you have one).
 +
 
 +
== Importing the certificate using the keytool command (command-line mode) ==
 +
 
 +
<pre>
 +
keytool -import -trustcacerts -file rapidssl_01.cer -keystore &lt;server_trust.p12&gt; -storepass WebAS -storetype PKCS12 -alias rapidssl
 +
</pre>
 +
Where:
 +
 
 +
*&lt;server_trust.p12&gt; points to the trust.p12 file of the server on which hudson is running. It is found in {{<WAS_Install_Dir>/profiles/<profile>/config/cells/<cellname>/node/<nodename>}}.
 +
*The command uses the default WebSphere password for the keystore file (_WebAS_) - if it has been changed change the command accordingly.
 +
 
 +
Issuing the command brings a message that the certificate is found in the system wide keystore - confirm with yes that it should be updated.
 +
 
 +
Eg:
 +
<pre>
 +
$ cd /tmp $ wget http://www.rapidssl.com/cps/rapidssl_01.cer &lt;snip&gt; $ /was61/WebSphere/AppServer/java/jre/bin/keytool -import -trustcacerts -file rapidssl_01.cer -keystore /was61/WebSphere/AppServer/profiles/AppSrv01/config/cells/localhostCell01/nodes/localhostNode01/trust.p12 -storepass WebAS -storetype PKCS12 -alias rapidssl Certificate already exists in system-wide CA keystore under alias &lt;equifaxsecureca&gt; Do you still want to add it to your own keystore? [no]: yes Certificate was added to keystore $
 +
 
 +
</pre>
 +
 
 +
 
 +
== Importing the certificate using IBM Key Management (GUI mode) ==
 +
 
 +
*Start {{ikeyman.bat}}/{{ikeyman.sh}} located in {{<WAS_Install_Dir>/bin}}.
 +
*Go to _Key Database File &gt; Open_.
 +
*In the _Open_ window, set the _Key database type_ to _PKCS12 \_, then use the \_Browse_ button to locate the {{trust.p12}} file (it's in {{<WAS_Install_Dir>/profiles/<profile>/config/cells/<cellname>/node/<nodename>}}).
 +
*Enter the password for this keystore (the default value is _WebAS_).
 +
*In the _Key database content_, select the _Signer Certificates item_.
 +
*Click on the _Add..._ button, locate the certificate you've previously downloaded, and click on _OK_.
 +
*When asked to _Enter a Label_, set the value to _rapidssl_ and click on _OK_.
 +
*Go to _Key Database File &gt; Save As..._ and overwrite the existing {{trust.p12}} file (it's a good idea to make a copy of it before...).
 +
*When asked for a password, set it to the previous value (again, _WebAS_ is the default one).
 +
*Exit from the tool.
 +
 
 +
\\
 +
 
 +
h1. Known Issues
 +
 
 +
Following table tries to summarize the known issues. If there is a fix from IBM its PK Id will be referenced. || Issue # \\ || Hudson - Affects \\ || Hudson - Fixed In \\ || WAS - Affects || WAS - Fixed In \\ || PK # \\ || | [1680|https://hudson.dev.java.net/issues/show_bug.cgi?id=1680|Issue 1680] | 1.213 | 1.237 \\ | All \\ | | | | [3069|https://hudson.dev.java.net/issues/show_bug.cgi?id=3069|Issue 3069] | 1.271 | 1.291 \\ | All \\ | | | | [3274|https://hudson.dev.java.net/issues/show_bug.cgi?id=3274|Issue 3274] | &gt; 1.285 \\ | \\ | 7.0.0.x \\ | 7.0.0.7 \\ | PK86109 \\ |
 +
 
 +
h2. JIRA Plugin
 +
 
 +
I'm experiencing VerifyError on WAS 7.0 trying to use the provided JIRA plugin due to dependencies on the Stax API included in the stax-api-1.0.1.jar. I've simply removed the jar file from hudson's lib directory and it works ok for me. For further details see this [thread|https://hudson.dev.java.net/servlets/BrowseList?list=users&amp;by=thread&amp;from=1870092].

Revision as of 06:09, 2 September 2011

Hudson Continuous Integration Server
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse Source
Hudson-bust.png Using IBM WebSphere as a Container











Warning2.png
Requirements
Hudson 1.291 or above requires WebSphere 7.0.0.7 or above. Hudson will NOT work on WebSphere versions 7.0.0.0 - 7.0.0.5.



Installation procedure

There are two ways to install Hudson on WAS:

  • Manually through the Admin console
  • Automated through the WAS scripting interface

Admin console installation

The installation instructions are simple as for each WAR Module.

  • Start the installation wizard under Applications - Install new application.
  • Select hudson.war and enter the context root for the application - for example hudson

After finishing the wizard go to the installed application (hudson_war for example) and perform the following steps to change the classloader mode:

  • Click Manage Modules
  • Click Hudson
  • From the "Class loader order" drop-down select "Classes loaded with application class loader first"
  • Save the changes
  • Restart the server - this is necessary to apply the changed class loader mode. You need to restart only the server onto which hudson is installed

Installing through wsadmin

Note.png
Information Needed
This section needs to be verified / checked for WAS 7. The old wiki indicated that this only works for 6.1
A jacl script called hudson.jacl and configuration file config.properties are provided to install and configure hudson on WAS 6.1 ND. 

Before running hudson.jacl make the necessary changes in the config.properties file - adjust the server envoronment, the context root, the virtual host mapping and optional the hudson home directory. After that run following command from the deployment manager bin directory:


wsadmin(.sh) -f <path_to_hudson.jacl>/hudson.jacl <path_to_config.properties>/config.properties <command> <path_to_hudson.war>/hudson.war

where the <command> is:

  • deploy - use it for first time installation. it performs installation only
  • redeploy - use it to upgrade hudson. It uninstalls previously installed hudson instance and installs the new version from the hudson.war
  • undeploy - use to uninstall hudson. In this case the last parameter is not necessary.

The paths must be provided in UNIX style even on Windows - d:/test/hudson/hudson.war instead of d:\test\hudson\hudson.war

After successfully installation the server must be restarted manually - the script doesn't provide this functionality at the moment, but the stopServer and startServer commands can be used for this purpose.

If security is enabled on the server either provide \-user and \-password arguments to the command or adjust the soap.client.props file with the login information in order to be able to connect to the server's admin interface. 

The script is not tested with the base server edition, but should work on it - the only change is to disable the node synchronization in the saveConfigAndSync procedure - the line to comment can be found in hudson.jacl - search for BASE or for saveConfigAndSync. 

Installation using Jython Scripts

Note.png
These scripts make heavy use of 'wsadminlib.py', a large monolithic jython library for WebSphere Administration. The original scripts can be found here Sample Scripts for WebSphere Application Server. The 'wsadminlib.py' file that is included here has been modified to include some extra functions that were not present in the original.


There are four script files that have been provided. They have been tested under WAS 6.1 and AIX. Feedback is sought for WAS 7.0 and other platforms.

  • createHudsonServer.py
  • deleteHudsonServer.py
  • installHudson.py
  • wsadminlib.py

They are executed using the wsadmin.sh tool:

/was61/WebSphere/AppServer/bin/wsadmin.sh -lang jython -f <<<script file>>>

= Attachments

Additional Setup

Please remember that a 64-bit JVM takes about 60% more heap space than a 32-bit JVM does. Size your VM, if using 64-bit, accordingly. I'm using 1Gb (-Xmx1024M) heap, as 512Mb was causing regular heap dumps due to out of memory errors.

Notes

This is simply how I do it. It does require additional machine resources, as it takes a complete JVM, but I prefer to create a server per application which provides for better application isolation and tuning capabilities.

CVS SSH authentication

For CVS ssh authentication the following environment entry is required in the application server: {{code|CVS_RSH=ssh}. This can be set in the admin console in:

Application Servers / <server> / Java and Process Management / Process Definition / Environment Entries

Upgrading

Changing the WAR file to reference the newest dom4j library (see here):

  • Unpack hudson.war and navigate to WEB-INF/lib directory.
  • Download dom4j-1.6.1.jar and copy it to the WEB-INF/lib directory.
  • Delete dom4j-1.5.jar
  • Zip the war file again.
Warning2.png
Do not remove dom4j-1.6.1-hudson-1.jar

Following steps should be done upgrading running hudson instance:

  • Backup the current configuration
tar -cvf hudsonXX.tar <hudson_home_dir> 
  • Redeploy hudson with the provided scripts as follows:

Edit config.properties to the environment and run (see Installing through wsadmin above for further information):

wsadmin.sh -f hudson.jacl config.properties redeploy hudson.war

The above command assumes that wsadmin.sh is in PATH and hudson.jacl, config.properties and hudson.war are in the current dir.

  • Restart the application server.

Setting up WAS for the update center to work

As of version 1.23x? hudson provides update center. In order to be able to use it with the WebSphere's JDK a trusted certificate must be imported in the server's keystore. To acomplish this following steps are necessary:

  1. Download the RapidSSL root certificate from here .
  2. Install the certificate using keytool (command-line mode) or IBM Key Management (GUI mode).
  3. After importing the certificate the application server must be restarted. After that it should be possible to upgrade your plugins from the Update Center in Hudson (don't forget to set the proxy if you have one).

Importing the certificate using the keytool command (command-line mode)

keytool -import -trustcacerts -file rapidssl_01.cer -keystore <server_trust.p12> -storepass WebAS -storetype PKCS12 -alias rapidssl

Where:

  • <server_trust.p12> points to the trust.p12 file of the server on which hudson is running. It is found in {{<WAS_Install_Dir>/profiles/<profile>/config/cells/<cellname>/node/<nodename>}}.
  • The command uses the default WebSphere password for the keystore file (_WebAS_) - if it has been changed change the command accordingly.

Issuing the command brings a message that the certificate is found in the system wide keystore - confirm with yes that it should be updated.

Eg:

$ cd /tmp $ wget http://www.rapidssl.com/cps/rapidssl_01.cer <snip> $ /was61/WebSphere/AppServer/java/jre/bin/keytool -import -trustcacerts -file rapidssl_01.cer -keystore /was61/WebSphere/AppServer/profiles/AppSrv01/config/cells/localhostCell01/nodes/localhostNode01/trust.p12 -storepass WebAS -storetype PKCS12 -alias rapidssl Certificate already exists in system-wide CA keystore under alias <equifaxsecureca> Do you still want to add it to your own keystore? [no]: yes Certificate was added to keystore $ 


Importing the certificate using IBM Key Management (GUI mode)

  • Start Template:Ikeyman.bat/Template:Ikeyman.sh located in {{<WAS_Install_Dir>/bin}}.
  • Go to _Key Database File > Open_.
  • In the _Open_ window, set the _Key database type_ to _PKCS12 \_, then use the \_Browse_ button to locate the Template:Trust.p12 file (it's in {{<WAS_Install_Dir>/profiles/<profile>/config/cells/<cellname>/node/<nodename>}}).
  • Enter the password for this keystore (the default value is _WebAS_).
  • In the _Key database content_, select the _Signer Certificates item_.
  • Click on the _Add..._ button, locate the certificate you've previously downloaded, and click on _OK_.
  • When asked to _Enter a Label_, set the value to _rapidssl_ and click on _OK_.
  • Go to _Key Database File > Save As..._ and overwrite the existing Template:Trust.p12 file (it's a good idea to make a copy of it before...).
  • When asked for a password, set it to the previous value (again, _WebAS_ is the default one).
  • Exit from the tool.

\\

h1. Known Issues

Following table tries to summarize the known issues. If there is a fix from IBM its PK Id will be referenced. || Issue # \\ || Hudson - Affects \\ || Hudson - Fixed In \\ || WAS - Affects || WAS - Fixed In \\ || PK # \\ || | [1680|https://hudson.dev.java.net/issues/show_bug.cgi?id=1680%7CIssue 1680] | 1.213 | 1.237 \\ | All \\ | | | | [3069|https://hudson.dev.java.net/issues/show_bug.cgi?id=3069%7CIssue 3069] | 1.271 | 1.291 \\ | All \\ | | | | [3274|https://hudson.dev.java.net/issues/show_bug.cgi?id=3274%7CIssue 3274] | > 1.285 \\ | \\ | 7.0.0.x \\ | 7.0.0.7 \\ | PK86109 \\ |

h2. JIRA Plugin

I'm experiencing VerifyError on WAS 7.0 trying to use the provided JIRA plugin due to dependencies on the Stax API included in the stax-api-1.0.1.jar. I've simply removed the jar file from hudson's lib directory and it works ok for me. For further details see this [thread|https://hudson.dev.java.net/servlets/BrowseList?list=users&by=thread&from=1870092].

Back to the top