SlideShare ist ein Scribd-Unternehmen logo
1 von 103
From build to assembly to deployment:
Using p2 to facilitate agile software
development


                    Kim Moir, IBM
            Ian Bull, EclipseSource




                 Copyright © IBM Corp., EclipseSource 2010. All
                   rights reserved. Licensed under EPL, v1.0.
About us

• Kim Moir is the Release Engineering lead for the Eclipse and
  RT Equinox projects, and works in the IBM Ottawa Lab. She
  uses p2 to provision builds for 13 platforms.



• Ian Bull works on a number of Eclipse projects, including p2,
  Zest and the PDE Incubator. Ian works at EclipseSource as a
  software engineer.




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
What about you?

• How do you use p2?
• What are you looking to get out of this tutorial?
• Are your building products based on p2?




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Agile Software Development




• Key characteristic of agile software development includes Fast
  Cycle Time:
  •   Include your customers in the development process
  •   Ensure your customers are continually using the latest software
  •   Ensure your developers are building against the latest software



                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Overview

• How can p2 be used to manage your update strategy?
  •   Update your RCP and OSGi applications
  •   Provide a mechanism to install and manage new features
  •   Provide a mechanism to manage different configurations
  •   Manage your developers target platforms




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Outline

• Overview of p2
  • p2 architecture and terminology
  • Anatomy of a repository
  • Using the director and publisher
  • Product based builds with p2
  • Repository management best practices
  • Assembling products out of pre-existing components (no
    compiling)




                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Hands-on exercises

  • Building and assembling different configurations of your
    application
  • Building and publishing add-on bundles
  • Export or build your product to a repository, and then install the
    product from the repository you just created.
  • Using repository tools such as the slicer, repo2runnable or mirror
    to build smaller components from existing repositories




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
A brief history of Eclipse

• When Eclipse starts, the plug-ins are scanned and
  functionality is discovered

  • If a dependency is missing, all the dependent plug-ins simply
    fail to start

  • Old plug-ins pollute the application

  • You cannot update resources, licenses, executables or the
    framework itself




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Unzipping is not Installing




                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
What is p2 – p2 is Installing!

• A replacement for the old update manager
  •   New UI, simplified workflow
  •   Manage Eclipse, RCP and more (exe, ini, bundles, registry keys, …)
  •   Shared bundles across Eclipse-based products
  •   An installer
                                                    TM
• A provisioning platform for OSGi                        systems (in progress)
  • Managing non-running instance
  • Start level, framework extension
  • Fine-grained dependency management




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
What does p2 enable?

• An extensible provisioning platform for OSGiTM systems which
  provides
  •   Installation
  •   Searching for updates
  •   Rollback
  •   Dependency management
  •   Policy control
  •   UI or headless




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
What p2 isn’t

• An end to end build system
• PDE build provides tooling to generate p2 repositories when
  building bundles
• A product – the eclipse community builds the products!




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
What can you build with p2?

•   Add-on manager for RCP applications
•   Installers
•   Configuration Management Systems
•   Self updating applications
•   Install -> Update -> Roll back scenarios
•   etc…




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Who needs to provision?


          Engineers                                                                 Users




             source code                              applications
        open source                                              tools
      in-house built
                                                     runtimes
       licensed software



         Automated Builds                                                            Test
                Test


                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2 is for more than just bundles

• p2 can provision
  •   OSGiTM bundles
  •   Executables
  •   Configuration files – for instance eclipse.ini and config.ini
  •   Registry keys
  •   Native code
• Also supports bundle pooling – sharing bundles across
  multiple installs




                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Where’s p2 ?




               Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2 terminology

• Artifacts is actual content being installed (bytes)
• Metadata consist of Installable units (IUs) that describes the
  content that can be installed




  Person Artifact                                  IU
                                                   Name: org.eclipse.gumby
                                                   Version:3.6.0.v20100321
                                                   Requirements: org.eclipse.pokey
                                                   Provided capabilities: org.eclipse.bendy




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Decouple decision making from the actual content




                                         IU
                                       (id, ver)




                      Everything is an IU
                   Everything is installable
            It is also referred to as “metadata”

                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Anatomy of an IU, more

• Update description
   • This allows to control of
     • IU is being updated org.eclipse.osgi_3.5.1 _v20090827
     • IU to update it to org.eclipse.osgi_3.5.2_v20100126
• Applicability filter
   • This allows for an IU to express when it is only applicable to a
     particular environment.
   • Example platform specific filters for swt fragments (x86,linux,gtk)




                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Anatomy of an IU, requirements / capabilities

• Capabilities and requirements are the mechanism by which an IU
  express what it provides and what needs.

• A capability is composed of a:
  •   Namespace (string), name (string) and version

• A requirement is composed of a query by default:
  •   Namespace, name and version range

• Namespace, name and version are open ended.

• The requirements and capabilities expressed by IUs can be arbitrary
  and don’t have to all be in the same namespace.
  •   Resources – RPMs, .exes, docs, …
  •   Virtual – if you can define a capability, I can depend on it

                          Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Separation of concerns

•   Installable Unit
    •   Exists independently of the repository


•   Metadata Repository
    •   Store only Installable Units


•   Artifact Repository
    •   Store only Artifacts




         Metadata                                                                             Artifacts




                               Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Artifacts

• Bytes/content to be installed
• Any form
  • JARs (e.g., bundles, features, …)‫‏‬
  • Binary executables
  • RPM, MSI, …
• Defined, maintained, loaded and used separately from the
  metadata




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Repositories

• Defined as an interface, IRepository
• No serialization format assumed
• All repositories have
  • Identity
  • Version
  • Description


• Repos can be queried
  • Allows for delayed loading
  • Captures standard questions




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Metadata Repository

• Defined as an interface, IMetadataRepository

• Add/remove installable units
• Add references to other repos

• Created by factories
• Looked up in an IMetadataRepositoryManager service




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Artifact Repository

• Defined as an interface, IArtifactRepository



• Add/remove descriptors
• Access artifacts by descriptor



• Created by factories
• Looked up in an IArtifactRepositoryManager service




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2 architecture

   Metadata                                                                                       Artifacts




                     Director            Repositories




   Runtimes
                                                     Engine
                   Touchpoints                                                                    Profiles

Eclipse
                                                                                                         Eclipse
                                                                                                         Classic

Other                                                                                   Eclipse
              OS
                                                                                       for C++
                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2 architecture


                                          Metadata                        Data transfer
                                        fetched and
                                         constraints
               Director                   analyzed                Transports
                                                                                      Http/Https
                                                                                     File system
                                                                                       Volume
                                                             Mirroring
          Provisioning
           operation                             Repositories
           requested                                                      p2
                   IU install,                                         Update Site
               uninstall, update
                  operations
                           Engine                   Artifact availability
                                                      and mirroring
                    Eclipse/OSGi
                     Native/OS
          IUs configured                               Profile updated
           into runtimes

         Runtimes                                                      Profiles
                           Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Disk layout




                                                 Configuration area

                                                p2 data area




                                              Artifact repository index. This allows the
                                              plug-ins to be served to other instances.




              Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Disk layout

