Project

General

Profile

Bug #5416

downloaded modules by Kepler module manager should know the path of main Kepler installation.

Added by jianwu jianwu over 8 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
build system
Target version:
Start date:
05/30/2011
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
5416

Description

In Kepler 2.2, new modules downloaded by Kepler module manager are located at ~/KeplerData/kepler.modules/, which includes both zip file and unzipped module fold. Some modules have their own executable files which need the classes in main Kepler installation, such as the *.sh files in master-slave module. To correctly start these executables, they need to know the path of main Kepler installation, namely the path where kepler.sh is located when users install Kepler 2.2. Since the installation paths for Kepler 2.2 could be different, there is no conventional path for it.

I found the build-area folder in ~/KeplerData/kepler.modules/, it could be a good place to put a info file, e.g. keplerPath.txt, in this folder telling the Kepler installation path. By this way, downloaded modules from Kepler module manager will be able to find the classes in main Kepler installation.

GetProperty.kar (5.52 KB) GetProperty.kar Christopher Brooks, 05/31/2011 10:25 AM

History

#1 Updated by Matt Jones over 8 years ago

Why couldn't this just be a standard configuration property that is set by the core or loader on startup and that is accessible to any other module via the ConfigurationManager? I think this would be better than having yet another configuration file.

#2 Updated by jianwu jianwu over 8 years ago

The challenge is that new downloaded modules are not aware the path of the main Kepler installation. So these modules can not use any class in the main Kepler, including Configuration Manager, before they know where they are located.

#3 Updated by Christopher Brooks over 8 years ago

I suggest setting a Java property. For Ptolemy, we use ptolemy.ptII.dir.
On the Mac,
/Applications/Ptolemy/ptII8.0.1/bin/Vergil.app/Contents/Info.plist

<dict>
<key>ptolemy.ptII.dir</key>
<string>$APP_PACKAGE/../..</string>
<dict>

The izPack Windows executable does not have something similar.

ptolemy.util.StringUtilities.getProperty() has hacky code that checks
for the ptolemy.ptII.dir property. If it is not set, then it looks
for the StringUtilities class using getResource(). There is quite a
bit of magic there to handle Jar URLs etc.

In an Expression actor, if you call
property("ptolemy.ptII.dir")
then you will get something like:
/Users/cxh/src/kepler/ptolemy/target/classes

I've attached a model that does that.

It should be checked in a release to see if it works with the installers.

#4 Updated by jianwu jianwu about 7 years ago

I updated class in build-area to write install-path.txt to ~/KeplerDatat/kepler.modules/build-area dir at version 30323. closing the bug.

Christopher, as I explained in comment 2, this bug happens before Kepler start, not after Kepler start. So the new added install-path.txt can help modules in ~/KeplerData/kepler.modules/ to find where kepler is installed.

#5 Updated by Derik Barseghian about 7 years ago

One problem with your change at r30323 is that it only writes this install-path.txt on a new install. A user could subsequently move/rename their install directory.

#6 Updated by jianwu jianwu about 7 years ago

(In reply to comment #5)

One problem with your change at r30323 is that it only writes this
install-path.txt on a new install. A user could subsequently move/rename their
install directory.

you are right. I re-open it and will work on it, so that install-path.txt can be reset if the installation path is changed. It will also work better in case there are two kepler installations (same or different versions).

#7 Updated by jianwu jianwu about 7 years ago

it is fixed based on comment 5 and 6 at version 30378.

#8 Updated by Redmine Admin over 6 years ago

Original Bugzilla ID was 5416

Also available in: Atom PDF