<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugzilla.globus.org/bugzilla/bugzilla.dtd">

<bugzilla version="3.2.3"
          urlbase="http://bugzilla.globus.org/bugzilla/"
          maintainer="bacon@mcs.anl.gov"
>

    <bug>
          <bug_id>6342</bug_id>
          
          <creation_ts>2008-08-27 18:16</creation_ts>
          <short_desc>remove dependency on abs paths from properties files</short_desc>
          <delta_ts>2008-09-03 09:39:38</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>GridShib</product>
          <component>SAML/Binding Tools</component>
          <version>0.5</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>beta</target_milestone>
          
          <blocked>6167</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tom Scavo">trscavo@gmail.com</reporter>
          <assigned_to name="Tom Scavo">trscavo@gmail.com</assigned_to>
          <cc>gridshib-dev@globus.org</cc>

      

      
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-08-27 18:16:20</bug_when>
            <thetext>On Wed, Aug 27, 2008 at 12:10 PM, Von Welch &lt;vwelch@ncsa.uiuc.edu&gt; wrote:
&gt; Here&apos;s the deal:
&gt;
&gt; During the &apos;init&apos; target, the GS-ST build.xml creates two properties
&gt; files which have hard-coded paths to the install dir:
&gt;
&gt; org/globus/gridshib/resource/gridshib-bootstrap.properties
&gt; etc/log4j.properties
&gt;
&gt; The log4j.properties isn&apos;t a big deal, &apos;ant init&apos; could re-make it
&gt; any any time.
&gt;
&gt; gridshib-bootstrap.properties ends up in the jarfiles, where it is
&gt; used by the java byte code. So if you distribute the jars, you would
&gt; have to have a process to change this file in the jar, which doesn&apos;t
&gt; currently exist.
&gt;
&gt; One possible solution, and I&apos;m pretty sure this would work with the
&gt; log4j file - not sure about the bootstrap file, is to have something
&gt; earlier in the execution set a java system property based on
&gt; GRIDSHIB_HOME (which is the install path) and then have these
&gt; properties be relative to that install path. This should allow for
&gt; relocatability without re-generating of these properties file.


On Wed, Aug 27, 2008 at 1:55 PM, Von Welch &lt;vwelch@ncsa.uiuc.edu&gt; wrote:
&gt; What is typical with a CTSS deployment today is a distribution that
&gt; does not require compilation to deploy. We can try giving them the
&gt; current GS-ST distribution and seeing if java compilation causes
&gt; problems, but I think it is worth exploring this a little to see if
&gt; we can distribute jar files that don&apos;t place new demands on their
&gt; process.
&gt;
&gt; To be more explicit with regards to my suggestion, the url below
&gt; gives an example of what I mean.
&gt;
&gt; http://dev-answers.blogspot.com/2006/03/propertyvariable-reference-in.html
&gt;
&gt; I propose that setting gridshib.home java system property that is
&gt; use in the properties file and defined by the GS code to be equal to
&gt; the value of the GRIDSHIB_HOME environment variable.
&gt;
&gt; So then the bootstrap file would contain values such as:
&gt; gridshib.cogConfigPath=${gridshib.home}/etc/cog.properties
&gt;
&gt; Is there something about that you think won&apos;t work?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Von Welch">vwelch@uiuc.edu</who>
            <bug_when>2008-08-28 10:40:24</bug_when>
            <thetext>Here&apos;s a summary of CTSS installation from JP.

In short I think it matches GS-ST now fairly well, but I&apos;m still concerned about GS-ST&apos;s requirement for javac. If we could allow them to unpack gs-st, run ant-install, tar up the resulting directory, download that, untar and just have it work (with java of course, but not requiring javac), I think we would avoid serious headaches. The changes suggested in this bug will do that I believe.

--start quote from JP--
All our CTSS installs download and untar tars. The only requirement that I
can think of that might be important to you is that what is downloaded must
be untarable into an arbitrary path and directory.

Our deployment steps are typicall:
   mkdir &lt;prefix&gt;/foo-1.2.3-r1/
   cd &lt;prefix&gt;/foo-1.2.3-r1
   soft add +pacman (need installation tools in order to install)
   # define environment variables needed by tool, eg GLOBUS_LOCATION
   pacman -install TeraGrid/ctss4/foo:foo

Which typically produces:
   &lt;prefix&gt;/foo-1.2.3-r1/bin
   &lt;prefix&gt;/foo-1.2.3-r1/lib
   etc.

In some cases, after the download untar, our installers will run software
specified installation commands, such as gpt-postinstall.  Almost always
these commands expect the deployment to already be layed out at it&apos;s
target directory. They basically configure or tweak the layed out files..

In a few rare cases, like use to be the case for older condor tars, the
untarred files expect to be given a different prefix to which they copy
to produce the deployment. This is messy and less than ideal.

We also prefer if the tars don&apos;t include their own prefix, but we can
work around it if necessary since it&apos;s fairly common for tars to do so.
In other words, if foo-1.2.3.tgz untars to foo-1.2.3/, then if we do
the above steps
   mkdir &lt;prefix&gt;/foo-1.2.3-r1/
   cd &lt;prefix&gt;/foo-1.2.3-r1/
   pacman -install  -&gt; which downloads and untars foo-1.2.3.tgz
We end up with
   &lt;prefix&gt;/foo-1.2.3-r1/foo-1.2.3/
Again, we can clean this up by moving stuff up a level or repackaging
the tar ourselves..

So, if you give us a tar we can untar and run &apos;ant install&apos; to afix the
install location and do other install time configuration, that would be
fine.  We would prefer that the &apos;ant install&apos; not re-copy everything to
a new target directory, but instead expect everything to already be
layed out as contained in a tar. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-08-28 11:15:57</bug_when>
            <thetext>In the java sh helper script, changed this line