• Simple configurator provides the OSGi framework the list
  of bundles to run.
• The information stored in bundles.info is
  • Location, id, version, start level, started state


                                                                Configuration area




                                                                Simple configurator data




                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Disk layout




                                                      Download cache, where non-eclipse
                                                      pieces are mirrored before being installed.


                                                                       Profile registry

                                                              Storage for the profile

              MailApp.profile                                 Lock file created when the
                                                              profile is being modified


                                                              Current and previous state of the system


                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
A p2 profile

• A profile contains
  • Properties defining the “environment” such as os, ws, arch,
    install location, bundle pool location
  • The list of IUs
  • Properties associated with each IUs


• Profiles are held by a profile registry
• A profile registry can hold on to several profiles




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Changing a profile

• A profile is usually created during the initial installation
• It is changed by provisioning operations performed using:
   • The director application
   • The UI
   • The API
   • …




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Our example: Hyperbola

• RCP chat client application from the RCP book
  http://eclipsercp.org
• We’ll be building this application
• Creating a repository
• Publishing add-on bundles
• Installing new bundles
• Adding self update to the product
• Using repository tools to create smaller components from the
  repository




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Tutorial requirements

• Eclipse 3.6M6
  http://download.eclipse.org/eclipse/downloads/drops/S-
  3.6M6-201003121448
• >= 1.5 VM
• Files from USB key that’s travelling around the classroom




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Installing the tutorial code

• Start Eclipse 3.6M6
  with a clean workspace
• The samples.zip
  contains the repository
  that we’ll be using
  during the tutorial
• Help->Add New
  Software->Add and
  select the location the
  file on disk
• Accept the license and
  don’t worry about
  unsigned content.



                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Introduction to the sample manager




                 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 1 – Target Platforms

•   Two large bodies of artifacts make-up your software system
    1. The code you write
    2. The libraries you use


•   We know lots about the code you write (SCM Systems,
    software processes, etc…)
•   How do you manage your libraries?
    •   These are considered your “target”


•   Eclipse developers often use the Eclipse SDK as their target
•   There are better options



                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 1 – Target Platforms

• PDE provides facilities to help you manage your target
• We don’t need JDT or PDE in our chat client
  • Create a target based on the Eclipse Platform + Delta Pack




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Create a target platform




• Window -> preferences -> Plugin development -> Target
  platform
• Add Empty Target
• Select directory
• Add new target platform from the directory when you have
  extracted the SDK and delta pack zips

                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 2 – Adding a little p2




• Reusing the Eclipse SDK UI
  • Reusing the UI in its entirety is easy
  • A variety of techniques can be used to customize the UI


                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Versioning

• Every IU has the following identifiers
• Major.minor.service.qualifier
• 3.6.0.v20100129
  •   Major – breaking API
  •   Minor – new API
  •   Service – bug fix
  •   Qualifier – SCM tag or build id
• IU version must increase lexicographically for a successful
  install
• NEVER rebuild and keep the same version number.
• Ensure that your plugin has a .qualifier at the end!



                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Configure the UI




                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Include the p2 bundles




• We have provided a simple p2 feature that includes everything you need
• Simply add the feature to your product
                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Add the feature and launch




                 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
A Variety of Options

• Use the p2 API to create your
  own update UI
• Reuse the existing p2 UI in its
  entirety
• Customize the existing p2 UI




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Customizing the UI




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Eclipse 3.6 – New UI Options
    Simplifying update and extension install for RCP applications


                                              Steffen Pingel
                                              Susan McCourt

                                              Wednesday, 15:45, 25 minutes
                                                Grand Ballroom




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 3 – Product Builds




• Using PDE/Build to create p2 enabled products


                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
pde build

• PDE build generates Ant scripts based on the inputs that your
  provide to the build.
• These Ant scripts are run to create the build artifacts
• Example scripts exist in the templates directory




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Enabling p2 in your build

• Options to enable in your feature or product build’s
  build.properties
• p2.gathering=true
  • Publishes p2 metadata for all bundles, features, product builds
    and pre-existing binary bundles
• p2.compress=true
  • Creates artifacts.jar and content.jar files (XML by default)




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Enabling p2 in your build

• p2.build.repo
  • Default value is file:${buildDirectory}/buildRepo
  • Build time repository
• The artifacts and metadata will be mirrored from
  ${p2.build.repo} and into the values of ${p2.artifacts.repo}
  and ${p2.metadata.repo} are defined.




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Product builds

• Eclipse bundles + custom branding
  • Platform specific options for VM args, program arguments
  • Specify startup levels for bundles
  • Custom splash




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Creating a builder
                 Create a builder with a top level build.properties file:

# Product and packaging control                            # Cross platform building
product=                                                  configs=win32, win32, x86 & linux, gtk, x86
/org.eclipsercp.hyperbola.product/hyperbola.product
runPackager=true                                           # CVS Access control
archivePrefix=hyperbola                                    skipMaps=true
                                                           mapsRepo=
# Build naming and locatingion                                 :pserver:anonymous@example.com</path/to/repo>
buildDirectory=${user.home}/eclipse.build                  mapsRoot=<path/to/maps>
buildType=I                                                mapsCheckoutTag=HEAD
buildId=TestBuild                                          skipFetch=true
buildLabel=${buildType}.${buildId}
                                                           # Publish the build to a p2 repository
# Base identification and location                         p2.gathering = true
skipBase=true                                              p2.metadata.repo =
pluginPath=                                                    file://${buildDirectory}/repository/hyperbola
                                                           p2.artifact.repo = 
                                                               file://${buildDirectory}/repository/hyperbola
                                                           p2.compress = true

                                                           # Java class libraries and compile controls
                                                           #bootclasspath=${java.home}/lib/rt.jar
                                                           compilerArg=

                                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Running the Builder

•   Create ${buildDirectory}.
•   Create ${buildDirectory}/plugins.
•   Create ${buildDirectory}/features.
•   Copy the required feature projects to the features directory
    and plug-in projects to the plugins directory.


cd <workspace location>hyperbola.builder
c:ideeclipseeclipse.exe
 -application org.eclipse.ant.core.antRunner
 -buildfile productBuild.xml
 -consolelog




                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Running the Builder




                  Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Building SDKs

• Software developer kits provide
   •   Binaries
   •   Source
   •   Documentation
• SDK features
   •   Include binary feature
   •   Generate source feature

generate.feature@org.yourfeature.source=org.yourfeature
  SDK build.properties

individualSourceBundles=true
   Top level build.properties

http://wiki.eclipse.org/PDEBuild/Individual_Source_Bundles

                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 4




•   Creating a Voice Over IP feature
•   Export from the workspace
•   Install the add-on using the UI
•   Install the add-on using the director


                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Feature builds

• Features are collections of bundles with related functionality.
  Example org.eclipse.pde feature




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Update your target

