Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » How to use locally cached bundles
How to use locally cached bundles [message #734271] Fri, 07 October 2011 10:47 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hello all.

In our app's architecture we have a Virgo kernel (the client) which sits on the user's machine and which is associated to a remote Virgo server which is the repository of all up to date bundles. Depending upon the user's specific request, a service in the Virgo client reads the appropriate plan file from the server and deposits a copy of this plan into the client's pickup directory. This in turn triggers download of the required bundles and their activation in the kernel.

This is all working like magic.

However I want to make the code more solid and ensure that the application is instantiated even if the remote Virgo server is temporarily unavailable.

To this end, every time I build a plan file and deposit it in the pickup directory, I also cache it somewhere else so that, next time the user request the same feature, I can check if the server is available and, if not, simply copy the most recently cached plan file from the cache to the pickup directory. However, when this happens, I get a deploy failure because Virgo still looks to download the bundles that are defined in that plan from the remote server, even if it does have those bundles in its work directory.

How do I go about persuading Virgo to use completely local information if the remote server is not available?

Is it a matter of modifying the org.eclipse.virgo.repository.properties file?

My file currently reads as follows:
ext.type=external
ext.searchPattern=repository/ext/{artifact}

usr.type=watched
usr.watchDirectory=repository/usr

remote-repo.type=remote
remote-repo.uri=http://some_url/org.eclipse.virgo.apps.repository/workbench-repository
remote-repo.indexRefreshInterval=30

chain=ext,remote-repo,usr


TIA,
B.

[Updated on: Fri, 07 October 2011 10:49]

Report message to a moderator

Re: How to use locally cached bundles [message #734273 is a reply to message #734271] Fri, 07 October 2011 10:54 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Virgo dereferences plan contents by looking in its repository chain. Remote repositories are partially cached on disk in the repository client, but that's designed to be a performance optimisation rather than insulating the client from the repository server not being available.

So it seems you'll need to deposit the bundles in watched repository -- either repository/usr or a new one -- and put that watched repository ahead of the remote repository in the chain definition.
Re: How to use locally cached bundles [message #734275 is a reply to message #734273] Fri, 07 October 2011 11:00 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Thanks Glyn.

What I deposit is the plan file in the pickup directory, and then I let Virgo do its magic in terms of getting bundles and their dependencies.

So a couple of questions:

1) do you mean to say that I need to deposit my plan file in a watched repository or that I need to actually dereference the plan file by hand and deposit the actual bundles in that watched repo?

2) if I put the watched repository ahead of the remote one, does this mean that, if I do have a remote server available, my (possibly stale) bundles will be used even if newer ones may be available in the remote Virgo server? This would be an issue, as I use this mechanism not just for dynamic download of lean portions of the app, but also as an update mechanism.

Thanks, as always.
Re: How to use locally cached bundles [message #734277 is a reply to message #734275] Fri, 07 October 2011 11:13 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
[quote title=Barbara Rosi-Schwartz wrote on Fri, 07 October 2011 12:00]Thanks Glyn.

What I deposit is the plan file in the pickup directory, and then I let Virgo do its magic in terms of getting bundles and their dependencies.

So a couple of questions:

1) do you mean to say that I need to deposit my plan file in a watched repository or that I need to actually dereference the plan file by hand and deposit the actual bundles in that watched repo?]/quote]

You need to deposit the actual bundles in that watched repo. Admittedly you'd have to parse the plan file to know what bundles you need to cache, but you should be able to use the remote repository service in the client to manage the downloads if you want to.

Alternatively, you might consider extending the current remote repository support so that it can cope with temporary outages of the repository server. That would involve caching the remote index on disk and adding checksums to the remote index for artifacts other than bundles (only bundles get the checksum at the moment and get cached on the client). But maybe that's too much to bite off.

Quote:
2) if I put the watched repository ahead of the remote one, does this mean that, if I do have a remote server available, my (possibly stale) bundles will be used even if newer ones may be available in the remote Virgo server? This would be an issue, as I use this mechanism not just for dynamic download of lean portions of the app, but also as an update mechanism.

Thanks, as always.


Yes , it does. You would need to increment the bundle version of a bundle on the server in order for the chain search to find it on the repository client.
Re: How to use locally cached bundles [message #734280 is a reply to message #734277] Fri, 07 October 2011 11:28 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
I would like to consider the possibility of extending the remote repository support. Any pointer to where to get started in the code base to get a feel for what is required?

Thanks.
Re: How to use locally cached bundles [message #734322 is a reply to message #734280] Fri, 07 October 2011 13:18 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Barbara Rosi-Schwartz wrote on Fri, 07 October 2011 12:28
I would like to consider the possibility of extending the remote repository support. Any pointer to where to get started in the code base to get a feel for what is required?

Thanks.


Take a look at the code via OpenGrok, starting here. There's not that much code in the artifact-repository git repo, so you could also grab that and build it etc. as described on the wiki.
Previous Topic:Mysterious service problem
Next Topic:Re: How does the Virgo server get started from the Eclipse Servers view?
Goto Forum:
  


Current Time: Thu Mar 28 11:41:36 GMT 2024

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

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

Back to the top