1 / 17

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. Christian Bourgeois @bourgeois_c. 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 state.

bluma
Download Presentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly Christian Bourgeois @bourgeois_c

  2. 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 state

  3. How can we update a software component and migrate it’s configuration data while having a stable system in case of failure?

  4. Demonstration

  5. Provisioning UI importorg.eclipse.equinox.internal.p2.ui.ProvUI; importorg.eclipse.equinox.internal.p2.ui.ProvUIProvisioningListener; importorg.eclipse.equinox.internal.p2.ui.dialogs.AddRepositoryDialog; importorg.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;

  6. Business ModelArtifacts Layout • server.feature • info.feature • server.bundle • common.bundle • config.feature • client.feature • info.feature • client.bundle • common.bundle • client.bundle.nls

  7. Business Modelinfo.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 = APM

  8. Migrations… How to integrate them with p2? public abstract class org.eclipse.equinox.p2.engine.spi.ProvisioningAction { … public abstract IStatusexecute(Map<String, Object> parameters); public abstract IStatusundo(Map<String, Object> parameters); … }

  9. Remote Provisioning Server Client Create Plan Uninstall Create Plan Execute Plan Save timestamp Install Create Plan Migrate Execute Plan timestamp Execute Plan

  10. 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”!

  11. 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 runtime

  12. public IStatusexecute(Map<String, Object> parameters) { booleanisServer = RuntimeInfo.isServer(); if (!isServer) { return Status.OK_STATUS; } … IInstallableUnitinfoInstallableUnit = this.getInfoInstallableUnit(iu, repositoryManager, progressMonitor); String adaptorID = this.getAdaptorID(infoInstallableUnit); Version adaptorVersion = this.getAdaptorVersion(infoInstallableUnit); MigrationManager manager = this.getMigrationManager(); MigrationStatusmigrationStatus = manager.migrate(adaptorID, adaptorVersion); IStatus status = EclipseStatusFactory.createStatus(migrationStatus); return status; } public IStatusundo(Map<String, Object> parameters) { … MigrationManager manager = this.getMigrationManager(); manager.revert(adaptorID, adaptorVersion); }

  13. Ok… But now I get a “No action found” message?

  14. 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.1 com.compuware.vantage.vsm.adaptors.p2.prerequisite.feature metaRequirements.0.namespace=com.compuware.vantage.vsm.adaptors.p2 metaRequirements.0.name=touchpoints metaRequirements.0.range=1.1

  15. p2 Meta-RequirementsBeware! • Tycho Bugzilla 351487 • tycho-p2-director-plugin ignores meta-requirements • *.target in IDE

  16. 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 pitfalls

  17. Feedback is always appreciated Christian Bourgeois @bourgeois_c

More Related