• Add on providers don’t have access to your SCM
• Add on providers don’t want access to your SCM

• Add on provider need access to your builds

• You can include the results of your product in your target




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Update your target




                 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Update your target




                 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Categories

• If features are not categorized they will not show up
• Most developers worry about the producers version of the
  world
• Categories help define a consumers version of the world
• Use the category editor define categories




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Voice Chat

• Exercise 4 contains a simple
  VoIP feature
• Integrates with Hyperbola to
  add voice chat
• Load the code and export the
  feature
  •   Generate a p2 metadata
      repository




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Installing the feature

• We all know how to install the feature using the UI

                                                                                 DO NOT USE
              E                                                                   DROPINS!
        OT US
    DO N I NS !                                                                        DO
     DROP                                                                              DRO
                                                                                          NOT
                                                                                              U SE
                                                                                           PINS
                                                                                               !
              U SE                                                                D
                                                                                    O
            T S!                                                                 D NO
          NO PIN                                                                  R
                                                                                    O T
        DO RO                                                                         PI U
                                                                                        N SE
          D                                                                              S!

•
    We can also install it from the command line
    • We use the director application to affect RCP installs

                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
director




                                             • Invoke provisioning
                                               operations in a
                                               headless manner
                                                   • Install
                                                   • Uninstall
                                                   • Update?




           Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Director app from within IDE




Install pde
feature into new
directory

                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
director example



  d:buildereclipsec.exe -application
  org.eclipse.equinox.p2.director
  –metadataRepository http://download.eclipse.org/releases/helios/
  –artifactRepository http://download.eclipse.org/releases/helios/
  -installIU org.eclipsercp.voice.feature.feature.group
  -destination d:/eclipse/
  -profile SDKProfile




                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Voice Over IP




                Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
The p2 UI




            Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 5 – Feature builds




                  Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Adding the voice feature

• Like product builds, PDE supports building features
• We just want a repository to represent our feature

• To build our Voice feature we need two different
  requirements
  • The Eclipse Platform
  • The Hyperbola Platform


• For the hyperbola platform, we can use the repositories we
  generated earlier




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Feature build.properties

# Feature identification                                   # SCM Access control
topLevelElementType = feature                              skipMaps=true
topLevelElementId =                                        skipFetch=true
   org.eclipsercp.voice.feature
archivePrefix=voip_feature                                 # Publish the build to a p2 repository
                                                           p2.gathering = true
# Build naming and location
buildDirectory=${user.home}/feature.build                  # Cross platform building
                                                           configs = *, *, *
# Base identification and location
skipBase=true
baseLocation=C:/hyperbola_prereqs
repoBaseLocation=
<hyperbolaBuildLocation>/repository
transformedRepoLocation=
   ${buildDirectory}/transformedRepo


                           Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Running the build

•   Create ${buildDirectory}
•   Create ${buildDirectory}/plugins.
•   Create ${buildDirectory}/features.
•   Copy the required plug-ins and feature to plugins/ and
    features/ directory.
•   Invoke org.eclipse.ant.core.antRunner as shown below:


            cd <workspace location>/feature.builder
            c:ideeclipseeclipse.exe
               -application org.eclipse.ant.core.antRunner
               –buildfile build.xml -consolelog



                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Running the build




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise 6




• Automatically update Hyperbola each time it starts



                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
How to update

• Two ways to update
  •    Look at all the IUs in your Profile
  •    See if there are any “updates” available
  •    Plan the update
  •    Execute the update on the engine
  •    Handle errors
  •    Restart
• Or
  • Create an UpdateOperation
  • Execute the Operation




                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Update on startup




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Operation API

• We have a much simpler API for the basic use case
  • Pre-canned Operations for Update, Install, Uninstall
  • Available in the “operations” bundle




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Setting your repositories

• You likely want a pre-canned set of repositories to check
• You can use a p2.inf file to supply this information




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise

• Setup hyperbola to auto update itself on startup.
• Make some changes, rebuild, and continually update




                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Metadata is immutable


 Reuse metadata




                                      to create subsets of functionality
                  Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2.repository.repo2runnable




Specify source and destination


                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
repo2runnable

• Transforms features and bundles into their installed form
• For example, bundles that are in folder format will be
  extracted

<p2.repo2runnable>
  <source dir="${sourcedir}“/>
  <destination="${destinationdir}/eclipse“/>
</p2.repo2runnable>


• By default, all IUs will be transformed but you can also specify
  nested <iu> elements



                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Mirroring is slicing




               Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Mirroring repositories with p2

• Mirror a repository or a subset of the IUs to a new location
• Separate applications to mirror metadata and artifacts




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2.metadata.repository.mirrorApplication




Specify source and destination

                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2.artifact.repository.mirrorApplication




                                                      Specify source and destination




Option to use a comparator
against a baseline

                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Exercise: Mirroring a Hyperbola subset

• Use the metadata and artifact repository mirroring tools to
  mirror a subset of the Hyperbola product – perhaps one
  platform.
• Not sure if we will have time for this




                     Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
One of these bundles is not like the other




Bundle id + version = one set of bytes
               Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Consistent bundles with a comparator

• If you use a different compiler to compile the same source,
  it’s not necessarily the same byte code
• Use a comparator with a baseline to compare the bundles in
  the repository in the current ones being built.
• Discard new bundles with the same bundle id + version
• Bundles in product zip must be identical repository bundles




            Product
             build
                                  ==                          p2 repo


                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Composite repositories

• Delineate artifacts and metadata into child repos
      compositeArtifacts.jar
      compositeContent.jar
      I20100210-0950/
      I20100211-0900/
      I20100212-1053/
• Child repository I20100211-0900
      artifacts.jar
      content.jar
      features/
      plugins/




                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
get involved

•   p2 in the wiki http://wiki.eclipse.org/P2
•   p2 mailing list p2-dev@eclipse.org
•   IRC #equinox-dev
•   p2 committers on twitter http://wiki.eclipse.org/Twitter
•   Project sets




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
References

• Version numbering http://wiki.eclipse.org/Version_Numbering
• 2009 EclipseCon p2 tutorial
  http://www.slideshare.net/PascalRapicault/understanding-
  and-extending-p2-for-fun-and-profit
• PDE Build Integration with p2
  http://help.eclipse.org/galileo/index.jsp?nav=/4_2_2
• Adding Self Update to an RCP Application
  http://wiki.eclipse.org/Equinox/p2/Adding_Self-
  Update_to_an_RCP_Application
• p2 director application
  http://wiki.eclipse.org/Equinox_p2_director_application



                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Photo credits

• Orange and knife by Safari11
  http://www.sxc.hu/browse.phtml?f=view&id=983682
• Oranges by Stephanie Berghaeuser
  http://www.sxc.hu/photo/783917
• Sliced oranges shin0 http://www.sxc.hu/photo/278
• Recycle tag by jaylopez http://www.sxc.hu/photo/917290
• Cutlery by Oliver Delgado
  http://www.sxc.hu/browse.phtml?f=view&id=582099
