Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Cleaning up Virgo repository
Cleaning up Virgo repository [message #829780] Mon, 26 March 2012 15:27 Go to next message
Piotrek De is currently offline Piotrek De
Messages: 5
Registered: March 2012
Junior Member
We are moving our monolithic application towards OSGI compatible form. Its build process and all dependencies are managed by Maven. When some bundle is extracted, it is deployed to Virgo to ensure that it will start/stop properly. Before bundle installation take place, we must ensure that all imported packages are available on server. However, after some time, it turns out that some bundles installed as dependencies from EBR all no longer needed - sometimes such orphans are detected, sometimes not. Is there any way to automate removal of unused bundles from Virgo repository? Is it considered as a good practice at all?
Every time application is deployed into another server we must copy Virgo along with its entire bundles repository first. What we'd like to avoid is having Virgo directory taking huge disk space and thus hard to manage.
Re: Cleaning up Virgo repository [message #829942 is a reply to message #829780] Mon, 26 March 2012 21:35 Go to previous messageGo to next message
Miles Parker is currently offline Miles Parker
Messages: 1338
Registered: July 2009
Senior Member
To me that does not sound like the best practice. I think it is better to think about reducing the bundles that are added. For one thing that will create many fewer headaches all around. Maven may make this a bit more difficult as it has a reputation for being greedy I guess, but it really will be worth the time you invest up front in controlling run away dependencies. Perhaps the Virgo tooling can help a bit in helping you to understand the dependencies you really need to consume. Smile

Re: Cleaning up Virgo repository [message #830077 is a reply to message #829942] Tue, 27 March 2012 02:42 Go to previous messageGo to next message
Piotrek De is currently offline Piotrek De
Messages: 5
Registered: March 2012
Junior Member
We try to understand dependencies (at least we expect developers to do so Wink) but it's difficult to track all of them when porting existing application. We have to do a lot of experimentation, OSGIfying a lot of external libraries, and sometimes no longer needed bundles are left. It would be great if we could do garbage collecting - it may be done manually of course. The essential thing is to list all unused bundles. Is it possible to do with standard tooling?

[Updated on: Tue, 27 March 2012 02:43]

Report message to a moderator

Re: Cleaning up Virgo repository [message #830102 is a reply to message #830077] Tue, 27 March 2012 03:38 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
There seem to be three categories of unnecessary bundles in the repository, only one of which seems feasible to detect automatically as far as I can see.

  1. Bundles which are not installed at runtime. Trivial to detect by diffing the runtime state against the repository.
  2. Bundles which are installed but are not depended upon (NB. this includes all kinds of dependencies: package, service, bundle, fragment). Typically, bundled libraries do not publish or consume services, so that makes things a bit simpler. Not too bad to detect as the wiring can be inspected using standard OSGi APIs to detect orphaned groups of bundles. However, the "fly in the ointment" is as follows. Since these bundles were installed at all, some of them must have been explicitly deployed via pickup, deployer API, present in a deployed plan, etc.. I can't see how tooling could know which explicitly deployed bundles were intentionally present and which were unintentionally present. I think it is up to the user to trim back the list of explicitly deployed bundles according to their requirements.
  3. Bundles which are installed and which satisfy optional dependencies (which Spring, for example, has lots of) of necessary bundles but which aren't really needed. This also appears impossible to detect automatically.

Is there a flaw in my analysis?
Previous Topic:Virgo tomcat Server 3.0.2 uploading war file problem
Next Topic:ImportMergeException for aspectj
Goto Forum:
  


Current Time: Wed Aug 20 05:07:13 EDT 2014

Powered by FUDForum. Page generated in 0.01800 seconds