updateOptions &quot;GRIDSHIB_HOME&quot; &quot;$GRIDSHIB_HOME&quot;

to this:

updateOptions &quot;gridshib.home&quot; &quot;$GRIDSHIB_HOME&quot;

In the java bat helper script, changed this line

set LOCAL_OPTS=-DGRIDSHIB_HOME=&quot;%GRIDSHIB_HOME%&quot; -Djava.endorsed.dirs=&quot;%GRIDSHIB_HOME%\endorsed&quot;

to these two lines:

set LOCAL_OPTS=-Dgridshib.home=&quot;%GRIDSHIB_HOME%&quot;
set LOCAL_OPTS=-Djava.endorsed.dirs=&quot;%GRIDSHIB_HOME%\endorsed&quot; %LOCAL_OPTS%

These two changes expose system property &quot;gridshib.home&quot; to all command-line applications.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-08-28 13:04:39</bug_when>
            <thetext>(In reply to comment #0)
&gt; &gt;
&gt; &gt; gridshib-bootstrap.properties ends up in the jarfiles, where it is
&gt; &gt; used by the java byte code. So if you distribute the jars, you would
&gt; &gt; have to have a process to change this file in the jar, which doesn&apos;t
&gt; &gt; currently exist.

More specifically, gridshib-bootstrap.properties ends up in gridshib-saml-tools-0_5_0.jar, which is not meant to be distributed or deployed outside of GS-ST.  This JAR file is used by the command-line tools only.

Binary deployments are expected to provide their own gridshib-bootstrap.properties file.  GS4GT, for example, has its own bootstrap properties file, for instance.  (This is documented in the new Developer Guide, btw.)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-08-28 14:38:30</bug_when>
            <thetext>The gridshib.home property is already defined in build.xml:

&lt;property name=&quot;gridshib.home&quot; location=&quot;${basedir}&quot;/&gt;

(Note that the environment variable GRIDSHIB_HOME is not needed.)

Added the following nested arg to every &lt;java&gt; and &lt;junit&gt; task in build.xml:

&lt;jvmarg value=&quot;-Dgridshib.home=${gridshib.home}&quot;/&gt;

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-09-02 12:56:58</bug_when>
            <thetext>(In reply to comment #0)
&gt; On Wed, Aug 27, 2008 at 12:10 PM, Von Welch &lt;vwelch@ncsa.uiuc.edu&gt; wrote:
&gt; &gt;
&gt; &gt; org/globus/gridshib/resource/gridshib-bootstrap.properties
&gt; &gt; etc/log4j.properties
&gt; &gt;
&gt; &gt; The log4j.properties isn&apos;t a big deal, &apos;ant init&apos; could re-make it
&gt; &gt; any any time.

Actually, log4j.properties is now static, that is, once GS-ST is installed, no modifications to this config file are needed, even if the installation directory is moved somewhere else in the file system.

The relevant line in the config file is the following:

log4j.appender.R.File=${gridshib.home}/logs/saml-tools.log

This ALWAYS works, provided the gridshib.home system property is defined.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-09-02 17:32:06</bug_when>
            <thetext>(In reply to comment #0)
&gt; On Wed, Aug 27, 2008 at 12:10 PM, Von Welch &lt;vwelch@ncsa.uiuc.edu&gt; wrote:
&gt; &gt;
&gt; &gt; So then the bootstrap file would contain values such as:
&gt; &gt; gridshib.cogConfigPath=${gridshib.home}/etc/cog.properties
&gt; &gt;
&gt; &gt; Is there something about that you think won&apos;t work?

No, that doesn&apos;t work, at least it&apos;s not as easy as that.  As it stands now, the bootstrap properties in the bootstrap properties file are assumed to be absolute paths, without exception.

That said, that can be changed.  If we assume the existence of system property gridshib.home, we should be able to modify BootstrapConfigLoader to resolve relative paths relative to gridshib.home.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-09-02 17:57:09</bug_when>
            <thetext>(In reply to comment #6)
&gt; 
&gt; If we assume the existence of system property
&gt; gridshib.home, we should be able to modify BootstrapConfigLoader to resolve
&gt; relative paths relative to gridshib.home.

This has been done.  So here&apos;s how it works:

- At install time, a default bootstrap properties file with absolute paths is created as exactly as before.

- BootstrapConfigLoader has been modified to resolve relative paths relative to gridshib.home.  If gridshib.home is null, relative paths are resolved relative to user.dir (which is system dependent).

For example, consider the following bootstrap properties file:

-------------BEGIN-----------
#Thu Aug 28 16:34:24 EDT 2008
gridshib.logConfigPath=etc/log4j.properties
gridshib.SAMLToolsConfigPath=etc/gridshib-saml-tools-config.properties
gridshib.certPath=etc/testcert.pem
gridshib.keyPath=etc/testkey.pem
gridshib.identityAttributesPath=etc/identity-attributes.txt
gridshib.cogConfigPath=etc/cog.properties
-------------END-----------

If you set env var GRIDSHIB_CONFIG so that it points to the above file (absolutely), then you can move the GS-ST installation at $GRIDSHIB_HOME anywhere in the file system without having to re-install.

I believe this solves the problem.  Let me know if I&apos;ve overlooked something.


</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Tom Scavo">trscavo@gmail.com</who>
            <bug_when>2008-09-02 18:12:10</bug_when>
            <thetext>Committed all resources to CVS HEAD.  This patch will be distributed with GS-ST v0.5.0 RC3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Von Welch">vwelch@uiuc.edu</who>
            <bug_when>2008-09-03 09:39:38</bug_when>
            <thetext>Looks good to me.</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>