Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335689 - Allows PARs to contain plans
Summary: Allows PARs to contain plans
Status: CLOSED FIXED
Alias: None
Product: Virgo
Classification: RT
Component: runtime (show other bugs)
Version: 2.1.0.RELEASE   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 3.0.0.M04   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 351871
  Show dependency tree
 
Reported: 2011-01-28 09:40 EST by Wolfgang Schell CLA
Modified: 2011-07-12 11:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Schell CLA 2011-01-28 09:40:47 EST
Plans are a really nice way to deploy applications in Virgo. You can reference config files, bundles, etc. A PAR on the other hand contains everything, that makes up your application. In my eyes, the ideal deployment package would be a hybrid deployment type (in the following called PLAR).

A PLAR would be a zip archive similar to a PAR, in that it has a MANIFEST.MF, may contain bundles, config files or other deployment units. Additionally, it would allow to specify additional, external dependencies with a included PLAN file.

Therefore I could create an application with its main bundle(s), include the configuration and reference dependencies in Virgos bundle repository.

The main advantage is a small deployment unit including configuration contained in a single file with external dependencies provided by Virgo.

Example Layout:

Archive xxx.plar

META-INF/MANIFEST.MF             (like in PAR)
<Application-SymbolicName>.plan  (references to external deps, config)
org.example.core-1.0.0.jar       (main app)
org.example.web-1.0.0.jar        (web interface)
app-config.properties            (configuration, e.g. database)


Maybe this could be implemented as an extension to the PAR deployer, which looks for a file <Application-SymbolicName>.plan in the PAR, and processes it similar to the PLAN deployer.
Comment 1 Glyn Normington CLA 2011-01-28 10:50:40 EST
Interesting and shouldn't be too hard to implement as described: making a plan a valid artifact inside a PAR.

Implementation notes:

1. There are some restrictions in ParPlanInstallArtifact which limit the contents of PARs to be bundles and configurations. The first step in implementing this would be to allow plans too.

2. PlanResolver converts a single node containing just a plan into a tree of install artifacts consisting of the single input node as the root and the plan contents as its children. This would need tweaking to ensure it doesn't skip partially resolved plans (i.e. PAR trees with unresolved plan subtrees).

3. After that, it should pretty much work, although bugs could clearly come out of the woodwork as this is a new use case. So suitable integration test should be written and then tested/debugged.
Comment 2 Glyn Normington CLA 2011-03-20 07:52:02 EDT
Implemented. See ParDeploymentTests.deployParContainingPlan which deploys org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-in-par/ParContainingPlan.par.

Note that this implementation does not relax the restriction that scopes cannot be nested. Since a PAR is always scoped, a PAR containing a scoped plan will fail to deploy. Similarly if a scoped plan is indirectly referred to by a plan in a PAR, the PAR will fail to deploy.

Any artifacts referenced by a plan inside a PAR must reside in the repository as usual. In particular, a plan inside a PAR may not refer to artifacts supplied in the PAR. If there is a good use case for this, then a separate enhancement bug should be raised.
Comment 3 Wolfgang Schell CLA 2011-03-21 05:59:32 EDT
Great, thanks, Glyn!

Are there any upcoming builds (milestones, ...), were I can check it out without building the whole thing myself?
Comment 4 Glyn Normington CLA 2011-03-22 18:56:33 EDT
Hi Wolfgang

If you are happy to try a kernel build, take one from Hudson e.g. [1]. Otherwise wait for milestone 4 which should ship in about 3-4 weeks.

[1] https://hudson.eclipse.org/hudson/view/Virgo/job/virgo.kernel.snapshot/lastSuccessfulBuild/artifact/build-kernel/target/artifacts/virgo-kernel-3.0.0.CI-2011-03-21_20-52-50.zip