[Swift-commit] r2597 - in trunk: . docs etc src/org/griphyn/vdl/karajan tests/misc tests/sites/wonky

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Feb 24 06:47:17 CST 2009


Author: benc
Date: 2009-02-24 06:47:17 -0600 (Tue, 24 Feb 2009)
New Revision: 2597

Added:
   trunk/tests/misc/relative-wrapper.sh
   trunk/tests/misc/wonky-relative-absolute-wrapper.sh
   trunk/tests/misc/wonky-wrongdir-relative-fail.sh
   trunk/tests/sites/wonky/relative-absolute-wrapper.xml
Modified:
   trunk/CHANGES.txt
   trunk/docs/userguide.xml
   trunk/etc/swift.properties
   trunk/src/org/griphyn/vdl/karajan/VDSTaskTransformer.java
   trunk/tests/misc/run
   trunk/tests/misc/run-wonky
Log:
Provide a configuration option wrapper.invocation.mode, specifiable either globally in the configuration file or per-site as a profile key, that configures whether wrapper script invocations are made with an absolute path (as was the behaviour in Swift 0.8) or with a relative path (as was behaviour in previous versions of Swift).

Modified: trunk/CHANGES.txt
===================================================================
--- trunk/CHANGES.txt	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/CHANGES.txt	2009-02-24 12:47:17 UTC (rev 2597)
@@ -1,3 +1,10 @@
+(02/09/24)
+*** New configuration option wrapper.invocation.mode, specifiable either
+    globally in the configuration file or per-site as a profile key,
+    that configures whether wrapper script invocations are made with an
+    absolute path (as was the behaviour in Swift 0.8) or with a relative
+    path (as was behaviour in previous versions of Swift).
+
 (02/09/22)
 *** Recompilation will happen if a .kml file was compiled with a different
     version of Swift to the version being invoked. This is in addition to the

Modified: trunk/docs/userguide.xml
===================================================================
--- trunk/docs/userguide.xml	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/docs/userguide.xml	2009-02-24 12:47:17 UTC (rev 2597)
@@ -2864,7 +2864,33 @@
 						</listitem>
 					</varlistentry>
 
+					<varlistentry>
+						<term>
+							<property>wrapper.invocation.mode</property>
+						</term>
+						<listitem>
+							<para>
+Valid values: <parameter>absolute</parameter>, <parameter>relative</parameter>
+							</para>
+							<para>
+Default value: <literal>absolute</literal>
+							</para>
+							<para>
+Determines if Swift remote wrappers will be executed by specifying an
+absolute path, or a path relative to the job initial working directory.
+In most cases, execution will be successful with either option. However,
+some execution sites ignore the specified initial working directory, and
+so <literal>absolute</literal> must be used. Conversely on some sites,
+job directories appear in a different place on the worker node file system
+than on the filesystem access node, with the execution system handling
+translation of the job initial working directory. In such cases,
+<literal>relative</literal> mode must be used.
+							</para>
 
+						</listitem>
+					</varlistentry>
+
+
 										
 				</variablelist>
 				

Modified: trunk/etc/swift.properties
===================================================================
--- trunk/etc/swift.properties	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/etc/swift.properties	2009-02-24 12:47:17 UTC (rev 2597)
@@ -295,3 +295,10 @@
 #
 # status.mode=files
 
+
+# Determines if Swift remote wrappers will be executed by specifying an
+# absolute path, or a path relative to the job initial working directory
+#
+# valid values: absolute, relative
+# wrapper.invocation.mode=absolute
+

Modified: trunk/src/org/griphyn/vdl/karajan/VDSTaskTransformer.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/VDSTaskTransformer.java	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/src/org/griphyn/vdl/karajan/VDSTaskTransformer.java	2009-02-24 12:47:17 UTC (rev 2597)
@@ -3,6 +3,7 @@
  */
 package org.griphyn.vdl.karajan;
 
+import java.io.IOException;
 import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -23,6 +24,7 @@
 import org.griphyn.common.catalog.TransformationCatalogEntry;
 import org.griphyn.common.classes.TCType;
 import org.griphyn.vdl.util.FQN;
