Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » bundle pooling and p2 director
bundle pooling and p2 director [message #1592289] Fri, 30 January 2015 01:30 Go to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
I am experimenting with using bundle pools with p2 director and not having a lot of luck. Here is the command that I am running:

java
-Xmx512m
-cp
[launcher-path]
org.eclipse.core.launcher.Main
-application
org.eclipse.equinox.p2.director
-metadataRepository
[repo]
-artifactRepository
[repo]
-destination
[destination]
-bundlepool
[pool]
-installIU
[iu]


This does indeed place installed bundles in the separate pool location. However, when I run this command again, the plugins and features already in the pool are _not_ re-used. Based on the time it takes for the command to run and the fact that files in the pool have new time stamps, it looks like p2 director re-downloads and re-writes exact same bundles and features into the pool.

What am I missing?
Re: bundle pooling and p2 director [message #1597379 is a reply to message #1592289] Mon, 02 February 2015 08:45 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 30/01/2015 02:30, Konstantin Komissarchik wrote:
> I am experimenting with using bundle pools with p2 director and not
> having a lot of luck. Here is the command that I am running:
>
> java
> -Xmx512m
> -cp
> [launcher-path]
> org.eclipse.core.launcher.Main
> -application
> org.eclipse.equinox.p2.director
> -metadataRepository
> [repo]
> -artifactRepository
> [repo]
> -destination
> [destination]
> -bundlepool
> [pool]
> -installIU
> [iu]
>
>
> This does indeed place installed bundles in the separate pool location.
> However, when I run this command again, the plugins and features already
> in the pool are _not_ re-used. Based on the time it takes for the
> command to run and the fact that files in the pool have new time stamps,
> it looks like p2 director re-downloads and re-writes exact same bundles
> and features into the pool.
>
> What am I missing?

Hi

there should be a similar post in this newsgroup; to make bundlepool
work correctly, you need to specify a profile, that p2 will use to keep
track of the bundles (associated to specific profiles). Each
installation should have a different profile. You may also want to use
the option -shared to specify a directory where all profile information
will be stored.

Hope this helps
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: bundle pooling and p2 director [message #1597874 is a reply to message #1597379] Mon, 02 February 2015 16:19 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Thanks for the tip. I added the following switches:

-shared
[pool]/p2",
-profile
[generated-number]


With this addition, all p2 install operations fail on not being able to find core platform features and bundles. Do I need to do something to my base Eclipse install to make it work with this arrangement. I just unzip the platform zip and run install operations targeting that.
Re: bundle pooling and p2 director [message #1597955 is a reply to message #1597874] Mon, 02 February 2015 17:31 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
It seems that I need to create a profile first and instruct Eclipse launcher to use it. How to I do this? Without any intervention, it creates and uses profile called "SDKProfile".
Re: bundle pooling and p2 director [message #1598838 is a reply to message #1597955] Tue, 03 February 2015 07:30 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 02/02/2015 18:31, Konstantin Komissarchik wrote:
> It seems that I need to create a profile first and instruct Eclipse
> launcher to use it. How to I do this? Without any intervention, it
> creates and uses profile called "SDKProfile".

mh... probably I didn't get your question right the first time; it seems
you have an installed Eclipse and you want to use bundlepool for that
Eclipse? However, once an Eclipse has been installed without
bundlepools, you can't "turn" it to use bundle pool (as far as I
know)... you need to install a brand new Eclipse SDK from the command
line with the p2 director using bundlepool, something like

-installIU org.eclipse.sdk.ide
-tag InitialState -profile EclipseLunaSDK

from then on, that installation will be used shared bundlepools
automatically...

is this your scenario?

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: bundle pooling and p2 director [message #1601244 is a reply to message #1598838] Wed, 04 February 2015 20:46 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Thanks for the tip. Installing Eclipse from scratch using p2 director seems to be the key to get this scenario to work. That does make things a bit awkward since you need an Eclipse install to run the p2 director. My script has been originally written to download eclipse platform zip and then use that base to run p2 director and to install into. To use the bundle pool, the initial Eclipse install will only be used to run p2 director. Not ideal, but I can manage the awkwardness by re-using the bootstrap installation across multiple runs of my scripts.

For completeness, here is the full p2 director command:

java
-Xmx512m
-cp
[launcher-path]
org.eclipse.core.launcher.Main
-application
org.eclipse.equinox.p2.director
-repository
[repo]
-destination
[destination]
-bundlepool
[pool]
-installIU
[iu]
-shared
[pool]/p2
-profile
[profile] // I used time of the install as a generated id
-profileProperties
org.eclipse.update.install.features=true
-p2.os
win32
-p2.ws
win32
-p2.arch
x86_64

Note that there seems to be a bug in p2 when using this approach that causes the splash screen not to show. The issue is that in config.ini, a setting points to the Eclipse install folder rather than to the bundle pool.

osgi.splashPath=platform\:/base/plugins/org.eclipse.platform

Manually fixing the path to point to the pool where this bundle is located, fixes this issue.
Re: bundle pooling and p2 director [message #1602388 is a reply to message #1601244] Thu, 05 February 2015 14:26 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

see comments

On 04/02/2015 21:46, Konstantin Komissarchik wrote:
> Thanks for the tip. Installing Eclipse from scratch using p2 director
> seems to be the key to get this scenario to work. That does make things
> a bit awkward since you need an Eclipse install to run the p2 director.

I guess that's one of the main reasons why bundlepool is not that popular ;)

By the way, you may want to try the new Oomph installer (that heavily
relies on bundlepool)

> My script has been originally written to download eclipse platform zip
> and then use that base to run p2 director and to install into. To use
> the bundle pool, the initial Eclipse install will only be used to run p2
> director. Not ideal, but I can manage the awkwardness by re-using the
> bootstrap installation across multiple runs of my scripts.

what I do for bootstrapping is downloading the standalone director
application (you can get it from
https://www.eclipse.org/buckminster/downloads.html )

I'm using some ant scripts to automate all my eclipse installations
(using bundle pooling); I still haven't got time to make it public, but
a blog post will hopefully come soon :)

> -profile
> [profile] // I used time of the install as a generated id

I use a mnemonic name summarizing the main features installed in that
particular installation (e.g., LunaXtextLatest, MarsXtextStable, etc.)

> Note that there seems to be a bug in p2 when using this approach that
> causes the splash screen not to show. The issue is that in config.ini, a
> setting points to the Eclipse install folder rather than to the bundle
> pool.
>
> osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
>
> Manually fixing the path to point to the pool where this bundle is
> located, fixes this issue.

I know, I filed a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=436222

that seems to be a regression since Luna.

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Is it possible to disable "uninstall" button when selecte the product feature itse
Next Topic:Portable p2 director package?
Goto Forum:
  


Current Time: Tue Mar 19 09:31:42 GMT 2024

Powered by FUDForum. Page generated in 0.02416 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top