• Save
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Upcoming SlideShare
Loading in...5
×
 

Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly

on

  • 388 views

Case study of how Compuware leveraged the p2 framework to create an end to end remote provisioning solution for one of our product offering. We'll also show how we solved the common problem of ...

Case study of how Compuware leveraged the p2 framework to create an end to end remote provisioning solution for one of our product offering. We'll also show how we solved the common problem of configuration management with the help of p2.

p2 is a provisioning framework that covers broad use cases. Adopting p2 in a product is not just about including a feature in your product: chances are that if you want to use it inside one of your product you will have to build some customized components on top of p2 to make it fit your requirements.

Attending this talk, the audience will learn what are the caveats and quick wins of building software on top of the p2 framework. If you envision to use p2 in your next product, you'd better take some notes!

Through code samples and a demo, we'll show you concrete examples of how to:
* leverage p2 to provision a remote runtime (using JMS)
* add custom p2 touchpoint actions to run your migrations
* deal with p2 metarequirements in your IDE
* create a business model on top of the standard p2 Installable Units
* create a custom UI for your provisioning business model

Statistics

Views

Total Views
388
Views on SlideShare
387
Embed Views
1

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly Presentation Transcript

  • Provisioning & Migration with p2:Case study - The Good, the Badand the UglyChristian Bourgeois@bourgeois_c EclipseCon 2012
  • Some Context on Previous Product Version • Based on Eclipse 3.4 • Too much time to deliver a simple update • Migration would leave system in inconsistent state2
  • ow can we update a software component and migrate it’s configuration data while having a stable system in case of failure?3
  • Demonstration4
  • Provisioning UI import org.eclipse.equinox.internal.p2.ui.ProvUI; import org.eclipse.equinox.internal.p2.ui.ProvUIProvisioningListener; import org.eclipse.equinox.internal.p2.ui.dialogs.AddRepositoryDialog; import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;5
  • Business Model Artifacts Layout • server.feature • client.feature • info.feature • info.feature • server.bundle • client.bundle • common.bundle • common.bundle • config.feature • client.bundle.nls6
  • Business Model info.feature – p2.inf properties.1.name = bsm.adaptor properties.1.value = true properties.2.name = adaptor.name properties.2.value = ZExampleAdaptor properties.3.name = client.feature.name properties.3.value = zzz.compuware.example.adaptor.client.feature properties.4.name = server.feature.name properties.4.value = zzz.compuware.example.adaptor.server.feature properties.5.name = adaptor.id properties.5.value = ZExampleAdaptor properties.6.name = adaptor.version properties.6.value = 1.0.0 properties.7.name = company.id properties.7.value = CPWR properties.8.name = domains.ids properties.8.value = APM7
  • igrations… How to integrate them with p2? public abstract class org.eclipse.equinox.p2.engine.spi.ProvisioningAction { … public abstract IStatus execute(Map<String, Object> parameters); public abstract IStatus undo(Map<String, Object> parameters); … }8
  • Remote Provisioning Client Server Create Plan Uninstall Create Plan Execute Plan Save timestamp Install Create Plan Execute Plan Migrate timestamp Execute Plan9
  • p2 Touchpoint Actions instructions.configure=markStarted(started:true); instructions.configure=copy(source:a, target:b,overwrite:true); instructions.configure=setProgramProperty(propName:key, propValue:value); instructions.configure=addJvmArg(jvmArg:-XX:+UnlockDiagnosticVMOptions); They are executed in the “builder”!10
  • Custom p2 Touchpoint Actions instructions.configure=…adaptors.p2.engine.touchpoint.migrate(); instructions.unconfigure=…adaptors.p2.engine.touchpoint.saveConfigurations(); • Executes business logic • Must have knowledge of their runtime11
  • public IStatus execute(Map<String, Object> parameters) { boolean isServer = RuntimeInfo.isServer(); if (!isServer) { return Status.OK_STATUS; } … IInstallableUnit infoInstallableUnit = this.getInfoInstallableUnit(iu, repositoryManager, progressMonitor); String adaptorID = this.getAdaptorID(infoInstallableUnit); Version adaptorVersion = this.getAdaptorVersion(infoInstallableUnit); MigrationManager manager = this.getMigrationManager(); MigrationStatus migrationStatus = manager.migrate(adaptorID, adaptorVersion); IStatus status = EclipseStatusFactory.createStatus(migrationStatus); return status; } public IStatus undo(Map<String, Object> parameters) { … MigrationManager manager = this.getMigrationManager(); manager.revert(adaptorID, adaptorVersion); }12
  • k… But now I get a “No action found” message?13
  • p2 Meta-Requirements • Provisions the meta-requirements in the builder com.compuware.vantage.vsm.adaptors.p2.engine.touchpoint.feature provides.0.namespace=com.compuware.vantage.vsm.adaptors.p2 provides.0.name=touchpoints provides.0.version=1.1com.compuware.vantage.vsm.adaptors.p2.prerequisite.feature metaRequirements.0.namespace=com.compuware.vantage.vsm.adaptors.p2 metaRequirements.0.name=touchpoints metaRequirements.0.range=1.114
  • p2 Meta-Requirements Beware! • Tycho Bugzilla 351487 • tycho-p2-director-plugin ignores meta- requirements • *.target in IDE15
  • Conclusion • p2 is easy to use (when you know the basics) • p2 API is becoming more high level • Must be aware of the “tricks” and pitfalls16
  • Christian Bourgeois@bourgeois_c Feedback is always appreciated