• Director’s chair by Alek von Felkerzam
  http://www.sxc.hu/browse.phtml?f=view&id=814604




                   Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Legal notice

•   Copyright © IBM Corp., 2007-2010. All rights reserved. This presentation
    and the source code in it are made available under the EPL, v1.0.
•   Java and all Java-based trademarks are trademarks of Sun Microsystems,
    Inc. in the United States, other countries, or both.
•   Eclipse and the Eclipse logo are trademarks of Eclipse Foundation, Inc.
•   IBM and the IBM logo are trademarks or registered trademarks of IBM
    Corporation, in the United States, other countries or both.
•   Other company, product, or service names may be trademarks or service
    marks of others.
•   THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED
    FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO
    VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION, IT IS
    PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES
    ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, SUCH
    INFORMATION. ANY INFORMATION CONCERNING IBM'S PRODUCT PLANS
    OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT NOTICE


                         Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Extra slides




               Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2.mirror Ant task

• Allows you to mirror artifacts and metadata simultaneously
• Filter by platform and specify IUs

<p2.mirror source="file://${myRepo}">
<destination kind="metadata" location="file://${myNewRepo}"
   format="file://${myRepo}" />
<destination kind="artifact" location="file://${myNewRepo}"
   format="file://${myRepo}" />
<iu id=“org.eclipse.pde" version="" />
<iu id=“org.eclipse.pde.sdk" version="" />
<slicingOptions platformFilter="true" includeOptional="false"
   includeNonGreedy="false" followStrict="true" />
</p2.mirror>




                      Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
remove.iu Ant task

• Remove IUs from the repository

• Remove all packed jars from a repo

<p2.remove.iu>
   <repository location="file://${myRepo}" />
   <iu query="" artifacts="(format=packed)" />
</p2.remove.iu>


• Remove specific IUs

<p2.remove.iu>
   <repository location="file://${myRepo}" />
   <iu id="com.ibm.icu" artifacts="(format=packed)" />
</p2.remove.iu>


                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2.composite.{artifact|metadata}.repository

• Create composite artifact and metadata repositories
<p2.composite.artifact.repository.create
  location="file://${myRepo}" name="${p2.repo.name}"
  compressed="true" failOnExists="false" />
<p2.composite.metadata.repository.create
  location="file://${myRepo}" name="${p2.repo.name}"
  compressed="true" failOnExists="false" />

• Add children
<p2.composite.artifact.repository.add
  location="file://${myRepo}" child="${buildId}" />
<p2.composite.metadata.repository.add
  location="file://${myRepo}" child="${buildId}" />
</target>

                    Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
Repository management best practices

•   Implement composite repositories
•   Use repository tools to modify the contents of a repository
•   Life cycle of a repository
•   How to specify mirrors in your repository? (Not sure if this is
    too much detail)




                       Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
publisher

• The p2 publisher was integrated into pde build in 3.5M5.
• Features and bundles are gathered from source and published
  to a repository
• Can publish
  •   Feature and bundles
  •   Products
  •   Categories
  •   Update site
  •   From an existing install
• Enabling the publisher will create a repository for all platforms
  you are building.




                        Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
p2 and agile software development


                                 Develop




                          p2 repository
         Test                                                                    Build




                               Assemble
                 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.

Weitere ähnliche Inhalte

Was ist angesagt?

Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2Pascal Rapicault
 
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSubramanyam C
 
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoTUdoHafermann
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
Building Eclipse Plugins
Building Eclipse PluginsBuilding Eclipse Plugins
Building Eclipse PluginsLiran Zelkha
 
EEF : Sexy Properties, Wizards and Views - EclipseCon 11
EEF : Sexy Properties, Wizards and Views - EclipseCon 11EEF : Sexy Properties, Wizards and Views - EclipseCon 11
EEF : Sexy Properties, Wizards and Views - EclipseCon 11Chauvin Mariot
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good PracticesAnkur Sharma
 
Migrating to Git: Rethinking the Commit
Migrating to Git:  Rethinking the CommitMigrating to Git:  Rethinking the Commit
Migrating to Git: Rethinking the CommitKim Moir
 
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inTonny Madsen
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingChris Aniszczyk
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOpsEficode
 
Automating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal useAutomating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal usePascal Rapicault
 
Building Good Containers for Python Applications
Building Good Containers for Python ApplicationsBuilding Good Containers for Python Applications
Building Good Containers for Python ApplicationsAll Things Open
 
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Benjamin Cabé
 
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019Edwin Derks
 
Dr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin developmentDr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin developmentUlrich Krause
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsTeodor Madan
 
Cross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open SourceCross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open SourceAll Things Open
 

Was ist angesagt? (20)

Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2
 
Sleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your ProductSleep Peacefully as Maven Tycho Builds your Product
Sleep Peacefully as Maven Tycho Builds your Product
 
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
2015 11-04 HEADS at EclipseCon: Modelling Things for IoT
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
PDE builds or Maven
PDE builds or MavenPDE builds or Maven
PDE builds or Maven
 
Building Eclipse Plugins
Building Eclipse PluginsBuilding Eclipse Plugins
Building Eclipse Plugins
 
EEF : Sexy Properties, Wizards and Views - EclipseCon 11
EEF : Sexy Properties, Wizards and Views - EclipseCon 11EEF : Sexy Properties, Wizards and Views - EclipseCon 11
EEF : Sexy Properties, Wizards and Views - EclipseCon 11
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good Practices
 
Migrating to Git: Rethinking the Commit
Migrating to Git:  Rethinking the CommitMigrating to Git:  Rethinking the Commit
Migrating to Git: Rethinking the Commit
 
L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
 
OSGi, Eclipse and API Tooling
OSGi, Eclipse and API ToolingOSGi, Eclipse and API Tooling
OSGi, Eclipse and API Tooling
 
Compare framework
Compare frameworkCompare framework
Compare framework
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOps
 
Automating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal useAutomating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal use
 
Building Good Containers for Python Applications
Building Good Containers for Python ApplicationsBuilding Good Containers for Python Applications
Building Good Containers for Python Applications
 
Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012Lua on Steroids - EclipseCon NA 2012
Lua on Steroids - EclipseCon NA 2012
 
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
 
Dr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin developmentDr. Strangelove, or how I learned to love plugin development
Dr. Strangelove, or how I learned to love plugin development
 
Migrating from PDE to Tycho builds
Migrating from PDE to Tycho buildsMigrating from PDE to Tycho builds
Migrating from PDE to Tycho builds
 
Cross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open SourceCross-platform Mobile Development on Open Source
Cross-platform Mobile Development on Open Source
 

Andere mochten auch

GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11Chauvin Mariot
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitMike Pfaff
 
The ultimate dependency manager shoot out - X Uiterlinden & S Mak
The ultimate dependency manager shoot out - X Uiterlinden & S MakThe ultimate dependency manager shoot out - X Uiterlinden & S Mak
The ultimate dependency manager shoot out - X Uiterlinden & S Makmfrancis
 
