Dev ops tools and was liberty profile
Transcript of Dev ops tools and was liberty profile
© 2014 IBM Corporation
DevOps Tools & the
WebSphere Liberty Profile Jaroslaw Gawor, Software Engineer, IBM
Jeremy Hughes, DevOps Architect, IBM
Please Note
IBM’s statements regarding its plans, directions, and intent are subject to change
or withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general
product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a
commitment, promise, or legal obligation to deliver any material, code or
functionality. Information about potential future products may not be incorporated
into any contract. The development, release, and timing of any future features or
functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM
benchmarks in a controlled environment. The actual throughput or performance
that any user will experience will vary depending upon many factors, including
considerations such as the amount of multiprogramming in the user’s job stream,
the I/O configuration, the storage configuration, and the workload processed.
Therefore, no assurance can be given that an individual user will achieve results
similar to those stated here.
github.com/wasdev
• Tools
• Samples
• Apache License 2.0
What’s new
WASdev.net
• Download
• Learn
• Share
2
Liberty Ant Tasks
Collection of Ant tasks
• Server operations
– create, start, stop, status, package, dump, javadump
• Application operations
– deploy, undeploy
Open-source
• Apache licensed
• Available at GitHub
– https://github.com/WASdev/ci.ant
• Binaries available on Maven Central repository
3
Liberty Ant Tasks – Basic Configuration
In your build.xml
• Declare antlib namespace
• Make Liberty Ant tasks available in the script
<project xmlns:wlp=”antlib:net.wasdev.wlp.ant”>
<typedef resource="net/wasdev/wlp/ant/antlib.xml"
uri="antlib:net.wasdev.wlp.ant"
classpath="/path/to/wlp-anttasks.jar"/>
<target name=”test”>
<wlp:server ... />
</target>
</project>
4
Liberty Ant Tasks – Example
<wlp:server id=”myServer”
serverName=”testServer”
installDir=”/path/to/liberty”
operation=”start”/>
<wlp:deploy ref=”myServer”>
<fileset dir=”/apps”>
<include name=”*.war”/>
</fileset>
</wlp:deploy>
<wlp:server ref=”myServer” operation=”stop”/>
5
Liberty Maven Plug-in
Collection of Maven goals
• Server operations
– create-server, start-server, stop-server, package-server, dump-
server, java-dump-server
• Application operations
– deploy, undeploy
Provides a packaging type
Packages applications, server configuration, and Liberty
binaries into a single zip file
Provides an archetype
• Generates a sample multi-mode project
6
Liberty Maven Plug-in – GitHub
Open-sourced in 2013
• Apache licensed
• Available at GitHub
– https://github.com/WASdev/ci.maven
• Binaries available on Maven Central repository
7
Liberty Maven Plug-in – Configuration
Basic definition
Must be configured with Liberty installation information
• Directory of local installation (installDirectory parameter)
• Zip file (assemblyArchive parameter)
• Maven artifact (assemblyArtifact parameter)
8
<plugins>
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
<configuration>
<installDirectory>/opt/ibm/wlp</installDirectory>
</configuration>
Liberty Maven Plug-in – Server Configuration
Specify server configuration (server.xml, bootstrap.properties,
jvm.options) as
• Individual files
– configFile, bootstrapPropertiesFile, jvmOptionFile parameters
• In-lined in POM
– bootstrapProperties, jvmOptions parameters
• User directory
– userDirectory parameter
9
<configuration>
<configFile>${basedir}/src/main/resources/myServer.xml</configFile>
<bootstrapProperties>
<httpPort>8888</httpPort>
</bootstrapProperties>
<jvmOptions>
<param>-Xmx768m</param>
</jvmOptions>
</configuration>
Liberty Maven Plug-in – Start/Stop Example
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<executions>
<execution>
<id>start-liberty-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
</execution>
<execution>
<id>stop-liberty-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
<configuration>
<installDirectory>/path/to/liberty</installDirectory>
<serverName>testServer</serverName>
</configuration>
</plugin>
10
Liberty Maven Plug-in – Deploy/Undeploy Example
...
<execution>
<id>start-liberty-server</id>
...
</execution>
<execution>
<id>deploy-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<appArchive>/apps/test-app.war</appArchive>
</configuration>
</execution>
<execution>
<id>undeploy-app</id>
<phase>post-integration-test</phase>
<goals>
<goal>undeploy</goal>
</goals>
<configuration>
<appArchive>test-app.war</appArchive>
</configuration>
</execution>
<execution>
<id>stop-liberty-server</id>
<phase>post-integration-test</phase>
...
11
Jenkins and WebSphere Liberty Profile
Run Jenkins on WebSphere Liberty Profile
• Dropins directory
• Configured with server.xml with security
• Update by replacing jenkins.war => restart
• https://wiki.jenkins-ci.org/display/JENKINS/Liberty+profile
WebSphere Deployer Plugin
• Deploy application/s as part of Jenkins build
12
Jenkins WebSphere Deployer Plugin
The WebSphere Deployer Plugin offers an easy way to deploy applications to an instance of WebSphere as a post-build action in a Jenkins build.
Plugin Features
Supports deployment to most offerings of WebSphere v6.0.x - 8.5.x (including Liberty Profile, Base, ND, Extreme Scale, Express, etc.)
Support for deployments when SSL is activated on WebSphere (Global Security)
Support for deploying to different WebSphere instances/types per build
Support for node, cell, and server level deployments
Support for pre-compiling JSPs on WebSphere during deployment (When stress testing as part of build process)
Support for disabling JSP reloading (When stress testing as part of build process)
Support for not starting application after deployment
Support for fully stopping, uninstalling, installing and starting application during deployment process
Smart detection of existing deployed application state (to prevent failures when a system admin stops your application without you knowing)
13
Jenkins WebSphere Deployer Plugin
Example of the Jenkins post-build action configuration for a Liberty deployment using the
WebSphere Deployer Plugin:
More information on the plugin is available here:
https://wiki.jenkins-ci.org/display/JENKINS/WebSphere+Deployer+Plugin
Chef node setup
15
Chef Server Chef workstation
node_1
chef-client
node_2
chef-client
node_3
chef-client
knife cookbook upload
poll
knife node edit|from file
Opscode Community
knife cookbook download x
16
Install & Create … cookbook “wlp”
Chef Server Chef workstation
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 4
wlp cookbook community.opscode.com/cookbooks/wlp
Install Liberty: archive|zip
• Note: IBM Licensing
Create server/s
• Separate wlp/usr dir
Set JVM options
Manipulate server’s live
server.xml as Ruby hash
Create init.d service
wlp-<server_name>
…
poll poll poll
Templating config files
Erebus Ruby Gem for sophisticated ‘variable evaluation’
Embedded Ruby code
Init.d service …
17
application_wlp cookbook community.opscode.com/cookbooks/application_wlp
Extends ‘application’
• Template Method pattern
Deploy application of any type
.ear | .war | .eba
18
Deploy application … cookbook “application_wlp”
Chef Server Chef workstation
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 4
poll poll poll
Apps Apps
Apps Apps
Apps Apps
Apps Apps
Modelling server.xml … and <include>s
Simple, minimal, but rich (!!)
• 94 different element types
Need to represent server config in code
And keep ‘application’ cookbook’s deployment
idiom
1. Manage raw server.xml
• Clash with ‘application’ cookbook’s deployment
idiom
2. server.xml.erb template?
• Need complete model of elements and attributes
in Ruby to manipulate them … onerous
• Preserving includes during changes?
3. Simple, good enough:
• Server config hash -> server.xml
19
Hash to XML
20
Converted by wlp cookbook
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Apps Apps
Apps Apps
Apps Apps
Load balancing … add in “apache2” cookbook
Chef Server Chef workstation
node_4
chef-client
HTTP Server
21
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Apps Apps
Apps Apps
Apps Apps
Load balancing … search for nodes in cluster role
Chef Server Chef workstation
node_4
chef-client
HTTP Server
22
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Apps Apps
Apps Apps
Apps Apps
Load balancing … configure web server
Chef Server Chef workstation
node_4
chef-client
HTTP Server
23
httpd.conf.erb httpd.conf
node_1
chef-client
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 1
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 2
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 3
Apps Apps
Apps Apps
Apps Apps
Load balancing … sample
Chef Server Chef workstation
node_4
chef-client
HTTP Server
24
Chef recipe:
http://github.com/WASdev/ci.chef.wlp.samples
What’s next?
IBM Installation Manager
IBM HTTP Server
WebSphere eXtreme Scale
Full Profile WebSphere Application Server
25
What’s next: IBM HTTP Server
26
Chef Server Chef workstation
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 2
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 3
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 4
Apps Apps
node_1
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 1
Apps
node_4
chef-client
IHS
WebSphere
plugin
What’s next: WebSphere eXtreme Scale
27
Chef Server Chef workstation
node_2
chef-client
node_3
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 2
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 3
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 4
Apps Apps
node_1
chef-client
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 1
Apps
node_4
chef-client
IHS
WebSphere
plugin
…
Grid
Container
WXS Caching
Tier
Grid
Container
Grid
Container
Grid
Container
Grid
Container
Grid
Container
Catalog
Server
Chef & Liberty Profile: no-charge downloads
Chef is Infrastructure as Code
model your infrastructure as code. www.getchef.com
WebSphere Liberty Profile
designed for Developers, ideal for Ops
Visit us at WASdev and our GitHub org
28
wasdev.net
github.com/WASdev
Puppet and WebSphere Liberty Profile
29
Puppet Master Puppet workstation
node_2
puppet agent
node_3
puppet agent
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 2
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 3
Apps
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Liberty Profile Server 4
Apps Apps
node_1
puppet agent
Feat
ure
Manag
er
HTTP
Tra
nspor
t
Appl
icat
ion M
anag
er
serv
let-
3.0
jsp-
2.2
apps
ecur
ity-1
.0
rest
conn
ector
-1.0
jpa-
2.0
Apps
Liberty Profile Server 1
Apps
node_4
puppet agent
HTTP Server
…
Grid
Container
WXS Caching
Tier
Grid
Container
Grid
Container
Grid
Container
Grid
Container
Grid
Container
Catalog
Server
poll poll poll
upload puppet module
Puppet module:
http://github.com/WASdev/ci.puppet.wlp
Questions?
We Value Your Feedback
Don’t forget to submit your Impact session and speaker
feedback! Your feedback is very important to us – we use it to
continually improve the conference.
Use the Conference Mobile App or the online Agenda Builder to
quickly submit your survey
• Navigate to “Surveys” to see a view of surveys for sessions
you’ve attended
31
Thank You
Legal Disclaimer
• © IBM Corporation 2014. All Rights Reserved.
• The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained
in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are
subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing
contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and
conditions of the applicable license agreement governing the use of IBM software.
• References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or
capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to
future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by
you will result in any specific sales, revenue growth or other results.
• IBM, the IBM logo and WebSphere are trademarks of International Business Machines Corporation in the United States, other countries, or both.
• Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.