The tricky part I think will be for the Hudson discovery code to
determine whether a Hudson instance is running inside the parent JBoss
AS server. This would be easier if Hudson exposed some management
MBeans, but from a quick glance at their docs, it doesn't look like they
do. A couple thoughts on how you might figure out if Hudson is deployed
to a managed AS instance:
1) Via the parent JBoss AS server ResourceComponent's remote EMS/JMX
connection, get a list of all deployed WARs. Iterate through them and
see if there is one named hudson.war and/or one with a context root of
/hudson. If so, figure out the base URL for the Hudson instance by
concatenating the base URL for the AS server, the Hudson context path,
and if necessary, you could even dive into the web.xml for the
deployment (e.g.
/opt/jboss-4.2.3.GA/server/default/deploy/hudson.war/WEB-INF/web.xml)
and figure out the servlet mapping. Once you think you've figured out
the base URL, try to connect to it. If connection succeeds, you found a
Hudson instance and verified it's running inside the AS instance.
2) Write one or more MBeans for Hudson and add them to the Hudson WAR,
along with a servlet that registers the MBeans at webapp startup. These
MBeans could then be used to see if there's a Hudson instance within a
given AS instance. This would make the discovery code simpler, but it
would only be able to discover Hudson instances that had been
instrumented with the MBeans, so not as versatile as 1).
On 8/6/2009 9:55 AM, John Mazzitelli wrote:
You can't "transform" a JBossAS Server as a
"Hudson Server" for example.
What you typically do is create a child service that represents the Hudson services.
This is what we do for the Jopr Server itself - the rhq-server-plugin adds several
services under the JBossAS Server. The Jopr Server has a few extra services such as the
"Communications Services" and "Measurement Subsystem" so you'll
see services under JBossAS server that look like those - but only if that JBossAS server
is hosted the Jopr Server.
See the rhq-plugin descriptor and code for examples of this:
https://anonsvn.jboss.org/repos/jopr/trunk/modules/plugins/rhq-server/src...
https://anonsvn.jboss.org/repos/jopr/trunk/modules/plugins/rhq-server/src...
----- Original Message -----
From: "Tiago Bruno Pires Gomes"<tiago-bruno.piresgomes(a)atosorigin.com>
To: jopr-dev(a)lists.jboss.org
Sent: Thursday, August 6, 2009 9:33:50 AM GMT -05:00 US/Canada Eastern
Subject: Re: [jopr-dev] Hudson Plugin
John Mazzitelli a écrit :
Did you take a look at the hudson plugin prototype that is already in the RHQ SVN:
http://svn.rhq-project.org/repos/rhq/trunk/modules/plugins/hudson/ You can probably see
how it did auto-discovery.
Yes, I did start from this plugin (i checkout the trunk). I did spot a discoverResources
method inside the HudsonServerDiscoveryComponent , however it does requires an urlBase.
My real issue here is how can I make Jopr understand that the JBoss instance it has
already "autodiscovered" is an Hudson instance ?
"If JBoss AS Free Memory is running too low, invoke a Hudson operation such
as 'kill all current builds' ". Does it sounds possible (and sensible) to
you ? This is a long desired feature not yet implemented (I'll see if I can dig out
that JIRA). We need a way to have an alert triggered on one resource to execute an
operation on another resource. That we do not have yet, so you can't do this today.
BUT! What you could do is expose a "Free Memory" metric directly on your Hudson
resource (you would need to collect that metric yourself in the Hudson component - but
that's not difficult to do). That way, you have a metric AND the operation on the same
resource, which would allow you to do what you want.
----- Original Message -----
From: "Tiago Bruno Pires Gomes"<tiago-bruno.piresgomes(a)atosorigin.com>
To: jopr-dev(a)lists.jboss.org Cc: "romain
pelisse"<romain.pelisse(a)atosorigin.com> Sent: Wednesday, July 29, 2009
10:10:06 AM GMT -05:00 US/Canada Eastern
Subject: [jopr-dev] Hudson Plugin
Hi
I work on Hudson plugin for Jopr for several weeks now. I manage to some operations and
metrics (not really usefull in this context) working. The plugin is still a beta but I
feel it is working enough to be at release for review by jopr developer and contributor.
The plugin (and its history) is availaible on BitBucket, as a mercurial repository :
http://bitbucket.org/tpiresgo/hudsonplugin/ Also, I have some troubles understanding how
auto discovery works, can someone help me with this ?
Once I'll get auto discovery working fine, I would like to know if such an operation
sounds possible to you:
"If JBoss AS Free Memory is running too low, invoke a Hudson operation such as
'kill all current builds' ". Does it sounds possible (and sensible) to you ?
_______________________________________________
jopr-dev mailing list
jopr-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jopr-dev
_______________________________________________
jopr-dev mailing list
jopr-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jopr-dev
--
Ian Springer
Sr. Software Developer
JBoss Operations Network
Red Hat
ian.springer(a)redhat.com