OSGi For Eclipse Developers
OSGi For Eclipse DevelopersOSGi For Eclipse Developers
OSGi For Eclipse DevelopersChris Aniszczyk
 
PRESENTACIÓ DELS GOSSOS P3
PRESENTACIÓ DELS GOSSOS P3PRESENTACIÓ DELS GOSSOS P3
PRESENTACIÓ DELS GOSSOS P3jmsosesinf
 
Tema2 els aliments
Tema2 els alimentsTema2 els aliments
Tema2 els alimentsdolorslm
 
Physics Unit P2
Physics Unit P2Physics Unit P2
Physics Unit P2Louisatom
 
Methods of cooking ppt
Methods of cooking pptMethods of cooking ppt
Methods of cooking pptlaurahuang
 

Andere mochten auch (17)

GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11GMF : Create your graphical DSL - EclipseCon 11
GMF : Create your graphical DSL - EclipseCon 11
 
SCR Annotations for Fun and Profit
SCR Annotations for Fun and ProfitSCR Annotations for Fun and Profit
SCR Annotations for Fun and Profit
 
The ultimate dependency manager shoot out - X Uiterlinden & S Mak
The ultimate dependency manager shoot out - X Uiterlinden & S MakThe ultimate dependency manager shoot out - X Uiterlinden & S Mak
The ultimate dependency manager shoot out - X Uiterlinden & S Mak
 
OSGi For Eclipse Developers
OSGi For Eclipse DevelopersOSGi For Eclipse Developers
OSGi For Eclipse Developers
 
Els gossos
Els gossosEls gossos
Els gossos
 
P2 slideshare
P2 slideshareP2 slideshare
P2 slideshare
 
Power point gossos
Power point gossosPower point gossos
Power point gossos
 
PRESENTACIÓ DELS GOSSOS P3
PRESENTACIÓ DELS GOSSOS P3PRESENTACIÓ DELS GOSSOS P3
PRESENTACIÓ DELS GOSSOS P3
 
Els aliments
Els alimentsEls aliments
Els aliments
 
OSGi Blueprint Services
OSGi Blueprint ServicesOSGi Blueprint Services
OSGi Blueprint Services
 
Projecte gossos p4
Projecte gossos p4Projecte gossos p4
Projecte gossos p4
 
Projecte: com creixen les flors?
Projecte: com creixen les flors?Projecte: com creixen les flors?
Projecte: com creixen les flors?
 
Panda
Panda Panda
Panda
 
Tema2 els aliments
Tema2 els alimentsTema2 els aliments
Tema2 els aliments
 
Els Aliments
Els AlimentsEls Aliments
Els Aliments
 
Physics Unit P2
Physics Unit P2Physics Unit P2
Physics Unit P2
 
Methods of cooking ppt
Methods of cooking pptMethods of cooking ppt
Methods of cooking ppt
 

Ähnlich wie P2 Introduction

Who Took The Cookie From The Cookie Jar?
Who Took The Cookie From The Cookie Jar?Who Took The Cookie From The Cookie Jar?
Who Took The Cookie From The Cookie Jar?Olivier Thomann
 
ABC of Platform Workspace
ABC of Platform WorkspaceABC of Platform Workspace
ABC of Platform WorkspaceTomasz Zarna
 
Orion Introduction
Orion IntroductionOrion Introduction
Orion IntroductionTomasz Zarna
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Chris Simmonds
 
Orion Introduction
Orion IntroductionOrion Introduction
Orion IntroductionTomasz Zarna
 