+import org.griphyn.vdl.util.VDL2Config;
 
 public class VDSTaskTransformer implements TaskTransformer {
 	public static final Logger logger = Logger.getLogger(VDSTaskTransformer.class);
@@ -123,11 +125,19 @@
 			List l =   spec.getArgumentsAsList();
 			// perhaps should check for /bin/bash in the executable, or some other way of detecting we need to do a substitution here... or equally could assume that the second parameter always needs to undergo this substitution...
 			String executable = (String)l.get(0);
-			if(executable.endsWith("shared/wrapper.sh") || 
-			   executable.endsWith("shared/seq.sh")) {
 
+			try {
+				VDL2Config config = VDL2Config.getConfig();
+
+				if(config.getProperty("wrapper.invocation.mode", bc).equals("absolute")
+			 	 &&(executable.endsWith("shared/wrapper.sh")
+			   	  || executable.endsWith("shared/seq.sh"))) {
+
 				String s  = spec.getDirectory()+"/"+executable;
 				l.set(0,s);
+				}
+			} catch(IOException ioe) {
+				throw new KarajanRuntimeException("Could not determine wrapper invocation mode", ioe);
 			}
 
 		}

Added: trunk/tests/misc/relative-wrapper.sh
===================================================================
--- trunk/tests/misc/relative-wrapper.sh	                        (rev 0)
+++ trunk/tests/misc/relative-wrapper.sh	2009-02-24 12:47:17 UTC (rev 2597)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+cd ../language-behaviour
+
+./generate-tc.data
+
+cat tc.data ../sites/tc.data > tmp.tc.data.sites
+
+SITE=wonky/wrongdir.xml
+
+echo testing site configuration: $SITE
+
+export CF=swift.properties.wrongdir-relative-fail
+cat $(dirname $(which swift))/../etc/swift.properties | grep --invert-match -E '^wrapper.invocation.mode=' > $CF
+echo wrapper.invocation.mode=relative >> $CF
+
+export SWIFT_TEST_PARAMS="-config $CF"
+
+./run 001-echo
+


Property changes on: trunk/tests/misc/relative-wrapper.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/misc/run
===================================================================
--- trunk/tests/misc/run	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/tests/misc/run	2009-02-24 12:47:17 UTC (rev 2597)
@@ -2,6 +2,7 @@
 for a in clusters no-retries dryrun typecheck path-prefix restart restart2 restart3 restart4 restart5 restart-iterate workernode-local \
 ordering-extern-notlazy restart-extern ordering-extern \
 external-mapper-args extract-int-delayed asserts \
+relative-wrapper \
 ; do
  ./${a}.sh
  R=$?

Modified: trunk/tests/misc/run-wonky
===================================================================
--- trunk/tests/misc/run-wonky	2009-02-24 12:45:13 UTC (rev 2596)
+++ trunk/tests/misc/run-wonky	2009-02-24 12:47:17 UTC (rev 2597)
@@ -6,6 +6,7 @@
          wonky-replication \
          wonky \
          wonky80 \
+	wonky-wrongdir-relative-fail \
 ; do
  ./${a}.sh
  R=$?

Added: trunk/tests/misc/wonky-relative-absolute-wrapper.sh
===================================================================
--- trunk/tests/misc/wonky-relative-absolute-wrapper.sh	                        (rev 0)
+++ trunk/tests/misc/wonky-relative-absolute-wrapper.sh	2009-02-24 12:47:17 UTC (rev 2597)
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+cd ../language-behaviour
+
+./generate-tc.data
+
+cat tc.data ../sites/tc.data > tmp.tc.data.sites.1
+
+cat tmp.tc.data.sites.1 | sed 's/localhost/wonkyA/' >> tmp.tc.data.sites
+cat tmp.tc.data.sites.1 | sed 's/localhost/wonkyB/' >> tmp.tc.data.sites
+
+
+SITE=wonky/relative-absolute-wrapper.xml
+
+echo testing site configuration: $SITE
+
+export CF=swift.properties.wrongdir-relative-fail
+cat $(dirname $(which swift))/../etc/swift.properties | grep --invert-match -E '^execution.retries=' | grep --invert-match -E '^wrapper.invocation.mode='  > $CF
+echo execution.retries=0 >> $CF
+echo wrapper.invocation.mode=relative >> $CF
+
+export SWIFT_TEST_PARAMS="-sites.file ../sites/${SITE} -tc.file tmp.tc.data.sites -config $CF"
+
+./run 130-fmri
+


Property changes on: trunk/tests/misc/wonky-relative-absolute-wrapper.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/misc/wonky-wrongdir-relative-fail.sh
===================================================================
--- trunk/tests/misc/wonky-wrongdir-relative-fail.sh	                        (rev 0)
+++ trunk/tests/misc/wonky-wrongdir-relative-fail.sh	2009-02-24 12:47:17 UTC (rev 2597)
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+cd ../language-behaviour
+
+./generate-tc.data
+
+cat tc.data ../sites/tc.data > tmp.tc.data.sites
+
+SITE=wonky/wrongdir.xml
+
+echo testing site configuration: $SITE
+
+export CF=swift.properties.wrongdir-relative-fail
+cat $(dirname $(which swift))/../etc/swift.properties | grep --invert-match -E '^wrapper.invocation.mode=' > $CF
+echo wrapper.invocation.mode=relative >> $CF
+
+export SWIFT_TEST_PARAMS="-sites.file ../sites/${SITE} -tc.file tmp.tc.data.sites -config $CF"
+
+./run 001-echo
+
+if [ "$?" = "0" ] ; then
+  echo "wonky-wrongdir-relative-fail test passed when it should have failed"
+  exit 1
+else
+  echo "wonky-wrongdir-relative-fail failed as expected, so test passes"
+  exit 0
+fi
+
+  


Property changes on: trunk/tests/misc/wonky-wrongdir-relative-fail.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/sites/wonky/relative-absolute-wrapper.xml
===================================================================
--- trunk/tests/sites/wonky/relative-absolute-wrapper.xml	                        (rev 0)
+++ trunk/tests/sites/wonky/relative-absolute-wrapper.xml	2009-02-24 12:47:17 UTC (rev 2597)
@@ -0,0 +1,19 @@
+<config>
+
+  <pool handle="wonkyA">
+    <gridftp  url="local://localhost" />
+    <execution provider="local" url="none" />
+    <workdirectory >/var/tmp/swift-test/A</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">0</profile>
+  </pool>
+
+
+  <pool handle="wonkyB">
+    <gridftp  url="local://localhost" />
+    <execution provider="wonky" url="good/wrongdirectory" />
+    <workdirectory >/var/tmp/swift-test/B</workdirectory>
+    <profile namespace="karajan" key="jobThrottle">0</profile>
+    <profile namespace="karajan" key="wrapper.invocation.mode">absolute</profile>
+  </pool>
+
+</config>




More information about the Swift-commit mailing list