[Swift-commit] r2442 - in trunk: . libexec src/org/griphyn/vdl/util

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Jan 14 08:38:43 CST 2009


Author: benc
Date: 2009-01-14 08:38:43 -0600 (Wed, 14 Jan 2009)
New Revision: 2442

Modified:
   trunk/CHANGES.txt
   trunk/libexec/vdl-int.k
   trunk/libexec/wrapper.sh
   trunk/src/org/griphyn/vdl/util/VDL2Config.java
Log:
Application success/failure status reporting can now be done using
CoG provider status, rather than the previous only choice of
using status files on the shared file system. A status.mode parameter
has been added to set this. It can be configured either in the 
swift.properties file, to have effect for all sites, or can be set
per-site.


Modified: trunk/CHANGES.txt
===================================================================
--- trunk/CHANGES.txt	2009-01-14 13:36:15 UTC (rev 2441)
+++ trunk/CHANGES.txt	2009-01-14 14:38:43 UTC (rev 2442)
@@ -1,3 +1,11 @@
+(01/14/09)
+*** Application success/failure status reporting can now be done using
+    CoG provider status, rather than the previous only choice of
+    using status files on the shared file system. A status.mode parameter
+    has been added to set this. It can be configured either in the
+    swift.properties file, to have effect for all sites, or can be set
+    per-site.
+
 (01/10/09)
 *** Console output for individual application invocation start and finish
     is no longer shown. The progress ticker now appears more often.

Modified: trunk/libexec/vdl-int.k
===================================================================
--- trunk/libexec/vdl-int.k	2009-01-14 13:36:15 UTC (rev 2441)
+++ trunk/libexec/vdl-int.k	2009-01-14 14:38:43 UTC (rev 2442)
@@ -107,7 +107,12 @@
 				transfer(srcdir="{vds.home}/libexec/", srcfile="wrapper.sh", destdir=sharedDir, desthost=rhost)
 				transfer(srcdir="{vds.home}/libexec/", srcfile="seq.sh", destdir=sharedDir, desthost=rhost)
 				dir:make(dircat(wfdir, "kickstart"), host=rhost)
-				dir:make(dircat(wfdir, "status"), host=rhost)
+
+				statusMode := configProperty("status.mode",host=rhost)
+				if(statusMode == "files"
+					dir:make(dircat(wfdir, "status"), host=rhost)
+				)
+
 				dir:make(dircat(wfdir, "info"), host=rhost)
 				wfdir, sharedDir
 				//we send the cleanup data to vdl:main()
@@ -374,6 +379,9 @@
 				jobid := concat(tr, "-", uid)
 				
 				log(LOG:DEBUG, "THREAD_ASSOCIATION jobid={jobid} thread={#thread} host={rhost} replicationGroup={replicationGroup}")
+
+				statusMode := configProperty("status.mode",host=rhost)
+
 				vdl:setprogress("Stage in")
 				tmpdir := dircat(concat(wfdir, "/jobs/", jobdir), jobid)
 				
@@ -403,6 +411,7 @@
 								"-if", flatten(infiles(stagein)), 
 								"-of", flatten(outfiles(stageout)),
 								"-k", kickstart,
+								"-status", statusMode
 								"-a", maybe(each(arguments)))
 							directory=wfdir
 							redirect=false
@@ -412,8 +421,10 @@
 							replicationChannel=replicationChannel
 							jobid=jobid
 						)
-							
-						checkJobStatus(rhost, wfdir, jobid, tr, jobdir)
+						
+						if(statusMode == "files"
+							checkJobStatus(rhost, wfdir, jobid, tr, jobdir)
+						)
 		
 						log(LOG:DEBUG, "STAGING_OUT jobid={jobid}")
 

Modified: trunk/libexec/wrapper.sh
===================================================================
--- trunk/libexec/wrapper.sh	2009-01-14 13:36:15 UTC (rev 2441)
+++ trunk/libexec/wrapper.sh	2009-01-14 14:38:43 UTC (rev 2442)
@@ -37,12 +37,16 @@
 fail() {
 	EC=$1
 	shift
-	echo $@ >"$WFDIR/status/$JOBDIR/${ID}-error"
+	if [ "$STATUSMODE" = "files" ]; then
+		echo $@ >"$WFDIR/status/$JOBDIR/${ID}-error"
+	fi
 	log $@
 	info
-	#exit $EC
-	#let vdl-int.k handle the issues
-	exit 0
+	if [ "$STATUSMODE" = "files" ]; then
+		exit 0
+	else
+		exit $EC
+	fi
 }
 
 checkError() {
@@ -115,7 +119,6 @@
 logstate "LOG_START"
 infosection "Wrapper"
 
-mkdir -p $WFDIR/status/$JOBDIR
 
 getarg "-e" "$@"
 EXEC=$VALUE
@@ -149,12 +152,20 @@
 KICKSTART=$VALUE
 shift $SHIFTCOUNT
 
+getarg "-status" "$@"
+STATUSMODE=$VALUE
+shift $SHIFTCOUNT
+
 if [ "$1" == "-a" ]; then
 	shift
 else
 	fail 254 "Missing arguments (-a option)"
 fi
 
+if [ "$STATUSMODE" = "files" ]; then
+	mkdir -p $WFDIR/status/$JOBDIR
+fi
+
 if [ "X$SWIFT_JOBDIR_PATH" != "X" ]; then
   log "Job directory mode is: local copy"
   DIR=${SWIFT_JOBDIR_PATH}/$JOBDIR/$ID
@@ -289,8 +300,15 @@
 rm -rf "$DIR" 2>&1 >& "$INFO"
 checkError 254 "Failed to remove job directory $DIR" 
 
-logstate "TOUCH_SUCCESS"
-touch status/${JOBDIR}/${ID}-success
+if [ "$STATUSMODE" = "files" ]; then
+	logstate "TOUCH_SUCCESS"
+	touch status/${JOBDIR}/${ID}-success
+fi
+
 logstate "END"
 
 closeinfo
+
+# ensure we exit with a 0 after a successful exection
+exit 0
+

Modified: trunk/src/org/griphyn/vdl/util/VDL2Config.java
===================================================================
--- trunk/src/org/griphyn/vdl/util/VDL2Config.java	2009-01-14 13:36:15 UTC (rev 2441)
+++ trunk/src/org/griphyn/vdl/util/VDL2Config.java	2009-01-14 14:38:43 UTC (rev 2442)
@@ -81,6 +81,7 @@
 		put("replication.enabled", "false");
 		put("replication.min.queue.time", "60");
 		put("replication.limit", "3");
+		put("status.mode", "files");
 	}
 
 	private VDL2Config(VDL2Config other) {




More information about the Swift-commit mailing list