Orion (What's Next conference)
Orion (What's Next conference)Orion (What's Next conference)
Orion (What's Next conference)Boris Bokowski
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)danielputerman
 
Oracle Java ME Embedded 8.1 Devloper Preview: Introduction
Oracle Java ME Embedded 8.1 Devloper Preview: IntroductionOracle Java ME Embedded 8.1 Devloper Preview: Introduction
Oracle Java ME Embedded 8.1 Devloper Preview: Introductionterrencebarr
 
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...mfrancis
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOpen Mobile Alliance
 
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraftstackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with UnikraftNETWAYS
 
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxDeploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxJamie Coleman
 
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...WASdev Community
 
Easy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on AzureEasy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on AzureMesosphere Inc.
 
EclipseCon 2010 - What's new in JDT
EclipseCon 2010 - What's new in JDTEclipseCon 2010 - What's new in JDT
EclipseCon 2010 - What's new in JDTdeepakazad
 
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBM
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBMIntroducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBM
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBMmfrancis
 
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfKolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfMichal Rostecki
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
 
MWLUG - Universal Java
MWLUG  -  Universal JavaMWLUG  -  Universal Java
MWLUG - Universal JavaPhilippe Riand
 

Ähnlich wie P2 Introduction (20)

Who Took The Cookie From The Cookie Jar?
Who Took The Cookie From The Cookie Jar?Who Took The Cookie From The Cookie Jar?
Who Took The Cookie From The Cookie Jar?
 
ABC of Platform Workspace
ABC of Platform WorkspaceABC of Platform Workspace
ABC of Platform Workspace
 
Orion Introduction
Orion IntroductionOrion Introduction
Orion Introduction
 
Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017Software update for IoT Embedded World 2017
Software update for IoT Embedded World 2017
 
Orion Introduction
Orion IntroductionOrion Introduction
Orion Introduction
 
Orion (What's Next conference)
Orion (What's Next conference)Orion (What's Next conference)
Orion (What's Next conference)
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
Oracle Java ME Embedded 8.1 Devloper Preview: Introduction
Oracle Java ME Embedded 8.1 Devloper Preview: IntroductionOracle Java ME Embedded 8.1 Devloper Preview: Introduction
Oracle Java ME Embedded 8.1 Devloper Preview: Introduction
 
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...
Keynote - Eclipse - Accelerating OSGi Adoption - Mike Milinkovich, Executive ...
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
 
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraftstackconf 2022: It’s Time to Debloat the Cloud with Unikraft
stackconf 2022: It’s Time to Debloat the Cloud with Unikraft
 
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptxDeploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
Deploy and Update Jakarta EE & MicroProfile applications with Paketo.pptx
 
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...
AAI-2016 WebSphere Application Server Installation and Maintenance in the Ent...
 
Easy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on AzureEasy Docker Deployments with Mesosphere DCOS on Azure
Easy Docker Deployments with Mesosphere DCOS on Azure
 
What's New In JDT ?
What's New In JDT ?What's New In JDT ?
What's New In JDT ?
 
EclipseCon 2010 - What's new in JDT
EclipseCon 2010 - What's new in JDTEclipseCon 2010 - What's new in JDT
EclipseCon 2010 - What's new in JDT
 
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBM
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBMIntroducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBM
Introducing the Embedded Rich Client Platform (eRCP) - Jim Robbins, IBM
 
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfKolla - containerizing the cloud itself
Kolla - containerizing the cloud itself
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
MWLUG - Universal Java
MWLUG  -  Universal JavaMWLUG  -  Universal Java
MWLUG - Universal Java
 

Kürzlich hochgeladen

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

P2 Introduction

  • 1. From build to assembly to deployment: Using p2 to facilitate agile software development Kim Moir, IBM Ian Bull, EclipseSource Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 2. About us • Kim Moir is the Release Engineering lead for the Eclipse and RT Equinox projects, and works in the IBM Ottawa Lab. She uses p2 to provision builds for 13 platforms. • Ian Bull works on a number of Eclipse projects, including p2, Zest and the PDE Incubator. Ian works at EclipseSource as a software engineer. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 3. What about you? • How do you use p2? • What are you looking to get out of this tutorial? • Are your building products based on p2? Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 4. Agile Software Development • Key characteristic of agile software development includes Fast Cycle Time: • Include your customers in the development process • Ensure your customers are continually using the latest software • Ensure your developers are building against the latest software Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 5. Overview • How can p2 be used to manage your update strategy? • Update your RCP and OSGi applications • Provide a mechanism to install and manage new features • Provide a mechanism to manage different configurations • Manage your developers target platforms Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 6. Outline • Overview of p2 • p2 architecture and terminology • Anatomy of a repository • Using the director and publisher • Product based builds with p2 • Repository management best practices • Assembling products out of pre-existing components (no compiling) Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 7. Hands-on exercises • Building and assembling different configurations of your application • Building and publishing add-on bundles • Export or build your product to a repository, and then install the product from the repository you just created. • Using repository tools such as the slicer, repo2runnable or mirror to build smaller components from existing repositories Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 8. A brief history of Eclipse • When Eclipse starts, the plug-ins are scanned and functionality is discovered • If a dependency is missing, all the dependent plug-ins simply fail to start • Old plug-ins pollute the application • You cannot update resources, licenses, executables or the framework itself Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 9. Unzipping is not Installing Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 10. What is p2 – p2 is Installing! • A replacement for the old update manager • New UI, simplified workflow • Manage Eclipse, RCP and more (exe, ini, bundles, registry keys, …) • Shared bundles across Eclipse-based products • An installer TM • A provisioning platform for OSGi systems (in progress) • Managing non-running instance • Start level, framework extension • Fine-grained dependency management Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 11. What does p2 enable? • An extensible provisioning platform for OSGiTM systems which provides • Installation • Searching for updates • Rollback • Dependency management • Policy control • UI or headless Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 12. What p2 isn’t • An end to end build system • PDE build provides tooling to generate p2 repositories when building bundles • A product – the eclipse community builds the products! Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 13. What can you build with p2? • Add-on manager for RCP applications • Installers • Configuration Management Systems • Self updating applications • Install -> Update -> Roll back scenarios • etc… Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 14. Who needs to provision? Engineers Users source code applications open source tools in-house built runtimes licensed software Automated Builds Test Test Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 15. p2 is for more than just bundles • p2 can provision • OSGiTM bundles • Executables • Configuration files – for instance eclipse.ini and config.ini • Registry keys • Native code • Also supports bundle pooling – sharing bundles across multiple installs Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 16. Where’s p2 ? Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 17. p2 terminology • Artifacts is actual content being installed (bytes) • Metadata consist of Installable units (IUs) that describes the content that can be installed Person Artifact IU Name: org.eclipse.gumby Version:3.6.0.v20100321 Requirements: org.eclipse.pokey Provided capabilities: org.eclipse.bendy Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 18. Decouple decision making from the actual content IU (id, ver) Everything is an IU Everything is installable It is also referred to as “metadata” Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 19. Anatomy of an IU, more • Update description • This allows to control of • IU is being updated org.eclipse.osgi_3.5.1 _v20090827 • IU to update it to org.eclipse.osgi_3.5.2_v20100126 • Applicability filter • This allows for an IU to express when it is only applicable to a particular environment. • Example platform specific filters for swt fragments (x86,linux,gtk) Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 20. Anatomy of an IU, requirements / capabilities • Capabilities and requirements are the mechanism by which an IU express what it provides and what needs. • A capability is composed of a: • Namespace (string), name (string) and version • A requirement is composed of a query by default: • Namespace, name and version range • Namespace, name and version are open ended. • The requirements and capabilities expressed by IUs can be arbitrary and don’t have to all be in the same namespace. • Resources – RPMs, .exes, docs, … • Virtual – if you can define a capability, I can depend on it Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 21. Separation of concerns • Installable Unit • Exists independently of the repository • Metadata Repository • Store only Installable Units • Artifact Repository • Store only Artifacts Metadata Artifacts Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 22. Artifacts • Bytes/content to be installed • Any form • JARs (e.g., bundles, features, …)‫‏‬ • Binary executables • RPM, MSI, … • Defined, maintained, loaded and used separately from the metadata Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 23. Repositories • Defined as an interface, IRepository • No serialization format assumed • All repositories have • Identity • Version • Description • Repos can be queried • Allows for delayed loading • Captures standard questions Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 24. Metadata Repository • Defined as an interface, IMetadataRepository • Add/remove installable units • Add references to other repos • Created by factories • Looked up in an IMetadataRepositoryManager service Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 25. Artifact Repository • Defined as an interface, IArtifactRepository • Add/remove descriptors • Access artifacts by descriptor • Created by factories • Looked up in an IArtifactRepositoryManager service Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 26. p2 architecture Metadata Artifacts Director Repositories Runtimes Engine Touchpoints Profiles Eclipse Eclipse Classic Other Eclipse OS for C++ Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 27. p2 architecture Metadata Data transfer fetched and constraints Director analyzed Transports Http/Https File system Volume Mirroring Provisioning operation Repositories requested p2 IU install, Update Site uninstall, update operations Engine Artifact availability and mirroring Eclipse/OSGi Native/OS IUs configured Profile updated into runtimes Runtimes Profiles Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 28. Disk layout Configuration area p2 data area Artifact repository index. This allows the plug-ins to be served to other instances. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 29. Disk layout • Simple configurator provides the OSGi framework the list of bundles to run. • The information stored in bundles.info is • Location, id, version, start level, started state Configuration area Simple configurator data Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 30. Disk layout Download cache, where non-eclipse pieces are mirrored before being installed. Profile registry Storage for the profile MailApp.profile Lock file created when the profile is being modified Current and previous state of the system Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 31. A p2 profile • A profile contains • Properties defining the “environment” such as os, ws, arch, install location, bundle pool location • The list of IUs • Properties associated with each IUs • Profiles are held by a profile registry • A profile registry can hold on to several profiles Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 32. Changing a profile • A profile is usually created during the initial installation • It is changed by provisioning operations performed using: • The director application • The UI • The API • … Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 33. Our example: Hyperbola • RCP chat client application from the RCP book http://eclipsercp.org • We’ll be building this application • Creating a repository • Publishing add-on bundles • Installing new bundles • Adding self update to the product • Using repository tools to create smaller components from the repository Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 34. Tutorial requirements • Eclipse 3.6M6 http://download.eclipse.org/eclipse/downloads/drops/S- 3.6M6-201003121448 • >= 1.5 VM • Files from USB key that’s travelling around the classroom Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 35. Installing the tutorial code • Start Eclipse 3.6M6 with a clean workspace • The samples.zip contains the repository that we’ll be using during the tutorial • Help->Add New Software->Add and select the location the file on disk • Accept the license and don’t worry about unsigned content. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 36. Introduction to the sample manager Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 37. Exercise 1 – Target Platforms • Two large bodies of artifacts make-up your software system 1. The code you write 2. The libraries you use • We know lots about the code you write (SCM Systems, software processes, etc…) • How do you manage your libraries? • These are considered your “target” • Eclipse developers often use the Eclipse SDK as their target • There are better options Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 38. Exercise 1 – Target Platforms • PDE provides facilities to help you manage your target • We don’t need JDT or PDE in our chat client • Create a target based on the Eclipse Platform + Delta Pack Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 39. Create a target platform • Window -> preferences -> Plugin development -> Target platform • Add Empty Target • Select directory • Add new target platform from the directory when you have extracted the SDK and delta pack zips Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 40. Exercise 2 – Adding a little p2 • Reusing the Eclipse SDK UI • Reusing the UI in its entirety is easy • A variety of techniques can be used to customize the UI Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 41. Versioning • Every IU has the following identifiers • Major.minor.service.qualifier • 3.6.0.v20100129 • Major – breaking API • Minor – new API • Service – bug fix • Qualifier – SCM tag or build id • IU version must increase lexicographically for a successful install • NEVER rebuild and keep the same version number. • Ensure that your plugin has a .qualifier at the end! Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 42. Configure the UI Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 43. Include the p2 bundles • We have provided a simple p2 feature that includes everything you need • Simply add the feature to your product Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 44. Add the feature and launch Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 45. A Variety of Options • Use the p2 API to create your own update UI • Reuse the existing p2 UI in its entirety • Customize the existing p2 UI Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 46. Customizing the UI Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 47. Eclipse 3.6 – New UI Options Simplifying update and extension install for RCP applications Steffen Pingel Susan McCourt Wednesday, 15:45, 25 minutes Grand Ballroom Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 48. Exercise 3 – Product Builds • Using PDE/Build to create p2 enabled products Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 49. pde build • PDE build generates Ant scripts based on the inputs that your provide to the build. • These Ant scripts are run to create the build artifacts • Example scripts exist in the templates directory Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 50. Enabling p2 in your build • Options to enable in your feature or product build’s build.properties • p2.gathering=true • Publishes p2 metadata for all bundles, features, product builds and pre-existing binary bundles • p2.compress=true • Creates artifacts.jar and content.jar files (XML by default) Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 51. Enabling p2 in your build • p2.build.repo • Default value is file:${buildDirectory}/buildRepo • Build time repository • The artifacts and metadata will be mirrored from ${p2.build.repo} and into the values of ${p2.artifacts.repo} and ${p2.metadata.repo} are defined. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 52. Product builds • Eclipse bundles + custom branding • Platform specific options for VM args, program arguments • Specify startup levels for bundles • Custom splash Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 53. Creating a builder Create a builder with a top level build.properties file: # Product and packaging control # Cross platform building product= configs=win32, win32, x86 & linux, gtk, x86 /org.eclipsercp.hyperbola.product/hyperbola.product runPackager=true # CVS Access control archivePrefix=hyperbola skipMaps=true mapsRepo= # Build naming and locatingion :pserver:anonymous@example.com</path/to/repo> buildDirectory=${user.home}/eclipse.build mapsRoot=<path/to/maps> buildType=I mapsCheckoutTag=HEAD buildId=TestBuild skipFetch=true buildLabel=${buildType}.${buildId} # Publish the build to a p2 repository # Base identification and location p2.gathering = true skipBase=true p2.metadata.repo = pluginPath= file://${buildDirectory}/repository/hyperbola p2.artifact.repo = file://${buildDirectory}/repository/hyperbola p2.compress = true # Java class libraries and compile controls #bootclasspath=${java.home}/lib/rt.jar compilerArg= Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 54. Running the Builder • Create ${buildDirectory}. • Create ${buildDirectory}/plugins. • Create ${buildDirectory}/features. • Copy the required feature projects to the features directory and plug-in projects to the plugins directory. cd <workspace location>hyperbola.builder c:ideeclipseeclipse.exe -application org.eclipse.ant.core.antRunner -buildfile productBuild.xml -consolelog Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 55. Running the Builder Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 56. Building SDKs • Software developer kits provide • Binaries • Source • Documentation • SDK features • Include binary feature • Generate source feature generate.feature@org.yourfeature.source=org.yourfeature SDK build.properties individualSourceBundles=true Top level build.properties http://wiki.eclipse.org/PDEBuild/Individual_Source_Bundles Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 57. Exercise 4 • Creating a Voice Over IP feature • Export from the workspace • Install the add-on using the UI • Install the add-on using the director Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 58. Feature builds • Features are collections of bundles with related functionality. Example org.eclipse.pde feature Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 59. Update your target • Add on providers don’t have access to your SCM • Add on providers don’t want access to your SCM • Add on provider need access to your builds • You can include the results of your product in your target Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 60. Update your target Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 61. Update your target Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 62. Categories • If features are not categorized they will not show up • Most developers worry about the producers version of the world • Categories help define a consumers version of the world • Use the category editor define categories Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 63. Voice Chat • Exercise 4 contains a simple VoIP feature • Integrates with Hyperbola to add voice chat • Load the code and export the feature • Generate a p2 metadata repository Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 64. Installing the feature • We all know how to install the feature using the UI DO NOT USE E DROPINS! OT US DO N I NS ! DO DROP DRO NOT U SE PINS ! U SE D O T S! D NO NO PIN R O T DO RO PI U N SE D S! • We can also install it from the command line • We use the director application to affect RCP installs Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 65. director • Invoke provisioning operations in a headless manner • Install • Uninstall • Update? Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 66. Director app from within IDE Install pde feature into new directory Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 67. director example d:buildereclipsec.exe -application org.eclipse.equinox.p2.director –metadataRepository http://download.eclipse.org/releases/helios/ –artifactRepository http://download.eclipse.org/releases/helios/ -installIU org.eclipsercp.voice.feature.feature.group -destination d:/eclipse/ -profile SDKProfile Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 68. Voice Over IP Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 69. The p2 UI Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 70. Exercise 5 – Feature builds Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 71. Adding the voice feature • Like product builds, PDE supports building features • We just want a repository to represent our feature • To build our Voice feature we need two different requirements • The Eclipse Platform • The Hyperbola Platform • For the hyperbola platform, we can use the repositories we generated earlier Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 72. Feature build.properties # Feature identification # SCM Access control topLevelElementType = feature skipMaps=true topLevelElementId = skipFetch=true org.eclipsercp.voice.feature archivePrefix=voip_feature # Publish the build to a p2 repository p2.gathering = true # Build naming and location buildDirectory=${user.home}/feature.build # Cross platform building configs = *, *, * # Base identification and location skipBase=true baseLocation=C:/hyperbola_prereqs repoBaseLocation= <hyperbolaBuildLocation>/repository transformedRepoLocation= ${buildDirectory}/transformedRepo Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 73. Running the build • Create ${buildDirectory} • Create ${buildDirectory}/plugins. • Create ${buildDirectory}/features. • Copy the required plug-ins and feature to plugins/ and features/ directory. • Invoke org.eclipse.ant.core.antRunner as shown below: cd <workspace location>/feature.builder c:ideeclipseeclipse.exe -application org.eclipse.ant.core.antRunner –buildfile build.xml -consolelog Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 74. Running the build Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 75. Exercise 6 • Automatically update Hyperbola each time it starts Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 76. How to update • Two ways to update • Look at all the IUs in your Profile • See if there are any “updates” available • Plan the update • Execute the update on the engine • Handle errors • Restart • Or • Create an UpdateOperation • Execute the Operation Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 77. Update on startup Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 78. Operation API • We have a much simpler API for the basic use case • Pre-canned Operations for Update, Install, Uninstall • Available in the “operations” bundle Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 79. Setting your repositories • You likely want a pre-canned set of repositories to check • You can use a p2.inf file to supply this information Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 80. Exercise • Setup hyperbola to auto update itself on startup. • Make some changes, rebuild, and continually update Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 81. Metadata is immutable Reuse metadata to create subsets of functionality Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 82. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 83. p2.repository.repo2runnable Specify source and destination Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 84. repo2runnable • Transforms features and bundles into their installed form • For example, bundles that are in folder format will be extracted <p2.repo2runnable> <source dir="${sourcedir}“/> <destination="${destinationdir}/eclipse“/> </p2.repo2runnable> • By default, all IUs will be transformed but you can also specify nested <iu> elements Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 85. Mirroring is slicing Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 86. Mirroring repositories with p2 • Mirror a repository or a subset of the IUs to a new location • Separate applications to mirror metadata and artifacts Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 87. p2.metadata.repository.mirrorApplication Specify source and destination Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 88. p2.artifact.repository.mirrorApplication Specify source and destination Option to use a comparator against a baseline Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 89. Exercise: Mirroring a Hyperbola subset • Use the metadata and artifact repository mirroring tools to mirror a subset of the Hyperbola product – perhaps one platform. • Not sure if we will have time for this Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 90. One of these bundles is not like the other Bundle id + version = one set of bytes Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 91. Consistent bundles with a comparator • If you use a different compiler to compile the same source, it’s not necessarily the same byte code • Use a comparator with a baseline to compare the bundles in the repository in the current ones being built. • Discard new bundles with the same bundle id + version • Bundles in product zip must be identical repository bundles Product build == p2 repo Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 92. Composite repositories • Delineate artifacts and metadata into child repos compositeArtifacts.jar compositeContent.jar I20100210-0950/ I20100211-0900/ I20100212-1053/ • Child repository I20100211-0900 artifacts.jar content.jar features/ plugins/ Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 93. get involved • p2 in the wiki http://wiki.eclipse.org/P2 • p2 mailing list p2-dev@eclipse.org • IRC #equinox-dev • p2 committers on twitter http://wiki.eclipse.org/Twitter • Project sets Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 94. References • Version numbering http://wiki.eclipse.org/Version_Numbering • 2009 EclipseCon p2 tutorial http://www.slideshare.net/PascalRapicault/understanding- and-extending-p2-for-fun-and-profit • PDE Build Integration with p2 http://help.eclipse.org/galileo/index.jsp?nav=/4_2_2 • Adding Self Update to an RCP Application http://wiki.eclipse.org/Equinox/p2/Adding_Self- Update_to_an_RCP_Application • p2 director application http://wiki.eclipse.org/Equinox_p2_director_application Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 95. Photo credits • Orange and knife by Safari11 http://www.sxc.hu/browse.phtml?f=view&id=983682 • Oranges by Stephanie Berghaeuser http://www.sxc.hu/photo/783917 • Sliced oranges shin0 http://www.sxc.hu/photo/278 • Recycle tag by jaylopez http://www.sxc.hu/photo/917290 • Cutlery by Oliver Delgado http://www.sxc.hu/browse.phtml?f=view&id=582099 • Director’s chair by Alek von Felkerzam http://www.sxc.hu/browse.phtml?f=view&id=814604 Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 96. Legal notice • Copyright © IBM Corp., 2007-2010. All rights reserved. This presentation and the source code in it are made available under the EPL, v1.0. • Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. • Eclipse and the Eclipse logo are trademarks of Eclipse Foundation, Inc. • IBM and the IBM logo are trademarks or registered trademarks of IBM Corporation, in the United States, other countries or both. • Other company, product, or service names may be trademarks or service marks of others. • THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, SUCH INFORMATION. ANY INFORMATION CONCERNING IBM'S PRODUCT PLANS OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT NOTICE Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 97. Extra slides Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 98. p2.mirror Ant task • Allows you to mirror artifacts and metadata simultaneously • Filter by platform and specify IUs <p2.mirror source="file://${myRepo}"> <destination kind="metadata" location="file://${myNewRepo}" format="file://${myRepo}" /> <destination kind="artifact" location="file://${myNewRepo}" format="file://${myRepo}" /> <iu id=“org.eclipse.pde" version="" /> <iu id=“org.eclipse.pde.sdk" version="" /> <slicingOptions platformFilter="true" includeOptional="false" includeNonGreedy="false" followStrict="true" /> </p2.mirror> Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 99. remove.iu Ant task • Remove IUs from the repository • Remove all packed jars from a repo <p2.remove.iu> <repository location="file://${myRepo}" /> <iu query="" artifacts="(format=packed)" /> </p2.remove.iu> • Remove specific IUs <p2.remove.iu> <repository location="file://${myRepo}" /> <iu id="com.ibm.icu" artifacts="(format=packed)" /> </p2.remove.iu> Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 100. p2.composite.{artifact|metadata}.repository • Create composite artifact and metadata repositories <p2.composite.artifact.repository.create location="file://${myRepo}" name="${p2.repo.name}" compressed="true" failOnExists="false" /> <p2.composite.metadata.repository.create location="file://${myRepo}" name="${p2.repo.name}" compressed="true" failOnExists="false" /> • Add children <p2.composite.artifact.repository.add location="file://${myRepo}" child="${buildId}" /> <p2.composite.metadata.repository.add location="file://${myRepo}" child="${buildId}" /> </target> Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 101. Repository management best practices • Implement composite repositories • Use repository tools to modify the contents of a repository • Life cycle of a repository • How to specify mirrors in your repository? (Not sure if this is too much detail) Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 102. publisher • The p2 publisher was integrated into pde build in 3.5M5. • Features and bundles are gathered from source and published to a repository • Can publish • Feature and bundles • Products • Categories • Update site • From an existing install • Enabling the publisher will create a repository for all platforms you are building. Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.
  • 103. p2 and agile software development Develop p2 repository Test Build Assemble Copyright © IBM Corp., EclipseSource 2010. All rights reserved. Licensed under EPL, v1.0.