From noreply at svn.ci.uchicago.edu Sun Aug 1 05:42:20 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 1 Aug 2010 05:42:20 -0500 (CDT) Subject: [Swift-commit] r3495 - in usertools/swift/swiftconfig/etc/sites: . local-pbs local-pbs-coasters ssh Message-ID: <20100801104220.36D599CC80@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-01 05:42:19 -0500 (Sun, 01 Aug 2010) New Revision: 3495 Added: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/ usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data usertools/swift/swiftconfig/etc/sites/local-pbs/ usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data usertools/swift/swiftconfig/etc/sites/ssh/ usertools/swift/swiftconfig/etc/sites/ssh/sites.xml usertools/swift/swiftconfig/etc/sites/ssh/tc.data Log: Template additions and modifications Added: usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,6 @@ + + + + $HOME/swiftwork + 0 + Added: usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,17 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +local-pbs echo /bin/echo INSTALLED INTEL32::LINUX null +local-pbs cat /bin/cat INSTALLED INTEL32::LINUX null +local-pbs ls /bin/ls INSTALLED INTEL32::LINUX null +local-pbs grep /bin/grep INSTALLED INTEL32::LINUX null +local-pbs sort /bin/sort INSTALLED INTEL32::LINUX null +local-pbs paste /bin/paste INSTALLED INTEL32::LINUX null Added: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,13 @@ + + + + $HOME/swiftwork + 3000 + 8 + 1 + 1 + 10 + short + 0.5 + 10000 + Added: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,17 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +local-pbs-coasters echo /bin/echo INSTALLED INTEL32::LINUX null +local-pbs-coasters cat /bin/cat INSTALLED INTEL32::LINUX null +local-pbs-coasters ls /bin/ls INSTALLED INTEL32::LINUX null +local-pbs-coasters grep /bin/grep INSTALLED INTEL32::LINUX null +local-pbs-coasters sort /bin/sort INSTALLED INTEL32::LINUX null +local-pbs-coasters paste /bin/paste INSTALLED INTEL32::LINUX null Added: usertools/swift/swiftconfig/etc/sites/ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/ssh/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/ssh/sites.xml 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,6 @@ + + + + $HOME/swiftwork + 0 + Added: usertools/swift/swiftconfig/etc/sites/ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/ssh/tc.data (rev 0) +++ usertools/swift/swiftconfig/etc/sites/ssh/tc.data 2010-08-01 10:42:19 UTC (rev 3495) @@ -0,0 +1,17 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +ssh echo /bin/echo INSTALLED INTEL32::LINUX null +ssh cat /bin/cat INSTALLED INTEL32::LINUX null +ssh ls /bin/ls INSTALLED INTEL32::LINUX null +ssh grep /bin/grep INSTALLED INTEL32::LINUX null +ssh sort /bin/sort INSTALLED INTEL32::LINUX null +ssh paste /bin/paste INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Sun Aug 1 08:23:51 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 1 Aug 2010 08:23:51 -0500 (CDT) Subject: [Swift-commit] r3496 - in usertools/swift/swiftconfig: . bin docs Message-ID: <20100801132351.622C59CC80@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-01 08:23:51 -0500 (Sun, 01 Aug 2010) New Revision: 3496 Added: usertools/swift/swiftconfig/docs/ usertools/swift/swiftconfig/docs/tutorial.pdf Modified: usertools/swift/swiftconfig/bin/swiftconfig Log: Updated perldoc and a swiftconfig multisite tutorial Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-01 10:42:19 UTC (rev 3495) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-01 13:23:51 UTC (rev 3496) @@ -464,16 +464,20 @@ =head1 OVERVIEW -The swiftconfig program allows users to configure Swift. It allows for the adding, removing, and modification of remote sites by utilizing a set of standard templates. It also provides a way to quickly add, remove and modify translation catalog entries without having to manually edit files. +The swiftconfig program allows users to configure Swift. It allows for the +adding, removing, and modification of remote sites by utilizing a set of +standard templates. It also provides a way to quickly add, remove and modify +translation catalog entries without having to manually edit files. =head1 DESCRIPTION General operations: - -add sitename add a site from template - -remove site removes a site from sites.xml - -templates display all available sites in template - -modify site Specifies the name of a site to modify - + -add sitename add a site from template + -remove site removes a site from sites.xml + -templates display all available sites in template + -modify site Specifies the name of a site to modify + -describe site Prints the raw XML site configuration + =head1 EXAMPLES List all templates available for adding @@ -490,7 +494,11 @@ =head1 CAVEATS -Swiftconfig will attempt to automatically determine the location of swift configuration files. It first checks for an environment variable called $SWIFT_HOME. If that is not found, it will look for the location of "swift" in the path, and try to find the configuration files from there. This default behavior can be overwridden by manually specifying the location of files with -templatefile, -sitesfile, and -tcfile. +Swiftconfig will attempt to automatically determine the location of swift +configuration files. It first checks for an environment variable called +$SWIFT_HOME. If that is not found, it will look for the location of "swift" +in the path. -The XML library that swiftconfig uses ignores comments in XML. All comments will be stripped from sites.xml as it gets modified. +The XML library that swiftconfig uses ignores comments in XML. All comments +will be stripped from sites.xml as it gets modified. =cut Added: usertools/swift/swiftconfig/docs/tutorial.pdf =================================================================== (Binary files differ) Property changes on: usertools/swift/swiftconfig/docs/tutorial.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream From noreply at svn.ci.uchicago.edu Tue Aug 3 15:09:38 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 3 Aug 2010 15:09:38 -0500 (CDT) Subject: [Swift-commit] r3497 - usertools/swift/swiftconfig/docs Message-ID: <20100803200938.CDC499CD30@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-03 15:09:38 -0500 (Tue, 03 Aug 2010) New Revision: 3497 Added: usertools/swift/swiftconfig/docs/tutorial.odt Log: tutorial.odt Added: usertools/swift/swiftconfig/docs/tutorial.odt =================================================================== (Binary files differ) Property changes on: usertools/swift/swiftconfig/docs/tutorial.odt ___________________________________________________________________ Name: svn:mime-type + application/octet-stream From noreply at svn.ci.uchicago.edu Fri Aug 6 17:45:43 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 6 Aug 2010 17:45:43 -0500 (CDT) Subject: [Swift-commit] r3498 - trunk/tests Message-ID: <20100806224543.520939CC86@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-06 17:45:43 -0500 (Fri, 06 Aug 2010) New Revision: 3498 Modified: trunk/tests/nightly.sh Log: Minor nightly.sh revisions... Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-03 20:09:38 UTC (rev 3497) +++ trunk/tests/nightly.sh 2010-08-06 22:45:43 UTC (rev 3498) @@ -20,7 +20,7 @@ printf "\t -p Do not build the package \n" printf "\t -s Do not do a fresh svn checkout \n" printf "\t -x Do not continue after a failure \n" - printf "\t -v Verbose (set -x) \n" + printf "\t -v Verbose (set -x, HTML comments) \n" printf "\t output Location for output (TOPDIR) \n" } @@ -63,7 +63,10 @@ esac done -(( VERBOSE )) && set -x +if (( VERBOSE )); then + set -x + HTML_COMMENTS=1 +fi # Iterations ITERS_LOCAL=1 @@ -106,21 +109,80 @@ echo $@ >>$HTML } -a_name() { +html_h1() { + TEXT=$1 + html "

$TEXT

" +} + +html_a_name() { NAME=$1 html "" } -a_href() { +html_a_href() { HREF=$1 TEXT=$2 html "$TEXT" } +html_table() { + html "" +} + +html_~table() { + html "
" +} + +html_tr() { + CLASS=$1 + if [ -n $CLASS ]; then + html "" + else + html "" + fi +} + +html_~tr() { + html "" +} + +html_th() { + COLSPAN=$1 + if [ -n $COLSPAN ]; then + html "" + else + html "" + fi +} + +html_~th() { + html "" +} + +html_td() { + ALIGN=$1 + if [ -n $ALIGN ]; then + html "" + else + html "" + fi +} + +html_~td() { + html "" +} + +html_comment() { + COMMENT=$1 + (( HTML_COMMENTS == 1 )) && html "" +} + footer() { + html "" + html_comment "End of tests" + MONTHS=("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" \ "Jul" "Aug" "Sep" "Oct" "Nov" "Dec") - html "" if [ "$BINPACKAGE" != "" ]; then FBP=$RUNDIR/$BINPACKAGE @@ -190,44 +252,26 @@ TYPE=$1 if [ "$TYPE" == "test" ]; then - NAME=$2 # - LABEL=$3 # Text on link to output - CMD=$4 - RES=$5 + LABEL=$2 # Text on link to output + CMD=$3 # Command issued (td title) + RESULT=$4 - if [ "$FIRSTTEST" == "1" ]; then - html "

Test results

" - a_name "tests" - a_href "tests.log" "Output log from tests" - html "" - FIRSTTEST=0 - else - if [ "$FLUSH" == "1" ]; then - html "
" - fi - fi - if [ "$TESTPART" != "" ]; then - html "$TESTPART" - TESTPART= + if [ "$FLUSH" == "1" ]; then + html_~tr + html_~table + html_~tr fi - if [ "$FLUSH" == "1" ]; then - html "$NAME: " - fi - if [ ${#LABEL} -gt 2 ]; then - WIDTH="" - else - WIDTH="width=\"20\"" - fi - if [ "$RES" == "Passed" ]; then + WIDTH=$( width $LABEL ) + if [ "$RESULT" == "Passed" ]; then html "" @@ -238,6 +282,55 @@ fi } +start_test_results() { + html_h1 "Test results" + html_a_name "tests" + html_a_href "tests.log" "Output log from tests" + html_table +} + +start_part() { + PART=$1 + html_tr part + html_th 2 + html $PART + html_~th + html_~tr +} + +start_row() { + html_tr testline + html_td right + if [[ -n $TESTLINK ]]; then + html_a_href $TESTLINK $TESTNAME + else + html $TESTNAME + fi + html_~td + html_td + html_table + html_tr + SEQ=1 +} + +end_row() { + html_~tr + html_~table + html_~td + html_~tr +} + +# HTML width of label (for alignment) +width() { + LABEL=$1 + if [ ${#LABEL} -gt 2 ]; then + WIDTH="" + else + WIDTH="width=\"20\"" + fi + echo $WIDTH +} + # TLOG = this (current) log tlog() { TLOG="output_$LOGCOUNT.txt" @@ -293,7 +386,6 @@ aexec "$@" ptest let "SEQ=$SEQ+1" - FLUSH=0 } ssexec() { @@ -308,21 +400,6 @@ FLUSH=0 } -# Execute final test in set -vexec() { - if [ "$SEQ" == "1" ]; then - banner "$TEST" - echo "Executing $TEST" - else - banner "$TEST (part $SEQ)" - echo "Executing $TEST (part $SEQ)" - fi - aexec "$@" - vtest - SEQ=1 - FLUSH=1 -} - # Fake exec fexec() { FLUSH=1 @@ -330,17 +407,17 @@ echo "Faking $TEST" EXITCODE=0 LASTCMD="" - vtest + ptest } ptest() { if [ "$EXITCODE" == "0" ]; then - RES="Passed" + RESULT="Passed" else - RES="Failed" + RESULT="Failed" fi tlog - out test "$TESTLINK" $SEQ "$LASTCMD" $RES $TLOG + out test $SEQ "$LASTCMD" $RESULT $TLOG if [ "$EXITONFAILURE" == "true" ]; then if [ "$EXITCODE" != "0" ]; then exit $EXITCODE @@ -348,57 +425,49 @@ fi } -vtest() { - EC=$? - if [ "$EXITCODE" == "0" ]; then - RES="Passed" - else - RES="Failed" - fi - tlog - out test "$TESTLINK" $SEQ "$LASTCMD" $RES $TLOG - if [ "$EXITCODE" != "0" ]; then - if [ "$EXITONFAILURE" == "true" ]; then - exit $EXITCODE - fi - fi -} - build_package() { TEST="Package" pexec cd $SWIFT_HOME/lib pexec rm -f castor*.jar *gt2ft*.jar ant.jar pexec cd $TOPDIR - vexec tar -pczf $RUNDIR/swift-$DATE.tar.gz $SWIFT_HOME + pexec tar -pczf $RUNDIR/swift-$DATE.tar.gz $SWIFT_HOME out package "swift-$DATE.tar.gz" } date > $LOG -FLUSH=1 header +start_test_results cd $TOPDIR -TESTPART="Part I: Build" +start_part "Part I: Build" + +TESTLINK= EXITONFAILURE=true if [ "$SKIP_CHECKOUT" != "1" ]; then - TEST="Checkout CoG" + TESTNAME="Checkout CoG" + start_row pexec rm -rf cog COG="https://cogkit.svn.sourceforge.net/svnroot/cogkit/trunk/current/src/cog" - vexec svn co $COG + pexec svn co $COG + end_row - TEST="Checkout Swift" + TESTNAME="Checkout Swift" + start_row pexec cd cog/modules pexec rm -rf swift - vexec svn co https://svn.ci.uchicago.edu/svn/vdl2/$BRANCH swift + pexec svn co https://svn.ci.uchicago.edu/svn/vdl2/$BRANCH swift + end_row fi -TEST="Compile" +TESTNAME="Compile" +start_row + pexec cd $TOPDIR/cog/modules/swift if [ $CLEAN == "1" ]; then pexec rm -rf dist fi -vexec ant -quiet dist +pexec ant -quiet dist SWIFT_HOME=$TOPDIR/cog/modules/swift/dist/swift-svn if [ $BUILD_PACKAGE = "1" ]; then @@ -411,23 +480,28 @@ TESTDIR=$TOPDIR/cog/modules/swift/tests cd $RUNDIR +end_row + if [ $ALWAYS_EXITONFAILURE != "1" ]; then EXITONFAILURE=false fi -TESTPART="Part II: Local Tests" +start_part "Part II: Local Tests" + for TEST in $( ls $TESTDIR/*.swift ); do # $TESTDIR/*.dtm TESTNAME=$( basename $TEST) - echo TESTNAME: $TESTNAME $TESTDIR/$TESTNAME cp -uv $TESTDIR/$TESTNAME . sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml + TESTLINK=$TESTNAME - TESTLINK="$TESTNAME" + start_row for ((i=1; $i<$ITERS_LOCAL; i=$i+1)); do pexec swift -sites.file sites.xml $TESTNAME done - vexec swift -sites.file sites.xml $TESTNAME + pexec swift -sites.file sites.xml $TESTNAME + + end_row done if [ $GRID_TESTS == "0" ]; then @@ -449,7 +523,7 @@ for ((i=0; $i<9; i=$i+1)); do pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml done - vexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml + pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml done #Don't remove me: From noreply at svn.ci.uchicago.edu Fri Aug 6 17:51:32 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 6 Aug 2010 17:51:32 -0500 (CDT) Subject: [Swift-commit] r3499 - trunk/tests Message-ID: <20100806225132.B91529CC86@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-06 17:51:32 -0500 (Fri, 06 Aug 2010) New Revision: 3499 Modified: trunk/tests/array_wildcard.swift Log: Fix to test case Modified: trunk/tests/array_wildcard.swift =================================================================== --- trunk/tests/array_wildcard.swift 2010-08-06 22:45:43 UTC (rev 3498) +++ trunk/tests/array_wildcard.swift 2010-08-06 22:51:32 UTC (rev 3499) @@ -8,6 +8,4 @@ } string greetings[] = ["how","are","you"]; -file hw = echo(greetings); - - +file hw = echo_wildcard(greetings); From noreply at svn.ci.uchicago.edu Sun Aug 8 16:06:37 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 8 Aug 2010 16:06:37 -0500 (CDT) Subject: [Swift-commit] r3500 - usertools/swift/swiftconfig/etc Message-ID: <20100808210637.2E4E79CC90@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-08 16:06:36 -0500 (Sun, 08 Aug 2010) New Revision: 3500 Added: usertools/swift/swiftconfig/etc/TODO Log: TODO list for swiftconfig/swiftrun Added: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO (rev 0) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-08 21:06:36 UTC (rev 3500) @@ -0,0 +1,16 @@ +TC editing +In the short term, re-add ability to edit TC file with an interactive editor +Longer term, eliminate TC and search PATH instead + +Swiftconfig should have all entries in one auth.defaults, rather than copying +and renaming + +Non-Swiftrun related command line arguments should be passed on to be handled +by swift + +Running and testing on more setups, OSG, teragrid, others + +Job tagging with search capabilities + +Ability to create groups of related sites for runs, ability to run on all +sites (-site all, -site mygroup, etc) From noreply at svn.ci.uchicago.edu Mon Aug 9 21:11:28 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 9 Aug 2010 21:11:28 -0500 (CDT) Subject: [Swift-commit] r3501 - usertools/swift/swiftconfig/bin Message-ID: <20100810021128.895069CCBF@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-09 21:11:28 -0500 (Mon, 09 Aug 2010) New Revision: 3501 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun Log: Better handling of auth.defaults Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-08 21:06:36 UTC (rev 3500) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-10 02:11:28 UTC (rev 3501) @@ -1,5 +1,6 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +use strict; use Cwd; use Cwd qw(abs_path); use File::Copy; @@ -11,7 +12,7 @@ } my @execution_path = split( '/', abs_path($0) ); -my @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); + at execution_path = splice( @execution_path, 0, $#execution_path - 1 ); my $parent_directory = join( '/', @execution_path ); if ( !$swift_home ) { @@ -37,12 +38,12 @@ use Data::Dumper; # Variables used for translation catalog -my $tc_host = 'localhost'; # Host name -my $tc_name = q{}; # Translation name -my $tc_path = "/usr/bin/$name"; # Full path of executable location -my $tc_status = 'INSTALLED'; # Installation status (not used) -my $tc_platform = 'INTEL32::LINUX'; # Platform (not used) -my $tc_profile = 'null'; # Profile entries +#my $tc_host = 'localhost'; # Host name +#my $tc_name = q{}; # Translation name +#my $tc_path = "/usr/bin/$name"; # Full path of executable location +#my $tc_status = 'INSTALLED'; # Installation status (not used) +#my $tc_platform = 'INTEL32::LINUX'; # Platform (not used) +#my $tc_profile = 'null'; # Profile entries # Variables used for sites.xml my $option_templates = q{}; # List all templates @@ -50,9 +51,9 @@ my $option_modify = q{}; # Modify mode my $option_add = q{}; # Add entry my $option_sites = q{}; # List all usable sites +my $option_describe = q{}; # Print raw XML configuration my @execution_providers = ( "gt4", "local", "pbs", "condor", "ssh", "coaster", ); -my $key_file = "$ENV{'HOME'}/.ssh/id_rsa"; # Assign variables from command line options GetOptions( @@ -67,7 +68,7 @@ # Create a new directory if it does not exist sub create_directory { - $directory = $_[0]; + my $directory = $_[0]; if ( !-d "$directory" ) { mkdir "$directory", 0700 or die "Unable to create directory $directory\n"; @@ -101,7 +102,7 @@ print 'Invalid value selected. Please select from: ' . "$error_message\n"; $entry_value = get_entry( $entry_description, $entry_value, - @allowable_entry_values, ); + @allowable_values, ); } } @@ -118,72 +119,91 @@ create_directory("$dotswift_directory/sites"); # Determine the template directory -my @execution_path = split( '/', abs_path($0) ); + at execution_path = split( '/', abs_path($0) ); @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); my $template_directory = join( '/', @execution_path ) . '/etc/sites'; # Add new entry to auths.default sub add_ssh { my ( $ssh_site, $ssh_url) = @_; - + # Open authfile - my $auth_file = "$dotswift_directory/sites/$ssh_site/auth.defaults"; - create_directory("$dotswift_directory/sites/$ssh_site"); - if ( -e "$auth_file" ) { - open( AUTH_FILE, "$auth_file" ) - || die "Unable to open auth file $auth_file for reading!\n"; + my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; + if( -e "$auth_file") { + open( AUTH_FILE, "<$auth_file") + || die "Unable to open $auth_file for reading\n"; } else { - open( AUTH_FILE, ">$auth_file" ) - || die "Unable to open $auth_file for writing!\n"; + open( AUTH_FILE, "+>$auth_file" ) + || die "Unable to open $auth_file for read/write!\n"; } my @auth_data = ; close(AUTH_FILE); - # Create RSA keypair if needed - #my $keyfile = "$ENV{'HOME'}/.ssh/auth.defaults"; - #if ( !-e "$keyfile" ) { - # system("ssh-keygen -t rsa -f $keyfile"); - #} - - # Get existing username and passphrase values + # Get existing values and modify if found my $ssh_username; - my $ssh_passphrase; + my $ssh_password; + my $found = 0; foreach (@auth_data) { - if (/username/i) { - ( my $not_used, $ssh_username, ) = split( '=', $_ ); + if (/username/i && /^$ssh_url/i) { + ( my $setting, $ssh_username, ) = split( '=', $_ ); chomp($ssh_username); + $ssh_username = get_entry( 'Username', $ssh_username ); + $_ = "$ssh_url.username=$ssh_username\n"; + $found = 1; } - if (/passphrase/i) { - ( my $not_used, $ssh_passphrase, ) = split( '=', $_ ); - chomp($ssh_passphrase); + if (/\.password/i && /^$ssh_url/i) { + ( my $setting, $ssh_password, ) = split( '=', $_ ); + chomp($ssh_password); + $ssh_password = get_entry( 'Password', $ssh_password ); + $_ = "$ssh_url.password=$ssh_password\n"; + $found = 1; } } - if ( !$ssh_username ) { + + # Add new entry if needed + if(!$found) { $ssh_username = getlogin(); - } - $ssh_username = get_entry( 'Username', $ssh_username ); - $ssh_passphrase = get_entry( 'Passphrase', $ssh_passphrase ); + $ssh_username = get_entry( 'Username', $ssh_username ); + $ssh_password = get_entry( 'Password', ''); - # Remove old auth.defaults if it already exists - if ( -e "$auth_file" ) { - unlink($auth_file) || die "Unable to remove $auth_file\n"; - @auth_data = (); + # Password based authentication + push( @auth_data, "$ssh_url.type=password\n" ); + push( @auth_data, "$ssh_url.username=$ssh_username\n" ); + push( @auth_data, "$ssh_url.password=$ssh_password\n" ); } - - # Key based authentication - #push( @authdata, "$site.type=key\n" ); - #push( @authdata, "$site.username=$username\n" ); - #push( @authdata, "$site.key=$keyfile\n" ); - #push( @authdata, "$site.passphrase=$passphrase\n" ); - - # Password based authentication - push( @auth_data, "$ssh_url.type=password\n" ); - push( @auth_data, "$ssh_url.username=$ssh_username\n" ); - push( @auth_data, "$ssh_url.password=$ssh_passphrase\n" ); + + # Write data write_file( $auth_file, @auth_data ); } +# Remove an entry from auth.defaults +sub remove_ssh { + my ( $ssh_url, ) = @_; + + # Open auth.defaults + my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; + if( -e "$auth_file") { + open( AUTH_FILE, "<$auth_file") + || die "Unable to open $auth_file for reading\n"; + } + else { + return; + } + my @auth_data = ; + close(AUTH_FILE); + + # Remove + foreach (@auth_data) { + if (/^$ssh_url/i) { + $_ = ''; + } + } + + # Write data + write_file( $auth_file, @auth_data ); +} + # Update TC with correct hostname sub update_tc_hostname { my ( $tc_filename, $tc_host ) = @_; @@ -191,10 +211,10 @@ # Store TC data open( TC_FILESTREAM, "$tc_filename" ) or die("Unable to open tc file $tc_filename!"); - @tc_data = ; + my @tc_data = ; close(TC_FILESTREAM); - foreach $line (@tc_data) { + foreach my $line (@tc_data) { # Ignore comments my $first_character = substr( $line, 0, 1 ); @@ -277,7 +297,7 @@ $xml_ref->{execution}{provider} = get_entry( 'Execution Provider', $xml_ref->{execution}{provider}, - @validproviders + @execution_providers, ); } if ( $xml_ref->{execution}{jobmanager} ) { @@ -298,7 +318,7 @@ $xml_ref->{filesystem}{provider} = get_entry( 'Filesystem Provider', $xml_ref->{filesystem}{provider}, - @validproviders + @execution_providers, ); } if ( $xml_ref->{filesystem}{url} ) { @@ -331,7 +351,7 @@ chdir($directory) || die "Unable to change directories to $directory\n"; my @files = <*>; - foreach $file (@files) { + foreach my $file (@files) { ( my $basename, my $ext ) = split( /\./, $file ); my @path = split( '/', $basename ); print "$basename\n"; @@ -361,9 +381,9 @@ # Update and copy files to reflect input my @files_to_copy = <$from_directory/*>; create_directory("$output_directory"); - foreach $file_to_copy (@files_to_copy) { + foreach my $file_to_copy (@files_to_copy) { copy( $file_to_copy, "$output_directory" ) - || die "Unable to copy to $file to $output_directory\n"; + || die "Unable to copy to $file_to_copy to $output_directory\n"; } my $xml_out_ref = $xml->XMLout( $xml_ref, @@ -394,11 +414,22 @@ # Remove an entry if ($option_remove) { + my $xml_filename = "$dotswift_directory/sites/$option_remove/sites.xml"; + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile)], + KeyAttr => [], + ); + # Remove SSH entry if needed + if($xml_ref->{execution}{provider} eq "ssh") { + remove_ssh($xml_ref->{execution}{url}); + } + + # Remove directory if ( !-d "$dotswift_directory/sites/$option_remove" ) { - "Unable to find site entry for $option_remove\n"; + die "Unable to find site entry for $option_remove\n"; } - rmtree("$dotswift_directory/sites/$option_remove") || die 'Unable to remove directory ' . "$dotswift_directory/sites/$option_remove\n"; @@ -417,15 +448,25 @@ # Modify a site entry if ($option_modify) { my $output_directory = "$dotswift_directory/sites/$option_modify"; - my $sites_file = "$output_directory/sites.xml"; + create_directory($output_directory); + + my $sites_file = "$output_directory/sites.xml"; if ( !-e "$sites_file" ) { die "Unable to find configuration for $option_modify\n"; } - - my $xml_ref = update_xml("$sites_file"); + + my $xml_filename = "$dotswift_directory/sites/$option_modify/sites.xml"; + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile)], + KeyAttr => [], + ); + + my $initial_exurl = $xml_ref->{execution}{url}; + $xml_ref = update_xml("$sites_file"); + my $new_exurl = $xml_ref->{execution}{url}; my $new_sitename = $xml_ref->{handle}; - - create_directory($output_directory); + my $xml_out_ref = $xml->XMLout( $xml_ref, RootName => 'pool', @@ -447,7 +488,11 @@ update_tc_hostname( "$tc_filename", $new_sitename ); } + # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { + if ( $initial_exurl ne $new_exurl ) { + remove_ssh( $initial_exurl ); + } add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); } } Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-08 21:06:36 UTC (rev 3500) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-10 02:11:28 UTC (rev 3501) @@ -1,5 +1,6 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +use strict; use Cwd; use Cwd qw(abs_path); use File::Copy; @@ -11,7 +12,7 @@ } my @path = split( '/', abs_path($0) ); -my @path = splice( @path, 0, $#path - 1 ); + at path = splice( @path, 0, $#path - 1 ); my $parent_directory = join( '/', @path ); if ( !$swifthome ) { @@ -31,37 +32,42 @@ # Create a new directory if it does not exist sub create_directory { - $directory = $_[0]; + my $directory = $_[0]; if ( !-d "$directory" ) { mkdir "$directory", 0700 - or die "Unable to create directory $directory\n"; + or die "Unable to create directory $directory\n"; } } # Append one file to another sub cat_file { - my ($src, $dst) = @_; - if(-e $dst){ open(DSTFILE, ">>$dst") or die "Unable to open $dst for append\n"; } - else { open(DSTFILE, ">$dst") or die "Unable to open $dst for writing\n"; } - open(SRCFILE, $src) || die "Unable to open $src for reading\n"; - foreach $line() { + my ( $src, $dst ) = @_; + if ( -e $dst ) { + open( DSTFILE, ">>$dst" ) or die "Unable to open $dst for append\n"; + } + else { + open( DSTFILE, ">$dst" ) + or die "Unable to open $dst for writing\n"; + } + open( SRCFILE, $src ) || die "Unable to open $src for reading\n"; + foreach my $line () { print DSTFILE $line; } } # Copy a file to a new location sub copy_file { - my ($src, $dst) = @_; - if(!-e $src) { die "Unable to access $src\n"; } - if(!-e $dst) { die "Unable to access $dst\n"; } - copy($src, $dst) or die "Unable to copy $src to $dst\n"; + my ( $src, $dst ) = @_; + if ( !-e $src ) { die "Unable to access $src\n"; } + if ( !-e $dst ) { die "Unable to access $dst\n"; } + copy( $src, $dst ) or die "Unable to copy $src to $dst\n"; } # Strip directory name out of script sub strip_directory { my ($fullpath) = @_; - my @path = split( '/', $fullpath); - my $filename = @path[$#path]; + my @path = split( '/', $fullpath ); + my $filename = $path[$#path]; return $filename; } @@ -72,56 +78,61 @@ use XML::Simple; use Data::Dumper; +my $site; # Site name to execute upon +my $script; # Script name to run + GetOptions( - 'site=s' => \$site, - 'script=s' => \$script, + 'site=s' => \$site, + 'script=s' => \$script, ); # Verify user-created profile info exists -my ($seconds, $minutes, $hours, $days, $months, $years, @junk) = localtime(time); -$datestring = sprintf "%04s%02s%02s%02s%02s%02s%s", $years+1900, $months+1, $days, $hours, $minutes, $seconds, getpgrp(0); +my ( $seconds, $minutes, $hours, $days, $months, $years, @junk ) = + localtime(time); +my $datestring = sprintf "%04s%02s%02s%02s%02s%02s%s", $years + 1900, + $months + 1, $days, $hours, $minutes, $seconds, getpgrp(0); my $dotswift = "$ENV{'HOME'}/.swift"; - # Run job - at sites = split(/,/, $site); +my @sites = split( /,/, $site ); my $script_filename = strip_directory($script); create_directory("$dotswift/jobs"); create_directory("$dotswift/jobs/$script_filename"); create_directory("$dotswift/jobs/$script_filename/$datestring"); -copy_file("$script", "$dotswift/jobs/$script_filename/$datestring"); +copy_file( "$script", "$dotswift/jobs/$script_filename/$datestring" ); -# Temporarily rename existing auth.defaults -if(-e "$ENV{'HOME'}/.ssh/auth.defaults") { - move("$ENV{'HOME'}/.ssh/auth.defaults", "$ENV{'HOME'}/.ssh/auth.defaults.$datestring") || die "Unable to rename $ENV{'HOME'}/.ssh/auth.defaults"; +# Create configuration file for run +foreach my $s (@sites) { + if ( !-d "$dotswift/sites/$s" ) { + print "$dotswift/sites/$site\n"; + die "Unable to find entry for $s\n"; + } + if ( !-e "$dotswift/sites/$s/sites.xml" ) { + die "Unable to find sites.xml for $s\n"; + } + if ( !-e "$dotswift/sites/$s/tc.data" ) { + die "Unable to find tc.data for $s\n"; + } + cat_file( "$dotswift/sites/$s/sites.xml", + "$dotswift/jobs/$script_filename/$datestring/sites.xml" ); + cat_file( "$dotswift/sites/$s/tc.data", + "$dotswift/jobs/$script_filename/$datestring/tc.data" ); } -foreach my $s(@sites) { - if(!-d "$dotswift/sites/$s"){ print "$dotswift/sites/$site\n"; die "Unable to find entry for $s\n"; } - if(!-e "$dotswift/sites/$s/sites.xml"){ die "Unable to find sites.xml for $s\n"; } - if(!-e "$dotswift/sites/$s/tc.data"){ die "Unable to find tc.data for $s\n"; } - cat_file("$dotswift/sites/$s/sites.xml", "$dotswift/jobs/$script_filename/$datestring/sites.xml"); - cat_file("$dotswift/sites/$s/tc.data", "$dotswift/jobs/$script_filename/$datestring/tc.data"); - if(-e "$dotswift/sites/$s/auth.defaults"){ - cat_file("$dotswift/sites/$s/auth.defaults", "$ENV{'HOME'}/.ssh/auth.defaults"); - } -} - # Update XML tags -open(SITEFILE, "$dotswift/jobs/$script_filename/$datestring/sites.xml") || die "Unable to open $dotswift/jobs/$script_filename/$datestring/sites.xml\n"; +my $site_filename = "$dotswift/jobs/$script_filename/$datestring/sites.xml"; +open( SITEFILE, "$site_filename" ) || die "Unable to open $site_filename\n"; my @sitedata = ; close(SITEFILE); -open(SITEFILE, ">$dotswift/jobs/$script_filename/$datestring/sites.xml") || die "Unable to open $dotswift/jobs/$script_filename/$datestring/sites.xml\n"; +open( SITEFILE, ">$site_filename" ) || die "Unable to open $site_filename\n"; print SITEFILE "\n at sitedata\n"; close(SITEFILE); # Run swift -chdir("$dotswift/jobs/$script_filename/$datestring") || die "Unable to change directories to $dotswift/job/$script_filename/$datestring\n"; -print "Submitting job. Check $dotswift/jobs/$script_filename/$datestring for details\n"; -system("swift -sites.file $dotswift/jobs/$script_filename/$datestring/sites.xml -tc.file $dotswift/jobs/$script_filename/$datestring/tc.data $script"); +my $run_directory = "$dotswift/jobs/$script_filename/$datestring"; +chdir("$run_directory") || die "Unable to chdir to $run_directory\n"; +print "Submitting job. Check $run_directory for details\n"; +system( + "swift -sites.file $site_filename -tc.file $run_directory/tc.data $script" +); -# Rename auths.default back to original -if(-e "$ENV{'HOME'}/.ssh/auth.defaults.$datestring") { - move("$ENV{'HOME'}/.ssh/auth.defaults.$datestring", "$ENV{'HOME'}/.ssh/auth.defaults") || die "Unable to rename $ENV{'HOME'}/.ssh/auth.defaults.$datestring"; -} - From noreply at svn.ci.uchicago.edu Tue Aug 10 12:33:49 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 12:33:49 -0500 (CDT) Subject: [Swift-commit] r3502 - trunk/tests Message-ID: <20100810173349.C48EC9CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 12:33:49 -0500 (Tue, 10 Aug 2010) New Revision: 3502 Added: trunk/tests/append.sh trunk/tests/tc.template.data Modified: trunk/tests/ trunk/tests/diamond.swift Log: Simplify diamond.swift test Property changes on: trunk/tests ___________________________________________________________________ Name: svn:ignore + tc.data Added: trunk/tests/append.sh =================================================================== --- trunk/tests/append.sh (rev 0) +++ trunk/tests/append.sh 2010-08-10 17:33:49 UTC (rev 3502) @@ -0,0 +1,12 @@ +#!/bin/sh + +# Concatenate the INPUT and TEXT to the OUTPUT file + +INPUT=$1 +TEXT=$2 +OUTPUT=$3 + +{ + cat ${INPUT} + echo ${TEXT} +} > ${OUTPUT} Property changes on: trunk/tests/append.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/diamond.swift =================================================================== --- trunk/tests/diamond.swift 2010-08-10 02:11:28 UTC (rev 3501) +++ trunk/tests/diamond.swift 2010-08-10 17:33:49 UTC (rev 3502) @@ -1,33 +1,27 @@ type file {}; -(file f) generate (float p1) { - app { - generate "-aTOP -T4" "-p" p1 "-o" @f; - } +app (file f) generate (string s) { + echo s stdout=@f; } -(file f2) process (file f1, string name, float p2) { - app { - process "-a" name "-T4" "-p" p2 "-i" @f1 "-o" @f2; - } +app (file f2) process (file f1, string text) { + append @f1 text @f2; } (file f3) combine (file f1, file f2) { - app { - combine "-aBOTTOM -T4" "-i" @f1 @f2 "-o" @f3; - } + cat @f1 @f2 stdout=@f3; } -(file fd) diamond (float p1, float p2) { - file fa; - file fb; - file fc; - - fa = generate(p1); - fb = process(fa, "LEFT", p2); - fc = process(fa, "RIGHT", p2); +(file fd) diamond (string p1, string p2) { + file fa<"fa.txt">; + file fb<"fb.txt">; + file fc<"fc.txt">; + + fa = generate("TOP"); + fb = process(fa, p1); + fc = process(fa, p2); fd = combine(fb, fc); } -file final<"FINAL">; -final = diamond(1, 100); +file fd<"fd.txt">; +fd = diamond("LEFT", "RIGHT"); Added: trunk/tests/tc.template.data =================================================================== --- trunk/tests/tc.template.data (rev 0) +++ trunk/tests/tc.template.data 2010-08-10 17:33:49 UTC (rev 3502) @@ -0,0 +1,19 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +localhost echo /bin/echo INSTALLED INTEL32::LINUX null +localhost cat /bin/cat INSTALLED INTEL32::LINUX null +localhost ls /bin/ls INSTALLED INTEL32::LINUX null +localhost grep /bin/grep INSTALLED INTEL32::LINUX null +localhost sort /bin/sort INSTALLED INTEL32::LINUX null +localhost paste /bin/paste INSTALLED INTEL32::LINUX null + +localhost append _DIR_/append.sh INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Tue Aug 10 12:35:33 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 12:35:33 -0500 (CDT) Subject: [Swift-commit] r3503 - trunk/tests Message-ID: <20100810173533.289249CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 12:35:32 -0500 (Tue, 10 Aug 2010) New Revision: 3503 Modified: trunk/tests/nightly.sh Log: Add -a and -k; tc.data processing Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 17:33:49 UTC (rev 3502) +++ trunk/tests/nightly.sh 2010-08-10 17:35:32 UTC (rev 3503) @@ -14,9 +14,11 @@ echo "nightly.sh " echo "" echo "usage:" + printf "\t -a Do not run ant \n" printf "\t -c Do not clean \n" printf "\t -g Do not run grid tests \n" printf "\t -h This message \n" + printf "\t -k Skip first N tests \n" printf "\t -p Do not build the package \n" printf "\t -s Do not do a fresh svn checkout \n" printf "\t -x Do not continue after a failure \n" @@ -25,7 +27,9 @@ } # Defaults: +RUN_ANT=1 CLEAN=1 +SKIP_TESTS=0 BUILD_PACKAGE=1 GRID_TESTS=1 SKIP_CHECKOUT=0 @@ -36,6 +40,9 @@ while [ $# -gt 0 ]; do case $1 in + -a) + RUN_ANT=0 + shift;; -c) CLEAN=0 shift;; @@ -45,6 +52,9 @@ -h) printhelp exit 0;; + -k) + SKIP_TESTS=$2 + shift 2;; -p) BUILD_PACKAGE=0 shift;; @@ -69,7 +79,7 @@ fi # Iterations -ITERS_LOCAL=1 +ITERS_LOCAL=2 LOGCOUNT=0 SEQ=1 @@ -106,7 +116,7 @@ } html() { - echo $@ >>$HTML + printf "$@\n" >>$HTML } html_h1() { @@ -172,6 +182,14 @@ html "" } +html_~body() { + html "" +} + +html_~html() { + html "" +} + html_comment() { COMMENT=$1 (( HTML_COMMENTS == 1 )) && html "" @@ -234,11 +252,8 @@ html "" done html "
" - a_href $TLOG $LABEL + html_a_href $TLOG $LABEL else echo "FAILED" cat $TLOG < /dev/null html "" - a_href $TLOG $LABEL + html_a_href $TLOG $LABEL fi html "$DY


" - cat <>$HTML - How to add new tests - - -DOH + html_~body + html_~html } outecho() { @@ -293,7 +308,7 @@ PART=$1 html_tr part html_th 2 - html $PART + html "$PART" html_~th html_~tr } @@ -464,10 +479,12 @@ start_row pexec cd $TOPDIR/cog/modules/swift -if [ $CLEAN == "1" ]; then +if (( $CLEAN )); then pexec rm -rf dist fi -pexec ant -quiet dist +if (( $RUN_ANT )); then + pexec ant -quiet dist +fi SWIFT_HOME=$TOPDIR/cog/modules/swift/dist/swift-svn if [ $BUILD_PACKAGE = "1" ]; then @@ -486,21 +503,24 @@ EXITONFAILURE=false fi +sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml +sed "s at _DIR_@$TESTDIR@" < $TESTDIR/tc.template.data > tc.data + start_part "Part II: Local Tests" -for TEST in $( ls $TESTDIR/*.swift ); do # $TESTDIR/*.dtm +J=0 +for TEST in $( ls $TESTDIR/*.swift ); do + + (( J++ < SKIP_TESTS )) && continue + TESTNAME=$( basename $TEST) cp -uv $TESTDIR/$TESTNAME . - sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml TESTLINK=$TESTNAME start_row - - for ((i=1; $i<$ITERS_LOCAL; i=$i+1)); do - pexec swift -sites.file sites.xml $TESTNAME + for ((i=0; $i<$ITERS_LOCAL; i=$i+1)); do + pexec swift -sites.file sites.xml -tc.file tc.data $TESTNAME done - pexec swift -sites.file sites.xml $TESTNAME - end_row done From noreply at svn.ci.uchicago.edu Tue Aug 10 13:20:23 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 13:20:23 -0500 (CDT) Subject: [Swift-commit] r3504 - trunk/tests Message-ID: <20100810182023.26C199CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 13:20:23 -0500 (Tue, 10 Aug 2010) New Revision: 3504 Added: trunk/tests/diamond.check.sh trunk/tests/diamond.clean.sh Log: Helper scripts for diamond test Added: trunk/tests/diamond.check.sh =================================================================== --- trunk/tests/diamond.check.sh (rev 0) +++ trunk/tests/diamond.check.sh 2010-08-10 18:20:23 UTC (rev 3504) @@ -0,0 +1,11 @@ +#!/bin/sh + +set -x + +COUNT=( $( ls f*.txt ) ) +(( ${#COUNT[@]} == 4 )) || exit 1 + +LINES=$( wc -l < fd.txt ) +(( ${LINES} == 4 )) || exit 1 + +exit 0 Property changes on: trunk/tests/diamond.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/diamond.clean.sh =================================================================== --- trunk/tests/diamond.clean.sh (rev 0) +++ trunk/tests/diamond.clean.sh 2010-08-10 18:20:23 UTC (rev 3504) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v f*.txt || exit 1 + +exit 0 Property changes on: trunk/tests/diamond.clean.sh ___________________________________________________________________ Name: svn:executable + * From noreply at svn.ci.uchicago.edu Tue Aug 10 13:21:12 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 13:21:12 -0500 (CDT) Subject: [Swift-commit] r3505 - trunk/tests Message-ID: <20100810182112.3D1399CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 13:21:12 -0500 (Tue, 10 Aug 2010) New Revision: 3505 Modified: trunk/tests/nightly.sh Log: New support for helper scripts (setup, check, clean) Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 18:20:23 UTC (rev 3504) +++ trunk/tests/nightly.sh 2010-08-10 18:21:12 UTC (rev 3505) @@ -267,21 +267,14 @@ TYPE=$1 if [ "$TYPE" == "test" ]; then - LABEL=$2 # Text on link to output + LABEL="$2" # Text on link to output CMD=$3 # Command issued (td title) - RESULT=$4 + RESULT=$4 # Passed or Failed - - if [ "$FLUSH" == "1" ]; then - html_~tr - html_~table - html_~tr - fi - - WIDTH=$( width $LABEL ) + WIDTH=$( width "$LABEL" ) if [ "$RESULT" == "Passed" ]; then html "" - html_a_href $TLOG $LABEL + html_a_href $TLOG "$LABEL" else echo "FAILED" cat $TLOG < /dev/null @@ -337,7 +330,7 @@ # HTML width of label (for alignment) width() { - LABEL=$1 + LABEL="$1" if [ ${#LABEL} -gt 2 ]; then WIDTH="" else @@ -379,6 +372,24 @@ } >>$BOUT } +# Check for early bailout condition +check_bailout() { + if [ "$EXITONFAILURE" == "true" ]; then + if [ "$EXITCODE" != "0" ]; then + exit $EXITCODE + fi + fi +} + +# Translate exit code into result (Passed/Failed) string +result() { + if [ "$EXITCODE" == "0" ]; then + echo "Passed" + else + echo "Failed" + fi +} + aexec() { declare -p PWD printf "\nExecuting: $@" >>$LOG @@ -399,10 +410,47 @@ banner "$TEST (part $SEQ)" echo "Executing $TEST (part $SEQ)" aexec "$@" - ptest + RESULT=$( result ) + tlog + out test $SEQ "$LASTCMD" $RESULT $TLOG + + check_bailout + let "SEQ=$SEQ+1" } +# Execute helper script (setup, check, or clean) +script_exec() { + SCRIPT=$1 + SYMBOL="$2" + + aexec $SCRIPT + RESULT=$( result ) + + tlog + out test "$SYMBOL" "$LASTCMD" $RESULT + + check_bailout +} + +# Execute Swift test case w/ setup, check, clean +swift_test() { + SWIFTSCRIPT=$1 + SETUPSCRIPT=${SWIFTSCRIPT%.swift}.setup.sh + CHECKSCRIPT=${SWIFTSCRIPT%.swift}.check.sh + CLEANSCRIPT=${SWIFTSCRIPT%.swift}.clean.sh + if [ -x $TESTDIR/$SETUPSCRIPT ]; then + script_exec $TESTDIR/$SETUPSCRIPT "S" + fi + pexec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT + if [ -x $TESTDIR/$CHECKSCRIPT ]; then + script_exec $TESTDIR/$CHECKSCRIPT "√" + fi + if [ -x $TESTDIR/$CLEANSCRIPT ]; then + script_exec $TESTDIR/$CLEANSCRIPT "C" + fi +} + ssexec() { SEQSAVE=$SEQ SEQ=$1 @@ -412,33 +460,19 @@ aexec "$@" ptest SEQ=$SEQSAVE - FLUSH=0 } # Fake exec fexec() { - FLUSH=1 banner "$TEST (faked)" echo "Faking $TEST" EXITCODE=0 LASTCMD="" - ptest + # ptest } -ptest() { - if [ "$EXITCODE" == "0" ]; then - RESULT="Passed" - else - RESULT="Failed" - fi - tlog - out test $SEQ "$LASTCMD" $RESULT $TLOG - if [ "$EXITONFAILURE" == "true" ]; then - if [ "$EXITCODE" != "0" ]; then - exit $EXITCODE - fi - fi -} +#ptest() { +#} build_package() { TEST="Package" @@ -519,7 +553,7 @@ start_row for ((i=0; $i<$ITERS_LOCAL; i=$i+1)); do - pexec swift -sites.file sites.xml -tc.file tc.data $TESTNAME + swift_test $TESTNAME done end_row done From noreply at svn.ci.uchicago.edu Tue Aug 10 13:28:21 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 13:28:21 -0500 (CDT) Subject: [Swift-commit] r3506 - trunk/tests Message-ID: <20100810182821.E73759CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 13:28:21 -0500 (Tue, 10 Aug 2010) New Revision: 3506 Removed: trunk/tests/file_counter.swift Log: This script is not simple enough for the top level Deleted: trunk/tests/file_counter.swift =================================================================== --- trunk/tests/file_counter.swift 2010-08-10 18:21:12 UTC (rev 3505) +++ trunk/tests/file_counter.swift 2010-08-10 18:28:21 UTC (rev 3506) @@ -1,20 +0,0 @@ -// a two-step workflow that essentially does -// ls "*.txt" | wc - -type file {} - -(file f) ls (string s) { - app { - ls s stdout=@filename(f); - } -} - -(file c) wc (file f) { - app { - wc stdin=@filename(f) stdout=@filename(c); - } -} - -file list, count; -list = ls("/"); -count = wc(list); From noreply at svn.ci.uchicago.edu Tue Aug 10 14:17:19 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:17:19 -0500 (CDT) Subject: [Swift-commit] r3507 - trunk/tests Message-ID: <20100810191719.77B359CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:17:19 -0500 (Tue, 10 Aug 2010) New Revision: 3507 Added: trunk/tests/array_iteration.check.sh trunk/tests/array_iteration.clean.sh trunk/tests/array_wildcard.check.sh trunk/tests/array_wildcard.clean.sh trunk/tests/default.check.sh trunk/tests/default.clean.sh trunk/tests/filesysmapper.check.sh trunk/tests/filesysmapper.clean.sh trunk/tests/filesysmapper.setup.sh trunk/tests/hello.check.sh trunk/tests/hello.clean.sh Modified: trunk/tests/array_iteration.swift trunk/tests/array_wildcard.swift trunk/tests/default.swift trunk/tests/filesysmapper.swift trunk/tests/hello.swift trunk/tests/tc.template.data Log: Helper test scripts Added: trunk/tests/array_iteration.check.sh =================================================================== --- trunk/tests/array_iteration.check.sh (rev 0) +++ trunk/tests/array_iteration.check.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +FILES=( $( ls f[1-3].txt ) ) +(( ${#FILES[@]} == 3 )) || exit 1 + +grep "hi there" < ${FILES[1]} || exit 1 + +exit 0 Property changes on: trunk/tests/array_iteration.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/array_iteration.clean.sh =================================================================== --- trunk/tests/array_iteration.clean.sh (rev 0) +++ trunk/tests/array_iteration.clean.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v f[1-3].txt || exit 1 + +exit 0 Property changes on: trunk/tests/array_iteration.clean.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/array_iteration.swift =================================================================== --- trunk/tests/array_iteration.swift 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/array_iteration.swift 2010-08-10 19:17:19 UTC (rev 3507) @@ -10,6 +10,7 @@ } } -string sa[] = ["hello","hi there","how are you"]; -file fa[]; -fa = echo_batch(sa); +string m[] = ["hello","hi there","how are you"]; +string f[] = ["f1.txt", "f2.txt", "f3.txt"]; +file fa[]; +fa = echo_batch(m); Added: trunk/tests/array_wildcard.check.sh =================================================================== --- trunk/tests/array_wildcard.check.sh (rev 0) +++ trunk/tests/array_wildcard.check.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +grep "how are you" < hw.txt || exit 1 + +exit 0 Property changes on: trunk/tests/array_wildcard.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/array_wildcard.clean.sh =================================================================== --- trunk/tests/array_wildcard.clean.sh (rev 0) +++ trunk/tests/array_wildcard.clean.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v hw.txt || exit 1 + +exit 0 Property changes on: trunk/tests/array_wildcard.clean.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/array_wildcard.swift =================================================================== --- trunk/tests/array_wildcard.swift 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/array_wildcard.swift 2010-08-10 19:17:19 UTC (rev 3507) @@ -1,11 +1,8 @@ -type file {} +type file; - -(file t) echo_wildcard (string s[]) { - app { - echo s[*] stdout=@filename(t); - } +app (file t) echo_wildcard (string s[]) { + echo s[*] stdout=@filename(t); } string greetings[] = ["how","are","you"]; -file hw = echo_wildcard(greetings); +file hw<"hw.txt"> = echo_wildcard(greetings); Added: trunk/tests/default.check.sh =================================================================== --- trunk/tests/default.check.sh (rev 0) +++ trunk/tests/default.check.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x + +grep "hello world" < hw1.txt || exit 1 +grep "hello again" < hw2.txt || exit 1 + +exit 0 Property changes on: trunk/tests/default.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/default.clean.sh =================================================================== --- trunk/tests/default.clean.sh (rev 0) +++ trunk/tests/default.clean.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm hw[12].txt || exit 1 + +exit 0 Property changes on: trunk/tests/default.clean.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/default.swift =================================================================== --- trunk/tests/default.swift 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/default.swift 2010-08-10 19:17:19 UTC (rev 3507) @@ -1,11 +1,13 @@ type file {} -(file t) echo (string s="hello world") { //s has a default value - app { - echo s stdout=@filename(t); //redirect stdout to a file - } +// s has a default value +app (file t) echo (string s="hello world") { + // redirect stdout to a file + echo s stdout=@filename(t); } -file hw1, hw2; -hw1 = echo(); // procedure call using the default value -hw2 = echo(s="hello again"); // using a different value +file hw1<"hw1.txt">, hw2<"hw2.txt">; +// procedure call using the default value +hw1 = echo(); +// using a different value +hw2 = echo(s="hello again"); Added: trunk/tests/filesysmapper.check.sh =================================================================== --- trunk/tests/filesysmapper.check.sh (rev 0) +++ trunk/tests/filesysmapper.check.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,9 @@ +#!/bin/sh + +set -x + +ls stdout.txt || exit 1 +COUNT=$( grep -c "file: [abc].dat" < stdout.txt ) +(( $COUNT == 3 )) || exit 1 + +exit 0 Property changes on: trunk/tests/filesysmapper.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/filesysmapper.clean.sh =================================================================== --- trunk/tests/filesysmapper.clean.sh (rev 0) +++ trunk/tests/filesysmapper.clean.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -v [abc].dat || exit 1 + +exit 0 Property changes on: trunk/tests/filesysmapper.clean.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/filesysmapper.setup.sh =================================================================== --- trunk/tests/filesysmapper.setup.sh (rev 0) +++ trunk/tests/filesysmapper.setup.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +touch a.dat b.dat c.dat || exit 1 + +exit 0 Property changes on: trunk/tests/filesysmapper.setup.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/filesysmapper.swift =================================================================== --- trunk/tests/filesysmapper.swift 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/filesysmapper.swift 2010-08-10 19:17:19 UTC (rev 3507) @@ -1,6 +1,6 @@ type file {}; -file files[]; +file files[]; foreach f in files { tracef("file: %s\n", @filename(f)); Added: trunk/tests/hello.check.sh =================================================================== --- trunk/tests/hello.check.sh (rev 0) +++ trunk/tests/hello.check.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +grep hello < hello.txt || exit 1 + +exit 0 Property changes on: trunk/tests/hello.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/hello.clean.sh =================================================================== --- trunk/tests/hello.clean.sh (rev 0) +++ trunk/tests/hello.clean.sh 2010-08-10 19:17:19 UTC (rev 3507) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v hello.txt || exit 1 + +exit 0 Property changes on: trunk/tests/hello.clean.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/hello.swift =================================================================== --- trunk/tests/hello.swift 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/hello.swift 2010-08-10 19:17:19 UTC (rev 3507) @@ -1,12 +1,7 @@ -type file {} +type file; - -(file t) echo (string s) { - app { - echo s stdout=@filename(t); - } +app (file t) echo (string s) { + echo s stdout=@filename(t); } -file hw = echo("hello world"); // May need syntax to give a call a name. - - +file hw<"hello.txt"> = echo("hello world"); Modified: trunk/tests/tc.template.data =================================================================== --- trunk/tests/tc.template.data 2010-08-10 18:28:21 UTC (rev 3506) +++ trunk/tests/tc.template.data 2010-08-10 19:17:19 UTC (rev 3507) @@ -14,6 +14,7 @@ localhost ls /bin/ls INSTALLED INTEL32::LINUX null localhost grep /bin/grep INSTALLED INTEL32::LINUX null localhost sort /bin/sort INSTALLED INTEL32::LINUX null -localhost paste /bin/paste INSTALLED INTEL32::LINUX null +localhost paste /bin/paste INSTALLED INTEL32::LINUX nul +localhost touch /bin/touch INSTALLED INTEL32::LINUX null localhost append _DIR_/append.sh INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Tue Aug 10 14:18:00 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:18:00 -0500 (CDT) Subject: [Swift-commit] r3508 - trunk/tests Message-ID: <20100810191800.904239CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:18:00 -0500 (Tue, 10 Aug 2010) New Revision: 3508 Added: trunk/tests/README.txt Log: README just points to documentation in nightly.sh Added: trunk/tests/README.txt =================================================================== --- trunk/tests/README.txt (rev 0) +++ trunk/tests/README.txt 2010-08-10 19:18:00 UTC (rev 3508) @@ -0,0 +1 @@ +See nightly.sh for usage From noreply at svn.ci.uchicago.edu Tue Aug 10 14:19:16 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:19:16 -0500 (CDT) Subject: [Swift-commit] r3509 - trunk/tests Message-ID: <20100810191916.8FAAB9CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:19:16 -0500 (Tue, 10 Aug 2010) New Revision: 3509 Modified: trunk/tests/nightly.sh Log: Handle stdout, more docs Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 19:18:00 UTC (rev 3508) +++ trunk/tests/nightly.sh 2010-08-10 19:19:16 UTC (rev 3509) @@ -10,6 +10,14 @@ # Everything for a Swift test is written in its RUNDIR # The temporary output always goes to OUTPUT (TOPDIR/exec.out) +# Each *.swift test may be accompanied by a +# *.setup.sh, *.check.sh, and/or *.clean.sh script +# These may setup and inspect files in RUNDIR including swift.out + +# OUTPUT is the stdout of the current test +# stdout.txt retains stdout from the previous test (for *.clean.sh) +# output_*.txt is the HTML-linked permanent output from a test + printhelp() { echo "nightly.sh " echo "" @@ -90,7 +98,7 @@ RUNDIR=$TOPDIR/$RUNDIRBASE LOGBASE=$RUNDIRBASE/tests.log LOG=$TOPDIR/$LOGBASE -OUTPUT=$TOPDIR/exec.out +OUTPUT=$RUNDIR/exec.out HTMLPATH=$RUNDIRBASE/tests-$DATE.html HTML=$TOPDIR/$HTMLPATH @@ -339,13 +347,14 @@ echo $WIDTH } -# TLOG = this (current) log -tlog() { +# TLOG = test log +test_log() { TLOG="output_$LOGCOUNT.txt" rm -fv $TLOG banner "$LASTCMD" $RUNDIR/$TLOG if [ -f $OUTPUT ]; then cp -v $OUTPUT $RUNDIR/$TLOG 2>>$LOG + cp -v $OUTPUT stdout.txt fi let "LOGCOUNT=$LOGCOUNT+1" } @@ -411,7 +420,7 @@ echo "Executing $TEST (part $SEQ)" aexec "$@" RESULT=$( result ) - tlog + test_log out test $SEQ "$LASTCMD" $RESULT $TLOG check_bailout @@ -427,7 +436,7 @@ aexec $SCRIPT RESULT=$( result ) - tlog + test_log out test "$SYMBOL" "$LASTCMD" $RESULT check_bailout From noreply at svn.ci.uchicago.edu Tue Aug 10 14:22:03 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:22:03 -0500 (CDT) Subject: [Swift-commit] r3510 - trunk/tests Message-ID: <20100810192203.B39019CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:22:03 -0500 (Tue, 10 Aug 2010) New Revision: 3510 Removed: trunk/tests/helloworld_named.swift Log: Redundant test Deleted: trunk/tests/helloworld_named.swift =================================================================== --- trunk/tests/helloworld_named.swift 2010-08-10 19:19:16 UTC (rev 3509) +++ trunk/tests/helloworld_named.swift 2010-08-10 19:22:03 UTC (rev 3510) @@ -1,9 +0,0 @@ -type file {} //define a type for file -(file t) echo (string s) { //procedure declaration - app { - echo s stdout=@filename(t); //redirect stdout to a file - } -} - -file hw<"helloworld.txt">; //name the output file -hw = echo("hello world"); //procedure call From noreply at svn.ci.uchicago.edu Tue Aug 10 14:22:36 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:22:36 -0500 (CDT) Subject: [Swift-commit] r3511 - trunk/tests Message-ID: <20100810192236.365619CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:22:36 -0500 (Tue, 10 Aug 2010) New Revision: 3511 Removed: trunk/tests/helloworld.swift Log: Redundant test Deleted: trunk/tests/helloworld.swift =================================================================== --- trunk/tests/helloworld.swift 2010-08-10 19:22:03 UTC (rev 3510) +++ trunk/tests/helloworld.swift 2010-08-10 19:22:36 UTC (rev 3511) @@ -1,8 +0,0 @@ -type file {} //define a type for file -(file t) echo (string s) { //procedure declaration - app { - echo s stdout=@filename(t); //redirect stdout to a file - } -} - -file hw = echo("hello world"); //procedure call From noreply at svn.ci.uchicago.edu Tue Aug 10 14:30:03 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 14:30:03 -0500 (CDT) Subject: [Swift-commit] r3512 - trunk/tests Message-ID: <20100810193003.7D9A69CCA2@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 14:30:03 -0500 (Tue, 10 Aug 2010) New Revision: 3512 Added: trunk/tests/range.check.sh Log: Check for range.swift Added: trunk/tests/range.check.sh =================================================================== --- trunk/tests/range.check.sh (rev 0) +++ trunk/tests/range.check.sh 2010-08-10 19:30:03 UTC (rev 3512) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +ls stdout.txt || exit 1 + +COUNT=$( grep -c "num:" < stdout.txt ) +(( $COUNT == 11 )) || exit 1 + +exit 0 Property changes on: trunk/tests/range.check.sh ___________________________________________________________________ Name: svn:executable + * From noreply at svn.ci.uchicago.edu Tue Aug 10 15:47:10 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 15:47:10 -0500 (CDT) Subject: [Swift-commit] r3513 - trunk/tests Message-ID: <20100810204710.70A489CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 15:47:10 -0500 (Tue, 10 Aug 2010) New Revision: 3513 Added: trunk/tests/local/ Log: Location for "local" tests From noreply at svn.ci.uchicago.edu Tue Aug 10 16:01:14 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:01:14 -0500 (CDT) Subject: [Swift-commit] r3514 - trunk/tests Message-ID: <20100810210114.AEB239CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:01:14 -0500 (Tue, 10 Aug 2010) New Revision: 3514 Modified: trunk/tests/diamond.swift Log: Quick fix Modified: trunk/tests/diamond.swift =================================================================== --- trunk/tests/diamond.swift 2010-08-10 20:47:10 UTC (rev 3513) +++ trunk/tests/diamond.swift 2010-08-10 21:01:14 UTC (rev 3514) @@ -8,7 +8,7 @@ append @f1 text @f2; } -(file f3) combine (file f1, file f2) { +app (file f3) combine (file f1, file f2) { cat @f1 @f2 stdout=@f3; } From noreply at svn.ci.uchicago.edu Tue Aug 10 16:13:25 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:13:25 -0500 (CDT) Subject: [Swift-commit] r3515 - in trunk/tests: . local Message-ID: <20100810211325.DBD429CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:13:25 -0500 (Tue, 10 Aug 2010) New Revision: 3515 Added: trunk/tests/array_index.swift trunk/tests/local/append.sh trunk/tests/local/array_iteration.check.sh trunk/tests/local/array_iteration.clean.sh trunk/tests/local/array_iteration.swift trunk/tests/local/array_wildcard.check.sh trunk/tests/local/array_wildcard.clean.sh trunk/tests/local/array_wildcard.swift trunk/tests/local/default.check.sh trunk/tests/local/default.clean.sh trunk/tests/local/default.swift trunk/tests/local/diamond.check.sh trunk/tests/local/diamond.clean.sh trunk/tests/local/diamond.swift trunk/tests/local/filesysmapper.check.sh trunk/tests/local/filesysmapper.clean.sh trunk/tests/local/filesysmapper.setup.sh trunk/tests/local/filesysmapper.swift trunk/tests/local/hello.check.sh trunk/tests/local/hello.clean.sh trunk/tests/local/hello.swift trunk/tests/local/range.check.sh trunk/tests/local/range.swift trunk/tests/local/tc.template.data Removed: trunk/tests/append.sh trunk/tests/array_index.dtm trunk/tests/array_iteration.check.sh trunk/tests/array_iteration.clean.sh trunk/tests/array_iteration.swift trunk/tests/array_wildcard.check.sh trunk/tests/array_wildcard.clean.sh trunk/tests/array_wildcard.swift trunk/tests/default.check.sh trunk/tests/default.clean.sh trunk/tests/default.swift trunk/tests/diamond.check.sh trunk/tests/diamond.clean.sh trunk/tests/diamond.swift trunk/tests/filesysmapper.check.sh trunk/tests/filesysmapper.clean.sh trunk/tests/filesysmapper.setup.sh trunk/tests/filesysmapper.swift trunk/tests/hello.check.sh trunk/tests/hello.clean.sh trunk/tests/hello.swift trunk/tests/range.check.sh trunk/tests/range.swift trunk/tests/tc.template.data Log: Restructure tests into GROUPs Deleted: trunk/tests/append.sh =================================================================== --- trunk/tests/append.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/append.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,12 +0,0 @@ -#!/bin/sh - -# Concatenate the INPUT and TEXT to the OUTPUT file - -INPUT=$1 -TEXT=$2 -OUTPUT=$3 - -{ - cat ${INPUT} - echo ${TEXT} -} > ${OUTPUT} Deleted: trunk/tests/array_index.dtm =================================================================== --- trunk/tests/array_index.dtm 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_index.dtm 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,12 +0,0 @@ -type file {} - - -(file t) echo_array (string s[]) { - app { - echo s[0] s[1] s[2] stdout=@filename(t); - } -} - -string greetings[] = ["how","are","you"]; -file hw = echo(greetings); - Copied: trunk/tests/array_index.swift (from rev 3501, trunk/tests/array_index.dtm) =================================================================== --- trunk/tests/array_index.swift (rev 0) +++ trunk/tests/array_index.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,12 @@ +type file {} + + +(file t) echo_array (string s[]) { + app { + echo s[0] s[1] s[2] stdout=@filename(t); + } +} + +string greetings[] = ["how","are","you"]; +file hw = echo(greetings); + Deleted: trunk/tests/array_iteration.check.sh =================================================================== --- trunk/tests/array_iteration.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_iteration.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,10 +0,0 @@ -#!/bin/sh - -set -x - -FILES=( $( ls f[1-3].txt ) ) -(( ${#FILES[@]} == 3 )) || exit 1 - -grep "hi there" < ${FILES[1]} || exit 1 - -exit 0 Deleted: trunk/tests/array_iteration.clean.sh =================================================================== --- trunk/tests/array_iteration.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_iteration.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -rm -v f[1-3].txt || exit 1 - -exit 0 Deleted: trunk/tests/array_iteration.swift =================================================================== --- trunk/tests/array_iteration.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_iteration.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,16 +0,0 @@ -type file {} - -app (file f) echo (string s) { - echo s stdout=@filename(f); -} - -(file fa[]) echo_batch (string sa[]) { - foreach s, i in sa { - fa[i] = echo(s); - } -} - -string m[] = ["hello","hi there","how are you"]; -string f[] = ["f1.txt", "f2.txt", "f3.txt"]; -file fa[]; -fa = echo_batch(m); Deleted: trunk/tests/array_wildcard.check.sh =================================================================== --- trunk/tests/array_wildcard.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_wildcard.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -grep "how are you" < hw.txt || exit 1 - -exit 0 Deleted: trunk/tests/array_wildcard.clean.sh =================================================================== --- trunk/tests/array_wildcard.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_wildcard.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -rm -v hw.txt || exit 1 - -exit 0 Deleted: trunk/tests/array_wildcard.swift =================================================================== --- trunk/tests/array_wildcard.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/array_wildcard.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,8 +0,0 @@ -type file; - -app (file t) echo_wildcard (string s[]) { - echo s[*] stdout=@filename(t); -} - -string greetings[] = ["how","are","you"]; -file hw<"hw.txt"> = echo_wildcard(greetings); Deleted: trunk/tests/default.check.sh =================================================================== --- trunk/tests/default.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/default.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,8 +0,0 @@ -#!/bin/sh - -set -x - -grep "hello world" < hw1.txt || exit 1 -grep "hello again" < hw2.txt || exit 1 - -exit 0 Deleted: trunk/tests/default.clean.sh =================================================================== --- trunk/tests/default.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/default.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -rm hw[12].txt || exit 1 - -exit 0 Deleted: trunk/tests/default.swift =================================================================== --- trunk/tests/default.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/default.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,13 +0,0 @@ -type file {} - -// s has a default value -app (file t) echo (string s="hello world") { - // redirect stdout to a file - echo s stdout=@filename(t); -} - -file hw1<"hw1.txt">, hw2<"hw2.txt">; -// procedure call using the default value -hw1 = echo(); -// using a different value -hw2 = echo(s="hello again"); Deleted: trunk/tests/diamond.check.sh =================================================================== --- trunk/tests/diamond.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/diamond.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,11 +0,0 @@ -#!/bin/sh - -set -x - -COUNT=( $( ls f*.txt ) ) -(( ${#COUNT[@]} == 4 )) || exit 1 - -LINES=$( wc -l < fd.txt ) -(( ${LINES} == 4 )) || exit 1 - -exit 0 Deleted: trunk/tests/diamond.clean.sh =================================================================== --- trunk/tests/diamond.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/diamond.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -rm -v f*.txt || exit 1 - -exit 0 Deleted: trunk/tests/diamond.swift =================================================================== --- trunk/tests/diamond.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/diamond.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,27 +0,0 @@ -type file {}; - -app (file f) generate (string s) { - echo s stdout=@f; -} - -app (file f2) process (file f1, string text) { - append @f1 text @f2; -} - -app (file f3) combine (file f1, file f2) { - cat @f1 @f2 stdout=@f3; -} - -(file fd) diamond (string p1, string p2) { - file fa<"fa.txt">; - file fb<"fb.txt">; - file fc<"fc.txt">; - - fa = generate("TOP"); - fb = process(fa, p1); - fc = process(fa, p2); - fd = combine(fb, fc); -} - -file fd<"fd.txt">; -fd = diamond("LEFT", "RIGHT"); Deleted: trunk/tests/filesysmapper.check.sh =================================================================== --- trunk/tests/filesysmapper.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/filesysmapper.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,9 +0,0 @@ -#!/bin/sh - -set -x - -ls stdout.txt || exit 1 -COUNT=$( grep -c "file: [abc].dat" < stdout.txt ) -(( $COUNT == 3 )) || exit 1 - -exit 0 Deleted: trunk/tests/filesysmapper.clean.sh =================================================================== --- trunk/tests/filesysmapper.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/filesysmapper.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,5 +0,0 @@ -#!/bin/sh - -rm -v [abc].dat || exit 1 - -exit 0 Deleted: trunk/tests/filesysmapper.setup.sh =================================================================== --- trunk/tests/filesysmapper.setup.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/filesysmapper.setup.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -touch a.dat b.dat c.dat || exit 1 - -exit 0 Deleted: trunk/tests/filesysmapper.swift =================================================================== --- trunk/tests/filesysmapper.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/filesysmapper.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -type file {}; - -file files[]; - -foreach f in files { - tracef("file: %s\n", @filename(f)); -} Deleted: trunk/tests/hello.check.sh =================================================================== --- trunk/tests/hello.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/hello.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -grep hello < hello.txt || exit 1 - -exit 0 Deleted: trunk/tests/hello.clean.sh =================================================================== --- trunk/tests/hello.clean.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/hello.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -#!/bin/sh - -set -x - -rm -v hello.txt || exit 1 - -exit 0 Deleted: trunk/tests/hello.swift =================================================================== --- trunk/tests/hello.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/hello.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,7 +0,0 @@ -type file; - -app (file t) echo (string s) { - echo s stdout=@filename(t); -} - -file hw<"hello.txt"> = echo("hello world"); Copied: trunk/tests/local/append.sh (from rev 3502, trunk/tests/append.sh) =================================================================== --- trunk/tests/local/append.sh (rev 0) +++ trunk/tests/local/append.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,12 @@ +#!/bin/sh + +# Concatenate the INPUT and TEXT to the OUTPUT file + +INPUT=$1 +TEXT=$2 +OUTPUT=$3 + +{ + cat ${INPUT} + echo ${TEXT} +} > ${OUTPUT} Copied: trunk/tests/local/array_iteration.check.sh (from rev 3507, trunk/tests/array_iteration.check.sh) =================================================================== --- trunk/tests/local/array_iteration.check.sh (rev 0) +++ trunk/tests/local/array_iteration.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +FILES=( $( ls f[1-3].txt ) ) +(( ${#FILES[@]} == 3 )) || exit 1 + +grep "hi there" < ${FILES[1]} || exit 1 + +exit 0 Copied: trunk/tests/local/array_iteration.clean.sh (from rev 3507, trunk/tests/array_iteration.clean.sh) =================================================================== --- trunk/tests/local/array_iteration.clean.sh (rev 0) +++ trunk/tests/local/array_iteration.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v f[1-3].txt || exit 1 + +exit 0 Copied: trunk/tests/local/array_iteration.swift (from rev 3507, trunk/tests/array_iteration.swift) =================================================================== --- trunk/tests/local/array_iteration.swift (rev 0) +++ trunk/tests/local/array_iteration.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,16 @@ +type file {} + +app (file f) echo (string s) { + echo s stdout=@filename(f); +} + +(file fa[]) echo_batch (string sa[]) { + foreach s, i in sa { + fa[i] = echo(s); + } +} + +string m[] = ["hello","hi there","how are you"]; +string f[] = ["f1.txt", "f2.txt", "f3.txt"]; +file fa[]; +fa = echo_batch(m); Copied: trunk/tests/local/array_wildcard.check.sh (from rev 3507, trunk/tests/array_wildcard.check.sh) =================================================================== --- trunk/tests/local/array_wildcard.check.sh (rev 0) +++ trunk/tests/local/array_wildcard.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +grep "how are you" < hw.txt || exit 1 + +exit 0 Copied: trunk/tests/local/array_wildcard.clean.sh (from rev 3507, trunk/tests/array_wildcard.clean.sh) =================================================================== --- trunk/tests/local/array_wildcard.clean.sh (rev 0) +++ trunk/tests/local/array_wildcard.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v hw.txt || exit 1 + +exit 0 Copied: trunk/tests/local/array_wildcard.swift (from rev 3507, trunk/tests/array_wildcard.swift) =================================================================== --- trunk/tests/local/array_wildcard.swift (rev 0) +++ trunk/tests/local/array_wildcard.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,8 @@ +type file; + +app (file t) echo_wildcard (string s[]) { + echo s[*] stdout=@filename(t); +} + +string greetings[] = ["how","are","you"]; +file hw<"hw.txt"> = echo_wildcard(greetings); Copied: trunk/tests/local/default.check.sh (from rev 3507, trunk/tests/default.check.sh) =================================================================== --- trunk/tests/local/default.check.sh (rev 0) +++ trunk/tests/local/default.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x + +grep "hello world" < hw1.txt || exit 1 +grep "hello again" < hw2.txt || exit 1 + +exit 0 Copied: trunk/tests/local/default.clean.sh (from rev 3507, trunk/tests/default.clean.sh) =================================================================== --- trunk/tests/local/default.clean.sh (rev 0) +++ trunk/tests/local/default.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm hw[12].txt || exit 1 + +exit 0 Copied: trunk/tests/local/default.swift (from rev 3507, trunk/tests/default.swift) =================================================================== --- trunk/tests/local/default.swift (rev 0) +++ trunk/tests/local/default.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,13 @@ +type file {} + +// s has a default value +app (file t) echo (string s="hello world") { + // redirect stdout to a file + echo s stdout=@filename(t); +} + +file hw1<"hw1.txt">, hw2<"hw2.txt">; +// procedure call using the default value +hw1 = echo(); +// using a different value +hw2 = echo(s="hello again"); Copied: trunk/tests/local/diamond.check.sh (from rev 3504, trunk/tests/diamond.check.sh) =================================================================== --- trunk/tests/local/diamond.check.sh (rev 0) +++ trunk/tests/local/diamond.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,11 @@ +#!/bin/sh + +set -x + +COUNT=( $( ls f*.txt ) ) +(( ${#COUNT[@]} == 4 )) || exit 1 + +LINES=$( wc -l < fd.txt ) +(( ${LINES} == 4 )) || exit 1 + +exit 0 Copied: trunk/tests/local/diamond.clean.sh (from rev 3504, trunk/tests/diamond.clean.sh) =================================================================== --- trunk/tests/local/diamond.clean.sh (rev 0) +++ trunk/tests/local/diamond.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v f*.txt || exit 1 + +exit 0 Copied: trunk/tests/local/diamond.swift (from rev 3502, trunk/tests/diamond.swift) =================================================================== --- trunk/tests/local/diamond.swift (rev 0) +++ trunk/tests/local/diamond.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,27 @@ +type file {}; + +app (file f) generate (string s) { + echo s stdout=@f; +} + +app (file f2) process (file f1, string text) { + append @f1 text @f2; +} + +app (file f3) combine (file f1, file f2) { + cat @f1 @f2 stdout=@f3; +} + +(file fd) diamond (string p1, string p2) { + file fa<"fa.txt">; + file fb<"fb.txt">; + file fc<"fc.txt">; + + fa = generate("TOP"); + fb = process(fa, p1); + fc = process(fa, p2); + fd = combine(fb, fc); +} + +file fd<"fd.txt">; +fd = diamond("LEFT", "RIGHT"); Copied: trunk/tests/local/filesysmapper.check.sh (from rev 3507, trunk/tests/filesysmapper.check.sh) =================================================================== --- trunk/tests/local/filesysmapper.check.sh (rev 0) +++ trunk/tests/local/filesysmapper.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,9 @@ +#!/bin/sh + +set -x + +ls stdout.txt || exit 1 +COUNT=$( grep -c "file: [abc].dat" < stdout.txt ) +(( $COUNT == 3 )) || exit 1 + +exit 0 Copied: trunk/tests/local/filesysmapper.clean.sh (from rev 3507, trunk/tests/filesysmapper.clean.sh) =================================================================== --- trunk/tests/local/filesysmapper.clean.sh (rev 0) +++ trunk/tests/local/filesysmapper.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -v [abc].dat || exit 1 + +exit 0 Copied: trunk/tests/local/filesysmapper.setup.sh (from rev 3507, trunk/tests/filesysmapper.setup.sh) =================================================================== --- trunk/tests/local/filesysmapper.setup.sh (rev 0) +++ trunk/tests/local/filesysmapper.setup.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +touch a.dat b.dat c.dat || exit 1 + +exit 0 Copied: trunk/tests/local/filesysmapper.swift (from rev 3507, trunk/tests/filesysmapper.swift) =================================================================== --- trunk/tests/local/filesysmapper.swift (rev 0) +++ trunk/tests/local/filesysmapper.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +type file {}; + +file files[]; + +foreach f in files { + tracef("file: %s\n", @filename(f)); +} Copied: trunk/tests/local/hello.check.sh (from rev 3507, trunk/tests/hello.check.sh) =================================================================== --- trunk/tests/local/hello.check.sh (rev 0) +++ trunk/tests/local/hello.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +grep hello < hello.txt || exit 1 + +exit 0 Copied: trunk/tests/local/hello.clean.sh (from rev 3507, trunk/tests/hello.clean.sh) =================================================================== --- trunk/tests/local/hello.clean.sh (rev 0) +++ trunk/tests/local/hello.clean.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -v hello.txt || exit 1 + +exit 0 Copied: trunk/tests/local/hello.swift (from rev 3507, trunk/tests/hello.swift) =================================================================== --- trunk/tests/local/hello.swift (rev 0) +++ trunk/tests/local/hello.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,7 @@ +type file; + +app (file t) echo (string s) { + echo s stdout=@filename(t); +} + +file hw<"hello.txt"> = echo("hello world"); Copied: trunk/tests/local/range.check.sh (from rev 3512, trunk/tests/range.check.sh) =================================================================== --- trunk/tests/local/range.check.sh (rev 0) +++ trunk/tests/local/range.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +ls stdout.txt || exit 1 + +COUNT=$( grep -c "num:" < stdout.txt ) +(( $COUNT == 11 )) || exit 1 + +exit 0 Copied: trunk/tests/local/range.swift (from rev 3501, trunk/tests/range.swift) =================================================================== --- trunk/tests/local/range.swift (rev 0) +++ trunk/tests/local/range.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,5 @@ +int nums[] = [0:20:2]; // generate a list 0, 2, 4, 6, 8 ... + +foreach num in nums { + tracef("num: %i\n", num); +} Copied: trunk/tests/local/tc.template.data (from rev 3507, trunk/tests/tc.template.data) =================================================================== --- trunk/tests/local/tc.template.data (rev 0) +++ trunk/tests/local/tc.template.data 2010-08-10 21:13:25 UTC (rev 3515) @@ -0,0 +1,20 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +localhost echo /bin/echo INSTALLED INTEL32::LINUX null +localhost cat /bin/cat INSTALLED INTEL32::LINUX null +localhost ls /bin/ls INSTALLED INTEL32::LINUX null +localhost grep /bin/grep INSTALLED INTEL32::LINUX null +localhost sort /bin/sort INSTALLED INTEL32::LINUX null +localhost paste /bin/paste INSTALLED INTEL32::LINUX nul +localhost touch /bin/touch INSTALLED INTEL32::LINUX null + +localhost append _DIR_/append.sh INSTALLED INTEL32::LINUX null Deleted: trunk/tests/range.check.sh =================================================================== --- trunk/tests/range.check.sh 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/range.check.sh 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,10 +0,0 @@ -#!/bin/sh - -set -x - -ls stdout.txt || exit 1 - -COUNT=$( grep -c "num:" < stdout.txt ) -(( $COUNT == 11 )) || exit 1 - -exit 0 Deleted: trunk/tests/range.swift =================================================================== --- trunk/tests/range.swift 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/range.swift 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,5 +0,0 @@ -int nums[] = [0:20:2]; // generate a list 0, 2, 4, 6, 8 ... - -foreach num in nums { - tracef("num: %i\n", num); -} Deleted: trunk/tests/tc.template.data =================================================================== --- trunk/tests/tc.template.data 2010-08-10 21:01:14 UTC (rev 3514) +++ trunk/tests/tc.template.data 2010-08-10 21:13:25 UTC (rev 3515) @@ -1,20 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -localhost echo /bin/echo INSTALLED INTEL32::LINUX null -localhost cat /bin/cat INSTALLED INTEL32::LINUX null -localhost ls /bin/ls INSTALLED INTEL32::LINUX null -localhost grep /bin/grep INSTALLED INTEL32::LINUX null -localhost sort /bin/sort INSTALLED INTEL32::LINUX null -localhost paste /bin/paste INSTALLED INTEL32::LINUX nul -localhost touch /bin/touch INSTALLED INTEL32::LINUX null - -localhost append _DIR_/append.sh INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Tue Aug 10 16:14:36 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:14:36 -0500 (CDT) Subject: [Swift-commit] r3516 - trunk/tests Message-ID: <20100810211436.DE2919CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:14:36 -0500 (Tue, 10 Aug 2010) New Revision: 3516 Modified: trunk/tests/nightly.sh Log: Start using test GROUPs Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 21:13:25 UTC (rev 3515) +++ trunk/tests/nightly.sh 2010-08-10 21:14:36 UTC (rev 3516) @@ -14,6 +14,8 @@ # *.setup.sh, *.check.sh, and/or *.clean.sh script # These may setup and inspect files in RUNDIR including swift.out +# Tests are GROUPed into directories + # OUTPUT is the stdout of the current test # stdout.txt retains stdout from the previous test (for *.clean.sh) # output_*.txt is the HTML-linked permanent output from a test @@ -289,7 +291,7 @@ html "" html_a_href $TLOG $LABEL fi - html "" + html_~td elif [ "$TYPE" == "package" ]; then BINPACKAGE=$2 @@ -448,15 +450,15 @@ SETUPSCRIPT=${SWIFTSCRIPT%.swift}.setup.sh CHECKSCRIPT=${SWIFTSCRIPT%.swift}.check.sh CLEANSCRIPT=${SWIFTSCRIPT%.swift}.clean.sh - if [ -x $TESTDIR/$SETUPSCRIPT ]; then - script_exec $TESTDIR/$SETUPSCRIPT "S" + if [ -x $GROUP/$SETUPSCRIPT ]; then + script_exec $GROUP/$SETUPSCRIPT "S" fi pexec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT - if [ -x $TESTDIR/$CHECKSCRIPT ]; then - script_exec $TESTDIR/$CHECKSCRIPT "√" + if [ -x $GROUP/$CHECKSCRIPT ]; then + script_exec $GROUP/$CHECKSCRIPT "√" fi - if [ -x $TESTDIR/$CLEANSCRIPT ]; then - script_exec $TESTDIR/$CLEANSCRIPT "C" + if [ -x $GROUP/$CLEANSCRIPT ]; then + script_exec $GROUP/$CLEANSCRIPT "C" fi } @@ -492,6 +494,28 @@ out package "swift-$DATE.tar.gz" } +test_group() { + + sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data + + J=0 + for TEST in $( ls $GROUP/*.swift ); do + + (( J++ < SKIP_TESTS )) && continue + + TESTNAME=$( basename $TEST) + cp -uv $GROUP/$TESTNAME . + TESTLINK=$TESTNAME + + start_row + for ((i=0; $i<$ITERS_LOCAL; i=$i+1)); do + swift_test $TESTNAME + done + end_row + done +} + + date > $LOG header @@ -537,7 +561,6 @@ PATH=$SWIFT_HOME/bin:$PATH cd $TOPDIR which swift -TESTDIR=$TOPDIR/cog/modules/swift/tests cd $RUNDIR end_row @@ -546,27 +569,17 @@ EXITONFAILURE=false fi +TESTDIR=$TOPDIR/cog/modules/swift/tests sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml -sed "s at _DIR_@$TESTDIR@" < $TESTDIR/tc.template.data > tc.data -start_part "Part II: Local Tests" +#start_part "Part II: Working Tests" +#GROUP=$TESTDIR/language/working +#test_group -J=0 -for TEST in $( ls $TESTDIR/*.swift ); do +start_part "Part III: Local Tests" +GROUP=$TESTDIR/local +test_group - (( J++ < SKIP_TESTS )) && continue - - TESTNAME=$( basename $TEST) - cp -uv $TESTDIR/$TESTNAME . - TESTLINK=$TESTNAME - - start_row - for ((i=0; $i<$ITERS_LOCAL; i=$i+1)); do - swift_test $TESTNAME - done - end_row -done - if [ $GRID_TESTS == "0" ]; then exit fi From noreply at svn.ci.uchicago.edu Tue Aug 10 16:21:39 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:21:39 -0500 (CDT) Subject: [Swift-commit] r3517 - trunk/tests Message-ID: <20100810212139.325C09CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:21:39 -0500 (Tue, 10 Aug 2010) New Revision: 3517 Modified: trunk/tests/nightly.sh Log: Demonstrate two test GROUPs NOTE: not all language/working (Part II) tests may currently succeed! Simply comment them out... Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 21:14:36 UTC (rev 3516) +++ trunk/tests/nightly.sh 2010-08-10 21:21:39 UTC (rev 3517) @@ -89,7 +89,7 @@ fi # Iterations -ITERS_LOCAL=2 +ITERS_LOCAL=1 LOGCOUNT=0 SEQ=1 @@ -572,9 +572,9 @@ TESTDIR=$TOPDIR/cog/modules/swift/tests sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml -#start_part "Part II: Working Tests" -#GROUP=$TESTDIR/language/working -#test_group +start_part "Part II: Working Tests" +GROUP=$TESTDIR/language/working +test_group start_part "Part III: Local Tests" GROUP=$TESTDIR/local From noreply at svn.ci.uchicago.edu Tue Aug 10 16:22:15 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:22:15 -0500 (CDT) Subject: [Swift-commit] r3518 - trunk/tests/language/working Message-ID: <20100810212215.1FAEE9CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:22:14 -0500 (Tue, 10 Aug 2010) New Revision: 3518 Modified: trunk/tests/language/working/005-procedure-invocation.swift Log: Quick fix Modified: trunk/tests/language/working/005-procedure-invocation.swift =================================================================== --- trunk/tests/language/working/005-procedure-invocation.swift 2010-08-10 21:21:39 UTC (rev 3517) +++ trunk/tests/language/working/005-procedure-invocation.swift 2010-08-10 21:22:14 UTC (rev 3518) @@ -1,7 +1,7 @@ -echo(int i) { -app { echo i ; } +app echo(int i) { + echo i; } -int greetings; +int greetings = 34; echo(greetings); From noreply at svn.ci.uchicago.edu Tue Aug 10 16:25:01 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:25:01 -0500 (CDT) Subject: [Swift-commit] r3519 - trunk/tests Message-ID: <20100810212501.ED1269CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:25:01 -0500 (Tue, 10 Aug 2010) New Revision: 3519 Modified: trunk/tests/nightly.sh Log: Fix SKIP_TESTS bug Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 21:22:14 UTC (rev 3518) +++ trunk/tests/nightly.sh 2010-08-10 21:25:01 UTC (rev 3519) @@ -498,10 +498,9 @@ sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data - J=0 for TEST in $( ls $GROUP/*.swift ); do - (( J++ < SKIP_TESTS )) && continue + (( SKIP_COUNTER++ < SKIP_TESTS )) && continue TESTNAME=$( basename $TEST) cp -uv $GROUP/$TESTNAME . @@ -572,6 +571,7 @@ TESTDIR=$TOPDIR/cog/modules/swift/tests sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml +SKIP_COUNTER=0 start_part "Part II: Working Tests" GROUP=$TESTDIR/language/working test_group From noreply at svn.ci.uchicago.edu Tue Aug 10 16:32:56 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 16:32:56 -0500 (CDT) Subject: [Swift-commit] r3520 - trunk/tests Message-ID: <20100810213256.8BCD79CC8B@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-10 16:32:56 -0500 (Tue, 10 Aug 2010) New Revision: 3520 Modified: trunk/tests/nightly.sh Log: Usage notes Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-10 21:25:01 UTC (rev 3519) +++ trunk/tests/nightly.sh 2010-08-10 21:32:56 UTC (rev 3520) @@ -1,6 +1,15 @@ #!/bin/bash # USAGE NOTES: + +# Run this script from a working directory in which you +# are willing to check out the whole Swift source and +# generate many small test files. + +# The script will checkout Swift, run several tests, +# in a subdirectory called run-DATE, including generating +# useful HTML output and tests.log + # Run nightly.sh -h for quick help # When something goes wrong, find and check tests.log # Code is checked out into TOPDIR From noreply at svn.ci.uchicago.edu Tue Aug 10 23:50:29 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 10 Aug 2010 23:50:29 -0500 (CDT) Subject: [Swift-commit] r3521 - in trunk: . bin Message-ID: <20100811045029.2D2CF9CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-10 23:50:29 -0500 (Tue, 10 Aug 2010) New Revision: 3521 Added: trunk/bin/swift trunk/bin/swift.bat Modified: trunk/build.xml trunk/launchers.xml Log: Swift usage statistics Added: trunk/bin/swift =================================================================== --- trunk/bin/swift (rev 0) +++ trunk/bin/swift 2010-08-11 04:50:29 UTC (rev 3521) @@ -0,0 +1,152 @@ +#! /bin/sh + +EXEC=org.griphyn.vdl.karajan.Loader +OPTIONS= + +CYGWIN= +CPDELIM=":" +HEAPMAX=256M + +if echo `uname` | grep -i "cygwin"; then + CYGWIN="yes" + CPDELIM=";" +fi + +fixCommandLine() { + + COMMANDLINE= + + while [ "X$1" != "X" ] ; do + COMMANDLINE="${COMMANDLINE} '$1'" + shift + done + + echo $COMMANDLINE +} + +updateOptions() { + + if [ "X$1" != "X" ] ; then + OPTIONS="$OPTIONS -D$2=$1" + fi + +} + +####### MAIN BODY ########## + +if [ ! -d "$SWIFT_HOME" ] ; then + SWIFT_HOME=`dirname $0`"/.." + if [ ! -f "$SWIFT_HOME/lib/cog-swift-svn.jar" ] && [ ! -f "$SWIFT_HOME/lib/cog.jar" ] ; then + MY_PATH=`which $0` + SWIFT_HOME=`dirname $MY_PATH`"/.." + if [ ! -f "$SWIFT_HOME/lib/cog-swift-svn.jar" ] && [ ! -f "$SWIFT_HOME/lib/cog.jar" ] ; then + echo "Error: SWIFT_HOME is not set, and all attempts at guessing it failed" + exit + fi + fi +fi + +OPTIONS="$OPTIONS -Djava.endorsed.dirs=$SWIFT_HOME/lib/endorsed" + +LOCALCLASSPATH=$SWIFT_HOME/etc$CPDELIM$SWIFT_HOME/libexec +for JAR in $SWIFT_HOME/lib/*.jar; do + LOCALCLASSPATH="$LOCALCLASSPATH$CPDELIM$JAR" +done +LOCALCLASSPATH=$LOCALCLASSPATH$CPDELIM$CLASSPATH + +CMDLINE=`fixCommandLine "$@"` + +### SETUP OTHER ENV VARIABLES #### + +USERID=`id | awk '{printf("%s\n", substr($1, 5, index($1, "(")-5 ) ) }'` + +if [ "X$GLOBUS_HOSTNAME" = "X" ] && [ "X$HOSTNAME" != "X" ]; then + GLOBUS_HOSTNAME=$HOSTNAME +fi + +updateOptions "$USERID" "UID" +updateOptions "$GLOBUS_INSTALL_PATH" "GLOBUS_INSTALL_PATH" +updateOptions "$GLOBUS_DEPLOY_PATH" "GLOBUS_DEPLOY_PATH" +updateOptions "$GLOBUS_TCP_PORT_RANGE" "GLOBUS_TCP_PORT_RANGE" +updateOptions "$GLOBUS_TCP_SOURCE_PORT_RANGE" "GLOBUS_TCP_SOURCE_PORT_RANGE" +updateOptions "$GLOBUS_UDP_SOURCE_PORT_RANGE" "GLOBUS_UDP_SOURCE_PORT_RANGE" +updateOptions "$GLOBUS_HOSTNAME" "GLOBUS_HOSTNAME" +updateOptions "$X509_USER_CERT" "X509_USER_CERT" +updateOptions "$X509_USER_KEY" "X509_USER_KEY" +updateOptions "$X509_CERT_DIR" "X509_CERT_DIR" +updateOptions "$X509_USER_PROXY" "X509_USER_PROXY" +updateOptions "$SWIFT_HOME" "COG_INSTALL_PATH" +updateOptions "$SWIFT_HOME" "swift.home" +#Use /dev/urandom instead of /dev/random for seeding RNGs +#This will lower the randomness of the seed, but avoid +#large delays if /dev/random does not have enough entropy collected +updateOptions "file:///dev/urandom" "java.security.egd" + +if [ "X$HEAPMAX" != "X" ]; then + OPTIONS="-Xmx$HEAPMAX $OPTIONS" +fi + +# Anonymous usage statistics +LISTENER="bridled.ci.uchicago.edu" +PORT="9999" + +if [ -z "$SWIFT_USAGE_STATS" ]; then + SWIFT_USAGE_STATS=1 +fi + +# To disable usage statistics, uncomment the line below +#SWIFT_USAGE_STATS=0 + +PATH=$PATH:/sbin +IFCONFIG=`which ifconfig` +if [ -x "$IFCONFIG" ]; then + MAC=`$IFCONFIG |grep HWaddr` +fi + +MD5SUM=`which md5sum` +if [ ! -x "$MD5SUM" ]; then + echo "warning: unable to find md5sum" + SWIFT_USAGE_STATS=0 +fi + +NC=`which nc` +if [ ! -x "$NC" ]; then + echo "warning: unable to find nc" + SWIFT_USAGE_STATS=0 +fi + +if [ "$SWIFT_USAGE_STATS" = 1 ]; then + for var in "$@" + do + SCRIPT=`echo $var|grep -i .swift` + if [ -e "$SCRIPT" ]; then + SCRIPT=$var + SCRIPTID=`$MD5SUM $SCRIPT|cut -d ' ' -f1` + SCRIPTLENGTH=`wc -l $SCRIPT|cut -d ' ' -f1` + fi + done + HOSTNAME=`hostname` + USERID=`echo $USERID $HOSTNAME $MAC | $MD5SUM |cut -d ' ' -f1` + DATE=`date` + KEY=`echo $USERID $DATE $$ | $MD5SUM | cut -d ' ' -f1` + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -u $LISTENER $PORT +fi + +### EXECUTE ############ +if test -n "$CYGWIN"; then + set CLASSPATHSAVE=$CLASSPATH + export CLASSPATH="$LOCALCLASSPATH" + eval java ${OPTIONS} ${COG_OPTS} ${EXEC} ${CMDLINE} + export CLASSPATH=$CLASSPATHSAVE +else + eval java ${OPTIONS} ${COG_OPTS} -classpath ${LOCALCLASSPATH} ${EXEC} ${CMDLINE} +fi +return_code=$? + +if [ "$SWIFT_USAGE_STATS" = 1 ]; then + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -u $LISTENER $PORT +fi + +exit $return_code + + Property changes on: trunk/bin/swift ___________________________________________________________________ Name: svn:executable + * Added: trunk/bin/swift.bat =================================================================== --- trunk/bin/swift.bat (rev 0) +++ trunk/bin/swift.bat 2010-08-11 04:50:29 UTC (rev 3521) @@ -0,0 +1,78 @@ + at echo off + +if "X%SWIFT_HOME%" == "X" goto nocogpath +goto cogpath + +:nocogpath + set UNSET_SWIFT_HOME=1 + set SWIFT_HOME=.. + if NOT EXIST "%SWIFT_HOME%\lib\cog-swift-svn.jar" goto nocogpath15 + goto cogpath + +:nocogpath15 + if NOT EXIST "%SWIFT_HOME%\lib\cog.jar" goto nocogpath2 + goto cogpath + +:nocogpath2 + rem test for expansion extensions first, so that we don't enter an infinite loop + set PARTIAL_PATH=test + set PARTIAL_PATH=%PARTIAL_PATH:~-2% + if NOT "%PARTIAL_PATH%" == "st" goto nocogpath3 + set PARTIAL_PATH=%~f0 + set FIRST_BACKSLASH=1 + +:loop + set LAST_CHAR=%PARTIAL_PATH:~-1% + set PARTIAL_PATH=%PARTIAL_PATH:~0,-1% + if "%LAST_CHAR%" == "\" goto found + if "X%PARTIAL_PATH%" == "X" goto nocogpath3 + goto loop + + +:found + if "%FIRST_BACKSLASH%" == "0" goto found2 + set FIRST_BACKSLASH=0 + goto loop + +:found2 + set SWIFT_HOME=%PARTIAL_PATH% + if NOT EXIST "%SWIFT_HOME%\lib\cog-swift-svn.jar" goto nocogpath25 + goto cogpath + +:nocogpath25 + if NOT EXIST "%SWIFT_HOME%\lib\cog.jar" goto nocogpath3 + goto cogpath + +:nocogpath3 + echo Error: SWIFT_HOME not set and all attempts at guessing it failed + goto end + +:cogpath + + set OPTS=-DCOG_INSTALL_PATH="%SWIFT_HOME%" -Dswift.home="%SWIFT_HOME%"%COG_OPTS% -Djava.endorsed.dirs="%SWIFT_HOME%\lib\endorsed" + + set LOCALCLASSPATH=%CLASSPATH%;%SWIFT_HOME%\etc;%SWIFT_HOME%\libexec + + for %%J in ("%SWIFT_HOME%\lib\*.jar") DO call :setpath %%J + + set SAVECLASSPATH=%CLASSPATH% + set CLASSPATH=%LOCALCLASSPATH% + java %OPTS% org.griphyn.vdl.karajan.Loader %* + set CLASSPATH=%SAVECLASSPATH% + +:end + if "%UNSET_SWIFT_HOME%"=="1" goto restore + goto done + +:setpath + set LOCALCLASSPATH=%LOCALCLASSPATH%;%* + goto done + +:restore + set SWIFT_HOME= + set PARTIAL_PATH= + set LAST_CHAR= + set UNSET_SWIFT_HOME= + set FIRST_BAKSLASH= + +:done Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-08-10 21:32:56 UTC (rev 3520) +++ trunk/build.xml 2010-08-11 04:50:29 UTC (rev 3521) @@ -213,45 +213,6 @@ - - COG_INSTALL_PATH - SWIFT_HOME - - - LOCALCLASSPATH=$SWIFT_HOME/etc - LOCALCLASSPATH=$SWIFT_HOME/etc$CPDELIM$SWIFT_HOME/libexec - - - HEAPMAX= - - HEAPMAX=256M - - - - updateOptions "$SWIFT_HOME" "SWIFT_HOME" - - updateOptions "$SWIFT_HOME" "COG_INSTALL_PATH" -updateOptions "$SWIFT_HOME" "swift.home" -#Use /dev/urandom instead of /dev/random for seeding RNGs -#This will lower the randomness of the seed, but avoid -#large delays if /dev/random does not have enough entropy collected -updateOptions "file:///dev/urandom" "java.security.egd" - - - - - - COG_INSTALL_PATH - SWIFT_HOME - - - set LOCALCLASSPATH=%CLASSPATH%;%SWIFT_HOME%\etc - set LOCALCLASSPATH=%CLASSPATH%;%SWIFT_HOME%\etc;%SWIFT_HOME%\libexec - - - set OPTS= - set OPTS=-DCOG_INSTALL_PATH="%SWIFT_HOME%" -Dswift.home="%SWIFT_HOME%" - Modified: trunk/launchers.xml =================================================================== --- trunk/launchers.xml 2010-08-10 21:32:56 UTC (rev 3520) +++ trunk/launchers.xml 2010-08-11 04:50:29 UTC (rev 3521) @@ -1,7 +1,5 @@ - - @@ -10,10 +8,6 @@ - - - - From noreply at svn.ci.uchicago.edu Wed Aug 11 07:55:21 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Wed, 11 Aug 2010 07:55:21 -0500 (CDT) Subject: [Swift-commit] r3522 - trunk/bin Message-ID: <20100811125521.0B5249CC8C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-11 07:55:20 -0500 (Wed, 11 Aug 2010) New Revision: 3522 Modified: trunk/bin/swift Log: Run nc as a background process Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-11 04:50:29 UTC (rev 3521) +++ trunk/bin/swift 2010-08-11 12:55:20 UTC (rev 3522) @@ -129,7 +129,7 @@ USERID=`echo $USERID $HOSTNAME $MAC | $MD5SUM |cut -d ' ' -f1` DATE=`date` KEY=`echo $USERID $DATE $$ | $MD5SUM | cut -d ' ' -f1` - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -u $LISTENER $PORT + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -u $LISTENER $PORT & fi ### EXECUTE ############ @@ -144,7 +144,7 @@ return_code=$? if [ "$SWIFT_USAGE_STATS" = 1 ]; then - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -u $LISTENER $PORT + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -u $LISTENER $PORT & fi exit $return_code From noreply at svn.ci.uchicago.edu Wed Aug 11 19:34:26 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Wed, 11 Aug 2010 19:34:26 -0500 (CDT) Subject: [Swift-commit] r3523 - usertools/swift/swiftconfig/etc Message-ID: <20100812003426.366749CC8C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-11 19:34:26 -0500 (Wed, 11 Aug 2010) New Revision: 3523 Modified: usertools/swift/swiftconfig/etc/TODO Log: Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-11 12:55:20 UTC (rev 3522) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-12 00:34:26 UTC (rev 3523) @@ -2,9 +2,6 @@ In the short term, re-add ability to edit TC file with an interactive editor Longer term, eliminate TC and search PATH instead -Swiftconfig should have all entries in one auth.defaults, rather than copying -and renaming - Non-Swiftrun related command line arguments should be passed on to be handled by swift @@ -14,3 +11,8 @@ Ability to create groups of related sites for runs, ability to run on all sites (-site all, -site mygroup, etc) + +Bypass swift shell script +Have swiftrun be flexible enough to work for new users, as well as advanced users + +Add a -link or similar option to create symlinks to input data within run directory From noreply at svn.ci.uchicago.edu Thu Aug 12 00:27:06 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 12 Aug 2010 00:27:06 -0500 (CDT) Subject: [Swift-commit] r3524 - usertools/swift/swiftconfig/bin Message-ID: <20100812052706.5EDF69CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-12 00:27:06 -0500 (Thu, 12 Aug 2010) New Revision: 3524 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: Symlink data in run directory with -input Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 00:34:26 UTC (rev 3523) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 05:27:06 UTC (rev 3524) @@ -1,31 +1,34 @@ #!/usr/bin/perl -w use strict; +use FindBin qw($Bin); +use lib "$FindBin::Bin/../lib/perl"; use Cwd; use Cwd qw(abs_path); use File::Copy; use File::Path; +use Getopt::Long; +use File::Which qw(which where); +use XML::Simple; -my $swifthome = ''; +# Figure out the path to Swift +my $swift_home = q{}; if ( $ENV{'SWIFT_HOME'} && -e "$ENV{'SWIFT_HOME'}/bin/swift" ) { - $swifthome = $ENV{'SWIFT_HOME'}; + $swift_home = $ENV{'SWIFT_HOME'}; } - -my @path = split( '/', abs_path($0) ); - at path = splice( @path, 0, $#path - 1 ); -my $parent_directory = join( '/', @path ); - -if ( !$swifthome ) { +my @execution_path = split( '/', abs_path($0) ); + at execution_path = splice( @execution_path, 0, $#execution_path - 1 ); +my $parent_directory = join( '/', @execution_path ); +if ( !$swift_home ) { if ( -e "$parent_directory/bin/swift" ) { - $swifthome = $parent_directory; + $swift_home = $parent_directory; } - else { - @path = split( '/', which("swift") ); - @path = splice( @path, 0, $#path - 1 ); - my $tmp = join( '/', @path ); + @execution_path = split( '/', which("swift") ); + @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); + my $tmp = join( '/', @execution_path ); if ( -e "$tmp/bin/swift" ) { - $swifthome = $tmp; + $swift_home = $tmp; } } } @@ -35,7 +38,7 @@ my $directory = $_[0]; if ( !-d "$directory" ) { mkdir "$directory", 0700 - or die "Unable to create directory $directory\n"; + || die "Unable to create directory $directory\n"; } } @@ -43,7 +46,7 @@ sub cat_file { my ( $src, $dst ) = @_; if ( -e $dst ) { - open( DSTFILE, ">>$dst" ) or die "Unable to open $dst for append\n"; + open( DSTFILE, ">>$dst" ) || die "Unable to open $dst for append\n"; } else { open( DSTFILE, ">$dst" ) @@ -71,56 +74,70 @@ return $filename; } -use FindBin qw($Bin); -use lib "$FindBin::Bin/../lib/perl"; -use Getopt::Long; -use File::Which qw(which where); -use XML::Simple; -use Data::Dumper; +# Command line processing +my @option_sites; # Site name to execute upon +my $option_script; # Script name to run +my @option_inputs; # Name of data to include with execution -my $site; # Site name to execute upon -my $script; # Script name to run - GetOptions( - 'site=s' => \$site, - 'script=s' => \$script, + 'site|sites=s{,}' => \@option_sites, + 'script=s' => \$option_script, + 'input|inputs=s{,}' => \@option_inputs, ); # Verify user-created profile info exists my ( $seconds, $minutes, $hours, $days, $months, $years, @junk ) = localtime(time); -my $datestring = sprintf "%04s%02s%02s%02s%02s%02s%s", $years + 1900, +my $date_string = sprintf "%04s%02s%02s%02s%02s%02s%s", $years + 1900, $months + 1, $days, $hours, $minutes, $seconds, getpgrp(0); -my $dotswift = "$ENV{'HOME'}/.swift"; +my $dotswift_directory = "$ENV{'HOME'}/.swift"; # Run job -my @sites = split( /,/, $site ); -my $script_filename = strip_directory($script); -create_directory("$dotswift/jobs"); -create_directory("$dotswift/jobs/$script_filename"); -create_directory("$dotswift/jobs/$script_filename/$datestring"); -copy_file( "$script", "$dotswift/jobs/$script_filename/$datestring" ); +my $script_filename = strip_directory($option_script); +create_directory("$dotswift_directory/jobs"); +create_directory("$dotswift_directory/jobs/$script_filename"); +create_directory("$dotswift_directory/jobs/$script_filename/$date_string"); +copy_file( "$option_script", + "$dotswift_directory/jobs/$script_filename/$date_string" ); -# Create configuration file for run -foreach my $s (@sites) { - if ( !-d "$dotswift/sites/$s" ) { - print "$dotswift/sites/$site\n"; - die "Unable to find entry for $s\n"; +# Create configuration files for run +foreach my $site (@option_sites) { + if ( !-d "$dotswift_directory/sites/$site" ) { + die "Unable to find entry for $site\n"; } - if ( !-e "$dotswift/sites/$s/sites.xml" ) { - die "Unable to find sites.xml for $s\n"; + if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) { + die "Unable to find sites.xml for $site\n"; } - if ( !-e "$dotswift/sites/$s/tc.data" ) { - die "Unable to find tc.data for $s\n"; + if ( !-e "$dotswift_directory/sites/$site/tc.data" ) { + die "Unable to find tc.data for $site\n"; } - cat_file( "$dotswift/sites/$s/sites.xml", - "$dotswift/jobs/$script_filename/$datestring/sites.xml" ); - cat_file( "$dotswift/sites/$s/tc.data", - "$dotswift/jobs/$script_filename/$datestring/tc.data" ); + cat_file( "$dotswift_directory/sites/$site/sites.xml", + "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); + cat_file( "$dotswift_directory/sites/$site/tc.data", + "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); } -# Update XML tags -my $site_filename = "$dotswift/jobs/$script_filename/$datestring/sites.xml"; +# Link input data +foreach my $input_file (@option_inputs) { + + # Check for relative path + my $relative_file = getcwd() . "/$input_file"; + if ( -e $relative_file ) { + $input_file = $relative_file; + } + + if ( !-e $input_file ) { + die "Unable to find requested input file: $input_file\n"; + } + my $new_path = "$dotswift_directory/jobs/$script_filename/$date_string/" + . strip_directory($input_file); + symlink $input_file, $new_path + || die "Unable to create symlink to $new_path\n"; +} + +# Complete XML tags +my $site_filename = + "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml"; open( SITEFILE, "$site_filename" ) || die "Unable to open $site_filename\n"; my @sitedata = ; close(SITEFILE); @@ -129,10 +146,10 @@ close(SITEFILE); # Run swift -my $run_directory = "$dotswift/jobs/$script_filename/$datestring"; +my $run_directory = "$dotswift_directory/jobs/$script_filename/$date_string"; chdir("$run_directory") || die "Unable to chdir to $run_directory\n"; print "Submitting job. Check $run_directory for details\n"; system( - "swift -sites.file $site_filename -tc.file $run_directory/tc.data $script" + "swift -sites.file $site_filename -tc.file $run_directory/tc.data $option_script" ); From noreply at svn.ci.uchicago.edu Thu Aug 12 00:59:24 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 12 Aug 2010 00:59:24 -0500 (CDT) Subject: [Swift-commit] r3525 - usertools/swift/swiftconfig/bin Message-ID: <20100812055924.759CC9CC8C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-12 00:59:24 -0500 (Thu, 12 Aug 2010) New Revision: 3525 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: Update to relative paths Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 05:27:06 UTC (rev 3524) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 05:59:24 UTC (rev 3525) @@ -121,9 +121,9 @@ foreach my $input_file (@option_inputs) { # Check for relative path - my $relative_file = getcwd() . "/$input_file"; - if ( -e $relative_file ) { - $input_file = $relative_file; + my $first_char = substr $input_file, 0, 1; + if( $first_char ne '/') { + $input_file = getcwd() . "/$input_file"; } if ( !-e $input_file ) { From noreply at svn.ci.uchicago.edu Thu Aug 12 08:49:11 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 12 Aug 2010 08:49:11 -0500 (CDT) Subject: [Swift-commit] r3526 - usertools/swift/swiftconfig/bin Message-ID: <20100812134911.F16EF9CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-12 08:49:11 -0500 (Thu, 12 Aug 2010) New Revision: 3526 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: -sites all, run on all configured sites Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 05:59:24 UTC (rev 3525) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 13:49:11 UTC (rev 3526) @@ -102,19 +102,42 @@ # Create configuration files for run foreach my $site (@option_sites) { - if ( !-d "$dotswift_directory/sites/$site" ) { - die "Unable to find entry for $site\n"; + # Handle 'all' to use all available configurations at once + if( lc($site) eq 'all' ) { + foreach my $all_site(<$dotswift_directory/sites/*>) { + print "all_site is: \"" . $all_site . "\"\n"; + if ( !-d "$all_site" ) { + die "Unable to find directory for $all_site\n"; + } + if ( !-e "$all_site/sites.xml" ) { + die "Unable to find sites.xml for $all_site\n"; + } + if ( !-e "$all_site/tc.data" ) { + die "Unable to find tc.data for $all_site\n"; + } + cat_file( "$all_site/sites.xml", + "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); + cat_file( "$all_site/tc.data", + "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); + } } - if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) { - die "Unable to find sites.xml for $site\n"; - } - if ( !-e "$dotswift_directory/sites/$site/tc.data" ) { - die "Unable to find tc.data for $site\n"; - } - cat_file( "$dotswift_directory/sites/$site/sites.xml", - "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); - cat_file( "$dotswift_directory/sites/$site/tc.data", - "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); + + # Normal, non-'all' site + else { + if ( !-d "$dotswift_directory/sites/$site" ) { + die "Unable to find entry for $site\n"; + } + if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) { + die "Unable to find sites.xml for $site\n"; + } + if ( !-e "$dotswift_directory/sites/$site/tc.data" ) { + die "Unable to find tc.data for $site\n"; + } + cat_file( "$dotswift_directory/sites/$site/sites.xml", + "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); + cat_file( "$dotswift_directory/sites/$site/tc.data", + "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); + } } # Link input data From noreply at svn.ci.uchicago.edu Thu Aug 12 09:17:09 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 12 Aug 2010 09:17:09 -0500 (CDT) Subject: [Swift-commit] r3527 - usertools/swift/swiftconfig/bin Message-ID: <20100812141709.8270F9CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-12 09:17:09 -0500 (Thu, 12 Aug 2010) New Revision: 3527 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: Pass unknown options to swift Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 13:49:11 UTC (rev 3526) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 14:17:09 UTC (rev 3527) @@ -7,7 +7,7 @@ use Cwd qw(abs_path); use File::Copy; use File::Path; -use Getopt::Long; +use Getopt::Long qw(:config permute pass_through); use File::Which qw(which where); use XML::Simple; @@ -85,6 +85,7 @@ 'input|inputs=s{,}' => \@option_inputs, ); + # Verify user-created profile info exists my ( $seconds, $minutes, $hours, $days, $months, $years, @junk ) = localtime(time); @@ -105,7 +106,6 @@ # Handle 'all' to use all available configurations at once if( lc($site) eq 'all' ) { foreach my $all_site(<$dotswift_directory/sites/*>) { - print "all_site is: \"" . $all_site . "\"\n"; if ( !-d "$all_site" ) { die "Unable to find directory for $all_site\n"; } @@ -172,7 +172,15 @@ my $run_directory = "$dotswift_directory/jobs/$script_filename/$date_string"; chdir("$run_directory") || die "Unable to chdir to $run_directory\n"; print "Submitting job. Check $run_directory for details\n"; -system( - "swift -sites.file $site_filename -tc.file $run_directory/tc.data $option_script" -); +my $system_command = "swift -sites.file $site_filename " + . "-tc.file $run_directory/tc.data " + . "$option_script "; +# Add unknown options +foreach my $unknown_argument (@ARGV) { + $system_command = "$system_command $unknown_argument "; +} + +# Execute +system($system_command); + From noreply at svn.ci.uchicago.edu Thu Aug 12 23:13:38 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 12 Aug 2010 23:13:38 -0500 (CDT) Subject: [Swift-commit] r3528 - in usertools/swift/swiftconfig: bin etc etc/sites etc/sites/local Message-ID: <20100813041338.B2C9D9CC6B@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-12 23:13:38 -0500 (Thu, 12 Aug 2010) New Revision: 3528 Added: usertools/swift/swiftconfig/etc/sites/local/ usertools/swift/swiftconfig/etc/sites/local/sites.xml usertools/swift/swiftconfig/etc/sites/local/tc.data Removed: usertools/swift/swiftconfig/etc/sites/localhost/ Modified: usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/etc/TODO Log: Better naming for run directory. Renamed localhost template to local. Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-12 14:17:09 UTC (rev 3527) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-13 04:13:38 UTC (rev 3528) @@ -89,7 +89,7 @@ # Verify user-created profile info exists my ( $seconds, $minutes, $hours, $days, $months, $years, @junk ) = localtime(time); -my $date_string = sprintf "%04s%02s%02s%02s%02s%02s%s", $years + 1900, +my $date_string = sprintf "%04s-%02s-%02s-%02s%02s%02s-%s", $years + 1900, $months + 1, $days, $hours, $minutes, $seconds, getpgrp(0); my $dotswift_directory = "$ENV{'HOME'}/.swift"; Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-12 14:17:09 UTC (rev 3527) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-13 04:13:38 UTC (rev 3528) @@ -16,3 +16,5 @@ Have swiftrun be flexible enough to work for new users, as well as advanced users Add a -link or similar option to create symlinks to input data within run directory + +Add -help or similar Added: usertools/swift/swiftconfig/etc/sites/local/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local/sites.xml 2010-08-13 04:13:38 UTC (rev 3528) @@ -0,0 +1,6 @@ + + + + 0 + $HOME/swiftwork + Added: usertools/swift/swiftconfig/etc/sites/local/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local/tc.data (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local/tc.data 2010-08-13 04:13:38 UTC (rev 3528) @@ -0,0 +1,8 @@ +# sitename transformation path INSTALLED platform profiles +local echo /bin/echo INSTALLED INTEL32::LINUX null +local cat /bin/cat INSTALLED INTEL32::LINUX null +local ls /bin/ls INSTALLED INTEL32::LINUX null +local grep /bin/grep INSTALLED INTEL32::LINUX null +local sort /bin/sort INSTALLED INTEL32::LINUX null +local paste /bin/paste INSTALLED INTEL32::LINUX null +local tr /usr/bin/tr INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Fri Aug 13 00:12:44 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 00:12:44 -0500 (CDT) Subject: [Swift-commit] r3529 - usertools/swift/swiftconfig/bin Message-ID: <20100813051244.D130D9CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 00:12:44 -0500 (Fri, 13 Aug 2010) New Revision: 3529 Modified: usertools/swift/swiftconfig/bin/swiftconfig Log: -default and -full modes for adding in swiftconfig Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 04:13:38 UTC (rev 3528) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 05:12:44 UTC (rev 3529) @@ -52,18 +52,22 @@ my $option_add = q{}; # Add entry my $option_sites = q{}; # List all usable sites my $option_describe = q{}; # Print raw XML configuration +my $option_default = q{}; # When adding a site, use all defaults + my @execution_providers = ( "gt4", "local", "pbs", "condor", "ssh", "coaster", ); # Assign variables from command line options GetOptions( - 'add=s' => \$option_add, - 'remove=s' => \$option_remove, - 'templates' => \$option_templates, - 'modify=s' => \$option_modify, - 'swift_home=s' => \$swift_home, - 'sites' => \$option_sites, - 'describe=s' => \$option_describe, + 'add=s' => \$option_add, + 'remove=s' => \$option_remove, + 'templates' => \$option_templates, + 'modify=s' => \$option_modify, + 'swift_home=s' => \$swift_home, + 'sites' => \$option_sites, + 'describe=s' => \$option_describe, + 'default|defaults' => \$option_default, + 'full' => sub { $option_default = 0; }, ); # Create a new directory if it does not exist @@ -77,8 +81,12 @@ # Process keyboard input sub get_entry { - my ( $entry_description, $entry_value, @allowable_values, ) = @_; + my ( $entry_description, $entry_value, $use_default, @allowable_values, ) = @_; + if($use_default) { + return $entry_value; + } + print "$entry_description [$entry_value]: "; my $new_value = ; chomp($new_value); @@ -148,14 +156,14 @@ if (/username/i && /^$ssh_url/i) { ( my $setting, $ssh_username, ) = split( '=', $_ ); chomp($ssh_username); - $ssh_username = get_entry( 'Username', $ssh_username ); + $ssh_username = get_entry( 'Username', $ssh_username, 0); $_ = "$ssh_url.username=$ssh_username\n"; $found = 1; } if (/\.password/i && /^$ssh_url/i) { ( my $setting, $ssh_password, ) = split( '=', $_ ); chomp($ssh_password); - $ssh_password = get_entry( 'Password', $ssh_password ); + $ssh_password = get_entry( 'Password', $ssh_password, 0); $_ = "$ssh_url.password=$ssh_password\n"; $found = 1; } @@ -164,8 +172,8 @@ # Add new entry if needed if(!$found) { $ssh_username = getlogin(); - $ssh_username = get_entry( 'Username', $ssh_username ); - $ssh_password = get_entry( 'Password', ''); + $ssh_username = get_entry( 'Username', $ssh_username, 0 ); + $ssh_password = get_entry( 'Password', '', 0); # Password based authentication push( @auth_data, "$ssh_url.type=password\n" ); @@ -254,40 +262,40 @@ ); # Handle - $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle} ); + $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); # Grid FTP if ( $xml_ref->{gridftp} ) { $xml_ref->{gridftp}{url} = - get_entry( 'GridFTP URL', $xml_ref->{gridftp}{url} ); + get_entry( 'GridFTP URL', $xml_ref->{gridftp}{url}, $option_default); } # Work directory if ( $xml_ref->{workdirectory} ) { $xml_ref->{workdirectory}[0] =~ s/\$HOME/$ENV{'HOME'}/; $xml_ref->{workdirectory} = - [ get_entry( 'Work Directory', $xml_ref->{workdirectory}[0] ) ]; + [ get_entry( 'Work Directory', $xml_ref->{workdirectory}[0], $option_default) ]; } # Job manager if ( $xml_ref->{jobmanager} ) { if ( $xml_ref->{jobmanager}{universe} ) { $xml_ref->{jobmanager}{universe} = - get_entry( 'Job Universe', $xml_ref->{jobmanager}{universe} ); + get_entry( 'Job Universe', $xml_ref->{jobmanager}{universe}, $option_default); } if ( $xml_ref->{jobmanager}{url} ) { $xml_ref->{jobmanager}{url} = - get_entry( 'Job Manager URL', $xml_ref->{jobmanager}{url} ); + get_entry( 'Job Manager URL', $xml_ref->{jobmanager}{url}, $option_default); } if ( $xml_ref->{jobmanager}{major} ) { $xml_ref->{jobmanager}{major} = get_entry( 'Job Major Number', - $xml_ref->{jobmanager}{major} ); + $xml_ref->{jobmanager}{major}, $option_default); } if ( $xml_ref->{jobmanager}{minor} ) { $xml_ref->{jobmanager}{minor} = get_entry( 'Job Minor Number', - $xml_ref->{jobmanager}{minor} ); + $xml_ref->{jobmanager}{minor}, $option_default); } } @@ -297,19 +305,20 @@ $xml_ref->{execution}{provider} = get_entry( 'Execution Provider', $xml_ref->{execution}{provider}, + $option_default, @execution_providers, ); } if ( $xml_ref->{execution}{jobmanager} ) { $xml_ref->{execution}{jobmanager} = get_entry( 'Execution Job Manager', - $xml_ref->{execution}{jobmanager} ); + $xml_ref->{execution}{jobmanager}, + $option_default); } if ( $xml_ref->{execution}{url} ) { $xml_ref->{execution}{url} = - get_entry( 'Execution URL', $xml_ref->{execution}{url} ); + get_entry( 'Execution URL', $xml_ref->{execution}{url}, $option_default); } - } # Filesystem @@ -318,19 +327,20 @@ $xml_ref->{filesystem}{provider} = get_entry( 'Filesystem Provider', $xml_ref->{filesystem}{provider}, + $option_default, @execution_providers, ); } if ( $xml_ref->{filesystem}{url} ) { $xml_ref->{filesystem}{url} = - get_entry( 'Filesystem URL', $xml_ref->{filesystem}{url} ); + get_entry( 'Filesystem URL', $xml_ref->{filesystem}{url}, $option_default); } } # Profiles foreach my $profile ( @{ $xml_ref->{profile} } ) { $profile->{content} = - get_entry( $profile->{key}, $profile->{content} ); + get_entry( $profile->{key}, $profile->{content}, $option_default); } return $xml_ref; From noreply at svn.ci.uchicago.edu Fri Aug 13 10:43:27 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 10:43:27 -0500 (CDT) Subject: [Swift-commit] r3530 - in usertools/swift/swiftconfig: bin etc Message-ID: <20100813154327.802019CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 10:43:27 -0500 (Fri, 13 Aug 2010) New Revision: 3530 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/etc/TODO Log: Swiftconfig: edit, copy, template pod for swiftrun Help option displays pod for both swiftconfig and swiftrun editing modes Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 05:12:44 UTC (rev 3529) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 15:43:27 UTC (rev 3530) @@ -5,6 +5,7 @@ use Cwd qw(abs_path); use File::Copy; use File::Path; +use Pod::Usage; my $swift_home = q{}; if ( $ENV{'SWIFT_HOME'} && -e "$ENV{'SWIFT_HOME'}/bin/swift" ) { @@ -37,37 +38,32 @@ use XML::Simple; use Data::Dumper; -# Variables used for translation catalog -#my $tc_host = 'localhost'; # Host name -#my $tc_name = q{}; # Translation name -#my $tc_path = "/usr/bin/$name"; # Full path of executable location -#my $tc_status = 'INSTALLED'; # Installation status (not used) -#my $tc_platform = 'INTEL32::LINUX'; # Platform (not used) -#my $tc_profile = 'null'; # Profile entries - # Variables used for sites.xml my $option_templates = q{}; # List all templates my $option_remove = q{}; # Remove entry from sites.xml -my $option_modify = q{}; # Modify mode -my $option_add = q{}; # Add entry +my $option_edit = q{}; # Edit mode my $option_sites = q{}; # List all usable sites my $option_describe = q{}; # Print raw XML configuration my $option_default = q{}; # When adding a site, use all defaults +my $option_template = q{}; # Create config from template specified +my $option_copy = q{}; # Copy an existing configuration my @execution_providers = ( "gt4", "local", "pbs", "condor", "ssh", "coaster", ); # Assign variables from command line options GetOptions( - 'add=s' => \$option_add, 'remove=s' => \$option_remove, 'templates' => \$option_templates, - 'modify=s' => \$option_modify, 'swift_home=s' => \$swift_home, 'sites' => \$option_sites, 'describe=s' => \$option_describe, 'default|defaults' => \$option_default, 'full' => sub { $option_default = 0; }, + 'template=s' => \$option_template, + 'edit=s' => \$option_edit, + 'copy=s' => \$option_copy, + 'help' => sub { pod2usage(-verbose => 2); }, ); # Create a new directory if it does not exist @@ -83,6 +79,7 @@ sub get_entry { my ( $entry_description, $entry_value, $use_default, @allowable_values, ) = @_; + # If use_default is specified, automatically plug in the default value if($use_default) { return $entry_value; } @@ -250,7 +247,12 @@ sub update_xml { # Set up data - my ($xml_filename) = @_; + my ($xml_filename, $edit_mode) = @_; + # Values for edit mode + # 0 - Edit all + # 1 - All but name + # 2 - Customized.. to do + if ( !-e $xml_filename ) { die "Unable to update xml file $xml_filename\n"; } @@ -262,8 +264,10 @@ ); # Handle - $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); - + if($edit_mode == 0) { + $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); + } + # Grid FTP if ( $xml_ref->{gridftp} ) { $xml_ref->{gridftp}{url} = @@ -368,24 +372,20 @@ } } -# If a template is specified, find the correct one and modify as needed -if ($option_add) { +# Add configuration from a template +if ($option_template) { # Update XML info - my $from_directory = "$template_directory/$option_add"; + my $from_directory = "$template_directory/$option_template"; my $sites_input_file = "$from_directory/sites.xml"; if ( !-e "$sites_input_file" ) { - $from_directory = "$dotswift_directory/sites/$option_add"; - $sites_input_file = "$from_directory/sites.xml"; - if ( !-e "$sites_input_file" ) { - die "Unable to find $sites_input_file\n"; - } + die "Unable to find configuration for $sites_input_file\n"; } - my $xml_ref = update_xml("$sites_input_file"); + my $xml_ref = update_xml("$sites_input_file", 0); my $new_sitename = $xml_ref->{handle}; my $output_directory = "$dotswift_directory/sites/$new_sitename"; if ( -d "$output_directory" ) { - die "Entry for $new_sitename already exists\n"; + die "Configuration for $new_sitename already exists\n"; } # Update and copy files to reflect input @@ -402,7 +402,7 @@ ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - if ( $option_add ne $new_sitename ) { + if ( $option_template ne $new_sitename ) { my $tc_filename = "$output_directory/tc.data"; update_tc_hostname( "$tc_filename", $new_sitename ); } @@ -456,16 +456,16 @@ } # Modify a site entry -if ($option_modify) { - my $output_directory = "$dotswift_directory/sites/$option_modify"; +if ($option_edit) { + my $output_directory = "$dotswift_directory/sites/$option_edit"; create_directory($output_directory); my $sites_file = "$output_directory/sites.xml"; if ( !-e "$sites_file" ) { - die "Unable to find configuration for $option_modify\n"; + die "Unable to find configuration for $option_edit\n"; } - my $xml_filename = "$dotswift_directory/sites/$option_modify/sites.xml"; + my $xml_filename = "$output_directory/sites.xml"; my $xml_ref = $xml->XMLin( $xml_filename, ForceArray => [qw(workdirectory profile)], @@ -473,9 +473,9 @@ ); my $initial_exurl = $xml_ref->{execution}{url}; - $xml_ref = update_xml("$sites_file"); + $xml_ref = update_xml("$sites_file", 1); my $new_exurl = $xml_ref->{execution}{url}; - my $new_sitename = $xml_ref->{handle}; + #my $new_sitename = $xml_ref->{handle}; my $xml_out_ref = $xml->XMLout( $xml_ref, @@ -484,29 +484,74 @@ ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - # If the sitename has changed, move files - if ( $new_sitename ne $option_modify ) { - $output_directory = "$dotswift_directory/sites/$new_sitename"; - if ( -d "$output_directory" ) { - die "Directory for $new_sitename already exists\n"; - } - move( "$dotswift_directory/sites/$option_modify", - "$output_directory" ) - || die "Unable to rename $dotswift_directory/sites/$option_modify" - . " to $output_directory"; - my $tc_filename = "$output_directory/tc.data"; - update_tc_hostname( "$tc_filename", $new_sitename ); - } - # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { - if ( $initial_exurl ne $new_exurl ) { + if ( $initial_exurl && $initial_exurl ne $new_exurl ) { remove_ssh( $initial_exurl ); } add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); } } +# Copy a configuration +if($option_copy) { + my $input_directory = "$dotswift_directory/sites/$option_copy"; + my $input_site = "$input_directory/sites.xml"; + if( !-e $input_site) { + die "Unable to find configuration for $option_copy\n"; + } + + my $new_config_name = get_entry( 'New Configuration Name', '', 0); + my $output_directory = "$dotswift_directory/sites/$new_config_name"; + if(-d "$output_directory") { + die "Configuration for $new_config_name already exists\n"; + } + create_directory($output_directory); + + my @files_to_copy = <$input_directory/*>; + foreach my $file_to_copy (@files_to_copy) { + copy( $file_to_copy, "$output_directory" ) + || die "Unable to copy $file_to_copy to $output_directory\n"; + } + + # Rename and save + my $xml_filename = "$output_directory/sites.xml"; + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile)], + KeyAttr => [], + ); + $xml_ref->{handle} = $new_config_name; + my $xml_out_ref = $xml->XMLout( + $xml_ref, + RootName => 'pool', + SuppressEmpty => 1, + ); + write_file( "$output_directory/sites.xml", $xml_out_ref ); + + # Edit sites + my $initial_exurl = $xml_ref->{execution}{url}; + $xml_ref = update_xml( "$output_directory/sites.xml", 1); + my $new_exurl = $xml_ref->{execution}{url}; + + $xml_out_ref = $xml->XMLout( + $xml_ref, + RootName => 'pool', + SuppressEmpty => 1, + ); + + write_file( "$output_directory/sites.xml", $xml_out_ref ); + + # Update tc + my $tc_filename = "$output_directory/tc.data"; + update_tc_hostname( "$tc_filename", $new_config_name ); + + # Add ssh entries as needed + if ( $xml_ref->{execution}{provider} eq 'ssh' ) { + add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); + } +} + __END__ =head1 NAME @@ -527,33 +572,27 @@ =head1 DESCRIPTION General operations: - -add sitename add a site from template - -remove site removes a site from sites.xml - -templates display all available sites in template - -modify site Specifies the name of a site to modify - -describe site Prints the raw XML site configuration + -template sitename Add a configuration based on a template + -remove site Removes a site configuration + -templates Display all available templates + -sites Displays all existing configurations + -edit site Specifies the name of a configuration to edit + -describe site Prints the raw XML site configuration + -copy site Copies a configuration + -default Do not prompt for values, always use defaults + -full Edit every available configuration option =head1 EXAMPLES List all templates available for adding swiftconfig -templates -Add a site from template into working sites.xml - swiftconfig -add teraport +Add a site from template into a working configuration + swiftconfig -template ssh -Modify the work directory of a site - swiftconfig -modify teraport +Edit a configuration + swiftconfig -edit teraport Remove a site swiftconfig -remove teraport - -=head1 CAVEATS - -Swiftconfig will attempt to automatically determine the location of swift -configuration files. It first checks for an environment variable called -$SWIFT_HOME. If that is not found, it will look for the location of "swift" -in the path. - -The XML library that swiftconfig uses ignores comments in XML. All comments -will be stripped from sites.xml as it gets modified. =cut Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-13 05:12:44 UTC (rev 3529) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-13 15:43:27 UTC (rev 3530) @@ -10,6 +10,7 @@ use Getopt::Long qw(:config permute pass_through); use File::Which qw(which where); use XML::Simple; +use Pod::Usage; # Figure out the path to Swift my $swift_home = q{}; @@ -83,6 +84,7 @@ 'site|sites=s{,}' => \@option_sites, 'script=s' => \$option_script, 'input|inputs=s{,}' => \@option_inputs, + 'help' => sub { pod2usage(-verbose => 2); }, ); @@ -184,3 +186,41 @@ # Execute system($system_command); +__END__ + +=head1 NAME + +swiftrun - Run swift using configurations generated by swiftconfig + +=head1 SYNOPSIS + +swiftrun [B<-option> value] + +=head1 OVERVIEW + +The swiftrun program allows you to execute swift using configurations +generated by swiftconfig. + +=head1 DESCRIPTION + +General operations: + -site Execute swift on given sitename(s) + -script file.swift Specify the swift script to run + -input Link to data required for execution + +=head1 EXAMPLES + +Run a script on a single site + swiftrun -site local -script my.script + +Run a script on multiple sites + swiftrun -site host1 host2 -script my.script + +Run a script on all available configurations + swiftrun -site all -script my.script + +Link multiple files + swiftrun -site local -script my.script -input /foo/file* /foo2/file* + +=cut + Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-13 05:12:44 UTC (rev 3529) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-13 15:43:27 UTC (rev 3530) @@ -2,9 +2,6 @@ In the short term, re-add ability to edit TC file with an interactive editor Longer term, eliminate TC and search PATH instead -Non-Swiftrun related command line arguments should be passed on to be handled -by swift - Running and testing on more setups, OSG, teragrid, others Job tagging with search capabilities @@ -12,9 +9,6 @@ Ability to create groups of related sites for runs, ability to run on all sites (-site all, -site mygroup, etc) -Bypass swift shell script Have swiftrun be flexible enough to work for new users, as well as advanced users -Add a -link or similar option to create symlinks to input data within run directory - Add -help or similar From noreply at svn.ci.uchicago.edu Fri Aug 13 13:46:32 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 13:46:32 -0500 (CDT) Subject: [Swift-commit] r3531 - usertools/swift/swiftconfig/bin Message-ID: <20100813184632.20F5A9CCE6@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 13:46:31 -0500 (Fri, 13 Aug 2010) New Revision: 3531 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: run.#### Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-13 15:43:27 UTC (rev 3530) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-13 18:46:31 UTC (rev 3531) @@ -88,21 +88,19 @@ ); -# Verify user-created profile info exists -my ( $seconds, $minutes, $hours, $days, $months, $years, @junk ) = - localtime(time); -my $date_string = sprintf "%04s-%02s-%02s-%02s%02s%02s-%s", $years + 1900, - $months + 1, $days, $hours, $minutes, $seconds, getpgrp(0); +# Create run directory +my $script_filename = strip_directory($option_script); my $dotswift_directory = "$ENV{'HOME'}/.swift"; +my @run_directories = ; +if(!@run_directories) { + $run_directories[0] = "run.0000"; +} +my ($run_number) = $run_directories[-1] =~ m{(\d+)}; +$run_number++; +my $run_directory = getcwd() . "/" . sprintf "run.%04s", $run_number; +create_directory($run_directory); +copy_file( "$option_script", "$run_directory" ); -# Run job -my $script_filename = strip_directory($option_script); -create_directory("$dotswift_directory/jobs"); -create_directory("$dotswift_directory/jobs/$script_filename"); -create_directory("$dotswift_directory/jobs/$script_filename/$date_string"); -copy_file( "$option_script", - "$dotswift_directory/jobs/$script_filename/$date_string" ); - # Create configuration files for run foreach my $site (@option_sites) { # Handle 'all' to use all available configurations at once @@ -117,10 +115,8 @@ if ( !-e "$all_site/tc.data" ) { die "Unable to find tc.data for $all_site\n"; } - cat_file( "$all_site/sites.xml", - "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); - cat_file( "$all_site/tc.data", - "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); + cat_file( "$all_site/sites.xml", "$run_directory/sites.xml" ); + cat_file( "$all_site/tc.data", "$run_directory/tc.data" ); } } @@ -136,15 +132,14 @@ die "Unable to find tc.data for $site\n"; } cat_file( "$dotswift_directory/sites/$site/sites.xml", - "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml" ); + "$run_directory/sites.xml" ); cat_file( "$dotswift_directory/sites/$site/tc.data", - "$dotswift_directory/jobs/$script_filename/$date_string/tc.data" ); + "$run_directory/tc.data" ); } } # Link input data foreach my $input_file (@option_inputs) { - # Check for relative path my $first_char = substr $input_file, 0, 1; if( $first_char ne '/') { @@ -154,27 +149,27 @@ if ( !-e $input_file ) { die "Unable to find requested input file: $input_file\n"; } - my $new_path = "$dotswift_directory/jobs/$script_filename/$date_string/" - . strip_directory($input_file); + my $new_path = "$run_directory/" . strip_directory($input_file); symlink $input_file, $new_path || die "Unable to create symlink to $new_path\n"; } # Complete XML tags -my $site_filename = - "$dotswift_directory/jobs/$script_filename/$date_string/sites.xml"; -open( SITEFILE, "$site_filename" ) || die "Unable to open $site_filename\n"; +open( SITEFILE, "$run_directory/sites.xml" ) + || die "Unable to open $run_directory/sites.xml\n"; my @sitedata = ; close(SITEFILE); -open( SITEFILE, ">$site_filename" ) || die "Unable to open $site_filename\n"; +open( SITEFILE, ">$run_directory/sites.xml" ) + || die "Unable to open $run_directory/sites.xml for writing\n"; print SITEFILE "\n at sitedata\n"; close(SITEFILE); # Run swift -my $run_directory = "$dotswift_directory/jobs/$script_filename/$date_string"; chdir("$run_directory") || die "Unable to chdir to $run_directory\n"; print "Submitting job. Check $run_directory for details\n"; -my $system_command = "swift -sites.file $site_filename " +my $system_command = + 'swift ' + . "-sites.file $run_directory/sites.xml " . "-tc.file $run_directory/tc.data " . "$option_script "; From noreply at svn.ci.uchicago.edu Fri Aug 13 14:12:45 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 14:12:45 -0500 (CDT) Subject: [Swift-commit] r3532 - usertools/swift/swiftconfig/bin Message-ID: <20100813191245.CFC0A9CCE6@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 14:12:45 -0500 (Fri, 13 Aug 2010) New Revision: 3532 Modified: usertools/swift/swiftconfig/bin/swiftconfig Log: Display all options when editing a field with limited choices Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 18:46:31 UTC (rev 3531) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-13 19:12:45 UTC (rev 3532) @@ -84,12 +84,27 @@ return $entry_value; } - print "$entry_description [$entry_value]: "; + if(!@allowable_values) { + print "$entry_description [$entry_value]: "; + } + else { + print "$entry_description ["; + foreach my $allowable(@allowable_values) { + if($allowable eq $entry_value) { + print "*$allowable "; + } + else { + print "$allowable "; + } + } + print "]: "; + } my $new_value = ; chomp($new_value); if ($new_value) { $entry_value = $new_value; } + # Check if value entered is valid (if valid values were passed) my $is_valid = 0; From noreply at svn.ci.uchicago.edu Fri Aug 13 16:55:38 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 16:55:38 -0500 (CDT) Subject: [Swift-commit] r3533 - trunk/bin Message-ID: <20100813215538.E263D9CCE6@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 16:55:38 -0500 (Fri, 13 Aug 2010) New Revision: 3533 Modified: trunk/bin/swift Log: Timeout value for nc Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-13 19:12:45 UTC (rev 3532) +++ trunk/bin/swift 2010-08-13 21:55:38 UTC (rev 3533) @@ -129,7 +129,7 @@ USERID=`echo $USERID $HOSTNAME $MAC | $MD5SUM |cut -d ' ' -f1` DATE=`date` KEY=`echo $USERID $DATE $$ | $MD5SUM | cut -d ' ' -f1` - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -u $LISTENER $PORT & + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -w 60 -u $LISTENER $PORT & fi ### EXECUTE ############ @@ -144,7 +144,7 @@ return_code=$? if [ "$SWIFT_USAGE_STATS" = 1 ]; then - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -u $LISTENER $PORT & + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -w 60 -u $LISTENER $PORT & fi exit $return_code From noreply at svn.ci.uchicago.edu Fri Aug 13 20:22:46 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 13 Aug 2010 20:22:46 -0500 (CDT) Subject: [Swift-commit] r3534 - trunk/bin Message-ID: <20100814012246.30CF99CCA2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-13 20:22:46 -0500 (Fri, 13 Aug 2010) New Revision: 3534 Modified: trunk/bin/swift Log: Redirect 'which' stderr stream Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-13 21:55:38 UTC (rev 3533) +++ trunk/bin/swift 2010-08-14 01:22:46 UTC (rev 3534) @@ -98,18 +98,18 @@ #SWIFT_USAGE_STATS=0 PATH=$PATH:/sbin -IFCONFIG=`which ifconfig` +IFCONFIG=`which ifconfig 2>&1` if [ -x "$IFCONFIG" ]; then MAC=`$IFCONFIG |grep HWaddr` fi -MD5SUM=`which md5sum` +MD5SUM=`which md5sum 2>&1` if [ ! -x "$MD5SUM" ]; then echo "warning: unable to find md5sum" SWIFT_USAGE_STATS=0 fi -NC=`which nc` +NC=`which nc 2>&1` if [ ! -x "$NC" ]; then echo "warning: unable to find nc" SWIFT_USAGE_STATS=0 From noreply at svn.ci.uchicago.edu Sat Aug 14 17:45:00 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sat, 14 Aug 2010 17:45:00 -0500 (CDT) Subject: [Swift-commit] r3535 - usertools/swift/swiftconfig/bin Message-ID: <20100814224500.9F4A79CC8F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-14 17:45:00 -0500 (Sat, 14 Aug 2010) New Revision: 3535 Modified: usertools/swift/swiftconfig/bin/swiftconfig Log: Better transitioning between execution providers Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-14 01:22:46 UTC (rev 3534) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-14 22:45:00 UTC (rev 3535) @@ -84,18 +84,23 @@ return $entry_value; } - if(!@allowable_values) { + if(!@allowable_values) { print "$entry_description [$entry_value]: "; } else { print "$entry_description ["; + my $counter=0; foreach my $allowable(@allowable_values) { + if($counter != 0) { + print " "; + } if($allowable eq $entry_value) { - print "*$allowable "; + print "*$allowable"; } else { - print "$allowable "; + print "$allowable"; } + $counter++; } print "]: "; } @@ -283,6 +288,53 @@ $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); } + # Execution + my $initial_exprovider = $xml_ref->{execution}{provider}; + $xml_ref->{execution}{provider} = get_entry( + 'Execution Provider', + $xml_ref->{execution}{provider}, + $option_default, + @execution_providers, + ); + my $current_exprovider = $xml_ref->{execution}{provider}; + + # Handle changes in execution provider + if( $initial_exprovider ne $current_exprovider ) { + # Add SSH fields + if( $current_exprovider eq 'ssh' ) { + if( !$xml_ref->{execution}{url} ) { + $xml_ref->{execution}{url} = 'unknown'; + } + } + # Add coaster fields + if( $current_exprovider eq 'coaster' ) { + if( !$xml_ref->{execution}{jobmanager} ) { + $xml_ref->{execution}{jobmanager} = 'unknown'; + } + if( !$xml_ref->{execution}{url} ){ + $xml_ref->{execution}{url} = 'unknown'; + } + } + } + + # Job manager + if ( $xml_ref->{execution}{jobmanager}) { + $xml_ref->{execution}{jobmanager} = + get_entry( 'Execution Job Manager', + $xml_ref->{execution}{jobmanager}, + $option_default + ); + } + + # Execution URL + if ( $xml_ref->{execution}{url} ) { + $xml_ref->{execution}{url} = + get_entry( 'Execution URL', + $xml_ref->{execution}{url}, + $option_default + ); + } + # Grid FTP if ( $xml_ref->{gridftp} ) { $xml_ref->{gridftp}{url} = @@ -318,28 +370,6 @@ } } - # Execution - if ( $xml_ref->{execution} ) { - if ( $xml_ref->{execution}{provider} ) { - $xml_ref->{execution}{provider} = get_entry( - 'Execution Provider', - $xml_ref->{execution}{provider}, - $option_default, - @execution_providers, - ); - } - if ( $xml_ref->{execution}{jobmanager} ) { - $xml_ref->{execution}{jobmanager} = - get_entry( 'Execution Job Manager', - $xml_ref->{execution}{jobmanager}, - $option_default); - } - if ( $xml_ref->{execution}{url} ) { - $xml_ref->{execution}{url} = - get_entry( 'Execution URL', $xml_ref->{execution}{url}, $option_default); - } - } - # Filesystem if ( $xml_ref->{filesystem} ) { if ( $xml_ref->{filesystem}{provider} ) { @@ -432,13 +462,18 @@ if ($option_describe) { my $site_file = "$dotswift_directory/sites/$option_describe/sites.xml"; if ( !-e $site_file ) { - die "Unable to find $site_file\n"; + die "Unable to locate configuration for $option_describe\n"; } system("cat $site_file"); } # Remove an entry if ($option_remove) { + + if ( !-d "$dotswift_directory/sites/$option_remove" ) { + die "Unable to find configuration named $option_remove\n"; + } + my $xml_filename = "$dotswift_directory/sites/$option_remove/sites.xml"; my $xml_ref = $xml->XMLin( $xml_filename, @@ -447,14 +482,11 @@ ); # Remove SSH entry if needed - if($xml_ref->{execution}{provider} eq "ssh") { - remove_ssh($xml_ref->{execution}{url}); - } + #if($xml_ref->{execution}{provider} eq "ssh") { + # remove_ssh($xml_ref->{execution}{url}); + #} # Remove directory - if ( !-d "$dotswift_directory/sites/$option_remove" ) { - die "Unable to find site entry for $option_remove\n"; - } rmtree("$dotswift_directory/sites/$option_remove") || die 'Unable to remove directory ' . "$dotswift_directory/sites/$option_remove\n"; @@ -486,12 +518,9 @@ ForceArray => [qw(workdirectory profile)], KeyAttr => [], ); + $xml_ref = update_xml("$sites_file", 1); - my $initial_exurl = $xml_ref->{execution}{url}; - $xml_ref = update_xml("$sites_file", 1); - my $new_exurl = $xml_ref->{execution}{url}; - #my $new_sitename = $xml_ref->{handle}; - + # Save my $xml_out_ref = $xml->XMLout( $xml_ref, RootName => 'pool', @@ -501,9 +530,6 @@ # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { - if ( $initial_exurl && $initial_exurl ne $new_exurl ) { - remove_ssh( $initial_exurl ); - } add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); } } From noreply at svn.ci.uchicago.edu Sun Aug 15 13:25:14 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 15 Aug 2010 13:25:14 -0500 (CDT) Subject: [Swift-commit] r3536 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100815182514.24B4D9CC9A@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-15 13:25:13 -0500 (Sun, 15 Aug 2010) New Revision: 3536 Added: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun Log: Many updates to clarify code. Most shared functions now stored in SwiftConfig.pm module. Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-14 22:45:00 UTC (rev 3535) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-15 18:25:13 UTC (rev 3536) @@ -1,42 +1,18 @@ #!/usr/bin/perl -w use strict; -use Cwd; -use Cwd qw(abs_path); + use File::Copy; use File::Path; use Pod::Usage; - -my $swift_home = q{}; -if ( $ENV{'SWIFT_HOME'} && -e "$ENV{'SWIFT_HOME'}/bin/swift" ) { - $swift_home = $ENV{'SWIFT_HOME'}; -} - -my @execution_path = split( '/', abs_path($0) ); - at execution_path = splice( @execution_path, 0, $#execution_path - 1 ); -my $parent_directory = join( '/', @execution_path ); - -if ( !$swift_home ) { - if ( -e "$parent_directory/bin/swift" ) { - $swift_home = $parent_directory; - } - - else { - @execution_path = split( '/', which("swift") ); - @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); - my $tmp = join( '/', @execution_path ); - if ( -e "$tmp/bin/swift" ) { - $swift_home = $tmp; - } - } -} - +use Cwd; +use Cwd qw(abs_path); use FindBin qw($Bin); -use lib "$FindBin::Bin/../lib/perl"; # Use libraries in $swift_home/lib/perl +use lib "$FindBin::Bin/../lib/perl"; # Use libs in swiftconfig_home/lib/perl +use SwiftConfig; use Getopt::Long; -use File::Which qw(which where); use XML::Simple; -use Data::Dumper; +use File::Which qw(which where); # Variables used for sites.xml my $option_templates = q{}; # List all templates @@ -55,7 +31,6 @@ GetOptions( 'remove=s' => \$option_remove, 'templates' => \$option_templates, - 'swift_home=s' => \$swift_home, 'sites' => \$option_sites, 'describe=s' => \$option_describe, 'default|defaults' => \$option_default, @@ -63,77 +38,9 @@ 'template=s' => \$option_template, 'edit=s' => \$option_edit, 'copy=s' => \$option_copy, - 'help' => sub { pod2usage(-verbose => 2); }, + 'help|man' => sub { pod2usage(-verbose => 2); }, ); -# Create a new directory if it does not exist -sub create_directory { - my $directory = $_[0]; - if ( !-d "$directory" ) { - mkdir "$directory", 0700 - or die "Unable to create directory $directory\n"; - } -} - -# Process keyboard input -sub get_entry { - my ( $entry_description, $entry_value, $use_default, @allowable_values, ) = @_; - - # If use_default is specified, automatically plug in the default value - if($use_default) { - return $entry_value; - } - - if(!@allowable_values) { - print "$entry_description [$entry_value]: "; - } - else { - print "$entry_description ["; - my $counter=0; - foreach my $allowable(@allowable_values) { - if($counter != 0) { - print " "; - } - if($allowable eq $entry_value) { - print "*$allowable"; - } - else { - print "$allowable"; - } - $counter++; - } - print "]: "; - } - my $new_value = ; - chomp($new_value); - if ($new_value) { - $entry_value = $new_value; - } - - - # Check if value entered is valid (if valid values were passed) - my $is_valid = 0; - if (@allowable_values) { - foreach my $allowable (@allowable_values) { - if ( $allowable eq $entry_value ) { - $is_valid = 1; - } - } - if ( !$is_valid ) { - my $error_message = q{}; - foreach my $allowable (@allowable_values) { - $error_message = $error_message . $allowable . ' '; - } - print 'Invalid value selected. Please select from: ' - . "$error_message\n"; - $entry_value = get_entry( $entry_description, $entry_value, - @allowable_values, ); - } - } - - return $entry_value; -} - # Prepare data my $xml = new XML::Simple(); @@ -144,279 +51,10 @@ create_directory("$dotswift_directory/sites"); # Determine the template directory - at execution_path = split( '/', abs_path($0) ); +my @execution_path = split( '/', abs_path($0) ); @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); my $template_directory = join( '/', @execution_path ) . '/etc/sites'; -# Add new entry to auths.default -sub add_ssh { - my ( $ssh_site, $ssh_url) = @_; - - # Open authfile - my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; - if( -e "$auth_file") { - open( AUTH_FILE, "<$auth_file") - || die "Unable to open $auth_file for reading\n"; - } - else { - open( AUTH_FILE, "+>$auth_file" ) - || die "Unable to open $auth_file for read/write!\n"; - } - my @auth_data = ; - close(AUTH_FILE); - - # Get existing values and modify if found - my $ssh_username; - my $ssh_password; - my $found = 0; - foreach (@auth_data) { - if (/username/i && /^$ssh_url/i) { - ( my $setting, $ssh_username, ) = split( '=', $_ ); - chomp($ssh_username); - $ssh_username = get_entry( 'Username', $ssh_username, 0); - $_ = "$ssh_url.username=$ssh_username\n"; - $found = 1; - } - if (/\.password/i && /^$ssh_url/i) { - ( my $setting, $ssh_password, ) = split( '=', $_ ); - chomp($ssh_password); - $ssh_password = get_entry( 'Password', $ssh_password, 0); - $_ = "$ssh_url.password=$ssh_password\n"; - $found = 1; - } - } - - # Add new entry if needed - if(!$found) { - $ssh_username = getlogin(); - $ssh_username = get_entry( 'Username', $ssh_username, 0 ); - $ssh_password = get_entry( 'Password', '', 0); - - # Password based authentication - push( @auth_data, "$ssh_url.type=password\n" ); - push( @auth_data, "$ssh_url.username=$ssh_username\n" ); - push( @auth_data, "$ssh_url.password=$ssh_password\n" ); - } - - # Write data - write_file( $auth_file, @auth_data ); -} - -# Remove an entry from auth.defaults -sub remove_ssh { - my ( $ssh_url, ) = @_; - - # Open auth.defaults - my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; - if( -e "$auth_file") { - open( AUTH_FILE, "<$auth_file") - || die "Unable to open $auth_file for reading\n"; - } - else { - return; - } - my @auth_data = ; - close(AUTH_FILE); - - # Remove - foreach (@auth_data) { - if (/^$ssh_url/i) { - $_ = ''; - } - } - - # Write data - write_file( $auth_file, @auth_data ); -} - -# Update TC with correct hostname -sub update_tc_hostname { - my ( $tc_filename, $tc_host ) = @_; - - # Store TC data - open( TC_FILESTREAM, "$tc_filename" ) - or die("Unable to open tc file $tc_filename!"); - my @tc_data = ; - close(TC_FILESTREAM); - - foreach my $line (@tc_data) { - - # Ignore comments - my $first_character = substr( $line, 0, 1 ); - if ( $first_character eq '#' ) { - next; - } - - # Replace old entry with new entry - my ($line_tc_host, $line_tc_name, $line_tc_path, - $line_tc_status, $line_tc_platform, $line_tc_profile, - ) = split( /\s+/, $line ); - $line = - "$tc_host\t" - . "$line_tc_name\t" - . "$line_tc_path\t" - . "$line_tc_status\t" - . "$line_tc_platform\t" - . "$line_tc_profile\n"; - } - - write_file( $tc_filename, @tc_data ); -} - -# Update XML hash with values from command line -sub update_xml { - - # Set up data - my ($xml_filename, $edit_mode) = @_; - # Values for edit mode - # 0 - Edit all - # 1 - All but name - # 2 - Customized.. to do - - if ( !-e $xml_filename ) { - die "Unable to update xml file $xml_filename\n"; - } - - my $xml_ref = $xml->XMLin( - $xml_filename, - ForceArray => [qw(workdirectory profile)], - KeyAttr => [], - ); - - # Handle - if($edit_mode == 0) { - $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); - } - - # Execution - my $initial_exprovider = $xml_ref->{execution}{provider}; - $xml_ref->{execution}{provider} = get_entry( - 'Execution Provider', - $xml_ref->{execution}{provider}, - $option_default, - @execution_providers, - ); - my $current_exprovider = $xml_ref->{execution}{provider}; - - # Handle changes in execution provider - if( $initial_exprovider ne $current_exprovider ) { - # Add SSH fields - if( $current_exprovider eq 'ssh' ) { - if( !$xml_ref->{execution}{url} ) { - $xml_ref->{execution}{url} = 'unknown'; - } - } - # Add coaster fields - if( $current_exprovider eq 'coaster' ) { - if( !$xml_ref->{execution}{jobmanager} ) { - $xml_ref->{execution}{jobmanager} = 'unknown'; - } - if( !$xml_ref->{execution}{url} ){ - $xml_ref->{execution}{url} = 'unknown'; - } - } - } - - # Job manager - if ( $xml_ref->{execution}{jobmanager}) { - $xml_ref->{execution}{jobmanager} = - get_entry( 'Execution Job Manager', - $xml_ref->{execution}{jobmanager}, - $option_default - ); - } - - # Execution URL - if ( $xml_ref->{execution}{url} ) { - $xml_ref->{execution}{url} = - get_entry( 'Execution URL', - $xml_ref->{execution}{url}, - $option_default - ); - } - - # Grid FTP - if ( $xml_ref->{gridftp} ) { - $xml_ref->{gridftp}{url} = - get_entry( 'GridFTP URL', $xml_ref->{gridftp}{url}, $option_default); - } - - # Work directory - if ( $xml_ref->{workdirectory} ) { - $xml_ref->{workdirectory}[0] =~ s/\$HOME/$ENV{'HOME'}/; - $xml_ref->{workdirectory} = - [ get_entry( 'Work Directory', $xml_ref->{workdirectory}[0], $option_default) ]; - } - - # Job manager - if ( $xml_ref->{jobmanager} ) { - if ( $xml_ref->{jobmanager}{universe} ) { - $xml_ref->{jobmanager}{universe} = - get_entry( 'Job Universe', $xml_ref->{jobmanager}{universe}, $option_default); - } - if ( $xml_ref->{jobmanager}{url} ) { - $xml_ref->{jobmanager}{url} = - get_entry( 'Job Manager URL', $xml_ref->{jobmanager}{url}, $option_default); - } - if ( $xml_ref->{jobmanager}{major} ) { - $xml_ref->{jobmanager}{major} = - get_entry( 'Job Major Number', - $xml_ref->{jobmanager}{major}, $option_default); - } - if ( $xml_ref->{jobmanager}{minor} ) { - $xml_ref->{jobmanager}{minor} = - get_entry( 'Job Minor Number', - $xml_ref->{jobmanager}{minor}, $option_default); - } - } - - # Filesystem - if ( $xml_ref->{filesystem} ) { - if ( $xml_ref->{filesystem}{provider} ) { - $xml_ref->{filesystem}{provider} = get_entry( - 'Filesystem Provider', - $xml_ref->{filesystem}{provider}, - $option_default, - @execution_providers, - ); - } - if ( $xml_ref->{filesystem}{url} ) { - $xml_ref->{filesystem}{url} = - get_entry( 'Filesystem URL', $xml_ref->{filesystem}{url}, $option_default); - } - } - - # Profiles - foreach my $profile ( @{ $xml_ref->{profile} } ) { - $profile->{content} = - get_entry( $profile->{key}, $profile->{content}, $option_default); - } - - return $xml_ref; -} - -# Write a file given variable and filename -sub write_file { - my ( $filename, @data ) = @_; - open( TEMPFILESTREAM, ">$filename" ) - or die("Unable to open $filename!\n"); - print TEMPFILESTREAM @data; - close(TEMPFILESTREAM); -} - -# Print all files in a directory -sub print_directory { - my ($directory) = @_; - chdir($directory) - || die "Unable to change directories to $directory\n"; - my @files = <*>; - foreach my $file (@files) { - ( my $basename, my $ext ) = split( /\./, $file ); - my @path = split( '/', $basename ); - print "$basename\n"; - } -} - # Add configuration from a template if ($option_template) { @@ -426,7 +64,7 @@ if ( !-e "$sites_input_file" ) { die "Unable to find configuration for $sites_input_file\n"; } - my $xml_ref = update_xml("$sites_input_file", 0); + my $xml_ref = update_xml("$sites_input_file", 0, $option_default, @execution_providers); my $new_sitename = $xml_ref->{handle}; my $output_directory = "$dotswift_directory/sites/$new_sitename"; if ( -d "$output_directory" ) { @@ -437,8 +75,7 @@ my @files_to_copy = <$from_directory/*>; create_directory("$output_directory"); foreach my $file_to_copy (@files_to_copy) { - copy( $file_to_copy, "$output_directory" ) - || die "Unable to copy to $file_to_copy to $output_directory\n"; + copy_file($file_to_copy, $output_directory); } my $xml_out_ref = $xml->XMLout( $xml_ref, @@ -474,14 +111,13 @@ die "Unable to find configuration named $option_remove\n"; } - my $xml_filename = "$dotswift_directory/sites/$option_remove/sites.xml"; - my $xml_ref = $xml->XMLin( - $xml_filename, - ForceArray => [qw(workdirectory profile)], - KeyAttr => [], - ); - # Remove SSH entry if needed + #my $xml_filename = "$dotswift_directory/sites/$option_remove/sites.xml"; + #my $xml_ref = $xml->XMLin( + # $xml_filename, + # ForceArray => [qw(workdirectory profile)], + # KeyAttr => [], + #); #if($xml_ref->{execution}{provider} eq "ssh") { # remove_ssh($xml_ref->{execution}{url}); #} @@ -518,7 +154,7 @@ ForceArray => [qw(workdirectory profile)], KeyAttr => [], ); - $xml_ref = update_xml("$sites_file", 1); + $xml_ref = update_xml("$sites_file", 1, $option_default, @execution_providers); # Save my $xml_out_ref = $xml->XMLout( @@ -551,8 +187,7 @@ my @files_to_copy = <$input_directory/*>; foreach my $file_to_copy (@files_to_copy) { - copy( $file_to_copy, "$output_directory" ) - || die "Unable to copy $file_to_copy to $output_directory\n"; + copy_file($file_to_copy, $output_directory); } # Rename and save @@ -572,7 +207,10 @@ # Edit sites my $initial_exurl = $xml_ref->{execution}{url}; - $xml_ref = update_xml( "$output_directory/sites.xml", 1); + $xml_ref = update_xml( "$output_directory/sites.xml", + 1, + $option_default, + @execution_providers); my $new_exurl = $xml_ref->{execution}{url}; $xml_out_ref = $xml->XMLout( @@ -605,10 +243,9 @@ =head1 OVERVIEW -The swiftconfig program allows users to configure Swift. It allows for the -adding, removing, and modification of remote sites by utilizing a set of -standard templates. It also provides a way to quickly add, remove and modify -translation catalog entries without having to manually edit files. +The swiftconfig program allows users to configure Swift. It enables users to +add configurations based on templates, copy configurations, remove configurations, +and edit configurations. =head1 DESCRIPTION Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-14 22:45:00 UTC (rev 3535) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-15 18:25:13 UTC (rev 3536) @@ -11,70 +11,8 @@ use File::Which qw(which where); use XML::Simple; use Pod::Usage; +use SwiftConfig; -# Figure out the path to Swift -my $swift_home = q{}; -if ( $ENV{'SWIFT_HOME'} && -e "$ENV{'SWIFT_HOME'}/bin/swift" ) { - $swift_home = $ENV{'SWIFT_HOME'}; -} -my @execution_path = split( '/', abs_path($0) ); - at execution_path = splice( @execution_path, 0, $#execution_path - 1 ); -my $parent_directory = join( '/', @execution_path ); -if ( !$swift_home ) { - if ( -e "$parent_directory/bin/swift" ) { - $swift_home = $parent_directory; - } - else { - @execution_path = split( '/', which("swift") ); - @execution_path = splice( @execution_path, 0, $#execution_path - 1 ); - my $tmp = join( '/', @execution_path ); - if ( -e "$tmp/bin/swift" ) { - $swift_home = $tmp; - } - } -} - -# Create a new directory if it does not exist -sub create_directory { - my $directory = $_[0]; - if ( !-d "$directory" ) { - mkdir "$directory", 0700 - || die "Unable to create directory $directory\n"; - } -} - -# Append one file to another -sub cat_file { - my ( $src, $dst ) = @_; - if ( -e $dst ) { - open( DSTFILE, ">>$dst" ) || die "Unable to open $dst for append\n"; - } - else { - open( DSTFILE, ">$dst" ) - or die "Unable to open $dst for writing\n"; - } - open( SRCFILE, $src ) || die "Unable to open $src for reading\n"; - foreach my $line () { - print DSTFILE $line; - } -} - -# Copy a file to a new location -sub copy_file { - my ( $src, $dst ) = @_; - if ( !-e $src ) { die "Unable to access $src\n"; } - if ( !-e $dst ) { die "Unable to access $dst\n"; } - copy( $src, $dst ) or die "Unable to copy $src to $dst\n"; -} - -# Strip directory name out of script -sub strip_directory { - my ($fullpath) = @_; - my @path = split( '/', $fullpath ); - my $filename = $path[$#path]; - return $filename; -} - # Command line processing my @option_sites; # Site name to execute upon my $option_script; # Script name to run @@ -84,10 +22,9 @@ 'site|sites=s{,}' => \@option_sites, 'script=s' => \$option_script, 'input|inputs=s{,}' => \@option_inputs, - 'help' => sub { pod2usage(-verbose => 2); }, + 'help|man' => sub { pod2usage(-verbose => 2); }, ); - # Create run directory my $script_filename = strip_directory($option_script); my $dotswift_directory = "$ENV{'HOME'}/.swift"; Added: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm (rev 0) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-15 18:25:13 UTC (rev 3536) @@ -0,0 +1,467 @@ +package SwiftConfig; + +use 5.010001; +use strict; +use warnings; + +use File::Copy; +use File::Path; +use Pod::Usage; +use FindBin qw($Bin); +use lib "$FindBin::Bin/../lib/perl"; # Use libraries in $swift_home/lib/perl +use SwiftConfig; +use Getopt::Long; +use File::Which qw(which where); +use XML::Simple; + +require Exporter; +our @ISA = qw(Exporter); + +# Items to export into callers namespace by default. Note: do not export +# names by default without a very good reason. Use EXPORT_OK instead. +# Do not simply export all your public functions/methods/constants. + +# This allows declaration use SwiftConfig ':all'; +# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK +# will save memory. +our %EXPORT_TAGS = ( 'all' => [ qw( +) ] ); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +our @EXPORT = qw(create_directory get_entry add_ssh remove_ssh +update_tc_hostname update_xml write_file print_directory strip_directory +copy_file cat_file +); +our $VERSION = '0.01'; + +# Prepare data +my $xml = new XML::Simple(); + +# Create a new directory if it does not exist +sub create_directory { + my $directory = $_[0]; + if ( !-d "$directory" ) { + mkdir "$directory", 0700 + or die "Unable to create directory $directory\n"; + } +} + +# Process keyboard input +sub get_entry { + my ( $entry_description, $entry_value, $use_default, @allowable_values, ) = @_; + + # If use_default is specified, automatically plug in the default value + if($use_default) { + return $entry_value; + } + + if(!@allowable_values) { + print "$entry_description [$entry_value]: "; + } + else { + print "$entry_description ["; + my $counter=0; + foreach my $allowable(@allowable_values) { + if($counter != 0) { + print " "; + } + if($allowable eq $entry_value) { + print "*$allowable"; + } + else { + print "$allowable"; + } + $counter++; + } + print "]: "; + } + my $new_value = ; + chomp($new_value); + if ($new_value) { + $entry_value = $new_value; + } + + # Check if value entered is valid (if valid values were passed) + my $is_valid = 0; + if (@allowable_values) { + foreach my $allowable (@allowable_values) { + if ( $allowable eq $entry_value ) { + $is_valid = 1; + } + } + if ( !$is_valid ) { + my $error_message = q{}; + foreach my $allowable (@allowable_values) { + $error_message = $error_message . $allowable . ' '; + } + print 'Invalid value selected. Please select from: ' + . "$error_message\n"; + $entry_value = get_entry( $entry_description, $entry_value, + @allowable_values, ); + } + } + return $entry_value; +} + +# Add new entry to auths.default +sub add_ssh { + my ( $ssh_site, $ssh_url) = @_; + + # Open authfile + my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; + if( -e "$auth_file") { + open( AUTH_FILE, "<$auth_file") + || die "Unable to open $auth_file for reading\n"; + } + else { + open( AUTH_FILE, "+>$auth_file" ) + || die "Unable to open $auth_file for read/write!\n"; + } + my @auth_data = ; + close(AUTH_FILE); + + # Get existing values and modify if found + my $ssh_username; + my $ssh_password; + my $found = 0; + foreach (@auth_data) { + if (/username/i && /^$ssh_url/i) { + ( my $setting, $ssh_username, ) = split( '=', $_ ); + chomp($ssh_username); + $ssh_username = get_entry( 'Username', $ssh_username, 0); + $_ = "$ssh_url.username=$ssh_username\n"; + $found = 1; + } + if (/\.password/i && /^$ssh_url/i) { + ( my $setting, $ssh_password, ) = split( '=', $_ ); + chomp($ssh_password); + $ssh_password = get_entry( 'Password', $ssh_password, 0); + $_ = "$ssh_url.password=$ssh_password\n"; + $found = 1; + } + } + + # Add new entry if needed + if(!$found) { + $ssh_username = getlogin(); + $ssh_username = get_entry( 'Username', $ssh_username, 0 ); + $ssh_password = get_entry( 'Password', '', 0); + + # Password based authentication + push( @auth_data, "$ssh_url.type=password\n" ); + push( @auth_data, "$ssh_url.username=$ssh_username\n" ); + push( @auth_data, "$ssh_url.password=$ssh_password\n" ); + } + + # Write data + write_file( $auth_file, @auth_data ); +} + +# Remove an entry from auth.defaults +sub remove_ssh { + my ( $ssh_url, ) = @_; + + # Open auth.defaults + my $auth_file = "$ENV{'HOME'}/.ssh/auth.defaults"; + if( -e "$auth_file") { + open( AUTH_FILE, "<$auth_file") + || die "Unable to open $auth_file for reading\n"; + } + else { + return; + } + my @auth_data = ; + close(AUTH_FILE); + + # Remove + foreach (@auth_data) { + if (/^$ssh_url/i) { + $_ = ''; + } + } + + # Write data + write_file( $auth_file, @auth_data ); +} + +# Update TC with correct hostname +sub update_tc_hostname { + my ( $tc_filename, $tc_host ) = @_; + + # Store TC data + open( TC_FILESTREAM, "$tc_filename" ) + or die("Unable to open tc file $tc_filename!"); + my @tc_data = ; + close(TC_FILESTREAM); + + foreach my $line (@tc_data) { + + # Ignore comments + my $first_character = substr( $line, 0, 1 ); + if ( $first_character eq '#' ) { + next; + } + + # Replace old entry with new entry + my ($line_tc_host, $line_tc_name, $line_tc_path, + $line_tc_status, $line_tc_platform, $line_tc_profile, + ) = split( /\s+/, $line ); + $line = + "$tc_host\t" + . "$line_tc_name\t" + . "$line_tc_path\t" + . "$line_tc_status\t" + . "$line_tc_platform\t" + . "$line_tc_profile\n"; + } + + write_file( $tc_filename, @tc_data ); +} + +# Update XML hash with values from command line +sub update_xml { + + # Set up data + my ($xml_filename, $edit_mode, $option_default, @execution_providers) = @_; + # Values for edit mode + # 0 - Edit all + # 1 - All but name + # 2 - Customized.. to do + + if ( !-e $xml_filename ) { + die "Unable to update xml file $xml_filename\n"; + } + + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile)], + KeyAttr => [], + ); + + # Handle + if($edit_mode == 0) { + $xml_ref->{handle} = get_entry( 'Site Entry Name', $xml_ref->{handle}, $option_default); + } + + # Execution + my $initial_exprovider = $xml_ref->{execution}{provider}; + $xml_ref->{execution}{provider} = get_entry( + 'Execution Provider', + $xml_ref->{execution}{provider}, + $option_default, + @execution_providers, + ); + my $current_exprovider = $xml_ref->{execution}{provider}; + + # Handle changes in execution provider + if( $initial_exprovider ne $current_exprovider ) { + # Add SSH fields + if( $current_exprovider eq 'ssh' ) { + if( !$xml_ref->{execution}{url} ) { + $xml_ref->{execution}{url} = 'unknown'; + } + } + # Add coaster fields + if( $current_exprovider eq 'coaster' ) { + if( !$xml_ref->{execution}{jobmanager} ) { + $xml_ref->{execution}{jobmanager} = 'unknown'; + } + if( !$xml_ref->{execution}{url} ){ + $xml_ref->{execution}{url} = 'unknown'; + } + } + } + + # Job manager + if ( $xml_ref->{execution}{jobmanager}) { + $xml_ref->{execution}{jobmanager} = + get_entry( 'Execution Job Manager', + $xml_ref->{execution}{jobmanager}, + $option_default + ); + } + + # Execution URL + if ( $xml_ref->{execution}{url} ) { + $xml_ref->{execution}{url} = + get_entry( 'Execution URL', + $xml_ref->{execution}{url}, + $option_default + ); + } + + # Grid FTP + if ( $xml_ref->{gridftp} ) { + $xml_ref->{gridftp}{url} = + get_entry( 'GridFTP URL', $xml_ref->{gridftp}{url}, $option_default); + } + + # Work directory + if ( $xml_ref->{workdirectory} ) { + $xml_ref->{workdirectory}[0] =~ s/\$HOME/$ENV{'HOME'}/; + $xml_ref->{workdirectory} = + [ get_entry( 'Work Directory', $xml_ref->{workdirectory}[0], $option_default) ]; + } + + # Job manager + if ( $xml_ref->{jobmanager} ) { + if ( $xml_ref->{jobmanager}{universe} ) { + $xml_ref->{jobmanager}{universe} = + get_entry( 'Job Universe', $xml_ref->{jobmanager}{universe}, $option_default); + } + if ( $xml_ref->{jobmanager}{url} ) { + $xml_ref->{jobmanager}{url} = + get_entry( 'Job Manager URL', $xml_ref->{jobmanager}{url}, $option_default); + } + if ( $xml_ref->{jobmanager}{major} ) { + $xml_ref->{jobmanager}{major} = + get_entry( 'Job Major Number', + $xml_ref->{jobmanager}{major}, $option_default); + } + if ( $xml_ref->{jobmanager}{minor} ) { + $xml_ref->{jobmanager}{minor} = + get_entry( 'Job Minor Number', + $xml_ref->{jobmanager}{minor}, $option_default); + } + } + + # Filesystem + if ( $xml_ref->{filesystem} ) { + if ( $xml_ref->{filesystem}{provider} ) { + $xml_ref->{filesystem}{provider} = get_entry( + 'Filesystem Provider', + $xml_ref->{filesystem}{provider}, + $option_default, + @execution_providers, + ); + } + if ( $xml_ref->{filesystem}{url} ) { + $xml_ref->{filesystem}{url} = + get_entry( 'Filesystem URL', $xml_ref->{filesystem}{url}, $option_default); + } + } + + # Profiles + foreach my $profile ( @{ $xml_ref->{profile} } ) { + $profile->{content} = + get_entry( $profile->{key}, $profile->{content}, $option_default); + } + + return $xml_ref; +} + +# Write a file given variable and filename +sub write_file { + my ( $filename, @data ) = @_; + open( TEMPFILESTREAM, ">$filename" ) + or die("Unable to open $filename!\n"); + print TEMPFILESTREAM @data; + close(TEMPFILESTREAM); +} + +# Print all files in a directory +sub print_directory { + my ($directory) = @_; + chdir($directory) + || die "Unable to change directories to $directory\n"; + my @files = <*>; + foreach my $file (@files) { + ( my $basename, my $ext ) = split( /\./, $file ); + my @path = split( '/', $basename ); + print "$basename\n"; + } +} + +# Append one file to another +sub cat_file { + my ( $src, $dst ) = @_; + if ( -e $dst ) { + open( DSTFILE, ">>$dst" ) || die "Unable to open $dst for append\n"; + } + else { + open( DSTFILE, ">$dst" ) + or die "Unable to open $dst for writing\n"; + } + open( SRCFILE, $src ) || die "Unable to open $src for reading\n"; + foreach my $line () { + print DSTFILE $line; + } +} + +# Copy a file to a new location +sub copy_file { + my ( $src, $dst ) = @_; + if ( !-e $src ) { die "Unable to access $src\n"; } + if ( !-e $dst ) { die "Unable to access $dst\n"; } + copy( $src, $dst ) or die "Unable to copy $src to $dst\n"; +} + +# Strip directory name out of a string +sub strip_directory { + my ($fullpath) = @_; + my @path = split( '/', $fullpath ); + my $filename = $path[$#path]; + return $filename; +} + +1; +__END__ + +=head1 SwiftConfig + +SwiftConfig - Perl module for swiftconfig and swiftrun applications + +=head1 SYNOPSIS + + use SwiftConfig; + +=head1 DESCRIPTION + +The SwiftConfig module provides a set of standard routines needed to handle +Swift Configuration. + +create_directory(directory_name) + Creates a directory, handles errors + +get_entry($entry_description, $entry_value, $use_default, @allowable_values) + get_entry is used to get input from the user + $entry_description is used to describe the data to the user + $entry_value is the default value. If the user hits enter, it will be used + $use_default, if true, will set input to $entry_value without prompting + @allowable_values is a list of all available options for that input + +add_ssh($ssh_site, $ssh_url) + Add an entry to ~/.ssh/auth.defaults + $ssh_site is the swift configuration name + $ssh_url is the network name/address to connect to + +remove_ssh($ssh_url) + Remove an entry from ~/.ssh/auth.defaults + $ssh_url is the network name/address to remove + +update_tc_hostname($filename, $tc_hostname) + Change the site name in a tc.data file + $filename is the filename of the tc.data + $tc_hostname is the value of the new hostname + +update_xml($xml_filename, $edit_mode, $option_default, @execution_providers) + Edit and update a sites.xml file + $xml_filename filename to edit + There are currently two edit modes: 0=edit everything, 1=everything but name + $option_default, if true, will automatically use defaults + @execution_providers is the list of all valid execution providers + +write_file($filename, @data) + Write to $filename with @data. Handle errors + +print_directory($directory) + List all files within a directory without paths + +cat_file($src, $dst) + Concatenate $src to $dst, handle errors + +copy_file($src, $dst) + Copy file $src to $dst, handle errors + +strip_directory($fullpath) + Given a string like "/foo/blah/file.txt", return "file.txt" +=cut From noreply at svn.ci.uchicago.edu Sun Aug 15 17:10:29 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 15 Aug 2010 17:10:29 -0500 (CDT) Subject: [Swift-commit] r3537 - trunk/bin Message-ID: <20100815221030.0208F9CC9A@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-15 17:10:29 -0500 (Sun, 15 Aug 2010) New Revision: 3537 Modified: trunk/bin/swift Log: Test for both nc and netcat, use IP address rather than hostname for usage statistics Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-15 18:25:13 UTC (rev 3536) +++ trunk/bin/swift 2010-08-15 22:10:29 UTC (rev 3537) @@ -87,7 +87,7 @@ fi # Anonymous usage statistics -LISTENER="bridled.ci.uchicago.edu" +LISTENER="128.135.125.18" PORT="9999" if [ -z "$SWIFT_USAGE_STATS" ]; then @@ -111,8 +111,11 @@ NC=`which nc 2>&1` if [ ! -x "$NC" ]; then - echo "warning: unable to find nc" - SWIFT_USAGE_STATS=0 + NC=`which netcat 2>&1` + if [ ! -x "$NC" ]; then + echo "warning: unable to find nc" + SWIFT_USAGE_STATS=0 + fi fi if [ "$SWIFT_USAGE_STATS" = 1 ]; then @@ -148,5 +151,3 @@ fi exit $return_code - - From noreply at svn.ci.uchicago.edu Sun Aug 15 17:20:16 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sun, 15 Aug 2010 17:20:16 -0500 (CDT) Subject: [Swift-commit] r3538 - trunk/bin Message-ID: <20100815222016.1B36E9CC9A@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-15 17:20:15 -0500 (Sun, 15 Aug 2010) New Revision: 3538 Modified: trunk/bin/swift Log: Disabled hostname and service lookups Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-15 22:10:29 UTC (rev 3537) +++ trunk/bin/swift 2010-08-15 22:20:15 UTC (rev 3538) @@ -132,7 +132,7 @@ USERID=`echo $USERID $HOSTNAME $MAC | $MD5SUM |cut -d ' ' -f1` DATE=`date` KEY=`echo $USERID $DATE $$ | $MD5SUM | cut -d ' ' -f1` - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -w 60 -u $LISTENER $PORT & + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH -1 0| $NC -w 10 -n -u $LISTENER $PORT & fi ### EXECUTE ############ @@ -147,7 +147,7 @@ return_code=$? if [ "$SWIFT_USAGE_STATS" = 1 ]; then - echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -w 60 -u $LISTENER $PORT & + echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1| $NC -w 10 -n -u $LISTENER $PORT & fi exit $return_code From noreply at svn.ci.uchicago.edu Mon Aug 16 00:35:45 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 00:35:45 -0500 (CDT) Subject: [Swift-commit] r3539 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100816053545.6CB349CC9A@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 00:35:45 -0500 (Mon, 16 Aug 2010) New Revision: 3539 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Preliminary version of TC editing Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-15 22:20:15 UTC (rev 3538) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 05:35:45 UTC (rev 3539) @@ -15,18 +15,16 @@ use File::Which qw(which where); # Variables used for sites.xml -my $option_templates = q{}; # List all templates -my $option_remove = q{}; # Remove entry from sites.xml -my $option_edit = q{}; # Edit mode -my $option_sites = q{}; # List all usable sites -my $option_describe = q{}; # Print raw XML configuration -my $option_default = q{}; # When adding a site, use all defaults -my $option_template = q{}; # Create config from template specified -my $option_copy = q{}; # Copy an existing configuration +my $option_templates = q{}; # List all templates +my $option_remove = q{}; # Remove entry from sites.xml +my $option_edit = q{}; # Edit mode +my $option_sites = q{}; # List all usable sites +my $option_describe = q{}; # Print raw XML configuration +my $option_default = q{}; # When adding a site, use all defaults +my $option_template = q{}; # Create config from template specified +my $option_copy = q{}; # Copy an existing configuration +my $option_applications = q{}; # Edit applications -my @execution_providers = - ( "gt4", "local", "pbs", "condor", "ssh", "coaster", ); - # Assign variables from command line options GetOptions( 'remove=s' => \$option_remove, @@ -38,11 +36,13 @@ 'template=s' => \$option_template, 'edit=s' => \$option_edit, 'copy=s' => \$option_copy, + 'apps|applications' => \$option_applications, 'help|man' => sub { pod2usage(-verbose => 2); }, ); # Prepare data my $xml = new XML::Simple(); +initialize_swiftconfig(); # Create all required directories my $dotswift_directory = "$ENV{'HOME'}/.swift"; @@ -64,7 +64,7 @@ if ( !-e "$sites_input_file" ) { die "Unable to find configuration for $sites_input_file\n"; } - my $xml_ref = update_xml("$sites_input_file", 0, $option_default, @execution_providers); + my $xml_ref = update_xml("$sites_input_file", 0, $option_default); my $new_sitename = $xml_ref->{handle}; my $output_directory = "$dotswift_directory/sites/$new_sitename"; if ( -d "$output_directory" ) { @@ -154,7 +154,7 @@ ForceArray => [qw(workdirectory profile)], KeyAttr => [], ); - $xml_ref = update_xml("$sites_file", 1, $option_default, @execution_providers); + $xml_ref = update_xml("$sites_file", 1, $option_default); # Save my $xml_out_ref = $xml->XMLout( @@ -207,10 +207,7 @@ # Edit sites my $initial_exurl = $xml_ref->{execution}{url}; - $xml_ref = update_xml( "$output_directory/sites.xml", - 1, - $option_default, - @execution_providers); + $xml_ref = update_xml( "$output_directory/sites.xml", 1, $option_default,); my $new_exurl = $xml_ref->{execution}{url}; $xml_out_ref = $xml->XMLout( @@ -231,6 +228,55 @@ } } +# Add/Edit applications +if($option_applications) { + my @applications = glob("$dotswift_directory/apps/*"); + foreach(@applications) { + $_ = strip_directory($_); + my ($base, $ext) = split('\.'); + $_ = $base; + } + push(@applications, 'new'); + + my $application_set = get_entry('Select application set', 'linux', 0, + @applications); + if($application_set eq 'new') { + $application_set = get_entry('Name of new application set', '', 0); + my $now = time(); + if(-e "$dotswift_directory/apps/$application_set.apps") { + print "Set named $application_set already exists\n"; + return; + } + open(APPFILE, ">$dotswift_directory/apps/$application_set.apps") + || die "Unable to create file $dotswift_directory/apps/$application_set.apps"; + print "$application_set set created\n\n"; + close(APPFILE); + } + + my $quit = 0; + while($quit == 0) { + print "\n(E)dit, (a)dd, (r)emove, (l)ist, or (q)uit: "; + my $edit_or_add = ; + chomp($edit_or_add); + + if(lc($edit_or_add) eq 'a') { + add_application("$dotswift_directory/apps/$application_set.apps"); + } + elsif(lc($edit_or_add) eq 'q') { + $quit = 1; + } + elsif(lc($edit_or_add) eq 'r') { + remove_application("$dotswift_directory/apps/$application_set.apps"); + } + elsif(lc($edit_or_add) eq 'l') { + list_applications("$dotswift_directory/apps/$application_set.apps"); + } + elsif(lc($edit_or_add) eq 'e') { + edit_application("$dotswift_directory/apps/$application_set.apps"); + } + } +} + __END__ =head1 NAME Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-15 22:20:15 UTC (rev 3538) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 05:35:45 UTC (rev 3539) @@ -26,6 +26,7 @@ ); # Create run directory +initialize_swiftconfig(); my $script_filename = strip_directory($option_script); my $dotswift_directory = "$ENV{'HOME'}/.swift"; my @run_directories = ; @@ -35,46 +36,72 @@ my ($run_number) = $run_directories[-1] =~ m{(\d+)}; $run_number++; my $run_directory = getcwd() . "/" . sprintf "run.%04s", $run_number; +my @sites_xml; create_directory($run_directory); copy_file( "$option_script", "$run_directory" ); -# Create configuration files for run -foreach my $site (@option_sites) { - # Handle 'all' to use all available configurations at once - if( lc($site) eq 'all' ) { - foreach my $all_site(<$dotswift_directory/sites/*>) { - if ( !-d "$all_site" ) { - die "Unable to find directory for $all_site\n"; +# Sites.xml for 'all' +if( grep /all/, @option_sites ) { + foreach my $all_site(<$dotswift_directory/sites/*>) { + if ( !-d "$all_site" ) { + die "Unable to find directory for $all_site\n"; + } + if ( !-e "$all_site/sites.xml" ) { + die "Unable to find sites.xml for $all_site\n"; + } + open(CURRENT_SITE, "$all_site/sites.xml") + || die "Unable to open $all_site/sites.xml"; + my @current_site_data = ; + push(@sites_xml, @current_site_data); + close(CURRENT_SITE); + # Add applications + my @all_apps = glob("$dotswift_directory/apps/*.apps"); + foreach my $current_app_file(@all_apps) { + open(CURRENT_APP, $current_app_file) || die "Unable to open app file $current_app_file\n"; + my @current_app_data = ; + close(CURRENT_APP); + $all_site = strip_directory($all_site); + foreach(@current_app_data) { + s/\$HOST/$all_site/ig; } - if ( !-e "$all_site/sites.xml" ) { - die "Unable to find sites.xml for $all_site\n"; - } - if ( !-e "$all_site/tc.data" ) { - die "Unable to find tc.data for $all_site\n"; - } - cat_file( "$all_site/sites.xml", "$run_directory/sites.xml" ); - cat_file( "$all_site/tc.data", "$run_directory/tc.data" ); + open(RUNTC, ">>$run_directory/tc.data") || die "Unable to write to $run_directory/tc.data\n"; + print RUNTC @current_app_data; + close(RUNTC); } } - - # Normal, non-'all' site - else { +} + +# Sites.xml for non-'all' +else { + foreach my $site (@option_sites) { if ( !-d "$dotswift_directory/sites/$site" ) { - die "Unable to find entry for $site\n"; + die "Unable to find configuration for $site\n"; } if ( !-e "$dotswift_directory/sites/$site/sites.xml" ) { die "Unable to find sites.xml for $site\n"; + } + open(CURRENT_SITE, "$dotswift_directory/sites/$site/sites.xml") + || die "Unable to open $dotswift_directory/sites/$site/sites.xml"; + my @current_site_data = ; + close(CURRENT_SITE); + push(@sites_xml, @current_site_data); + # Add applications + my @all_apps = glob("$dotswift_directory/apps/*.apps"); + foreach my $current_app_file(@all_apps) { + open(CURRENT_APP, $current_app_file) || die "Unable to open app file $current_app_file\n"; + my @current_app_data = ; + close(CURRENT_APP); + foreach(@current_app_data) { + s/\$HOST/$site/ig; + } + open(RUNTC, ">>$run_directory/tc.data") || die "Unable to write to $run_directory/tc.data\n"; + print RUNTC @current_app_data; + close(RUNTC); } - if ( !-e "$dotswift_directory/sites/$site/tc.data" ) { - die "Unable to find tc.data for $site\n"; - } - cat_file( "$dotswift_directory/sites/$site/sites.xml", - "$run_directory/sites.xml" ); - cat_file( "$dotswift_directory/sites/$site/tc.data", - "$run_directory/tc.data" ); - } + } } + # Link input data foreach my $input_file (@option_inputs) { # Check for relative path @@ -91,14 +118,9 @@ || die "Unable to create symlink to $new_path\n"; } -# Complete XML tags -open( SITEFILE, "$run_directory/sites.xml" ) - || die "Unable to open $run_directory/sites.xml\n"; -my @sitedata = ; -close(SITEFILE); open( SITEFILE, ">$run_directory/sites.xml" ) || die "Unable to open $run_directory/sites.xml for writing\n"; -print SITEFILE "\n at sitedata\n"; +print SITEFILE "\n at sites_xml\n"; close(SITEFILE); # Run swift Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-15 22:20:15 UTC (rev 3538) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 05:35:45 UTC (rev 3539) @@ -16,25 +16,19 @@ require Exporter; our @ISA = qw(Exporter); - -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. - -# This allows declaration use SwiftConfig ':all'; -# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK -# will save memory. -our %EXPORT_TAGS = ( 'all' => [ qw( -) ] ); +our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw(create_directory get_entry add_ssh remove_ssh update_tc_hostname update_xml write_file print_directory strip_directory -copy_file cat_file +copy_file cat_file add_application edit_application remove_application +list_applications initialize_swiftconfig ); our $VERSION = '0.01'; # Prepare data my $xml = new XML::Simple(); +my @execution_providers = + ( "gt4", "local", "pbs", "condor", "ssh", "coaster", ); # Create a new directory if it does not exist sub create_directory { @@ -221,7 +215,7 @@ sub update_xml { # Set up data - my ($xml_filename, $edit_mode, $option_default, @execution_providers) = @_; + my ($xml_filename, $edit_mode, $option_default) = @_; # Values for edit mode # 0 - Edit all # 1 - All but name @@ -248,7 +242,7 @@ 'Execution Provider', $xml_ref->{execution}{provider}, $option_default, - @execution_providers, + @execution_providers, ); my $current_exprovider = $xml_ref->{execution}{provider}; @@ -331,7 +325,6 @@ 'Filesystem Provider', $xml_ref->{filesystem}{provider}, $option_default, - @execution_providers, ); } if ( $xml_ref->{filesystem}{url} ) { @@ -345,7 +338,6 @@ $profile->{content} = get_entry( $profile->{key}, $profile->{content}, $option_default); } - return $xml_ref; } @@ -403,6 +395,155 @@ return $filename; } +# Add an application +sub add_application { + my ($app_filename) = @_; + open(APPFILE, "+<$app_filename") || die "Unable to open application file $app_filename for writing\n"; + + print "Enter name of new application: "; + my $app_name = ; + chomp($app_name); + foreach(){ + my ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); + if($name eq $app_name) { + print "$name already exists\n"; + return; + } + } + my $app_path_guess = which("$app_name"); + if(!$app_path_guess) { + $app_path_guess = "/path/to/$app_name"; + } + my $app_path = get_entry("Path", $app_path_guess, 0); + my $app_time = get_entry("Walltime (hh:mm:ss)", "00:20:00", 0); + while($app_time !~ m/(\d+:\d+:\d+)/ ) { + print "Error: incorrect format\n"; + $app_time = get_entry("Walltime", $1, 0); + } + print APPFILE "\$HOST\t$app_name\t$app_path\tINSTALLED\tINTEL32::LINUX\tGLOBUS::maxwalltime=\"$app_time\"\n"; + close(APPFILE); + print "Added $app_name\n"; +} + +# Remove an application +sub remove_application { + my ($app_filename) = @_; + open(APPFILE, "$app_filename") || die "Unable to open application file $app_filename\n"; + my $app_to_remove = get_entry("Name of application to remove", '', 0); + my @app_data; + my $found=0; + foreach my $line (){ + my ($site, $name, $path, $status, $platform, $profile) = split(/\s+/, $line); + if($name eq $app_to_remove) { + $found=1; + } + else { + push(@app_data, $line); + } + } + close(APPFILE); + if(!$found) { + print "Unable to find application named $app_to_remove\n"; + return; + } + else { + write_file($app_filename, @app_data); + print "Removed $app_to_remove\n"; + } +} + +# List applications +sub list_applications { + my ($app_filename) = @_; + open(APPFILE, $app_filename) || die "Unable to open application file $app_filename\n"; + my @app_data = ; + close(APPFILE); + my ($site, $name, $path, $status, $platform, $profile); + my $counter=0; + foreach(@app_data) { + ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); + my $nicely_formatted = sprintf("%-15s %-30s %-35s", $name, $path, $profile); + print "$nicely_formatted\n"; + } + +} + +# Edit application +sub edit_application { + my ($app_filename) = @_; + open(APPFILE, $app_filename) || die "Unable to open application file $app_filename\n"; + my @app_data = ; + close(APPFILE); + print "Application to edit: "; + my $app_to_edit = ; + chomp($app_to_edit); + + my $found=0; + foreach(@app_data) { + my ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); + if( $name eq $app_to_edit) { + $found=1; + my $previous_name = $name; + # App name + $name = get_entry("New application name", $name, 0); + if($name ne $previous_name) { + $path = which("$name"); + } + # Path + if(!$path) { + $path = "/path/app"; + } + $path = get_entry("New path", $path, 0); + # Time + my $time = ''; + my $wallfound=0; + my $counter=0; + my @profiles = split(/;/, $profile); + foreach (@profiles) { + if( m/maxwalltime=\"(\d+:\d+:\d+)\"/ig ) { + $wallfound=1; + $time = get_entry("Walltime", $1, 0); + while($time !~ m/(\d+:\d+:\d+)/ ) { + print "Error: incorrect format\n"; + $time = get_entry("Walltime", $1, 0); + } + s/(\d+:\d+:\d+)/$time/g; + } + } + if( !$wallfound ) { + $time = get_entry("Time", "00:20:00", 0); + push(@profiles, "GLOBUS::maxwalltime=\"$time\""); + } + $profile = join(';', @profiles); + $_ = "$site\t$name\t$path\t$status\t$platform\t$profile\n"; + } + } + + if(!$found) { + print "Unable to find application named $app_to_edit\n"; + return; + } + else { + print "$app_to_edit updated\n"; + } + open(APPFILE, ">$app_filename") || die "Unable to open application file $app_filename for writing\n"; + print APPFILE @app_data; + close(APPFILE); +} + +# Initialize swiftconfig. Prepare things it needs for first run +sub initialize_swiftconfig { + create_directory("$ENV{'HOME'}/.swift"); + create_directory("$ENV{'HOME'}/.swift/sites"); + if(!-e "$ENV{'HOME'}/.swift/apps") { + create_directory("$ENV{'HOME'}/.swift/apps"); + my @app_files = glob("$FindBin::Bin/../etc/apps/*.apps"); + foreach my $app_file(@app_files) { + copy_file($app_file, "$ENV{'HOME'}/.swift/apps"); + } + } +} + 1; __END__ @@ -443,12 +584,11 @@ $filename is the filename of the tc.data $tc_hostname is the value of the new hostname -update_xml($xml_filename, $edit_mode, $option_default, @execution_providers) +update_xml($xml_filename, $edit_mode, $option_default) Edit and update a sites.xml file $xml_filename filename to edit There are currently two edit modes: 0=edit everything, 1=everything but name $option_default, if true, will automatically use defaults - @execution_providers is the list of all valid execution providers write_file($filename, @data) Write to $filename with @data. Handle errors From noreply at svn.ci.uchicago.edu Mon Aug 16 01:34:44 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 01:34:44 -0500 (CDT) Subject: [Swift-commit] r3540 - in usertools/swift/swiftconfig: etc etc/apps lib/perl Message-ID: <20100816063444.0F04D9D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 01:34:43 -0500 (Mon, 16 Aug 2010) New Revision: 3540 Added: usertools/swift/swiftconfig/etc/apps/ usertools/swift/swiftconfig/etc/apps/imagemagick.apps usertools/swift/swiftconfig/etc/apps/linux.apps Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Default apps Added: usertools/swift/swiftconfig/etc/apps/imagemagick.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/imagemagick.apps (rev 0) +++ usertools/swift/swiftconfig/etc/apps/imagemagick.apps 2010-08-16 06:34:43 UTC (rev 3540) @@ -0,0 +1,11 @@ +$HOST convert /usr/bin/convert INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST mogrify /usr/bin/mogrify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST identify /usr/bin/identify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST composite /usr/bin/composite INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST montage /usr/bin/montage INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST compare /usr/bin/compare INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST stream /usr/bin/stream INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST display /usr/bin/display INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST animate /usr/bin/animate INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST import /usr/bin/import INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +$HOST conjure /usr/bin/conjure INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" Added: usertools/swift/swiftconfig/etc/apps/linux.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/linux.apps (rev 0) +++ usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-16 06:34:43 UTC (rev 3540) @@ -0,0 +1,7 @@ +$HOST echo /bin/echo INSTALLED INTEL32::LINUX $TIME +$HOST cat /bin/cat INSTALLED INTEL32::LINUX $TIME +$HOST ls /bin/ls INSTALLED INTEL32::LINUX $TIME +$HOST grep /bin/grep INSTALLED INTEL32::LINUX $TIME +$HOST sort /bin/sort INSTALLED INTEL32::LINUX $TIME +$HOST paste /bin/paste INSTALLED INTEL32::LINUX $TIME + Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 05:35:45 UTC (rev 3539) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 06:34:43 UTC (rev 3540) @@ -462,8 +462,10 @@ my $counter=0; foreach(@app_data) { ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); - my $nicely_formatted = sprintf("%-15s %-30s %-35s", $name, $path, $profile); - print "$nicely_formatted\n"; + if($name) { + my $nicely_formatted = sprintf("%-15s %-30s %-35s", $name, $path, $profile); + print "$nicely_formatted\n"; + } } } From noreply at svn.ci.uchicago.edu Mon Aug 16 01:56:02 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 01:56:02 -0500 (CDT) Subject: [Swift-commit] r3541 - usertools/swift/swiftconfig/etc/apps Message-ID: <20100816065602.C8A0F9CC8F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 01:56:02 -0500 (Mon, 16 Aug 2010) New Revision: 3541 Modified: usertools/swift/swiftconfig/etc/apps/linux.apps Log: linux app Modified: usertools/swift/swiftconfig/etc/apps/linux.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-16 06:34:43 UTC (rev 3540) +++ usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-16 06:56:02 UTC (rev 3541) @@ -1,7 +1,7 @@ -$HOST echo /bin/echo INSTALLED INTEL32::LINUX $TIME -$HOST cat /bin/cat INSTALLED INTEL32::LINUX $TIME -$HOST ls /bin/ls INSTALLED INTEL32::LINUX $TIME -$HOST grep /bin/grep INSTALLED INTEL32::LINUX $TIME -$HOST sort /bin/sort INSTALLED INTEL32::LINUX $TIME -$HOST paste /bin/paste INSTALLED INTEL32::LINUX $TIME - +$HOST echo /bin/echo INSTALLED INTEL32::LINUX null +$HOST cat /bin/cat INSTALLED INTEL32::LINUX null +$HOST ls /bin/ls INSTALLED INTEL32::LINUX null +$HOST grep /bin/grep INSTALLED INTEL32::LINUX null +$HOST sort /bin/sort INSTALLED INTEL32::LINUX null +$HOST paste /bin/paste INSTALLED INTEL32::LINUX null +$HOST wc /usr/bin/wc INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Mon Aug 16 10:57:42 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 10:57:42 -0500 (CDT) Subject: [Swift-commit] r3542 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100816155742.3E5989D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 10:57:42 -0500 (Mon, 16 Aug 2010) New Revision: 3542 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Application sets per host Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 06:56:02 UTC (rev 3541) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 15:57:42 UTC (rev 3542) @@ -62,7 +62,7 @@ my $from_directory = "$template_directory/$option_template"; my $sites_input_file = "$from_directory/sites.xml"; if ( !-e "$sites_input_file" ) { - die "Unable to find configuration for $sites_input_file\n"; + die "Unable to find template for $option_template\n"; } my $xml_ref = update_xml("$sites_input_file", 0, $option_default); my $new_sitename = $xml_ref->{handle}; @@ -84,10 +84,11 @@ ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - if ( $option_template ne $new_sitename ) { - my $tc_filename = "$output_directory/tc.data"; - update_tc_hostname( "$tc_filename", $new_sitename ); - } + update_site_applications($new_sitename); + #if ( $option_template ne $new_sitename ) { + # my $tc_filename = "$output_directory/tc.data"; + # update_tc_hostname( "$tc_filename", $new_sitename ); + #} # Handle SSH if ( $xml_ref->{execution}{provider} eq 'ssh' ) { @@ -164,6 +165,8 @@ ); write_file( "$output_directory/sites.xml", $xml_out_ref ); + update_site_applications($option_edit); + # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 06:56:02 UTC (rev 3541) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 15:57:42 UTC (rev 3542) @@ -25,8 +25,14 @@ 'help|man' => sub { pod2usage(-verbose => 2); }, ); +# Check arguments +initialize_swiftconfig(); +if(!$option_script || !@option_sites) { + print "Incorrect usage. Try swiftrun -help\n"; + exit; +} + # Create run directory -initialize_swiftconfig(); my $script_filename = strip_directory($option_script); my $dotswift_directory = "$ENV{'HOME'}/.swift"; my @run_directories = ; @@ -55,8 +61,23 @@ push(@sites_xml, @current_site_data); close(CURRENT_SITE); # Add applications - my @all_apps = glob("$dotswift_directory/apps/*.apps"); + my @all_apps; + if(-e "$all_site/apps") { + open(APPFILE, "$all_site/apps") + || die "Unable to open $all_site/apps"; + @all_apps = ; + close(APPFILE); + foreach(@all_apps) { + chomp($_); + $_ = "$dotswift_directory/apps/$_.apps\n"; + } + } + else { + @all_apps = glob("$dotswift_directory/apps/*.apps"); + } foreach my $current_app_file(@all_apps) { + chomp($current_app_file); + print "About to open $current_app_file\n"; open(CURRENT_APP, $current_app_file) || die "Unable to open app file $current_app_file\n"; my @current_app_data = ; close(CURRENT_APP); @@ -85,8 +106,22 @@ my @current_site_data = ; close(CURRENT_SITE); push(@sites_xml, @current_site_data); + # Add applications - my @all_apps = glob("$dotswift_directory/apps/*.apps"); + my @all_apps; + if(-e "$dotswift_directory/sites/$site/apps") { + open(APPFILE, "$dotswift_directory/sites/$site/apps") + || die "Unable to open $site/apps"; + @all_apps = ; + close(APPFILE); + foreach(@all_apps) { + chomp($_); + $_ = "$dotswift_directory/apps/$_.apps"; + } + } + else { + @all_apps = glob("$dotswift_directory/apps/*.apps"); + } foreach my $current_app_file(@all_apps) { open(CURRENT_APP, $current_app_file) || die "Unable to open app file $current_app_file\n"; my @current_app_data = ; Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 06:56:02 UTC (rev 3541) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 15:57:42 UTC (rev 3542) @@ -21,7 +21,7 @@ our @EXPORT = qw(create_directory get_entry add_ssh remove_ssh update_tc_hostname update_xml write_file print_directory strip_directory copy_file cat_file add_application edit_application remove_application -list_applications initialize_swiftconfig +list_applications initialize_swiftconfig update_site_applications ); our $VERSION = '0.01'; @@ -546,6 +546,50 @@ } } +sub update_site_applications { + my ($site) = @_; + my $apps = ''; + + if(! -d "$ENV{'HOME'}/.swift/sites/$site") { + print "Unable to find configuration for $site\n"; + return; + } + + if(-e "$ENV{'HOME'}/.swift/sites/apps") { + open(APPLIST, "$ENV{'HOME'}/.swift/sites/apps") + || die "Unable to open app list $ENV{'HOME'}/.swift/sites/apps"; + my @apps_file_data = ; + close(APPLIST); + foreach my $current_app (@apps_file_data) { + if($apps) { + $apps = "$apps $current_app"; + } + else { + $apps = "$current_app"; + } + } + } + + my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); + print "Available application sets are: "; + foreach(@all_available_appsets) { + $_ = strip_directory($_); + ($_, my $junk) = split('\.'); + print "$_ "; + } + print "\n"; + + print "Enter applications sets for $site: "; + $apps = ; + chomp($apps); + my @all_list = split(/ /, $apps); + open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps") + || die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n"; + foreach(@all_list) { + print APPFILE "$_\n"; + } + close(APPFILE); +} 1; __END__ From noreply at svn.ci.uchicago.edu Mon Aug 16 12:40:59 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 12:40:59 -0500 (CDT) Subject: [Swift-commit] r3543 - in usertools/swift/swiftconfig: bin etc lib/perl Message-ID: <20100816174059.60AAE9D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 12:40:59 -0500 (Mon, 16 Aug 2010) New Revision: 3543 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/etc/TODO usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Import of existing, standard sites.xml files into swiftconfig format Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 15:57:42 UTC (rev 3542) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 17:40:59 UTC (rev 3543) @@ -13,6 +13,7 @@ use Getopt::Long; use XML::Simple; use File::Which qw(which where); +use Data::Dumper; # Variables used for sites.xml my $option_templates = q{}; # List all templates @@ -24,6 +25,7 @@ my $option_template = q{}; # Create config from template specified my $option_copy = q{}; # Copy an existing configuration my $option_applications = q{}; # Edit applications +my $option_import = q{}; # Import existing configuration # Assign variables from command line options GetOptions( @@ -37,7 +39,8 @@ 'edit=s' => \$option_edit, 'copy=s' => \$option_copy, 'apps|applications' => \$option_applications, - 'help|man' => sub { pod2usage(-verbose => 2); }, + 'import=s' => \$option_import, + 'help|man' => sub { pod2usage(-verbose => 2); }, ); # Prepare data @@ -85,10 +88,6 @@ write_file( "$output_directory/sites.xml", $xml_out_ref ); update_site_applications($new_sitename); - #if ( $option_template ne $new_sitename ) { - # my $tc_filename = "$output_directory/tc.data"; - # update_tc_hostname( "$tc_filename", $new_sitename ); - #} # Handle SSH if ( $xml_ref->{execution}{provider} eq 'ssh' ) { @@ -111,17 +110,6 @@ if ( !-d "$dotswift_directory/sites/$option_remove" ) { die "Unable to find configuration named $option_remove\n"; } - - # Remove SSH entry if needed - #my $xml_filename = "$dotswift_directory/sites/$option_remove/sites.xml"; - #my $xml_ref = $xml->XMLin( - # $xml_filename, - # ForceArray => [qw(workdirectory profile)], - # KeyAttr => [], - #); - #if($xml_ref->{execution}{provider} eq "ssh") { - # remove_ssh($xml_ref->{execution}{url}); - #} # Remove directory rmtree("$dotswift_directory/sites/$option_remove") @@ -277,9 +265,41 @@ elsif(lc($edit_or_add) eq 'e') { edit_application("$dotswift_directory/apps/$application_set.apps"); } - } + } } +# Import existing configurations +if($option_import) { + if(! -e $option_import) { + die "Unable to find file to import: $option_import\n"; + } + + my $xml_ref = $xml->XMLin( + $option_import, + ForceArray => [qw(workdirectory profile pool)], + KeyAttr => "pool", + ); + + foreach my $pool ( @{$xml_ref->{pool}} ) { + if(-d "$dotswift_directory/sites/$pool->{handle}") { + print "Configuration for $pool->{handle} already exists. Skipping\n"; + } + else { + create_directory("$dotswift_directory/sites/$pool->{handle}"); + my $xml_out_ref = $xml->XMLout( + $pool, + RootName => 'pool', + SuppressEmpty => 1, + ); + write_file("$dotswift_directory/sites/$pool->{handle}/sites.xml", + $xml_out_ref ); + update_site_applications($pool->{handle}); + print "Successfully imported $pool->{handle}\n\n"; + } + } +} + + __END__ =head1 NAME Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 15:57:42 UTC (rev 3542) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 17:40:59 UTC (rev 3543) @@ -173,6 +173,7 @@ } # Execute +print "Executing: $system_command\n"; system($system_command); __END__ Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-16 15:57:42 UTC (rev 3542) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-16 17:40:59 UTC (rev 3543) @@ -1,14 +1,9 @@ -TC editing -In the short term, re-add ability to edit TC file with an interactive editor -Longer term, eliminate TC and search PATH instead - Running and testing on more setups, OSG, teragrid, others Job tagging with search capabilities -Ability to create groups of related sites for runs, ability to run on all -sites (-site all, -site mygroup, etc) +Ability to group groups of sites (other than 'all') Have swiftrun be flexible enough to work for new users, as well as advanced users -Add -help or similar +swiftconfig -import to allow integration with existing configurations Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 15:57:42 UTC (rev 3542) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 17:40:59 UTC (rev 3543) @@ -579,7 +579,7 @@ } print "\n"; - print "Enter applications sets for $site: "; + print "Enter application sets for $site: "; $apps = ; chomp($apps); my @all_list = split(/ /, $apps); From noreply at svn.ci.uchicago.edu Mon Aug 16 13:17:07 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 13:17:07 -0500 (CDT) Subject: [Swift-commit] r3544 - in usertools/swift/swiftconfig: bin etc Message-ID: <20100816181707.AB43B9D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 13:17:07 -0500 (Mon, 16 Aug 2010) New Revision: 3544 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/etc/TODO Log: Replaced -templates and -describe with -list swiftconfig -list templates swiftconfig -list configs swiftconfig -list Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 17:40:59 UTC (rev 3543) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 18:17:07 UTC (rev 3544) @@ -16,7 +16,7 @@ use Data::Dumper; # Variables used for sites.xml -my $option_templates = q{}; # List all templates +my $option_list = q{}; # List information about config my $option_remove = q{}; # Remove entry from sites.xml my $option_edit = q{}; # Edit mode my $option_sites = q{}; # List all usable sites @@ -30,7 +30,6 @@ # Assign variables from command line options GetOptions( 'remove=s' => \$option_remove, - 'templates' => \$option_templates, 'sites' => \$option_sites, 'describe=s' => \$option_describe, 'default|defaults' => \$option_default, @@ -40,6 +39,7 @@ 'copy=s' => \$option_copy, 'apps|applications' => \$option_applications, 'import=s' => \$option_import, + 'list=s' => \$option_list, 'help|man' => sub { pod2usage(-verbose => 2); }, ); @@ -95,15 +95,6 @@ } } -# Describe a site -if ($option_describe) { - my $site_file = "$dotswift_directory/sites/$option_describe/sites.xml"; - if ( !-e $site_file ) { - die "Unable to locate configuration for $option_describe\n"; - } - system("cat $site_file"); -} - # Remove an entry if ($option_remove) { @@ -117,11 +108,6 @@ . "$dotswift_directory/sites/$option_remove\n"; } -# List all available templates -if ($option_templates) { - print_directory($template_directory); -} - # List all user-added sites if ($option_sites) { print_directory("$dotswift_directory/sites"); @@ -299,7 +285,22 @@ } } +if($option_list) { + if ($option_list eq "templates") { + print_directory($template_directory); + } + elsif ($option_list eq "configs") { + print_directory("$dotswift_directory/sites"); + } + # Assume it's the name of a configuration + else { + my @matched_configs = glob("$dotswift_directory/sites/$option_list"); + foreach my $site (@matched_configs) { + system("cat $site/sites.xml"); + } + } +} __END__ =head1 NAME @@ -324,10 +325,12 @@ -templates Display all available templates -sites Displays all existing configurations -edit site Specifies the name of a configuration to edit - -describe site Prints the raw XML site configuration -copy site Copies a configuration -default Do not prompt for values, always use defaults -full Edit every available configuration option + -import Import a sites.xml file into swiftconfig + -list Options: templates, configs, or a config + -apps Edit or create application sets =head1 EXAMPLES @@ -342,4 +345,17 @@ Remove a site swiftconfig -remove teraport + +Edit application sets + swiftconfig -apps + +List available templates + swiftconfig -list templates + +List all configurations + swiftconfig -list configs + +List information about one particular configuration + swiftconfig -list configuration_name + =cut Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-16 17:40:59 UTC (rev 3543) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-16 18:17:07 UTC (rev 3544) @@ -1,9 +1,6 @@ Running and testing on more setups, OSG, teragrid, others - Job tagging with search capabilities - Ability to group groups of sites (other than 'all') - Have swiftrun be flexible enough to work for new users, as well as advanced users - -swiftconfig -import to allow integration with existing configurations +Site aliases +Ability to "undo" edits From noreply at svn.ci.uchicago.edu Mon Aug 16 13:49:25 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 13:49:25 -0500 (CDT) Subject: [Swift-commit] r3545 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100816184925.E68359CC8F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 13:49:25 -0500 (Mon, 16 Aug 2010) New Revision: 3545 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Remove version restrictions Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 18:17:07 UTC (rev 3544) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 18:49:25 UTC (rev 3545) @@ -19,7 +19,6 @@ my $option_list = q{}; # List information about config my $option_remove = q{}; # Remove entry from sites.xml my $option_edit = q{}; # Edit mode -my $option_sites = q{}; # List all usable sites my $option_describe = q{}; # Print raw XML configuration my $option_default = q{}; # When adding a site, use all defaults my $option_template = q{}; # Create config from template specified @@ -30,7 +29,6 @@ # Assign variables from command line options GetOptions( 'remove=s' => \$option_remove, - 'sites' => \$option_sites, 'describe=s' => \$option_describe, 'default|defaults' => \$option_default, 'full' => sub { $option_default = 0; }, @@ -108,11 +106,6 @@ . "$dotswift_directory/sites/$option_remove\n"; } -# List all user-added sites -if ($option_sites) { - print_directory("$dotswift_directory/sites"); -} - # Modify a site entry if ($option_edit) { my $output_directory = "$dotswift_directory/sites/$option_edit"; @@ -323,7 +316,6 @@ -template sitename Add a configuration based on a template -remove site Removes a site configuration -templates Display all available templates - -sites Displays all existing configurations -edit site Specifies the name of a configuration to edit -copy site Copies a configuration -default Do not prompt for values, always use defaults Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 18:17:07 UTC (rev 3544) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 18:49:25 UTC (rev 3545) @@ -1,6 +1,5 @@ package SwiftConfig; -use 5.010001; use strict; use warnings; @@ -555,12 +554,13 @@ return; } - if(-e "$ENV{'HOME'}/.swift/sites/apps") { - open(APPLIST, "$ENV{'HOME'}/.swift/sites/apps") - || die "Unable to open app list $ENV{'HOME'}/.swift/sites/apps"; + if(-e "$ENV{'HOME'}/.swift/sites/$site/apps") { + open(APPLIST, "$ENV{'HOME'}/.swift/sites/$site/apps") + || die "Unable to open app list $ENV{'HOME'}/.swift/sites/$site/apps"; my @apps_file_data = ; close(APPLIST); foreach my $current_app (@apps_file_data) { + print "Looking at: $current_app\n"; if($apps) { $apps = "$apps $current_app"; } @@ -569,6 +569,7 @@ } } } + print "Apps: $apps\n"; my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); print "Available application sets are: "; @@ -579,9 +580,7 @@ } print "\n"; - print "Enter application sets for $site: "; - $apps = ; - chomp($apps); + $apps = get_entry("Application sets for $site", $apps, 0); my @all_list = split(/ /, $apps); open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps") || die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n"; From noreply at svn.ci.uchicago.edu Mon Aug 16 14:45:14 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 14:45:14 -0500 (CDT) Subject: [Swift-commit] r3546 - in usertools/swift/swiftconfig: bin etc etc/apps lib/perl Message-ID: <20100816194514.62CF19CC8F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 14:45:14 -0500 (Mon, 16 Aug 2010) New Revision: 3546 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/etc/TODO usertools/swift/swiftconfig/etc/apps/imagemagick.apps usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Importer to existing TC files Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 18:49:25 UTC (rev 3545) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 19:45:14 UTC (rev 3546) @@ -131,7 +131,6 @@ SuppressEmpty => 1, ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - update_site_applications($option_edit); # Add/modify/remove ssh entries as needed @@ -249,32 +248,11 @@ # Import existing configurations if($option_import) { - if(! -e $option_import) { - die "Unable to find file to import: $option_import\n"; + if($option_import =~ m/\.xml/gi) { + import_xml($option_import); } - - my $xml_ref = $xml->XMLin( - $option_import, - ForceArray => [qw(workdirectory profile pool)], - KeyAttr => "pool", - ); - - foreach my $pool ( @{$xml_ref->{pool}} ) { - if(-d "$dotswift_directory/sites/$pool->{handle}") { - print "Configuration for $pool->{handle} already exists. Skipping\n"; - } - else { - create_directory("$dotswift_directory/sites/$pool->{handle}"); - my $xml_out_ref = $xml->XMLout( - $pool, - RootName => 'pool', - SuppressEmpty => 1, - ); - write_file("$dotswift_directory/sites/$pool->{handle}/sites.xml", - $xml_out_ref ); - update_site_applications($pool->{handle}); - print "Successfully imported $pool->{handle}\n\n"; - } + if($option_import =~ m/\.data/gi) { + import_tc($option_import); } } Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 18:49:25 UTC (rev 3545) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 19:45:14 UTC (rev 3546) @@ -83,7 +83,7 @@ close(CURRENT_APP); $all_site = strip_directory($all_site); foreach(@current_app_data) { - s/\$HOST/$all_site/ig; + s/SWIFTCONFIGURATION/$all_site/ig; } open(RUNTC, ">>$run_directory/tc.data") || die "Unable to write to $run_directory/tc.data\n"; print RUNTC @current_app_data; @@ -127,7 +127,7 @@ my @current_app_data = ; close(CURRENT_APP); foreach(@current_app_data) { - s/\$HOST/$site/ig; + s/SWIFTCONFIGURATION/$site/ig; } open(RUNTC, ">>$run_directory/tc.data") || die "Unable to write to $run_directory/tc.data\n"; print RUNTC @current_app_data; @@ -173,7 +173,6 @@ } # Execute -print "Executing: $system_command\n"; system($system_command); __END__ Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-16 18:49:25 UTC (rev 3545) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-16 19:45:14 UTC (rev 3546) @@ -4,3 +4,4 @@ Have swiftrun be flexible enough to work for new users, as well as advanced users Site aliases Ability to "undo" edits +Replace $HOST in app templates with something else Modified: usertools/swift/swiftconfig/etc/apps/imagemagick.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/imagemagick.apps 2010-08-16 18:49:25 UTC (rev 3545) +++ usertools/swift/swiftconfig/etc/apps/imagemagick.apps 2010-08-16 19:45:14 UTC (rev 3546) @@ -1,11 +1,11 @@ -$HOST convert /usr/bin/convert INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST mogrify /usr/bin/mogrify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST identify /usr/bin/identify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST composite /usr/bin/composite INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST montage /usr/bin/montage INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST compare /usr/bin/compare INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST stream /usr/bin/stream INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST display /usr/bin/display INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST animate /usr/bin/animate INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST import /usr/bin/import INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" -$HOST conjure /usr/bin/conjure INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION convert /usr/bin/convert INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION mogrify /usr/bin/mogrify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION identify /usr/bin/identify INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION composite /usr/bin/composite INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION montage /usr/bin/montage INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION compare /usr/bin/compare INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION stream /usr/bin/stream INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION display /usr/bin/display INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION animate /usr/bin/animate INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION import /usr/bin/import INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION conjure /usr/bin/conjure INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 18:49:25 UTC (rev 3545) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 19:45:14 UTC (rev 3546) @@ -20,7 +20,8 @@ our @EXPORT = qw(create_directory get_entry add_ssh remove_ssh update_tc_hostname update_xml write_file print_directory strip_directory copy_file cat_file add_application edit_application remove_application -list_applications initialize_swiftconfig update_site_applications +list_applications initialize_swiftconfig update_site_applications import_tc +import_xml ); our $VERSION = '0.01'; @@ -560,7 +561,6 @@ my @apps_file_data = ; close(APPLIST); foreach my $current_app (@apps_file_data) { - print "Looking at: $current_app\n"; if($apps) { $apps = "$apps $current_app"; } @@ -569,7 +569,6 @@ } } } - print "Apps: $apps\n"; my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); print "Available application sets are: "; @@ -580,7 +579,10 @@ } print "\n"; - $apps = get_entry("Application sets for $site", $apps, 0); + print "Application sets for $site: "; + $apps = ; + chomp($apps); + my @all_list = split(/ /, $apps); open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps") || die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n"; @@ -588,7 +590,59 @@ print APPFILE "$_\n"; } close(APPFILE); + print "Successfully saved application sets for $site\n\n"; } + +sub import_xml { + my ($xml_filename) = @_; + if(! -e $xml_filename) { + die "Unable to find file to import: $xml_filename\n"; + } + + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile pool)], + KeyAttr => "pool", + ); + + foreach my $pool ( @{$xml_ref->{pool}} ) { + if(-d "$ENV{'HOME'}/.swift/sites/$pool->{handle}") { + print "Configuration for $pool->{handle} already exists. Skipping\n"; + } + else { + create_directory("$ENV{'HOME'}/.swift/sites/$pool->{handle}"); + my $xml_out_ref = $xml->XMLout( + $pool, + RootName => 'pool', + SuppressEmpty => 1, + ); + write_file("$ENV{'HOME'}/.swift/sites/$pool->{handle}/sites.xml", + $xml_out_ref ); + update_site_applications($pool->{handle}); + } + } +} + +sub import_tc { + my ($tc_filename) = @_; + if(! -e $tc_filename) { + die "Unable to find file to import: $tc_filename\n"; + } + open(TCFILE, $tc_filename) || die "Unable to open $tc_filename for reading\n"; + my @tc_data = ; + close(TCFILE); + foreach(@tc_data) { + my ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); + $site = "SWIFTCONFIGURATION"; + $_ = "$site\t$name\t$path\t$status\t$platform\t$profile\n"; + } + print "Enter name to call this application set: "; + my $set_name = ; + chomp($set_name); + write_file("$ENV{'HOME'}/.swift/apps/$set_name.apps", @tc_data); + print "Successfully imported application set named $set_name\n"; +} + 1; __END__ From noreply at svn.ci.uchicago.edu Mon Aug 16 15:39:41 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 15:39:41 -0500 (CDT) Subject: [Swift-commit] r3547 - usertools/swift/swiftconfig/lib/perl Message-ID: <20100816203941.ED5F19CC8F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 15:39:41 -0500 (Mon, 16 Aug 2010) New Revision: 3547 Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Improvements to tc imports Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 19:45:14 UTC (rev 3546) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 20:39:41 UTC (rev 3547) @@ -634,6 +634,15 @@ foreach(@tc_data) { my ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); $site = "SWIFTCONFIGURATION"; + if(!$name) { + $_ = ''; + next; + } + my $first_character = substr( $_, 0, 1 ); + if ( $first_character eq '#' ) { + $_ = ''; + next; + } $_ = "$site\t$name\t$path\t$status\t$platform\t$profile\n"; } print "Enter name to call this application set: "; From noreply at svn.ci.uchicago.edu Mon Aug 16 16:37:11 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 16:37:11 -0500 (CDT) Subject: [Swift-commit] r3548 - trunk/tests/language/working Message-ID: <20100816213711.DA2D99D17C@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-16 16:37:11 -0500 (Mon, 16 Aug 2010) New Revision: 3548 Added: trunk/tests/language/working/050-operators.swift Removed: trunk/tests/language/working/operators.swift Log: Rename operators test This conflicted with the Swift lib operators.xml Copied: trunk/tests/language/working/050-operators.swift (from rev 3532, trunk/tests/language/working/operators.swift) =================================================================== --- trunk/tests/language/working/050-operators.swift (rev 0) +++ trunk/tests/language/working/050-operators.swift 2010-08-16 21:37:11 UTC (rev 3548) @@ -0,0 +1,5 @@ + +boolean a = (1 != 2); + +int b = +3; + Deleted: trunk/tests/language/working/operators.swift =================================================================== --- trunk/tests/language/working/operators.swift 2010-08-16 20:39:41 UTC (rev 3547) +++ trunk/tests/language/working/operators.swift 2010-08-16 21:37:11 UTC (rev 3548) @@ -1,5 +0,0 @@ - -boolean a = (1 != 2); - -int b = +3; - From noreply at svn.ci.uchicago.edu Mon Aug 16 16:39:28 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 16:39:28 -0500 (CDT) Subject: [Swift-commit] r3549 - trunk/tests Message-ID: <20100816213928.0E3299D17C@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-16 16:39:27 -0500 (Mon, 16 Aug 2010) New Revision: 3549 Modified: trunk/tests/nightly.sh Log: Monitor Swift processes via background processes; kill cases that hang Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-16 21:37:11 UTC (rev 3548) +++ trunk/tests/nightly.sh 2010-08-16 21:39:27 UTC (rev 3549) @@ -6,8 +6,8 @@ # are willing to check out the whole Swift source and # generate many small test files. -# The script will checkout Swift, run several tests, -# in a subdirectory called run-DATE, including generating +# The script will checkout Swift, run several tests +# in a subdirectory called run-DATE, and generate # useful HTML output and tests.log # Run nightly.sh -h for quick help @@ -33,8 +33,8 @@ echo "nightly.sh " echo "" echo "usage:" - printf "\t -a Do not run ant \n" - printf "\t -c Do not clean \n" + printf "\t -a Do not run ant dist \n" + printf "\t -c Do not remove dist (clean) \n" printf "\t -g Do not run grid tests \n" printf "\t -h This message \n" printf "\t -k Skip first N tests \n" @@ -123,6 +123,12 @@ mkdir -p $RUNDIR [ $? != 0 ] && echo "Could not mkdir: $RUNDIR" && exit 1 +crash() { + MSG=$1 + echo $MSG + exit 1 +} + header() { CURRENT=$SCRIPTDIR/html/current.html sed "s at _HTMLBASE_@$HTMLPATH@" < $CURRENT > $TOPDIR/current.html @@ -293,12 +299,12 @@ WIDTH=$( width "$LABEL" ) if [ "$RESULT" == "Passed" ]; then html "" - html_a_href $TLOG "$LABEL" + html_a_href $TEST_LOG "$LABEL" else echo "FAILED" - cat $TLOG < /dev/null + cat $TEST_LOG < /dev/null html "" - html_a_href $TLOG $LABEL + html_a_href $TEST_LOG $LABEL fi html_~td @@ -358,13 +364,13 @@ echo $WIDTH } -# TLOG = test log +# TEST_LOG = test log test_log() { - TLOG="output_$LOGCOUNT.txt" - rm -fv $TLOG - banner "$LASTCMD" $RUNDIR/$TLOG + TEST_LOG="output_$LOGCOUNT.txt" + rm -fv $TEST_LOG + banner "$LASTCMD" $RUNDIR/$TEST_LOG if [ -f $OUTPUT ]; then - cp -v $OUTPUT $RUNDIR/$TLOG 2>>$LOG + cp -v $OUTPUT $RUNDIR/$TEST_LOG 2>>$LOG cp -v $OUTPUT stdout.txt fi let "LOGCOUNT=$LOGCOUNT+1" @@ -379,17 +385,20 @@ } banner() { - if [ "$2" == "" ]; then - BOUT=$LOG + MSG=$1 + FILE=$2 + + if [ "$FILE" == "" ]; then + BANNER_OUTPUT=$LOG else - BOUT=$2 + BANNER_OUTPUT=$2 fi { echo "" # stars - echo "* $1" + echo "* $MSG" # stars - } >>$BOUT + } >> $BANNER_OUTPUT } # Check for early bailout condition @@ -401,7 +410,7 @@ fi } -# Translate exit code into result (Passed/Failed) string +# Translate (global) test exit code into result (Passed/Failed) string result() { if [ "$EXITCODE" == "0" ]; then echo "Passed" @@ -410,7 +419,7 @@ fi } -aexec() { +process_exec() { declare -p PWD printf "\nExecuting: $@" >>$LOG rm -fv $OUTPUT @@ -421,30 +430,99 @@ echo "Command not found: $@" > $OUTPUT fi if [ -f $OUTPUT ]; then - cat $OUTPUT >>$LOG + cat $OUTPUT >> $LOG fi + return $EXITCODE } # Execute as part of test set -pexec() { +# Equivalent to monitored_exec() (but w/o monitoring) +test_exec() { banner "$TEST (part $SEQ)" echo "Executing $TEST (part $SEQ)" - aexec "$@" + process_exec "$@" RESULT=$( result ) test_log - out test $SEQ "$LASTCMD" $RESULT $TLOG + out test $SEQ "$LASTCMD" $RESULT $TEST_LOG check_bailout let "SEQ=$SEQ+1" } +# Background process monitoring function +# To be executed in the background as well +# If the monitored process times out, monitor() kills it and writes +# a message to OUTPUT +# If monitor() kills the process, it returns 0 +# Otherwise, return non-zero (as would result from killing +# this function) +monitor() { + (( $VERBOSE )) && set -x + + PID=$1 + TIMEOUT=$2 # seconds + OUTPUT=$3 + + sleep $TIMEOUT + EXITCODE=1 + + /bin/kill -TERM $PID + KILLCODE=$? + if [ $KILLCODE == 0 ]; then + echo "monitor(): killed process (TERM)" + sleep 1 + fi + /bin/kill -KILL $PID + if [ $KILLCODE == 0 ]; then + echo "monitor(): killed process (KILL)" + fi + + MSG="nightly.sh: monitor(): killed: exceeded $TIMEOUT seconds" + echo "$MSG" >> $OUTPUT +} + +# Execute given command line in background with monitor +# Otherwise equivalent to test_exec() +monitored_exec() +{ + banner "$TEST (part $SEQ)" + echo "Executing $TEST (part $SEQ)" + + START=$( date +%s ) + + process_exec "$@" & + PROCESS_PID=$! + + monitor $PROCESS_PID 30 $OUTPUT & + MONITOR_PID=$! + + wait $PROCESS_PID + EXITCODE=$? + + STOP=$( date +%s ) + + # If EXITCODE != 0, monitor() may have work to do + (( $EXITCODE != 0 )) && sleep 5 + kill -TERM $MONITOR_PID + + echo "TOOK: $(( STOP-START ))" + + RESULT=$( result ) + test_log + out test $SEQ "$LASTCMD" $RESULT $TEST_LOG + + check_bailout + + let "SEQ=$SEQ+1" +} + # Execute helper script (setup, check, or clean) script_exec() { SCRIPT=$1 SYMBOL="$2" - aexec $SCRIPT + process_exec $SCRIPT RESULT=$( result ) test_log @@ -454,7 +532,7 @@ } # Execute Swift test case w/ setup, check, clean -swift_test() { +swift_test_case() { SWIFTSCRIPT=$1 SETUPSCRIPT=${SWIFTSCRIPT%.swift}.setup.sh CHECKSCRIPT=${SWIFTSCRIPT%.swift}.check.sh @@ -462,7 +540,8 @@ if [ -x $GROUP/$SETUPSCRIPT ]; then script_exec $GROUP/$SETUPSCRIPT "S" fi - pexec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT + # test_exec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT + monitored_exec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT if [ -x $GROUP/$CHECKSCRIPT ]; then script_exec $GROUP/$CHECKSCRIPT "√" fi @@ -496,16 +575,26 @@ build_package() { TEST="Package" - pexec cd $SWIFT_HOME/lib - pexec rm -f castor*.jar *gt2ft*.jar ant.jar - pexec cd $TOPDIR - pexec tar -pczf $RUNDIR/swift-$DATE.tar.gz $SWIFT_HOME + test_exec cd $SWIFT_HOME/lib + test_exec rm -f castor*.jar *gt2ft*.jar ant.jar + test_exec cd $TOPDIR + test_exec tar -pczf $RUNDIR/swift-$DATE.tar.gz $SWIFT_HOME out package "swift-$DATE.tar.gz" } +create_tc_data() { + if [ -f $GROUP/tc.template.data ]; then + sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data + [ $? != 0 ] && crash "Could not create tc.data!" + else + cp -uv $SWIFT_HOME/etc/tc.data . + [ $? != 0 ] && crash "Could not copy tc.data!" + fi +} + test_group() { - sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data + create_tc_data for TEST in $( ls $GROUP/*.swift ); do @@ -517,7 +606,7 @@ start_row for ((i=0; $i<$ITERS_LOCAL; i=$i+1)); do - swift_test $TESTNAME + swift_test_case $TESTNAME done end_row done @@ -537,28 +626,28 @@ if [ "$SKIP_CHECKOUT" != "1" ]; then TESTNAME="Checkout CoG" start_row - pexec rm -rf cog + test_exec rm -rf cog COG="https://cogkit.svn.sourceforge.net/svnroot/cogkit/trunk/current/src/cog" - pexec svn co $COG + test_exec svn co $COG end_row TESTNAME="Checkout Swift" start_row - pexec cd cog/modules - pexec rm -rf swift - pexec svn co https://svn.ci.uchicago.edu/svn/vdl2/$BRANCH swift + test_exec cd cog/modules + test_exec rm -rf swift + test_exec svn co https://svn.ci.uchicago.edu/svn/vdl2/$BRANCH swift end_row fi TESTNAME="Compile" start_row -pexec cd $TOPDIR/cog/modules/swift +test_exec cd $TOPDIR/cog/modules/swift if (( $CLEAN )); then - pexec rm -rf dist + test_exec rm -rf dist fi if (( $RUN_ANT )); then - pexec ant -quiet dist + test_exec ant -quiet dist fi SWIFT_HOME=$TOPDIR/cog/modules/swift/dist/swift-svn @@ -589,6 +678,10 @@ GROUP=$TESTDIR/local test_group +start_part "Part IV: Should-Not-Work Tests" +GROUP=$TESTDIR/language/should-not-work +test_group + if [ $GRID_TESTS == "0" ]; then exit fi @@ -606,12 +699,11 @@ ssexec "Compile" vdlc $BN for ((i=0; $i<9; i=$i+1)); do - pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml + test_exec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml done - pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml + test_exec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml done -#Don't remove me: footer # Local Variables: From noreply at svn.ci.uchicago.edu Mon Aug 16 20:51:45 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 16 Aug 2010 20:51:45 -0500 (CDT) Subject: [Swift-commit] r3550 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100817015145.A40D69D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-16 20:51:45 -0500 (Mon, 16 Aug 2010) New Revision: 3550 Modified: usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Print run times and a few updates to application editing Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-16 21:39:27 UTC (rev 3549) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-17 01:51:45 UTC (rev 3550) @@ -160,7 +160,8 @@ # Run swift chdir("$run_directory") || die "Unable to chdir to $run_directory\n"; -print "Submitting job. Check $run_directory for details\n"; +print "Executing script $option_script\n"; +print "Check $run_directory for output and debugging information\n"; my $system_command = 'swift ' . "-sites.file $run_directory/sites.xml " @@ -175,6 +176,13 @@ # Execute system($system_command); +my $sec = (time - $^T); +my $hours = ($sec/(60*60))%24; +my $mins = ($sec/60)%60; +my $secs = $sec%60; +my $datestring = sprintf("%dh:%dm:%ds", $hours, $mins, $secs); +print "Script $option_script finished in $datestring\n"; + __END__ =head1 NAME Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-16 21:39:27 UTC (rev 3549) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-17 01:51:45 UTC (rev 3550) @@ -561,6 +561,7 @@ my @apps_file_data = ; close(APPLIST); foreach my $current_app (@apps_file_data) { + chomp($current_app); if($apps) { $apps = "$apps $current_app"; } @@ -571,7 +572,7 @@ } my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); - print "Available application sets are: "; + print "Available application sets: "; foreach(@all_available_appsets) { $_ = strip_directory($_); ($_, my $junk) = split('\.'); @@ -579,10 +580,7 @@ } print "\n"; - print "Application sets for $site: "; - $apps = ; - chomp($apps); - + $apps = get_entry("Select application sets for $site", $apps, 0); my @all_list = split(/ /, $apps); open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps") || die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n"; @@ -648,6 +646,15 @@ print "Enter name to call this application set: "; my $set_name = ; chomp($set_name); + + if(-e "$ENV{'HOME'}/.swift/apps/$set_name.apps") { + print "Set named $set_name already exists\n"; + my $yesno = get_entry("Overwrite $set_name?", "No", 0, ("yes", "no")); + if($yesno eq "no") { + return; + } + } + write_file("$ENV{'HOME'}/.swift/apps/$set_name.apps", @tc_data); print "Successfully imported application set named $set_name\n"; } From noreply at svn.ci.uchicago.edu Tue Aug 17 17:56:25 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 17 Aug 2010 17:56:25 -0500 (CDT) Subject: [Swift-commit] r3551 - branches Message-ID: <20100817225625.D5D019CCA5@vm-125-59.ci.uchicago.edu> Author: hategan Date: 2010-08-17 17:56:25 -0500 (Tue, 17 Aug 2010) New Revision: 3551 Added: branches/fast/ Log: branched fast Copied: branches/fast (from rev 3550, trunk) From noreply at svn.ci.uchicago.edu Tue Aug 17 23:27:04 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 17 Aug 2010 23:27:04 -0500 (CDT) Subject: [Swift-commit] r3553 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100818042704.51BA89CCA5@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-17 23:27:04 -0500 (Tue, 17 Aug 2010) New Revision: 3553 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Various bug fixes and improvements Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-18 00:50:11 UTC (rev 3552) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-18 04:27:04 UTC (rev 3553) @@ -19,7 +19,6 @@ my $option_list = q{}; # List information about config my $option_remove = q{}; # Remove entry from sites.xml my $option_edit = q{}; # Edit mode -my $option_describe = q{}; # Print raw XML configuration my $option_default = q{}; # When adding a site, use all defaults my $option_template = q{}; # Create config from template specified my $option_copy = q{}; # Copy an existing configuration @@ -29,7 +28,6 @@ # Assign variables from command line options GetOptions( 'remove=s' => \$option_remove, - 'describe=s' => \$option_describe, 'default|defaults' => \$option_default, 'full' => sub { $option_default = 0; }, 'template=s' => \$option_template, @@ -45,6 +43,18 @@ my $xml = new XML::Simple(); initialize_swiftconfig(); +# Check command line options +if( !$option_remove + && !$option_template + && !$option_edit + && !$option_copy + && !$option_applications + && !$option_import + && !$option_list) { + print "Incorrect usage. See swiftconfig -help for more information\n"; + exit; +} + # Create all required directories my $dotswift_directory = "$ENV{'HOME'}/.swift"; create_directory("$ENV{'HOME'}/.ssh"); @@ -225,24 +235,27 @@ my $quit = 0; while($quit == 0) { print "\n(E)dit, (a)dd, (r)emove, (l)ist, or (q)uit: "; - my $edit_or_add = ; - chomp($edit_or_add); + my $command = ; + chomp($command); - if(lc($edit_or_add) eq 'a') { + if(lc($command) eq 'a') { add_application("$dotswift_directory/apps/$application_set.apps"); } - elsif(lc($edit_or_add) eq 'q') { + elsif(lc($command) eq 'q') { $quit = 1; } - elsif(lc($edit_or_add) eq 'r') { + elsif(lc($command) eq 'r') { remove_application("$dotswift_directory/apps/$application_set.apps"); } - elsif(lc($edit_or_add) eq 'l') { + elsif(lc($command) eq 'l') { list_applications("$dotswift_directory/apps/$application_set.apps"); } - elsif(lc($edit_or_add) eq 'e') { + elsif(lc($command) eq 'e') { edit_application("$dotswift_directory/apps/$application_set.apps"); } + else { + print "Unknown option: $command\n"; + } } } @@ -256,19 +269,38 @@ } } +# List various about swiftconfig if($option_list) { if ($option_list eq "templates") { print_directory($template_directory); } - elsif ($option_list eq "configs") { + elsif ($option_list eq "configs" || $option_list eq "sites") { print_directory("$dotswift_directory/sites"); } # Assume it's the name of a configuration else { my @matched_configs = glob("$dotswift_directory/sites/$option_list"); foreach my $site (@matched_configs) { - system("cat $site/sites.xml"); + if(-e "$site/sites.xml") { + print "sites.xml:\n"; + system("cat $site/sites.xml"); + print "\n"; + } + else { + print "Unable to find configuration $option_list\n"; + } + if(-e "$site/apps") { + open(APPFILE, "$site/apps") || die "Unable to open $site/apps"; + my @appdata = ; + close(APPFILE); + print "Application sets: "; + foreach my $app(@appdata) { + chomp($app); + print "$app "; + } + print "\n\n"; + } } } } Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 00:50:11 UTC (rev 3552) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:27:04 UTC (rev 3553) @@ -504,10 +504,11 @@ foreach (@profiles) { if( m/maxwalltime=\"(\d+:\d+:\d+)\"/ig ) { $wallfound=1; - $time = get_entry("Walltime", $1, 0); + my $default_time = $1; + $time = get_entry("Walltime", $default_time, 0); while($time !~ m/(\d+:\d+:\d+)/ ) { print "Error: incorrect format\n"; - $time = get_entry("Walltime", $1, 0); + $time = get_entry("Walltime", $default_time, 0); } s/(\d+:\d+:\d+)/$time/g; } @@ -546,6 +547,7 @@ } } +# Associate application sets with a configuration sub update_site_applications { my ($site) = @_; my $apps = ''; @@ -591,6 +593,7 @@ print "Successfully saved application sets for $site\n\n"; } +# Import existing XML file into swiftconfig style format sub import_xml { my ($xml_filename) = @_; if(! -e $xml_filename) { @@ -621,6 +624,7 @@ } } +# Import tc.data files into swiftconfig application set sub import_tc { my ($tc_filename) = @_; if(! -e $tc_filename) { From noreply at svn.ci.uchicago.edu Tue Aug 17 23:35:48 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 17 Aug 2010 23:35:48 -0500 (CDT) Subject: [Swift-commit] r3554 - usertools/swift/swiftconfig/lib/perl Message-ID: <20100818043548.427749CCA5@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-17 23:35:48 -0500 (Tue, 17 Aug 2010) New Revision: 3554 Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Application editing should use SWIFTCONFIGURATION as placeholder Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:27:04 UTC (rev 3553) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:35:48 UTC (rev 3554) @@ -420,7 +420,7 @@ print "Error: incorrect format\n"; $app_time = get_entry("Walltime", $1, 0); } - print APPFILE "\$HOST\t$app_name\t$app_path\tINSTALLED\tINTEL32::LINUX\tGLOBUS::maxwalltime=\"$app_time\"\n"; + print APPFILE "SWIFTCONFIGURATION\t$app_name\t$app_path\tINSTALLED\tINTEL32::LINUX\tGLOBUS::maxwalltime=\"$app_time\""; close(APPFILE); print "Added $app_name\n"; } From noreply at svn.ci.uchicago.edu Tue Aug 17 23:43:11 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 17 Aug 2010 23:43:11 -0500 (CDT) Subject: [Swift-commit] r3555 - usertools/swift/swiftconfig/lib/perl Message-ID: <20100818044311.044849D17C@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-17 23:43:10 -0500 (Tue, 17 Aug 2010) New Revision: 3555 Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Missing newline Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:35:48 UTC (rev 3554) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:43:10 UTC (rev 3555) @@ -420,7 +420,7 @@ print "Error: incorrect format\n"; $app_time = get_entry("Walltime", $1, 0); } - print APPFILE "SWIFTCONFIGURATION\t$app_name\t$app_path\tINSTALLED\tINTEL32::LINUX\tGLOBUS::maxwalltime=\"$app_time\""; + print APPFILE "SWIFTCONFIGURATION\t$app_name\t$app_path\tINSTALLED\tINTEL32::LINUX\tGLOBUS::maxwalltime=\"$app_time\"\n"; close(APPFILE); print "Added $app_name\n"; } From noreply at svn.ci.uchicago.edu Wed Aug 18 22:46:23 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Wed, 18 Aug 2010 22:46:23 -0500 (CDT) Subject: [Swift-commit] r3556 - in usertools/swift/swiftconfig: bin etc etc/sites/local etc/sites/local-pbs etc/sites/local-pbs-coasters etc/sites/pads-local-pbs etc/sites/pads-local-pbs-coasters etc/sites/pads-remote-pbs-coasters-ssh etc/sites/pads-remote-ssh etc/sites/ssh etc/sites/teraport-local-pbs etc/sites/teraport-local-pbs-coasters etc/sites/teraport-remote-pbs-coasters-ssh etc/sites/teraport-remote-ssh lib/perl Message-ID: <20100819034623.AA4BC9CCC7@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-18 22:46:23 -0500 (Wed, 18 Aug 2010) New Revision: 3556 Added: usertools/swift/swiftconfig/etc/sites/local/swift.properties Removed: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data usertools/swift/swiftconfig/etc/sites/local/tc.data usertools/swift/swiftconfig/etc/sites/pads-local-pbs-coasters/tc.data usertools/swift/swiftconfig/etc/sites/pads-local-pbs/tc.data usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/tc.data usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/tc.data usertools/swift/swiftconfig/etc/sites/ssh/tc.data usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/tc.data usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/tc.data usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/tc.data usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/tc.data Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun usertools/swift/swiftconfig/etc/TODO usertools/swift/swiftconfig/etc/sites/local/sites.xml usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: App editing improvements Handle swift.properties Remove tc.data files from template directories Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-19 03:46:23 UTC (rev 3556) @@ -95,7 +95,7 @@ ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - update_site_applications($new_sitename); + update_site_applications($new_sitename, $option_default); # Handle SSH if ( $xml_ref->{execution}{provider} eq 'ssh' ) { @@ -141,7 +141,7 @@ SuppressEmpty => 1, ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - update_site_applications($option_edit); + update_site_applications($option_edit, $option_default); # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { @@ -228,7 +228,7 @@ } open(APPFILE, ">$dotswift_directory/apps/$application_set.apps") || die "Unable to create file $dotswift_directory/apps/$application_set.apps"; - print "$application_set set created\n\n"; + print "$application_set set created\n"; close(APPFILE); } Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-19 03:46:23 UTC (rev 3556) @@ -42,8 +42,10 @@ my ($run_number) = $run_directories[-1] =~ m{(\d+)}; $run_number++; my $run_directory = getcwd() . "/" . sprintf "run.%04s", $run_number; +create_directory($run_directory); my @sites_xml; -create_directory($run_directory); + +# Copy over needed files copy_file( "$option_script", "$run_directory" ); # Sites.xml for 'all' @@ -55,6 +57,11 @@ if ( !-e "$all_site/sites.xml" ) { die "Unable to find sites.xml for $all_site\n"; } + my $properties_file = "$dotswift_directory/sites/$all_site/swift.properties"; + if( -e "$properties_file") { + copy_file( $properties_file, "$run_directory/swift.properties"); + } + open(CURRENT_SITE, "$all_site/sites.xml") || die "Unable to open $all_site/sites.xml"; my @current_site_data = ; @@ -106,7 +113,10 @@ my @current_site_data = ; close(CURRENT_SITE); push(@sites_xml, @current_site_data); - + my $properties_file = "$dotswift_directory/sites/$site/swift.properties"; + if( -e "$properties_file") { + copy_file( $properties_file, "$run_directory"); + } # Add applications my @all_apps; if(-e "$dotswift_directory/sites/$site/apps") { @@ -167,10 +177,16 @@ . "-sites.file $run_directory/sites.xml " . "-tc.file $run_directory/tc.data " . "$option_script "; +if(-e "$run_directory/swift.properties") { + $system_command .= "-config $run_directory/swift.properties "; +} +else { + print "No such file $run_directory/swift.properties\n"; +} # Add unknown options foreach my $unknown_argument (@ARGV) { - $system_command = "$system_command $unknown_argument "; + $system_command .= "$unknown_argument "; } # Execute Modified: usertools/swift/swiftconfig/etc/TODO =================================================================== --- usertools/swift/swiftconfig/etc/TODO 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/TODO 2010-08-19 03:46:23 UTC (rev 3556) @@ -4,4 +4,3 @@ Have swiftrun be flexible enough to work for new users, as well as advanced users Site aliases Ability to "undo" edits -Replace $HOST in app templates with something else Modified: usertools/swift/swiftconfig/etc/sites/local/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local/sites.xml 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/local/sites.xml 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,6 +1,7 @@ - 0 + 10000 + .31 $HOME/swiftwork Added: usertools/swift/swiftconfig/etc/sites/local/swift.properties =================================================================== --- usertools/swift/swiftconfig/etc/sites/local/swift.properties (rev 0) +++ usertools/swift/swiftconfig/etc/sites/local/swift.properties 2010-08-19 03:46:23 UTC (rev 3556) @@ -0,0 +1,352 @@ +#sites.file=${swift.home}/etc/sites.xml +#tc.file=${swift.home}/etc/tc.data + +# +# The host name of the submit machine is used by GRAM as a callback +# address to report the status of submitted jobs. In general, Swift +# can automatically detect the host name of the local machine. +# However, if the machine host name is improperly configured or if +# it does not represent a valid DNS entry, certain services (such as +# GRAM) will not be able to send job status notifications back to +# the client. The value of this property can be an IP address. +# +# Format: +# hostname=string +# + + +#hostname=localhost + +# +# A TCP port range can be specified to restrict the ports on which GRAM +# callback services are started. This is likely needed if your submit +# host is behind a firewall, in which case the firewall should be +# configured to allow incoming connections on ports in the range. +# +# Format: +# tcp.port.range=start,end +# + +#tcp.port.range=50000,50100 + +# +# false - means an error will be immediately reported and cause the +# workflow to abort. At this time remote jobs that are already +# running will not be canceled +# true - means that Swift will try to do as much work as possible and +# report all errors encountered at the end. However, "errors" +# here only applies to job execution errors. Certain errors +# that are related to the Swift implementation (should such +# errors occur) will still be reported eagerly. +# +# Default: false +# +lazy.errors=false + +# +# What algorithm to use for caching of remote files. LRU (as in what +# files to purge) is the only implementation right now. One can set +# a target size (in bytes) for a host by using the swift:storagesize +# profile for a host in sites.xml +# +# Default: LRU +# +caching.algorithm=LRU + +# +# true - generate a provenance graph in .dot format (Swift will +# choose a random file name) +# false - do not generate a provenance graph +# - generate a provenange graph in the give file name +# +# Default: false +# +pgraph=false + + +# +# graph properties for the provenance graph (.dot specific) +# +# Default: splines="compound", rankdir="TB" +# +pgraph.graph.options=splines="compound", rankdir="TB" + + +# +# node properties for the provenance graph (.dot specific) +# +# Default: color="seagreen", style="filled" +# +pgraph.node.options=color="seagreen", style="filled" + +# +# true - clustering of small jobs is enabled. Clustering works in the +# following way: If a job is clusterable (meaning that it has the +# GLOBUS::maxwalltime profile specified in tc.data and its value +# is less than the value of the "clustering.min.time" property) it will +# be put in a clustering queue. The queue is processed at intervals +# specified by the "clustering.queue.delay" property. The processing +# of the clustering queue consists of selecting compatible jobs and +# grouping them in clusters whose max wall time does not exceed twice +# the value of the "clustering.min.time" property. Two or more jobs are +# considered compatible if they share the same site and do not have +# conflicting profiles (e.g. different values for the same environment +# variable). +# false - clustering of small jobs is disabled. +# +# Default: false +# +clustering.enabled=false + + +# +# - the intervals at which the clustering queue is processed +# +# Default: 4 +# +clustering.queue.delay=4 + +# +# - the threshold time for clustering +# +# Default: 60 +# +clustering.min.time=60 + +# +# Kickstart is a useful tool that can be used to gather various information +# about a remote process. Before it can be used it must be installed on the +# remote site and the corresponding entry be set in the sites file. +# This option allows controlling of how Swift uses Kickstart. The following +# values are possible: +# false - do not use Kickstart +# true - use Kickstart. If a job is scheduled on a site that does not have +# Kickstart installed, that job will fail. +# maybe - Use Kickstart if installed (i.e. the entry is present in the sites +# file) +# +# Default: maybe +# + +kickstart.enabled=maybe + +# +# Indicates when Kickstart records should be fetched from the remote site: +# true - always transfer Kickstart records if Kickstart was used (see +# kickstart.enabled) +# false - only transfer Kickstart records if the job fails +# +# Default: false +# + +kickstart.always.transfer=false + +# +# Indicates when wrapper logs should be fetched from the remote site: +# true - always transfer wrapper logs +# false - only transfer wrapper logs if the job fails +# +# Default: false +# + +wrapperlog.always.transfer=true + +########################################################################### +# Throttling options # +########################################################################### +# +# For the throttling parameters, valid values are either a positive integer +# or "off" (without the quotes). +# + +# +# Limits the number of concurrent submissions for a workflow instance. This +# throttle only limits the number of concurrent tasks (jobs) that are being +# sent to sites, not the total number of concurrent jobs that can be run. +# The submission stage in GRAM is one of the most CPU expensive stages (due +# mostly to the mutual authentication and delegation). Having too many +# concurrent submissions can overload either or both the submit host CPU +# and the remote host/head node causing degraded performance. +# +# Default: 4 +# + +throttle.submit=4 +#throttle.submit=off + +# +# Limits the number of concurrent submissions for any of the sites Swift will +# try to send jobs to. In other words it guarantees that no more than the +# value of this throttle jobs sent to any site will be concurrently in a state +# of being submitted. +# +# Default: 2 +# + +throttle.host.submit=2 +#throttle.host.submit=off + +# +# The Swift scheduler has the ability to limit the number of concurrent jobs +# allowed on a site based on the performance history of that site. Each site +# is assigned a score (initially 1), which can increase or decrease based +# on whether the site yields successful or faulty job runs. The score for a +# site can take values in the (0.1, 100) interval. The number of allowed jobs +# is calculated using the following formula: +# 2 + score*throttle.score.job.factor +# This means a site will always be allowed at least two concurrent jobs and +# at most 2 + 100*throttle.score.job.factor. With a default of 4 this means +# at least 2 jobs and at most 402. +# +# Default: 4 +# + +throttle.score.job.factor=0.2 +#throttle.score.job.factor=off + + +# +# Limits the total number of concurrent file transfers that can happen at any +# given time. File transfers consume bandwidth. Too many concurrent transfers +# can cause the network to be overloaded preventing various other signalling +# traffic from flowing properly. +# +# Default: 4 +# + +throttle.transfers=4 +#throttle.transfers=off + +# Limits the total number of concurrent file operations that can happen at any +# given time. File operations (like transfers) require an exclusive connection +# to a site. These connections can be expensive to establish. A large number +# of concurrent file operations may cause Swift to attempt to establish many +# such expensive connections to various sites. Limiting the number of concurrent +# file operations causes Swift to use a small number of cached connections and +# achieve better overall performance. +# +# Default: 8 +# + +throttle.file.operations=8 +#throttle.file.operations=off + +# Indicates whether the working directory on the remote site should be +# left intact even when the workflow completes successfully. This can be +# used to inspect the site working directory for debugging purposes. +# +# Default: false +# + +sitedir.keep=true + +# number of time a job will be retried if it fails (giving a maximum of +# 1 + execution.retries attempts at execution) +# + +execution.retries=1 + + +# Enables/disables replication. Replication is used to deal with jobs sitting +# in batch queues for abnormally large amounts of time. If replication is enabled +# and certain conditions are met, Swift creates and submits replicas of jobs, and +# allows multiple instances of a job to compete. +# + +replication.enabled=false + +# If replication is enabled, this value specifies the minimum time, in seconds, +# a job needs to be queued in a batch queue in order to be considered for +# replication +# + +replication.min.queue.time=60 + +# The maximum number of replicas that Swift should attempt. + +replication.limit=3 + +# +# WARNING: This option is deprecated. Please use the hostname option. +# +# The IP address of the submit machine is used by GRAM as a callback +# address to report the status of submitted jobs. In general, Swift +# can automatically detect the IP address of the local machine. +# However, if the machine has more than one network interface, Swift +# will pick the first one, which may not be the right choice. It is +# recommended that this property is set properly before attempting to +# run jobs through GRAM. +# +# Format: +# ip.address=x.y.z.w +# + +#ip.address=127.0.0.1 + + +# Controls how Swift will communicate the result code of running user programs +# from workers to the submit side. In files mode, a file +# indicating success or failure will be created on the site shared filesystem. +# In provider mode, the execution provider job status will +# be used. Notably, GRAM2 does not return job statuses correctly, and so +# provider mode will not work with GRAM2. With other +# providers, it can be used to reduce the amount of filesystem access compared +# to files mode. +# +# status.mode=files + +# Controls how swift will supply parameters to the remote wrapper script. +# 'args' mode will pass parameters on the command line +# 'files' mode will pass parameters through an additional input file +# +# valid values: args, files +# Default: files +# +# wrapper.parameter.mode=args + +# 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 + +# +# Limits the number of concurrent iterations that each foreach statement +# can have at one time. This conserves memory for swift programs that +# have large numbers of iterations (which would otherwise all be executed +# in parallel). +# +# Default: 1024 +# + +foreach.max.threads=16384 + +# controls whether the log file will contain provenance information +# enabling this will increase the size of log files, sometimes +# significantly. + +provenance.log=false + +# Controls whether file staging is done by swift or by the execution +# provider. If set to false, the standard swift staging mechanism is +# used. If set to true, swift does not stage files. Instead, the +# execution provider is instructed to stage files in and out. +# +# Provider staging is experimental. +# +# When enabled, and when coasters are used as an execution provider, +# a staging mechanism can be selected for each site +# using the swift:stagingMethod site profile in sites.xml. The +# following is a list of accepted mechanisms: +# +# * file: Staging is done from a filesystem accessible to the +# coaster service (typically running on the head node) +# * proxy: Staging is done from a filesystem accessible to the +# client machine that swift is running on, and is proxied +# through the coaster service +# * sfs: (short for "shared filesystem") Staging is done by +# copying files to and from a filesystem accessible +# by the compute node (such as an NFS or GPFS mount). + + +use.provider.staging=false Deleted: usertools/swift/swiftconfig/etc/sites/local/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/local/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,8 +0,0 @@ -# sitename transformation path INSTALLED platform profiles -local echo /bin/echo INSTALLED INTEL32::LINUX null -local cat /bin/cat INSTALLED INTEL32::LINUX null -local ls /bin/ls INSTALLED INTEL32::LINUX null -local grep /bin/grep INSTALLED INTEL32::LINUX null -local sort /bin/sort INSTALLED INTEL32::LINUX null -local paste /bin/paste INSTALLED INTEL32::LINUX null -local tr /usr/bin/tr INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/local-pbs/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -local-pbs echo /bin/echo INSTALLED INTEL32::LINUX null -local-pbs cat /bin/cat INSTALLED INTEL32::LINUX null -local-pbs ls /bin/ls INSTALLED INTEL32::LINUX null -local-pbs grep /bin/grep INSTALLED INTEL32::LINUX null -local-pbs sort /bin/sort INSTALLED INTEL32::LINUX null -local-pbs paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -local-pbs-coasters echo /bin/echo INSTALLED INTEL32::LINUX null -local-pbs-coasters cat /bin/cat INSTALLED INTEL32::LINUX null -local-pbs-coasters ls /bin/ls INSTALLED INTEL32::LINUX null -local-pbs-coasters grep /bin/grep INSTALLED INTEL32::LINUX null -local-pbs-coasters sort /bin/sort INSTALLED INTEL32::LINUX null -local-pbs-coasters paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/pads-local-pbs/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-local-pbs/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/pads-local-pbs/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -pads-local-pbs echo /bin/echo INSTALLED INTEL32::LINUX null -pads-local-pbs cat /bin/cat INSTALLED INTEL32::LINUX null -pads-local-pbs ls /bin/ls INSTALLED INTEL32::LINUX null -pads-local-pbs grep /bin/grep INSTALLED INTEL32::LINUX null -pads-local-pbs sort /bin/sort INSTALLED INTEL32::LINUX null -pads-local-pbs paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/pads-local-pbs-coasters/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-local-pbs-coasters/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/pads-local-pbs-coasters/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -pads-local-pbs-coasters echo /bin/echo INSTALLED INTEL32::LINUX null -pads-local-pbs-coasters cat /bin/cat INSTALLED INTEL32::LINUX null -pads-local-pbs-coasters ls /bin/ls INSTALLED INTEL32::LINUX null -pads-local-pbs-coasters grep /bin/grep INSTALLED INTEL32::LINUX null -pads-local-pbs-coasters sort /bin/sort INSTALLED INTEL32::LINUX null -pads-local-pbs-coasters paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -pads-remote-pbs-coasters echo /bin/echo INSTALLED INTEL32::LINUX null -pads-remote-pbs-coasters cat /bin/cat INSTALLED INTEL32::LINUX null -pads-remote-pbs-coasters ls /bin/ls INSTALLED INTEL32::LINUX null -pads-remote-pbs-coasters grep /bin/grep INSTALLED INTEL32::LINUX null -pads-remote-pbs-coasters sort /bin/sort INSTALLED INTEL32::LINUX null -pads-remote-pbs-coasters paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -pads-remote-ssh echo /bin/echo INSTALLED INTEL32::LINUX null -pads-remote-ssh cat /bin/cat INSTALLED INTEL32::LINUX null -pads-remote-ssh ls /bin/ls INSTALLED INTEL32::LINUX null -pads-remote-ssh grep /bin/grep INSTALLED INTEL32::LINUX null -pads-remote-ssh sort /bin/sort INSTALLED INTEL32::LINUX null -pads-remote-ssh paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/ssh/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/ssh/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -ssh echo /bin/echo INSTALLED INTEL32::LINUX null -ssh cat /bin/cat INSTALLED INTEL32::LINUX null -ssh ls /bin/ls INSTALLED INTEL32::LINUX null -ssh grep /bin/grep INSTALLED INTEL32::LINUX null -ssh sort /bin/sort INSTALLED INTEL32::LINUX null -ssh paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -teraport-local-pbs echo /bin/echo INSTALLED INTEL32::LINUX null -teraport-local-pbs cat /bin/cat INSTALLED INTEL32::LINUX null -teraport-local-pbs ls /bin/ls INSTALLED INTEL32::LINUX null -teraport-local-pbs grep /bin/grep INSTALLED INTEL32::LINUX null -teraport-local-pbs sort /bin/sort INSTALLED INTEL32::LINUX null -teraport-local-pbs paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -teraport-local-pbs-coasters echo /bin/echo INSTALLED INTEL32::LINUX null -teraport-local-pbs-coasters cat /bin/cat INSTALLED INTEL32::LINUX null -teraport-local-pbs-coasters ls /bin/ls INSTALLED INTEL32::LINUX null -teraport-local-pbs-coasters grep /bin/grep INSTALLED INTEL32::LINUX null -teraport-local-pbs-coasters sort /bin/sort INSTALLED INTEL32::LINUX null -teraport-local-pbs-coasters paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -localhost echo /bin/echo INSTALLED INTEL32::LINUX null -localhost cat /bin/cat INSTALLED INTEL32::LINUX null -localhost ls /bin/ls INSTALLED INTEL32::LINUX null -localhost grep /bin/grep INSTALLED INTEL32::LINUX null -localhost sort /bin/sort INSTALLED INTEL32::LINUX null -localhost paste /bin/paste INSTALLED INTEL32::LINUX null Deleted: usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/tc.data =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/tc.data 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/tc.data 2010-08-19 03:46:23 UTC (rev 3556) @@ -1,17 +0,0 @@ -#This is the transformation catalog. -# -#It comes pre-configured with a number of simple transformations with -#paths that are likely to work on a linux box. However, on some systems, -#the paths to these executables will be different (for example, sometimes -#some of these programs are found in /usr/bin rather than in /bin) -# -#NOTE WELL: fields in this file must be separated by tabs, not spaces; and -#there must be no trailing whitespace at the end of each line. -# -# sitename transformation path INSTALLED platform profiles -teraport-remote-ssh echo /bin/echo INSTALLED INTEL32::LINUX null -teraport-remote-ssh cat /bin/cat INSTALLED INTEL32::LINUX null -teraport-remote-ssh ls /bin/ls INSTALLED INTEL32::LINUX null -teraport-remote-ssh grep /bin/grep INSTALLED INTEL32::LINUX null -teraport-remote-ssh sort /bin/sort INSTALLED INTEL32::LINUX null -teraport-remote-ssh paste /bin/paste INSTALLED INTEL32::LINUX null Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-18 04:43:10 UTC (rev 3555) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-19 03:46:23 UTC (rev 3556) @@ -34,7 +34,7 @@ sub create_directory { my $directory = $_[0]; if ( !-d "$directory" ) { - mkdir "$directory", 0700 + mkdir "$directory" or die "Unable to create directory $directory\n"; } } @@ -88,8 +88,8 @@ $error_message = $error_message . $allowable . ' '; } print 'Invalid value selected. Please select from: ' - . "$error_message\n"; - $entry_value = get_entry( $entry_description, $entry_value, + . "$error_message\n\n"; + $entry_value = get_entry( $entry_description, $entry_value, 0, @allowable_values, ); } } @@ -549,7 +549,7 @@ # Associate application sets with a configuration sub update_site_applications { - my ($site) = @_; + my ($site, $use_defaults) = @_; my $apps = ''; if(! -d "$ENV{'HOME'}/.swift/sites/$site") { @@ -573,24 +573,34 @@ } } - my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); - print "Available application sets: "; - foreach(@all_available_appsets) { - $_ = strip_directory($_); - ($_, my $junk) = split('\.'); - print "$_ "; + if(!$use_defaults) { + my @all_available_appsets = glob("$ENV{'HOME'}/.swift/apps/*.apps"); + print "Available application sets: "; + foreach(@all_available_appsets) { + $_ = strip_directory($_); + ($_, my $junk) = split('\.'); + print "$_ "; + } + print "\n"; } - print "\n"; - $apps = get_entry("Select application sets for $site", $apps, 0); + if(!$apps) { + $apps = "linux"; + } + + $apps = get_entry("Select application sets for $site", $apps, $use_defaults); my @all_list = split(/ /, $apps); open(APPFILE, ">$ENV{'HOME'}/.swift/sites/$site/apps") || die "Unable to open $ENV{'HOME'}/.swift/sites/$site/apps for writing!\n"; + foreach(@all_list) { print APPFILE "$_\n"; } close(APPFILE); - print "Successfully saved application sets for $site\n\n"; + + if(!$use_defaults) { + print "Successfully saved application sets for $site\n\n"; + } } # Import existing XML file into swiftconfig style format @@ -723,4 +733,31 @@ strip_directory($fullpath) Given a string like "/foo/blah/file.txt", return "file.txt" + +add_application($filename) + Add an application to an application set + +remove_application($filename) + Remove an application from an application set + +list_applications($filename) + List all applications contained in $filename + +edit_application($filename) + Edit an application in $filename + +initialize_swiftconfig() + Set up swiftconig directory structure and copy required files + +update_site_applications($site, $use_defaults) + Associate application sets with a configuration + $site is the name of the configuration + If $use_defaults > 0, it will save without prompting + +import_xml($filename) + Import existing site configuration(s) from $filename + +import_tc($filename) + Import an application set from an existing tc.data file + =cut From noreply at svn.ci.uchicago.edu Fri Aug 20 02:11:57 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 20 Aug 2010 02:11:57 -0500 (CDT) Subject: [Swift-commit] r3557 - usertools/swift/swiftconfig/bin Message-ID: <20100820071157.A63C99CCAA@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-20 02:11:57 -0500 (Fri, 20 Aug 2010) New Revision: 3557 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/bin/swiftrun Log: Fixed bug with -edit incorrectly creating directories Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-19 03:46:23 UTC (rev 3556) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-20 07:11:57 UTC (rev 3557) @@ -119,13 +119,13 @@ # Modify a site entry if ($option_edit) { my $output_directory = "$dotswift_directory/sites/$option_edit"; - create_directory($output_directory); my $sites_file = "$output_directory/sites.xml"; if ( !-e "$sites_file" ) { die "Unable to find configuration for $option_edit\n"; } - + + create_directory($output_directory); my $xml_filename = "$output_directory/sites.xml"; my $xml_ref = $xml->XMLin( $xml_filename, Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-19 03:46:23 UTC (rev 3556) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-20 07:11:57 UTC (rev 3557) @@ -180,9 +180,6 @@ if(-e "$run_directory/swift.properties") { $system_command .= "-config $run_directory/swift.properties "; } -else { - print "No such file $run_directory/swift.properties\n"; -} # Add unknown options foreach my $unknown_argument (@ARGV) { From noreply at svn.ci.uchicago.edu Fri Aug 20 14:57:26 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 20 Aug 2010 14:57:26 -0500 (CDT) Subject: [Swift-commit] r3558 - trunk/bin Message-ID: <20100820195726.4431F9CCC7@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-20 14:57:26 -0500 (Fri, 20 Aug 2010) New Revision: 3558 Modified: trunk/bin/swift Log: Add SWIFT_HEAP_MAX variable Modified: trunk/bin/swift =================================================================== --- trunk/bin/swift 2010-08-20 07:11:57 UTC (rev 3557) +++ trunk/bin/swift 2010-08-20 19:57:26 UTC (rev 3558) @@ -1,5 +1,9 @@ #! /bin/sh +# Referenced environment variables (default values): +# SWIFT_HEAP_MAX (256M) +# SWIFT_USAGE_STATS + EXEC=org.griphyn.vdl.karajan.Loader OPTIONS= @@ -8,7 +12,7 @@ HEAPMAX=256M if echo `uname` | grep -i "cygwin"; then - CYGWIN="yes" + CYGWIN="yes" CPDELIM=";" fi @@ -27,7 +31,7 @@ updateOptions() { if [ "X$1" != "X" ] ; then - OPTIONS="$OPTIONS -D$2=$1" + OPTIONS="$OPTIONS -D$2=$1" fi } @@ -82,6 +86,9 @@ #large delays if /dev/random does not have enough entropy collected updateOptions "file:///dev/urandom" "java.security.egd" +if [ "X$SWIFT_HEAP_MAX" != "X" ]; then + HEAPMAX=$SWIFT_HEAP_MAX +fi if [ "X$HEAPMAX" != "X" ]; then OPTIONS="-Xmx$HEAPMAX $OPTIONS" fi @@ -151,3 +158,7 @@ fi exit $return_code + +# Local Variables: +# tab-width: 4 +# End: From noreply at svn.ci.uchicago.edu Sat Aug 21 13:30:43 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sat, 21 Aug 2010 13:30:43 -0500 (CDT) Subject: [Swift-commit] r3559 - usertools/swift/swiftconfig/etc/apps Message-ID: <20100821183043.036039CCC2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-21 13:30:42 -0500 (Sat, 21 Aug 2010) New Revision: 3559 Modified: usertools/swift/swiftconfig/etc/apps/linux.apps Log: Modified linux.app from using $HOST to using the correct tag SWIFTCONFIGURATION Modified: usertools/swift/swiftconfig/etc/apps/linux.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-20 19:57:26 UTC (rev 3558) +++ usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-21 18:30:42 UTC (rev 3559) @@ -1,7 +1,7 @@ -$HOST echo /bin/echo INSTALLED INTEL32::LINUX null -$HOST cat /bin/cat INSTALLED INTEL32::LINUX null -$HOST ls /bin/ls INSTALLED INTEL32::LINUX null -$HOST grep /bin/grep INSTALLED INTEL32::LINUX null -$HOST sort /bin/sort INSTALLED INTEL32::LINUX null -$HOST paste /bin/paste INSTALLED INTEL32::LINUX null -$HOST wc /usr/bin/wc INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION echo /bin/echo INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION cat /bin/cat INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION ls /bin/ls INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION grep /bin/grep INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION sort /bin/sort INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION paste /bin/paste INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION wc /usr/bin/wc INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Sat Aug 21 22:35:05 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Sat, 21 Aug 2010 22:35:05 -0500 (CDT) Subject: [Swift-commit] r3560 - in usertools/swift/swiftconfig: bin docs etc/apps etc/sites/local-pbs etc/sites/local-pbs-coasters etc/sites/pads-local-pbs etc/sites/pads-remote-pbs-coasters-ssh etc/sites/pads-remote-ssh etc/sites/ssh etc/sites/teraport-local-pbs etc/sites/teraport-local-pbs-coasters etc/sites/teraport-remote-pbs-coasters-ssh etc/sites/teraport-remote-ssh lib/perl Message-ID: <20100822033505.5DFCF9CCC2@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-21 22:35:05 -0500 (Sat, 21 Aug 2010) New Revision: 3560 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/docs/tutorial.odt usertools/swift/swiftconfig/docs/tutorial.pdf usertools/swift/swiftconfig/etc/apps/linux.apps usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml usertools/swift/swiftconfig/etc/sites/pads-local-pbs/sites.xml usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/sites.xml usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/sites.xml usertools/swift/swiftconfig/etc/sites/ssh/sites.xml usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/sites.xml usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/sites.xml usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/sites.xml usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/sites.xml usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Corrected formatting of standard templates Fixed bug where -copy would still look for a tc file Confirmation when adding configurations Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-22 03:35:05 UTC (rev 3560) @@ -101,6 +101,8 @@ if ( $xml_ref->{execution}{provider} eq 'ssh' ) { add_ssh( $new_sitename, $xml_ref->{execution}{url} ); } + + print "Successfully added $option_template\n"; } # Remove an entry @@ -197,10 +199,6 @@ write_file( "$output_directory/sites.xml", $xml_out_ref ); - # Update tc - my $tc_filename = "$output_directory/tc.data"; - update_tc_hostname( "$tc_filename", $new_config_name ); - # Add ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { add_ssh( $xml_ref->{handle}, $xml_ref->{execution}{url} ); @@ -224,7 +222,7 @@ my $now = time(); if(-e "$dotswift_directory/apps/$application_set.apps") { print "Set named $application_set already exists\n"; - return; + exit; } open(APPFILE, ">$dotswift_directory/apps/$application_set.apps") || die "Unable to create file $dotswift_directory/apps/$application_set.apps"; @@ -325,19 +323,18 @@ General operations: -template sitename Add a configuration based on a template -remove site Removes a site configuration - -templates Display all available templates -edit site Specifies the name of a configuration to edit -copy site Copies a configuration - -default Do not prompt for values, always use defaults + -defaults Do not prompt for values, always use defaults -full Edit every available configuration option -import Import a sites.xml file into swiftconfig -list Options: templates, configs, or a config - -apps Edit or create application sets + -apps Edit or create application sets =head1 EXAMPLES List all templates available for adding - swiftconfig -templates + swiftconfig -list templates Add a site from template into a working configuration swiftconfig -template ssh @@ -351,9 +348,6 @@ Edit application sets swiftconfig -apps -List available templates - swiftconfig -list templates - List all configurations swiftconfig -list configs Modified: usertools/swift/swiftconfig/docs/tutorial.odt =================================================================== (Binary files differ) Modified: usertools/swift/swiftconfig/docs/tutorial.pdf =================================================================== (Binary files differ) Modified: usertools/swift/swiftconfig/etc/apps/linux.apps =================================================================== --- usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/apps/linux.apps 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,7 +1,7 @@ -SWIFTCONFIGURATION echo /bin/echo INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION cat /bin/cat INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION ls /bin/ls INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION grep /bin/grep INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION sort /bin/sort INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION paste /bin/paste INSTALLED INTEL32::LINUX null -SWIFTCONFIGURATION wc /usr/bin/wc INSTALLED INTEL32::LINUX null +SWIFTCONFIGURATION echo /bin/echo INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION cat /bin/cat INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION ls /bin/ls INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION grep /bin/grep INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION sort /bin/sort INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION paste /bin/paste INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" +SWIFTCONFIGURATION wc /usr/bin/wc INSTALLED INTEL32::LINUX GLOBUS::maxwalltime="00:05:00" Modified: usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/local-pbs/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,6 +1,6 @@ - + $HOME/swiftwork 0 - + Modified: usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/local-pbs-coasters/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,4 +1,4 @@ - + $HOME/swiftwork @@ -10,4 +10,4 @@ short 0.5 10000 - + Modified: usertools/swift/swiftconfig/etc/sites/pads-local-pbs/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-local-pbs/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/pads-local-pbs/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,6 +1,6 @@ - + $HOME/swiftwork 0 - + Modified: usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/pads-remote-pbs-coasters-ssh/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,4 +1,4 @@ - + 3000 8 @@ -10,4 +10,4 @@ 10000 $HOME/swiftwork - + Modified: usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/pads-remote-ssh/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,6 +1,6 @@ - + $HOME/swiftwork 0 - + Modified: usertools/swift/swiftconfig/etc/sites/ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/ssh/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/ssh/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,6 +1,6 @@ - + $HOME/swiftwork 0 - + Modified: usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/teraport-local-pbs/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,7 +1,6 @@ - + $HOME/swiftwork 0 - - + Modified: usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/teraport-local-pbs-coasters/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,4 +1,4 @@ - + $HOME/swiftwork @@ -10,5 +10,4 @@ short 0.5 10000 - - + Modified: usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/teraport-remote-pbs-coasters-ssh/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,4 +1,4 @@ - + 3000 8 @@ -10,4 +10,4 @@ 10000 $HOME/swiftwork - + Modified: usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/sites.xml 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/etc/sites/teraport-remote-ssh/sites.xml 2010-08-22 03:35:05 UTC (rev 3560) @@ -1,7 +1,7 @@ - + $HOME/swiftwork 0 - + Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-21 18:30:42 UTC (rev 3559) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-22 03:35:05 UTC (rev 3560) @@ -460,6 +460,9 @@ close(APPFILE); my ($site, $name, $path, $status, $platform, $profile); my $counter=0; + my $header = sprintf("\n%-15s %-30s %-35s\n", 'Command Name', 'Path', 'Profile'); + $header .= sprintf("%-15s %-30s %-35s\n", '------------', '----', '-------'); + print $header; foreach(@app_data) { ($site, $name, $path, $status, $platform, $profile) = split(/\s+/); if($name) { From noreply at svn.ci.uchicago.edu Mon Aug 23 00:26:28 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 23 Aug 2010 00:26:28 -0500 (CDT) Subject: [Swift-commit] r3561 - trunk/src/org/griphyn/vdl/karajan/lib Message-ID: <20100823052628.8FAE39CCCE@vm-125-59.ci.uchicago.edu> Author: hategan Date: 2010-08-23 00:26:28 -0500 (Mon, 23 Aug 2010) New Revision: 3561 Modified: trunk/src/org/griphyn/vdl/karajan/lib/OutFileDirs.java trunk/src/org/griphyn/vdl/karajan/lib/OutFiles.java Log: fixed improper path parsing Modified: trunk/src/org/griphyn/vdl/karajan/lib/OutFileDirs.java =================================================================== --- trunk/src/org/griphyn/vdl/karajan/lib/OutFileDirs.java 2010-08-22 03:35:05 UTC (rev 3560) +++ trunk/src/org/griphyn/vdl/karajan/lib/OutFileDirs.java 2010-08-23 05:26:28 UTC (rev 3561) @@ -11,12 +11,11 @@ import org.globus.cog.karajan.stack.VariableStack; import org.globus.cog.karajan.util.TypeUtil; import org.globus.cog.karajan.workflow.ExecutionException; -import org.globus.cog.karajan.workflow.nodes.AbstractSequentialWithArguments; import org.griphyn.vdl.mapping.AbsFile; import org.griphyn.vdl.mapping.DSHandle; import org.griphyn.vdl.mapping.Path; -public class OutFileDirs extends AbstractSequentialWithArguments { +public class OutFileDirs extends VDLFunction { public static final Arg STAGEOUTS = new Arg.Positional("stageouts"); static { @@ -24,13 +23,13 @@ } @Override - protected void post(VariableStack stack) throws ExecutionException { + public Object function(VariableStack stack) throws ExecutionException { List files = TypeUtil.toList(STAGEOUTS.getValue(stack)); VariableArguments ret = ArgUtil.getVariableReturn(stack); try { for (Object f : files) { List pv = TypeUtil.toList(f); - Path p = Path.parse(TypeUtil.toString(pv.get(0))); + Path p = parsePath(pv.get(0), stack); DSHandle handle = (DSHandle) pv.get(1); DSHandle leaf = handle.getField(p); String fname = VDLFunction.filename(leaf)[0]; @@ -41,6 +40,6 @@ catch (Exception e) { throw new ExecutionException(e); } - super.post(stack); + return null; } } Modified: trunk/src/org/griphyn/vdl/karajan/lib/OutFiles.java =================================================================== --- trunk/src/org/griphyn/vdl/karajan/lib/OutFiles.java 2010-08-22 03:35:05 UTC (rev 3560) +++ trunk/src/org/griphyn/vdl/karajan/lib/OutFiles.java 2010-08-23 05:26:28 UTC (rev 3561) @@ -30,7 +30,7 @@ try { for (Object f : files) { List pv = TypeUtil.toList(f); - Path p = Path.parse(TypeUtil.toString(pv.get(0))); + Path p = parsePath(pv.get(0), stack); DSHandle handle = (DSHandle) pv.get(1); DSHandle leaf = handle.getField(p); String fname = argList(VDLFunction.filename(leaf), true); From noreply at svn.ci.uchicago.edu Mon Aug 23 13:08:04 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 23 Aug 2010 13:08:04 -0500 (CDT) Subject: [Swift-commit] r3562 - in usertools/swift/swiftconfig: etc/sites etc/sites/cnari-abe etc/sites/cnari-local etc/sites/cnari-queenbee etc/sites/cnari-ranger lib/perl Message-ID: <20100823180804.10E8E9CC9F@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-23 13:08:03 -0500 (Mon, 23 Aug 2010) New Revision: 3562 Added: usertools/swift/swiftconfig/etc/sites/cnari-abe/ usertools/swift/swiftconfig/etc/sites/cnari-abe/apps usertools/swift/swiftconfig/etc/sites/cnari-abe/sites.xml usertools/swift/swiftconfig/etc/sites/cnari-local/ usertools/swift/swiftconfig/etc/sites/cnari-local/apps usertools/swift/swiftconfig/etc/sites/cnari-local/sites.xml usertools/swift/swiftconfig/etc/sites/cnari-queenbee/ usertools/swift/swiftconfig/etc/sites/cnari-queenbee/apps usertools/swift/swiftconfig/etc/sites/cnari-queenbee/sites.xml usertools/swift/swiftconfig/etc/sites/cnari-ranger/ usertools/swift/swiftconfig/etc/sites/cnari-ranger/apps usertools/swift/swiftconfig/etc/sites/cnari-ranger/sites.xml Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: Swiftconfig should now substitute $USER Added cnari templates Added: usertools/swift/swiftconfig/etc/sites/cnari-abe/apps =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-abe/apps (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-abe/apps 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1 @@ +cnari-abe Added: usertools/swift/swiftconfig/etc/sites/cnari-abe/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-abe/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-abe/sites.xml 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1,18 @@ + + 10000 + 1.28 + 10 + 172800 + 10 + 8 + 8 + 8 + normal + TG-DBS080004N + configtest + + + 8 + /scratch/users/sidgrid/$USER + + Added: usertools/swift/swiftconfig/etc/sites/cnari-local/apps =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-local/apps (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-local/apps 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1 @@ +cnari-local Added: usertools/swift/swiftconfig/etc/sites/cnari-local/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-local/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-local/sites.xml 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1,7 @@ + + + + 10000 + .31 + $HOME/swiftwork + Added: usertools/swift/swiftconfig/etc/sites/cnari-queenbee/apps =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-queenbee/apps (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-queenbee/apps 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1 @@ +cnari-queenbee Added: usertools/swift/swiftconfig/etc/sites/cnari-queenbee/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-queenbee/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-queenbee/sites.xml 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1,18 @@ + + 10000 + 1.28 + 10 + 172800 + 10 + 8 + 8 + 8 + workq + TG-DBS080004N + configtest + + + 8 + /work/scommuni/$USER + + Added: usertools/swift/swiftconfig/etc/sites/cnari-ranger/apps =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-ranger/apps (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-ranger/apps 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1 @@ +cnari-ranger Added: usertools/swift/swiftconfig/etc/sites/cnari-ranger/sites.xml =================================================================== --- usertools/swift/swiftconfig/etc/sites/cnari-ranger/sites.xml (rev 0) +++ usertools/swift/swiftconfig/etc/sites/cnari-ranger/sites.xml 2010-08-23 18:08:03 UTC (rev 3562) @@ -0,0 +1,16 @@ + + 10000 + 1.28 + 10 + 172800 + 10 + 8 + 16 + 16 + long + TG-DBS080004N + + + 16 + /work/00926/tg459516/sidgrid_out/$USER + Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-23 05:26:28 UTC (rev 3561) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-23 18:08:03 UTC (rev 3562) @@ -292,6 +292,7 @@ # Work directory if ( $xml_ref->{workdirectory} ) { $xml_ref->{workdirectory}[0] =~ s/\$HOME/$ENV{'HOME'}/; + $xml_ref->{workdirectory}[0] =~ s/\$USER/$ENV{'USER'}/; $xml_ref->{workdirectory} = [ get_entry( 'Work Directory', $xml_ref->{workdirectory}[0], $option_default) ]; } From noreply at svn.ci.uchicago.edu Mon Aug 23 14:40:19 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 23 Aug 2010 14:40:19 -0500 (CDT) Subject: [Swift-commit] r3563 - in usertools/swift/swiftconfig: bin lib/perl Message-ID: <20100823194019.733B49CCCE@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-23 14:40:19 -0500 (Mon, 23 Aug 2010) New Revision: 3563 Modified: usertools/swift/swiftconfig/bin/swiftconfig usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm Log: swiftconfig -template can add multiple hosts at once (useful with -defaults) Can limit the profile settings you want to edit with -edit -profile Modified: usertools/swift/swiftconfig/bin/swiftconfig =================================================================== --- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-23 18:08:03 UTC (rev 3562) +++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-23 19:40:19 UTC (rev 3563) @@ -20,23 +20,25 @@ my $option_remove = q{}; # Remove entry from sites.xml my $option_edit = q{}; # Edit mode my $option_default = q{}; # When adding a site, use all defaults -my $option_template = q{}; # Create config from template specified +my @option_templates = (); # Create config from template specified my $option_copy = q{}; # Copy an existing configuration my $option_applications = q{}; # Edit applications my $option_import = q{}; # Import existing configuration +my @option_profiles = (); # Specify one or more profiles to edit # Assign variables from command line options GetOptions( - 'remove=s' => \$option_remove, - 'default|defaults' => \$option_default, - 'full' => sub { $option_default = 0; }, - 'template=s' => \$option_template, - 'edit=s' => \$option_edit, - 'copy=s' => \$option_copy, - 'apps|applications' => \$option_applications, - 'import=s' => \$option_import, - 'list=s' => \$option_list, - 'help|man' => sub { pod2usage(-verbose => 2); }, + 'remove=s' => \$option_remove, + 'default|defaults' => \$option_default, + 'full' => sub { $option_default = 0; }, + 'template|templates=s{,}' => \@option_templates, + 'edit=s' => \$option_edit, + 'copy=s' => \$option_copy, + 'apps|applications' => \$option_applications, + 'import=s' => \$option_import, + 'list=s' => \$option_list, + 'help|man' => sub { pod2usage(-verbose => 2); }, + 'profile|profiles=s{,}' => \@option_profiles, ); # Prepare data @@ -45,7 +47,7 @@ # Check command line options if( !$option_remove - && !$option_template + && !@option_templates && !$option_edit && !$option_copy && !$option_applications @@ -67,42 +69,45 @@ my $template_directory = join( '/', @execution_path ) . '/etc/sites'; # Add configuration from a template -if ($option_template) { +if (@option_templates) { - # Update XML info - my $from_directory = "$template_directory/$option_template"; - my $sites_input_file = "$from_directory/sites.xml"; - if ( !-e "$sites_input_file" ) { - die "Unable to find template for $option_template\n"; - } - my $xml_ref = update_xml("$sites_input_file", 0, $option_default); - my $new_sitename = $xml_ref->{handle}; - my $output_directory = "$dotswift_directory/sites/$new_sitename"; - if ( -d "$output_directory" ) { - die "Configuration for $new_sitename already exists\n"; - } + foreach my $option_template(@option_templates) { + # Update XML info + my $from_directory = "$template_directory/$option_template"; + my $sites_input_file = "$from_directory/sites.xml"; + if ( !-e "$sites_input_file" ) { + die "Unable to find template for $option_template\n"; + } + my $xml_ref = update_xml("$sites_input_file", 0, $option_default); + my $new_sitename = $xml_ref->{handle}; + my $output_directory = "$dotswift_directory/sites/$new_sitename"; + if ( -d "$output_directory" ) { + print "Configuration for $new_sitename already exists\n"; + next; + } - # Update and copy files to reflect input - my @files_to_copy = <$from_directory/*>; - create_directory("$output_directory"); - foreach my $file_to_copy (@files_to_copy) { - copy_file($file_to_copy, $output_directory); - } - my $xml_out_ref = $xml->XMLout( - $xml_ref, - RootName => 'pool', - SuppressEmpty => 1, - ); - write_file( "$output_directory/sites.xml", $xml_out_ref ); + # Update and copy files to reflect input + my @files_to_copy = <$from_directory/*>; + create_directory("$output_directory"); + foreach my $file_to_copy (@files_to_copy) { + copy_file($file_to_copy, $output_directory); + } + my $xml_out_ref = $xml->XMLout( + $xml_ref, + RootName => 'pool', + SuppressEmpty => 1, + ); + write_file( "$output_directory/sites.xml", $xml_out_ref ); + + update_site_applications($new_sitename, $option_default); - update_site_applications($new_sitename, $option_default); - - # Handle SSH - if ( $xml_ref->{execution}{provider} eq 'ssh' ) { - add_ssh( $new_sitename, $xml_ref->{execution}{url} ); + # Handle SSH + if ( $xml_ref->{execution}{provider} eq 'ssh' ) { + add_ssh( $new_sitename, $xml_ref->{execution}{url} ); + } + + print "Successfully added $option_template\n"; } - - print "Successfully added $option_template\n"; } # Remove an entry @@ -122,20 +127,25 @@ if ($option_edit) { my $output_directory = "$dotswift_directory/sites/$option_edit"; - my $sites_file = "$output_directory/sites.xml"; - if ( !-e "$sites_file" ) { + my $xml_filename = "$output_directory/sites.xml"; + if ( !-e "$xml_filename" ) { die "Unable to find configuration for $option_edit\n"; } - create_directory($output_directory); - my $xml_filename = "$output_directory/sites.xml"; my $xml_ref = $xml->XMLin( $xml_filename, ForceArray => [qw(workdirectory profile)], KeyAttr => [], ); - $xml_ref = update_xml("$sites_file", 1, $option_default); - + + if(@option_profiles) { + $xml_ref = edit_profile($xml_filename, @option_profiles); + } + else { + $xml_ref = update_xml("$xml_filename", 1, $option_default); + update_site_applications($option_edit, $option_default); + } + # Save my $xml_out_ref = $xml->XMLout( $xml_ref, @@ -143,7 +153,6 @@ SuppressEmpty => 1, ); write_file( "$output_directory/sites.xml", $xml_out_ref ); - update_site_applications($option_edit, $option_default); # Add/modify/remove ssh entries as needed if ( $xml_ref->{execution}{provider} eq 'ssh' ) { Modified: usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm =================================================================== --- usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-23 18:08:03 UTC (rev 3562) +++ usertools/swift/swiftconfig/lib/perl/SwiftConfig.pm 2010-08-23 19:40:19 UTC (rev 3563) @@ -21,7 +21,7 @@ update_tc_hostname update_xml write_file print_directory strip_directory copy_file cat_file add_application edit_application remove_application list_applications initialize_swiftconfig update_site_applications import_tc -import_xml +import_xml edit_profile ); our $VERSION = '0.01'; @@ -677,6 +677,32 @@ print "Successfully imported application set named $set_name\n"; } +sub edit_profile { + my ($xml_filename, @profiles_to_edit) = @_; + if(! -e $xml_filename) { + print "Unable to edit profile on $xml_filename\n"; + return; + } + + my $xml_ref = $xml->XMLin( + $xml_filename, + ForceArray => [qw(workdirectory profile)], + KeyAttr => [], + ); + + + foreach my $profile ( @{ $xml_ref->{profile} } ) { + foreach my $profile_to_edit(@profiles_to_edit) { + if(lc($profile->{key}) eq lc($profile_to_edit)) { + $profile->{content} = + get_entry( $profile->{key}, $profile->{content}, 0); + } + } + } + + return $xml_ref; +} + 1; __END__ From noreply at svn.ci.uchicago.edu Tue Aug 24 22:00:24 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 24 Aug 2010 22:00:24 -0500 (CDT) Subject: [Swift-commit] r3565 - trunk/libexec Message-ID: <20100825030024.47B7A9CD34@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-24 22:00:24 -0500 (Tue, 24 Aug 2010) New Revision: 3565 Modified: trunk/libexec/cdm.pl Log: Allow arbitrary tabs and spaces in CDM file Modified: trunk/libexec/cdm.pl =================================================================== --- trunk/libexec/cdm.pl 2010-08-23 20:16:04 UTC (rev 3564) +++ trunk/libexec/cdm.pl 2010-08-25 03:00:24 UTC (rev 3565) @@ -66,7 +66,7 @@ next if $_ eq ""; - @tokens = split(/ /, $_); + @tokens = split(/[ \t]+/, $_); $type = shift(@tokens); if ($type eq "rule") { From noreply at svn.ci.uchicago.edu Tue Aug 24 22:16:34 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 24 Aug 2010 22:16:34 -0500 (CDT) Subject: [Swift-commit] r3566 - trunk/libexec Message-ID: <20100825031634.4D8919CD34@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-24 22:16:34 -0500 (Tue, 24 Aug 2010) New Revision: 3566 Modified: trunk/libexec/_swiftwrap Log: Do a "mkdir -p" for CDM DIRECT output Also, ensure CDM lookup errors make it into the info file Modified: trunk/libexec/_swiftwrap =================================================================== --- trunk/libexec/_swiftwrap 2010-08-25 03:00:24 UTC (rev 3565) +++ trunk/libexec/_swiftwrap 2010-08-25 03:16:34 UTC (rev 3566) @@ -135,7 +135,8 @@ RESULT="DEFAULT" if [ -f shared/cdm.pl ]; then - RESULT=$( perl shared/cdm.pl lookup $FILE < $CDM_FILE ) + RESULT=$( perl shared/cdm.pl lookup $FILE < $CDM_FILE 2> $INFO ) + checkError 254 "CDM[LOOKUP]: failed! (malformed CDM file?)" fi echo $RESULT } @@ -162,6 +163,8 @@ elif [ $MODE == "OUTPUT" ]; then mkdir -p $DIRECT_DIR checkError 254 "CDM[DIRECT]: mkdir -p $DIRECT_DIR failed!" + mkdir -p $( dirname $DIRECT_DIR/$FILE ) + checkError 254 "CDM[DIRECT]: mkdir -p $( dirname $FILE ) failed!" touch $DIRECT_DIR/$FILE checkError 254 "CDM[DIRECT]: Touching $DIRECT_DIR/$FILE failed!" ln -s $DIRECT_DIR/$FILE $JOBDIR/$FILE @@ -396,6 +399,7 @@ fi fi +log "PWD=$PWD" log "DIR=$DIR" log "EXEC=$EXEC" log "STDIN=$STDIN" From noreply at svn.ci.uchicago.edu Thu Aug 26 15:35:09 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Thu, 26 Aug 2010 15:35:09 -0500 (CDT) Subject: [Swift-commit] r3567 - trunk/tests Message-ID: <20100826203509.BE3BB9CC99@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-26 15:35:09 -0500 (Thu, 26 Aug 2010) New Revision: 3567 Modified: trunk/tests/nightly.sh Log: Handle HTML write error Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-25 03:16:34 UTC (rev 3566) +++ trunk/tests/nightly.sh 2010-08-26 20:35:09 UTC (rev 3567) @@ -142,6 +142,7 @@ html() { printf "$@\n" >>$HTML + [ $? != 0 ] && echo "html(): write error!" && exit 1 } html_h1() { @@ -670,17 +671,17 @@ sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml SKIP_COUNTER=0 -start_part "Part II: Working Tests" -GROUP=$TESTDIR/language/working -test_group +#start_part "Part II: Working Tests" +#GROUP=$TESTDIR/language/working +#test_group start_part "Part III: Local Tests" GROUP=$TESTDIR/local test_group -start_part "Part IV: Should-Not-Work Tests" -GROUP=$TESTDIR/language/should-not-work -test_group +#start_part "Part IV: Should-Not-Work Tests" +#GROUP=$TESTDIR/language/should-not-work +#test_group if [ $GRID_TESTS == "0" ]; then exit From noreply at svn.ci.uchicago.edu Fri Aug 27 13:01:22 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 13:01:22 -0500 (CDT) Subject: [Swift-commit] r3568 - trunk/src/org/griphyn/vdl/karajan/lib Message-ID: <20100827180122.4C4779CCC9@vm-125-59.ci.uchicago.edu> Author: hategan Date: 2010-08-27 13:01:22 -0500 (Fri, 27 Aug 2010) New Revision: 3568 Modified: trunk/src/org/griphyn/vdl/karajan/lib/Mark.java Log: another invalid path Modified: trunk/src/org/griphyn/vdl/karajan/lib/Mark.java =================================================================== --- trunk/src/org/griphyn/vdl/karajan/lib/Mark.java 2010-08-26 20:35:09 UTC (rev 3567) +++ trunk/src/org/griphyn/vdl/karajan/lib/Mark.java 2010-08-27 18:01:22 UTC (rev 3568) @@ -33,7 +33,7 @@ List files = TypeUtil.toList(RESTARTS.getValue(stack)); for (Object f : files) { List pv = TypeUtil.toList(f); - Path p = Path.parse(TypeUtil.toString(pv.get(0))); + Path p = parsePath(pv.get(0), stack); DSHandle handle = (DSHandle) pv.get(1); DSHandle leaf = handle.getField(p); synchronized (leaf) { From noreply at svn.ci.uchicago.edu Fri Aug 27 13:32:00 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 13:32:00 -0500 (CDT) Subject: [Swift-commit] r3569 - trunk/tests Message-ID: <20100827183200.0BBA49CCC9@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 13:31:59 -0500 (Fri, 27 Aug 2010) New Revision: 3569 Modified: trunk/tests/nightly.sh Log: Improve group handling, use swift.properties Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-27 18:01:22 UTC (rev 3568) +++ trunk/tests/nightly.sh 2010-08-27 18:31:59 UTC (rev 3569) @@ -24,6 +24,12 @@ # These may setup and inspect files in RUNDIR including swift.out # Tests are GROUPed into directories +# Each GROUP directory has: +# 1) a list of *.swift tests (plus *.sh scripts) +# 2) optionally a tc.template.data +# 3) optionally a swift.properties +# 4) optionally a title.txt +# 5) preferably a README.txt # OUTPUT is the stdout of the current test # stdout.txt retains stdout from the previous test (for *.clean.sh) @@ -542,7 +548,9 @@ script_exec $GROUP/$SETUPSCRIPT "S" fi # test_exec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT - monitored_exec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT + monitored_exec swift -config swift.properties \ + -sites.file sites.xml \ + -tc.file tc.data $SWIFTSCRIPT if [ -x $GROUP/$CHECKSCRIPT ]; then script_exec $GROUP/$CHECKSCRIPT "√" fi @@ -583,7 +591,7 @@ out package "swift-$DATE.tar.gz" } -create_tc_data() { +group_tc_data() { if [ -f $GROUP/tc.template.data ]; then sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data [ $? != 0 ] && crash "Could not create tc.data!" @@ -593,9 +601,28 @@ fi } +group_swift_properties() { + if [ -f $GROUP/swift.properties ]; then + cp -uv $GROUP/swift.properties . + [ $? != 0 ] && crash "Could not copy swift.properties!" + else + cp -uv $SWIFT_HOME/etc/swift.properties . + [ $? != 0 ] && crash "Could not copy swift.properties!" + fi +} + +group_title() { + if [ -r $GROUP/title.txt ]; then + cat $GROUP/title.txt + else + echo "untitled" + fi +} + test_group() { - create_tc_data + group_tc_data + group_swift_properties for TEST in $( ls $GROUP/*.swift ); do @@ -620,7 +647,7 @@ start_test_results cd $TOPDIR -start_part "Part I: Build" +start_part "Prolog: Build" TESTLINK= EXITONFAILURE=true @@ -671,23 +698,27 @@ sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml SKIP_COUNTER=0 -#start_part "Part II: Working Tests" -#GROUP=$TESTDIR/language/working -#test_group -start_part "Part III: Local Tests" -GROUP=$TESTDIR/local -test_group +GROUPLIST=( $TESTDIR/language/working \ + $TESTDIR/local \ + $TESTDIR/language/should-not-work ) -#start_part "Part IV: Should-Not-Work Tests" -#GROUP=$TESTDIR/language/should-not-work -#test_group +echo ${GROUPLIST[@]} +GROUPCOUNT=1 +for G in ${GROUPLIST[@]}; do + GROUP=$G + TITLE=$( group_title ) + start_part "Part $GROUPCOUNT: $TITLE" + test_group + (( GROUPCOUNT++ )) +done + if [ $GRID_TESTS == "0" ]; then exit fi -TESTPART="Part III: Grid Tests" +TESTPART="Appendix G: Grid Tests" for TEST in `ls $TESTDIR/*.dtm $TESTDIR/*.swift`; do BN=`basename $TEST` From noreply at svn.ci.uchicago.edu Fri Aug 27 13:42:12 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 13:42:12 -0500 (CDT) Subject: [Swift-commit] r3570 - trunk/src/org/globus/swift/data Message-ID: <20100827184212.072839CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 13:42:11 -0500 (Fri, 27 Aug 2010) New Revision: 3570 Modified: trunk/src/org/globus/swift/data/Director.java Log: Spelling Modified: trunk/src/org/globus/swift/data/Director.java =================================================================== --- trunk/src/org/globus/swift/data/Director.java 2010-08-27 18:31:59 UTC (rev 3569) +++ trunk/src/org/globus/swift/data/Director.java 2010-08-27 18:42:11 UTC (rev 3570) @@ -231,7 +231,7 @@ } /** - Mark that the files in the given batch have been sucessfully broadcasted. + Mark that the files in the given batch have been successfully broadcasted. Should only be called by {@link doBroadcast}. */ private static void markBroadcasts(Map> batch) { From noreply at svn.ci.uchicago.edu Fri Aug 27 13:42:41 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 13:42:41 -0500 (CDT) Subject: [Swift-commit] r3571 - trunk/src/org/griphyn/vdl/karajan/lib Message-ID: <20100827184241.B1ECA9CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 13:42:41 -0500 (Fri, 27 Aug 2010) New Revision: 3571 Modified: trunk/src/org/griphyn/vdl/karajan/lib/AppStageins.java Log: Skip stagein in provider staging for CDM files Modified: trunk/src/org/griphyn/vdl/karajan/lib/AppStageins.java =================================================================== --- trunk/src/org/griphyn/vdl/karajan/lib/AppStageins.java 2010-08-27 18:42:11 UTC (rev 3570) +++ trunk/src/org/griphyn/vdl/karajan/lib/AppStageins.java 2010-08-27 18:42:41 UTC (rev 3571) @@ -6,16 +6,21 @@ import java.util.LinkedList; import java.util.List; +import org.apache.log4j.Logger; import org.globus.cog.karajan.arguments.Arg; import org.globus.cog.karajan.arguments.ArgUtil; import org.globus.cog.karajan.stack.VariableStack; import org.globus.cog.karajan.util.TypeUtil; import org.globus.cog.karajan.workflow.ExecutionException; import org.globus.cog.karajan.workflow.nodes.AbstractSequentialWithArguments; +import org.globus.swift.data.Director; +import org.globus.swift.data.policy.Policy; import org.griphyn.vdl.mapping.AbsFile; public class AppStageins extends AbstractSequentialWithArguments { + static Logger logger = Logger.getLogger(AppStageins.class); + public static final Arg JOBID = new Arg.Positional("jobid"); public static final Arg FILES = new Arg.Positional("files"); public static final Arg DIR = new Arg.Positional("dir"); @@ -31,16 +36,24 @@ List files = TypeUtil.toList(FILES.getValue(stack)); for (Object f : files) { AbsFile file = new AbsFile(TypeUtil.toString(f)); + Policy policy = Director.lookup(file.toString()); + if (policy != Policy.DEFAULT) { + logger.debug("will not stage in (CDM): " + file); + continue; + } + String protocol = file.getProtocol(); if (protocol.equals("file")) { protocol = TypeUtil.toString(STAGING_METHOD.getValue(stack)); } - String path = file.getDir().equals("") ? file.getName() : file.getDir() + String path = file.getDir().equals("") ? file.getName() : file + .getDir() + "/" + file.getName(); String relpath = path.startsWith("/") ? path.substring(1) : path; + logger.debug("will stage in: " + relpath + " via: " + protocol); ArgUtil.getChannelReturn(stack, STAGEIN).append( - makeList(protocol + "://" + file.getHost() + "/" + path, TypeUtil.toString(DIR.getValue(stack)) - + "/" + relpath)); + makeList(protocol + "://" + file.getHost() + "/" + path, + TypeUtil.toString(DIR.getValue(stack)) + "/" + relpath)); } super.post(stack); } From noreply at svn.ci.uchicago.edu Fri Aug 27 15:11:40 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 15:11:40 -0500 (CDT) Subject: [Swift-commit] r3572 - trunk/tests Message-ID: <20100827201140.B7B309CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 15:11:40 -0500 (Fri, 27 Aug 2010) New Revision: 3572 Added: trunk/tests/cdm/ Log: Location for CDM tests From noreply at svn.ci.uchicago.edu Fri Aug 27 15:12:16 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 15:12:16 -0500 (CDT) Subject: [Swift-commit] r3573 - trunk/tests Message-ID: <20100827201216.C5FF99CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 15:12:16 -0500 (Fri, 27 Aug 2010) New Revision: 3573 Added: trunk/tests/cdm-ps/ Log: Location for CDM provider staging tests From noreply at svn.ci.uchicago.edu Fri Aug 27 16:01:13 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 16:01:13 -0500 (CDT) Subject: [Swift-commit] r3574 - in trunk/tests/language: should-not-work working Message-ID: <20100827210113.951249CCC9@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 16:01:13 -0500 (Fri, 27 Aug 2010) New Revision: 3574 Added: trunk/tests/language/should-not-work/title.txt trunk/tests/language/working/title.txt Log: Add test titles Added: trunk/tests/language/should-not-work/title.txt =================================================================== --- trunk/tests/language/should-not-work/title.txt (rev 0) +++ trunk/tests/language/should-not-work/title.txt 2010-08-27 21:01:13 UTC (rev 3574) @@ -0,0 +1 @@ +Should-Not-Work tests Added: trunk/tests/language/working/title.txt =================================================================== --- trunk/tests/language/working/title.txt (rev 0) +++ trunk/tests/language/working/title.txt 2010-08-27 21:01:13 UTC (rev 3574) @@ -0,0 +1 @@ +Language-Working Tests From noreply at svn.ci.uchicago.edu Fri Aug 27 16:43:16 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 16:43:16 -0500 (CDT) Subject: [Swift-commit] r3575 - trunk/tests Message-ID: <20100827214316.AB7B19CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 16:43:16 -0500 (Fri, 27 Aug 2010) New Revision: 3575 Modified: trunk/tests/nightly.sh Log: Enable testing CDM features Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-27 21:01:13 UTC (rev 3574) +++ trunk/tests/nightly.sh 2010-08-27 21:43:16 UTC (rev 3575) @@ -21,7 +21,7 @@ # Each *.swift test may be accompanied by a # *.setup.sh, *.check.sh, and/or *.clean.sh script -# These may setup and inspect files in RUNDIR including swift.out +# These may setup and inspect files in RUNDIR including exec.out # Tests are GROUPed into directories # Each GROUP directory has: @@ -430,7 +430,6 @@ declare -p PWD printf "\nExecuting: $@" >>$LOG rm -fv $OUTPUT - LASTCMD="$@" "$@" > $OUTPUT 2>&1 EXITCODE=$? if [ "$EXITCODE" == "127" ]; then @@ -517,6 +516,7 @@ RESULT=$( result ) test_log + LASTCMD="$@" out test $SEQ "$LASTCMD" $RESULT $TEST_LOG check_bailout @@ -547,10 +547,15 @@ if [ -x $GROUP/$SETUPSCRIPT ]; then script_exec $GROUP/$SETUPSCRIPT "S" fi - # test_exec swift -sites.file sites.xml -tc.file tc.data $SWIFTSCRIPT + + CDM= + [ -r fs.data ] && CDM="-cdm.file fs.data" + monitored_exec swift -config swift.properties \ -sites.file sites.xml \ - -tc.file tc.data $SWIFTSCRIPT + -tc.file tc.data \ + $CDM $SWIFTSCRIPT + if [ -x $GROUP/$CHECKSCRIPT ]; then script_exec $GROUP/$CHECKSCRIPT "√" fi @@ -596,11 +601,20 @@ sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data [ $? != 0 ] && crash "Could not create tc.data!" else - cp -uv $SWIFT_HOME/etc/tc.data . + cp -v $SWIFT_HOME/etc/tc.data . [ $? != 0 ] && crash "Could not copy tc.data!" fi } +group_fs_data() { + if [ -f $GROUP/fs.template.data ]; then + sed "s at _PWD_@$PWD@" < $GROUP/fs.template.data > fs.data + [ $? != 0 ] && crash "Could not create fs.data!" + else + rm -f fs.data + fi +} + group_swift_properties() { if [ -f $GROUP/swift.properties ]; then cp -uv $GROUP/swift.properties . @@ -622,6 +636,7 @@ test_group() { group_tc_data + group_fs_data group_swift_properties for TEST in $( ls $GROUP/*.swift ); do @@ -701,7 +716,8 @@ GROUPLIST=( $TESTDIR/language/working \ $TESTDIR/local \ - $TESTDIR/language/should-not-work ) + $TESTDIR/language/should-not-work \ + $TESTDIR/cdm ) echo ${GROUPLIST[@]} @@ -715,7 +731,7 @@ done if [ $GRID_TESTS == "0" ]; then - exit + exit 0 fi TESTPART="Appendix G: Grid Tests" From noreply at svn.ci.uchicago.edu Fri Aug 27 16:44:47 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 16:44:47 -0500 (CDT) Subject: [Swift-commit] r3576 - trunk/tests/cdm Message-ID: <20100827214447.B65729CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 16:44:47 -0500 (Fri, 27 Aug 2010) New Revision: 3576 Added: trunk/tests/cdm/201-direct-output.check.sh trunk/tests/cdm/201-direct-output.clean.sh trunk/tests/cdm/201-direct-output.setup.sh trunk/tests/cdm/201-direct-output.swift trunk/tests/cdm/README.txt trunk/tests/cdm/fs.template.data trunk/tests/cdm/title.txt Log: Add test cdm/201-direct-output Added: trunk/tests/cdm/201-direct-output.check.sh =================================================================== --- trunk/tests/cdm/201-direct-output.check.sh (rev 0) +++ trunk/tests/cdm/201-direct-output.check.sh 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x + +grep $( uname -m ) 201-input.txt || exit 1 +grep $( uname -m ) 201/output.txt || exit 1 + +exit 0 Property changes on: trunk/tests/cdm/201-direct-output.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm/201-direct-output.clean.sh =================================================================== --- trunk/tests/cdm/201-direct-output.clean.sh (rev 0) +++ trunk/tests/cdm/201-direct-output.clean.sh 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -rv 201-input.txt 201 + +exit 0 Property changes on: trunk/tests/cdm/201-direct-output.clean.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm/201-direct-output.setup.sh =================================================================== --- trunk/tests/cdm/201-direct-output.setup.sh (rev 0) +++ trunk/tests/cdm/201-direct-output.setup.sh 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +{ + uname -a + date +} > 201-input.txt + +exit 0 Property changes on: trunk/tests/cdm/201-direct-output.setup.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm/201-direct-output.swift =================================================================== --- trunk/tests/cdm/201-direct-output.swift (rev 0) +++ trunk/tests/cdm/201-direct-output.swift 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1,14 @@ + +type file; + +app (file o) copy (file i) +{ + cp @i @o; +} + +file f1<"201-input.txt">; + +// Will be transformed by CDM to 201/output.txt: +file f2<"output.txt">; + +f2 = copy(f1); Added: trunk/tests/cdm/README.txt =================================================================== --- trunk/tests/cdm/README.txt (rev 0) +++ trunk/tests/cdm/README.txt 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1,5 @@ + +000 series : noop tests +200 series : DIRECT tests +300 series : BROADCAST test + Added: trunk/tests/cdm/fs.template.data =================================================================== --- trunk/tests/cdm/fs.template.data (rev 0) +++ trunk/tests/cdm/fs.template.data 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1 @@ +rule .*output.txt DIRECT _PWD_/201 Added: trunk/tests/cdm/title.txt =================================================================== --- trunk/tests/cdm/title.txt (rev 0) +++ trunk/tests/cdm/title.txt 2010-08-27 21:44:47 UTC (rev 3576) @@ -0,0 +1 @@ +CDM tests From noreply at svn.ci.uchicago.edu Fri Aug 27 17:15:23 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 17:15:23 -0500 (CDT) Subject: [Swift-commit] r3577 - trunk/etc Message-ID: <20100827221523.31ED49CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 17:15:23 -0500 (Fri, 27 Aug 2010) New Revision: 3577 Modified: trunk/etc/tc.data Log: Add /bin/cp Modified: trunk/etc/tc.data =================================================================== --- trunk/etc/tc.data 2010-08-27 21:44:47 UTC (rev 3576) +++ trunk/etc/tc.data 2010-08-27 22:15:23 UTC (rev 3577) @@ -15,3 +15,4 @@ localhost grep /bin/grep INSTALLED INTEL32::LINUX null localhost sort /bin/sort INSTALLED INTEL32::LINUX null localhost paste /bin/paste INSTALLED INTEL32::LINUX null +localhost cp /bin/cp INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Fri Aug 27 17:15:46 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Fri, 27 Aug 2010 17:15:46 -0500 (CDT) Subject: [Swift-commit] r3578 - trunk/libexec Message-ID: <20100827221546.608499CCAC@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-27 17:15:46 -0500 (Fri, 27 Aug 2010) New Revision: 3578 Modified: trunk/libexec/_swiftwrap trunk/libexec/_swiftwrap.staging trunk/libexec/cdm_lib.sh trunk/libexec/vdl-int-staging.k Log: Enable CDM DIRECT for input with provider staging Modified: trunk/libexec/_swiftwrap =================================================================== --- trunk/libexec/_swiftwrap 2010-08-27 22:15:23 UTC (rev 3577) +++ trunk/libexec/_swiftwrap 2010-08-27 22:15:46 UTC (rev 3578) @@ -6,7 +6,7 @@ echo >& "$INFO" echo "_____________________________________________________________________________" >& "$INFO" echo >& "$INFO" - echo " $1" >& "$INFO" + echo " $1" >& "$INFO" echo "_____________________________________________________________________________" >& "$INFO" echo >& "$INFO" } @@ -121,104 +121,23 @@ for a in ${!ARRAY} do - if [[ ${a} == ${X} ]]; then + if [[ ${a} == ${X} ]]; then return 0 fi done return 1 } -# Output: -cdm_lookup() { - FILE=$1 - CDM_FILE=$2 - - RESULT="DEFAULT" - if [ -f shared/cdm.pl ]; then - RESULT=$( perl shared/cdm.pl lookup $FILE < $CDM_FILE 2> $INFO ) - checkError 254 "CDM[LOOKUP]: failed! (malformed CDM file?)" - fi - echo $RESULT -} - -cdm_action() { - log "CDM_ACTION: $@" - - local JOBDIR=$1 # Given jobdir - local MODE=$2 # INPUT or OUTPUT - local FILE=$3 # User file - local POLICY=$4 # DIRECT, BROADCAST, ... - shift 4 - local ARGS=$@ - - case $POLICY in - DIRECT) - DIRECT_DIR=${ARGS[0]} - log "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE via $JOBDIR/$FILE" - if [ $MODE == "INPUT" ]; then - [ -f "$DIRECT_DIR/$FILE" ] - checkError 254 "CDM[DIRECT]: $DIRECT_DIR/$FILE does not exist!" - ln -s $DIRECT_DIR/$FILE $JOBDIR/$FILE - checkError 254 "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE failed!" - elif [ $MODE == "OUTPUT" ]; then - mkdir -p $DIRECT_DIR - checkError 254 "CDM[DIRECT]: mkdir -p $DIRECT_DIR failed!" - mkdir -p $( dirname $DIRECT_DIR/$FILE ) - checkError 254 "CDM[DIRECT]: mkdir -p $( dirname $FILE ) failed!" - touch $DIRECT_DIR/$FILE - checkError 254 "CDM[DIRECT]: Touching $DIRECT_DIR/$FILE failed!" - ln -s $DIRECT_DIR/$FILE $JOBDIR/$FILE - checkError 254 "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE failed!" - else - fail 254 "Unknown MODE: $MODE" - fi - ;; - LOCAL) - TOOL=${ARGS[0]} - REMOTE_DIR=${ARGS[1]} - FLAGS=${ARGS[3]} - log "CDM[LOCAL]: Copying $DIRECT_DIR/$FILE to $JOBDIR/$FILE" - if [ $MODE == "INPUT" ]; then - [ -f "$DIRECT_DIR/$FILE" ] - checkError 254 "CDM[LOCAL]: $REMOTE_DIR/$FILE does not exist!" - $TOOL $FLAGS $REMOTE_DIR/$FILE $JOBDIR/$FILE - checkError 254 "CDM[LOCAL]: Tool failed!" - elif [ $MODE == "OUTPUT" ]; then - log "CDM[LOCAL]..." - else - fail 254 "Unknown MODE: $MODE" - fi - ;; - BROADCAST) - BROADCAST_DIR=${ARGS[0]} - - if [ $MODE == "INPUT" ]; then - log "CDM[BROADCAST]: Linking $JOBDIR/$FILE to $BROADCAST_DIR/$FILE" - [ -f "$BROADCAST_DIR/$FILE" ] - checkError 254 "CDM[BROADCAST]: $BROADCAST_DIR/$FILE does not exist!" - ln -s $BROADCAST_DIR/$FILE $JOBDIR/$FILE - checkError 254 "CDM[BROADCAST]: Linking to $BROADCAST_DIR/$FILE failed!" - else - echo "CDM[BROADCAST]: Skipping output file: ${FILE}" - fi - ;; - GATHER) - if [ $MODE == "INPUT" ]; then - fail 254 "Cannot GATHER an input file!" - fi - esac -} - cdm_local_output() { L=$1 - if [[ $CDM_FILE == "" ]]; then + if [[ $CDM_FILE == "" ]]; then return fi - CDM_POLICY=$( cdm_lookup $L $CDM_FILE ) - if [[ $CDM_POLICY == "LOCAL" ]]; then + CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) + if [[ $CDM_POLICY == "LOCAL" ]]; then cdm_local_output_perform $L $CDM_POLICY fi } @@ -239,13 +158,13 @@ cdm_gather() { GATHER_OUTPUT=${*} - if [[ $CDM_FILE == "" ]]; then + if [[ $CDM_FILE == "" ]]; then return fi - if [[ $GATHER_OUTPUT == "" ]]; then + if [[ $GATHER_OUTPUT == "" ]]; then return fi - + cdm_gather_action $GATHER_MAX $GATHER_OUTPUT } @@ -333,7 +252,7 @@ getarg "-cdmfile" "$@" CDM_FILE= -if [ "X$VALUE" != "X" ]; then +if [ "X$VALUE" != "X" ]; then CDM_FILE=shared/$VALUE fi shift $SHIFTCOUNT @@ -429,10 +348,10 @@ logstate "LINK_INPUTS" for L in $INF ; do - CDM_POLICY=$( cdm_lookup $L $CDM_FILE ) + CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) if [ $CDM_POLICY != "DEFAULT" ]; then log "CDM_POLICY: $L -> $CDM_POLICY" - eval cdm_action $DIR "INPUT" $L $CDM_POLICY + eval cdm_action $DIR "INPUT" $L $CDM_POLICY continue fi if [ $COPYNOTLINK = 1 ]; then @@ -441,7 +360,7 @@ log "Copied input: $WFDIR/shared/$L to $DIR/$L" else [ -f $WFDIR/shared/$L ] - checkError 254 "Could not locate input file: $L" + checkError 254 "Could not locate input file: $L" ln -s "$WFDIR/shared/$L" "$DIR/$L" 2>&1 >& $INFO checkError 254 "Failed to link input file $L" log "Linked input: $WFDIR/shared/$L to $DIR/$L" @@ -452,16 +371,16 @@ SKIPPED_OUTPUT=() GATHER_OUTPUT=() for L in $OUTF ; do - CDM_POLICY=$( cdm_lookup $L $CDM_FILE ) - if [[ $CDM_POLICY != "DEFAULT" && + CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) + if [[ $CDM_POLICY != "DEFAULT" && $CDM_POLICY != "BROADCAST"* ]]; then - log "CDM_POLICY: $L -> $CDM_POLICY" + log "CDM_POLICY: $L -> $CDM_POLICY" eval cdm_action $DIR "OUTPUT" $L $CDM_POLICY SKIPPED_OUTPUT=( $SKIPPED_OUTPUT $L ) fi - if [ $CDM_POLICY == "GATHER" ]; then + if [ $CDM_POLICY == "GATHER" ]; then GATHER_OUTPUT=( $GATHER_OUTPUT $L ) - elif [ $CDM_POLICY == "LOCAL" ]; then + elif [ $CDM_POLICY == "LOCAL" ]; then CDM_LOCAL_OUTPUT=( $CDM_LOCAL_OUTPUT $L ) fi done @@ -496,7 +415,7 @@ else if [ ! -f "$KICKSTART" ]; then log "Kickstart executable ($KICKSTART) not found" - fail 254 "The Kickstart executable ($KICKSTART) was not found" + fail 254 "The Kickstart executable ($KICKSTART) was not found" elif [ ! -x "$KICKSTART" ]; then log "Kickstart executable ($KICKSTART) is not executable" fail 254 "The Kickstart executable ($KICKSTART) does not have the executable bit set" @@ -550,7 +469,7 @@ logstate "RM_JOBDIR" rm -rf "$DIR" 2>&1 >& "$INFO" -checkError 254 "Failed to remove job directory $DIR" +checkError 254 "Failed to remove job directory $DIR" if [ "$STATUSMODE" = "files" ]; then logstate "TOUCH_SUCCESS" @@ -569,7 +488,7 @@ # ensure we exit with a 0 after a successful execution exit 0 -# Local Variables: +# Local Variables: # mode: sh # sh-basic-offset: 8 # End: Modified: trunk/libexec/_swiftwrap.staging =================================================================== --- trunk/libexec/_swiftwrap.staging 2010-08-27 22:15:23 UTC (rev 3577) +++ trunk/libexec/_swiftwrap.staging 2010-08-27 22:15:46 UTC (rev 3578) @@ -4,7 +4,7 @@ echo >& "$INFO" echo "_____________________________________________________________________________" >& "$INFO" echo >& "$INFO" - echo " $1" >& "$INFO" + echo " $1" >& "$INFO" echo "_____________________________________________________________________________" >& "$INFO" echo >& "$INFO" } @@ -164,6 +164,14 @@ KICKSTART=$VALUE shift $SHIFTCOUNT +getarg "-cdmfile" "$@" +CDM_FILE= +if [ "X$VALUE" != "X" ]; then + CDM_FILE=$VALUE + log "CDM_FILE: $CDM_FILE" +fi +shift $SHIFTCOUNT + getarg "-status" "$@" STATUSMODE=$VALUE shift $SHIFTCOUNT @@ -187,6 +195,8 @@ fail 254 "Missing arguments (-a option)" fi +[[ $CDM_FILE != "" ]] && source cdm_lib.sh + PATH=$PATH:/bin:/usr/bin if [ "$PATHPREFIX" != "" ]; then @@ -205,6 +215,7 @@ fi fi +log "PWD=$PWD" log "EXEC=$EXEC" log "STDIN=$STDIN" log "STDOUT=$STDOUT" @@ -225,6 +236,14 @@ log "Created output directory: $D" done +if [[ $CDM_FILE != "" ]] ; then + for F in $INF ; do + CDM_POLICY=$( cdm_lookup cdm.pl $CDM_FILE $F ) + log "CDM_POLICY: $F -> $CDM_POLICY" + eval cdm_action $PWD "INPUT" $F $CDM_POLICY + done +fi + logstate "EXECUTE" #ls >>$WRAPPERLOG @@ -285,3 +304,9 @@ # ensure we exit with a 0 after a successful execution exit 0 +# Local Variables: +# mode: sh +# sh-basic-offset: 4 +# tab-width: 4 +# indent-tabs-mode: 1 +# End: Modified: trunk/libexec/cdm_lib.sh =================================================================== --- trunk/libexec/cdm_lib.sh 2010-08-27 22:15:23 UTC (rev 3577) +++ trunk/libexec/cdm_lib.sh 2010-08-27 22:15:46 UTC (rev 3578) @@ -1,6 +1,90 @@ # Source this for CDM shell functions +log "Reading cdm_lib.sh ..." + +# Do a CDM lookup +cdm_lookup() { + CDM_PL=$1 + CDM_FILE=$2 + FILE=$3 + + RESULT="DEFAULT" + if [ -f $CDM_PL ]; then + RESULT=$( perl $CDM_PL lookup $FILE < $CDM_FILE 2> $INFO ) + checkError 254 "cdm_lookup(): failed! (malformed CDM file?)" + fi + echo $RESULT +} + +cdm_action() { + log "CDM_ACTION: $@" + + local JOBDIR=$1 # Given jobdir + local MODE=$2 # INPUT or OUTPUT + local FILE=$3 # User file + local POLICY=$4 # DIRECT, BROADCAST, ... + shift 4 + local ARGS=$@ + + log "POLICY=$POLICY" + case $POLICY in + DIRECT) + DIRECT_DIR=${ARGS[0]} + log "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE via $JOBDIR/$FILE" + if [ $MODE == "INPUT" ]; then + [ -f "$DIRECT_DIR/$FILE" ] + checkError 254 "CDM[DIRECT]: $DIRECT_DIR/$FILE does not exist!" + ln -s $DIRECT_DIR/$FILE $JOBDIR/$FILE + checkError 254 "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE failed!" + elif [ $MODE == "OUTPUT" ]; then + mkdir -p $DIRECT_DIR + checkError 254 "CDM[DIRECT]: mkdir -p $DIRECT_DIR failed!" + mkdir -p $( dirname $DIRECT_DIR/$FILE ) + checkError 254 "CDM[DIRECT]: mkdir -p $( dirname $FILE ) failed!" + touch $DIRECT_DIR/$FILE + checkError 254 "CDM[DIRECT]: Touching $DIRECT_DIR/$FILE failed!" + ln -s $DIRECT_DIR/$FILE $JOBDIR/$FILE + checkError 254 "CDM[DIRECT]: Linking to $DIRECT_DIR/$FILE failed!" + else + fail 254 "Unknown MODE: $MODE" + fi + ;; + LOCAL) + TOOL=${ARGS[0]} + REMOTE_DIR=${ARGS[1]} + FLAGS=${ARGS[3]} + log "CDM[LOCAL]: Copying $DIRECT_DIR/$FILE to $JOBDIR/$FILE" + if [ $MODE == "INPUT" ]; then + [ -f "$DIRECT_DIR/$FILE" ] + checkError 254 "CDM[LOCAL]: $REMOTE_DIR/$FILE does not exist!" + $TOOL $FLAGS $REMOTE_DIR/$FILE $JOBDIR/$FILE + checkError 254 "CDM[LOCAL]: Tool failed!" + elif [ $MODE == "OUTPUT" ]; then + log "CDM[LOCAL]..." + else + fail 254 "Unknown MODE: $MODE" + fi + ;; + BROADCAST) + BROADCAST_DIR=${ARGS[0]} + if [ $MODE == "INPUT" ]; then + log "CDM[BROADCAST]: Linking $JOBDIR/$FILE to $BROADCAST_DIR/$FILE" + [ -f "$BROADCAST_DIR/$FILE" ] + checkError 254 "CDM[BROADCAST]: $BROADCAST_DIR/$FILE does not exist!" + ln -s $BROADCAST_DIR/$FILE $JOBDIR/$FILE + checkError 254 "CDM[BROADCAST]: Linking to $BROADCAST_DIR/$FILE failed!" + else + echo "CDM[BROADCAST]: Skipping output file: ${FILE}" + fi + ;; + GATHER) + if [ $MODE == "INPUT" ]; then + fail 254 "Cannot GATHER an input file!" + fi + esac +} + # Setup GATHER_DIR and some variables cdm_gather_setup() { GATHER_DIR=$1 @@ -8,7 +92,7 @@ logstate "GATHER_DIR $GATHER_DIR" mkdir -p $GATHER_DIR checkError 254 "Could not create: $GATHER_DIR" - + GATHER_LOCKFILE=$GATHER_DIR/.cdm.lock GATHER_MY_FILE=$GATHER_DIR/.cdm-$ID.lock GATHER_MY_OUTBOX=$GATHER_DIR/.cdm-outgoing-$ID @@ -72,7 +156,7 @@ unlink $GATHER_LOCKFILE } -# Move files from (LFS) OUTBOX to (GFS) GATHER_TARGET +# Move files from (LFS) OUTBOX to (GFS) GATHER_TARGET cdm_gather_flush() { pushd ${GATHER_MY_OUTBOX} logstate "GATHER_TARGET $GATHER_TARGET" @@ -93,10 +177,10 @@ GATHER_MAX=$( perl shared/cdm.pl property GATHER_LIMIT < $CDM_FILE ) GATHER_TARGET=$( perl shared/cdm.pl property GATHER_TARGET < $CDM_FILE ) - cdm_gather_setup $GATHER_DIR - cdm_gather_lock_acquire + cdm_gather_setup $GATHER_DIR + cdm_gather_lock_acquire - cdm_gather_import + cdm_gather_import USAGE=$( du -s --exclude=".cdm*" -B 1 $GATHER_DIR ) USAGE=${USAGE% *} # Chop off filename in output @@ -104,22 +188,22 @@ logstate "USAGE_CHECK $USAGE / $GATHER_MAX" FLUSH="no" - if (( USAGE > GATHER_MAX )); then + if (( USAGE > GATHER_MAX )); then FLUSH="yes" cdm_gather_export fi - + cdm_gather_lock_release - if [ $FLUSH == "yes" ]; then - cdm_gather_flush + if [ $FLUSH == "yes" ]; then + cdm_gather_flush fi } # Called by cdm_cleanup.sh at the end of the workflow cdm_gather_cleanup() { declare -p PWD DIR GATHER_DIR GATHER_TARGET ID - cdm_gather_setup $GATHER_DIR - cdm_gather_lock_acquire + cdm_gather_setup $GATHER_DIR + cdm_gather_lock_acquire cdm_gather_export EXPORT_RESULT=$? cdm_gather_lock_release @@ -128,7 +212,10 @@ fi } -# Local Variables: + +# Local Variables: # mode: sh -# sh-basic-offset: 8 +# sh-basic-offset: 4 +# tab-width: 4 +# indent-tabs-mode: 1 # End: Modified: trunk/libexec/vdl-int-staging.k =================================================================== --- trunk/libexec/vdl-int-staging.k 2010-08-27 22:15:23 UTC (rev 3577) +++ trunk/libexec/vdl-int-staging.k 2010-08-27 22:15:46 UTC (rev 3578) @@ -22,11 +22,11 @@ ) ddir ) - + element(inFiles, [stageins] pathnames(stageins) ) - + element(fileDirs, [stageins, stageouts] list( unique( @@ -35,13 +35,13 @@ ) ) ) - + element(graphStuff, [tr, stagein, stageout, err, optional(args)] if( vdl:configProperty("pgraph") != "false" then( errprops := if(err ",color=lightsalmon" ",color=lightsteelblue1") tp := vdl:threadPrefix() - to(graph, + to(graph, concat(str:quote(tp), " [label=", str:quote(tr), "{errprops}]") ) for(si, stagein @@ -57,7 +57,7 @@ file := basename(file) label := vdl:niceName(var, path = path) to(graph - concat(str:quote(file), " [shape=parallelogram,label=", + concat(str:quote(file), " [shape=parallelogram,label=", str:quote(label), "]") concat(str:quote(tp), " -> ", str:quote(file)) ) @@ -65,13 +65,13 @@ ) ) ) - + element(fileSizes, [files] math:sum( for(f, files, file:size(file)) ) ) - + element(cleanups, [cleanup] log(LOG:INFO, "START cleanups={cleanup}") ) @@ -80,17 +80,17 @@ replicationGroup, replicationChannel] stagein := list(unique(each(stagein))) stageout := list(unique(each(stageout))) - + allocateHost(rhost, constraints=vdl:jobConstraints(tr, stagein=stagein) - + ddir := initDDir() - + uid := uid() jobdir := substring(uid, from=0, to=1) jobid := "{tr}-{uid}" - + fileDirs := fileDirs(stagein, stageout) - + log(LOG:DEBUG, "THREAD_ASSOCIATION jobid={jobid} thread={#thread} host={rhost} replicationGroup={replicationGroup}") wrapper := "_swiftwrap.staging" @@ -102,11 +102,12 @@ vdl:setprogress("Stage in") wfdir := "{VDL:SCRIPTNAME}-{VDL:RUNID}" tmpdir := dircat("{wfdir}/jobs/{jobdir}", jobid) - + cdmfile := cdm:file() + try( sequential( log(LOG:DEBUG, "JOB_START jobid={jobid} tr={tr}", maybe(" arguments=", arguments), " tmpdir={tmpdir} host={rhost}") - + vdl:setprogress("Submitting") vdl:execute( @@ -114,14 +115,15 @@ list( vdl:siteprofile(rhost, "swift:wrapperInterpreterOptions"), wrapper, - "-e", vdl:executable(tr, rhost), + "-e", vdl:executable(tr, rhost), "-out", stdout, - "-err", stderr, + "-err", stderr, "-i", maybe(stdin), "-d", flatten(each(fileDirs)), - "-if", flatten(infiles(stagein)), + "-if", flatten(infiles(stagein)), "-of", flatten(outfiles(stageout)), "-k", + "-cdmfile", cdmfile, "-status", "provider" "-a", maybe(each(arguments)) ) @@ -132,17 +134,27 @@ replicationGroup = replicationGroup replicationChannel = replicationChannel jobid = jobid - - stagingMethod := vdl:siteProfile(rhost, "swift:stagingMethod", default="proxy") - + + stagingMethod := vdl:siteProfile(rhost, "swift:stagingMethod", default="proxy") + stageIn("{stagingMethod}://localhost/{swift.home}/libexec/{wrapper}", wrapper) + + if( cdmfile != "" then( + d := vdl:dirname(cdmfile) + f := basename(cdmfile) + echo("d: {d} f: {f}") + stageIn("{stagingMethod}://localhost/{d}/{f}", cdmfile) + stageIn("{stagingMethod}://localhost/{swift.home}/libexec/cdm.pl", "cdm.pl") + stageIn("{stagingMethod}://localhost/{swift.home}/libexec/cdm_lib.sh", "cdm_lib.sh") + )) + appStageins(jobid, stagein, ".", stagingMethod) - + stageOut("wrapper.log", "{stagingMethod}://localhost/{ddir}/{jobid}.info") //stageOut("{stdout}", "{stagingMethod}://localhost/{ddir}/{stdout}") //stageOut("{stderr}", "{stagingMethod}://localhost/{ddir}/{stderr}") appStageouts(jobid, stageout, ".", stagingMethod) - + task:cleanUp(".") //the whole job directory ) doRestartlog(restartout) @@ -155,7 +167,7 @@ catch("^(?!Abort$).*" vdl:setprogress("Failed but can retry") log(LOG:DEBUG, "APPLICATION_EXCEPTION jobid={jobid} - Application exception: ", exception) - + throw( exception( concat( @@ -173,7 +185,7 @@ ) ) ) - + element(generateProvenanceGraph, [gdata] pgraph := vdl:configProperty("pgraph") gname := if(pgraph == "true" "{VDL:SCRIPTNAME}-{VDL:RUNID}.dot" pgraph) @@ -181,7 +193,7 @@ "digraph SwiftProvenance {{", nl() " graph [", vdl:configProperty("pgraph.graph.options"), "];", nl() " node [", vdl:configProperty("pgraph.node.options"), "];", nl() - + for(i, gdata " ", i, nl() ) From noreply at svn.ci.uchicago.edu Mon Aug 30 12:16:13 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 12:16:13 -0500 (CDT) Subject: [Swift-commit] r3579 - trunk/tests/cdm-ps Message-ID: <20100830171613.BC1919CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 12:16:13 -0500 (Mon, 30 Aug 2010) New Revision: 3579 Added: trunk/tests/cdm-ps/201-direct-output.check.sh trunk/tests/cdm-ps/201-direct-output.clean.sh trunk/tests/cdm-ps/201-direct-output.setup.sh trunk/tests/cdm-ps/201-direct-output.swift trunk/tests/cdm-ps/README.txt trunk/tests/cdm-ps/fs.template.data trunk/tests/cdm-ps/title.txt Log: Copy of CDM tests for provider staging tests Copied: trunk/tests/cdm-ps/201-direct-output.check.sh (from rev 3576, trunk/tests/cdm/201-direct-output.check.sh) =================================================================== --- trunk/tests/cdm-ps/201-direct-output.check.sh (rev 0) +++ trunk/tests/cdm-ps/201-direct-output.check.sh 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x + +grep $( uname -m ) 201-input.txt || exit 1 +grep $( uname -m ) 201/output.txt || exit 1 + +exit 0 Copied: trunk/tests/cdm-ps/201-direct-output.clean.sh (from rev 3576, trunk/tests/cdm/201-direct-output.clean.sh) =================================================================== --- trunk/tests/cdm-ps/201-direct-output.clean.sh (rev 0) +++ trunk/tests/cdm-ps/201-direct-output.clean.sh 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -rv 201-input.txt 201 + +exit 0 Copied: trunk/tests/cdm-ps/201-direct-output.setup.sh (from rev 3576, trunk/tests/cdm/201-direct-output.setup.sh) =================================================================== --- trunk/tests/cdm-ps/201-direct-output.setup.sh (rev 0) +++ trunk/tests/cdm-ps/201-direct-output.setup.sh 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1,10 @@ +#!/bin/sh + +set -x + +{ + uname -a + date +} > 201-input.txt + +exit 0 Copied: trunk/tests/cdm-ps/201-direct-output.swift (from rev 3576, trunk/tests/cdm/201-direct-output.swift) =================================================================== --- trunk/tests/cdm-ps/201-direct-output.swift (rev 0) +++ trunk/tests/cdm-ps/201-direct-output.swift 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1,14 @@ + +type file; + +app (file o) copy (file i) +{ + cp @i @o; +} + +file f1<"201-input.txt">; + +// Will be transformed by CDM to 201/output.txt: +file f2<"output.txt">; + +f2 = copy(f1); Copied: trunk/tests/cdm-ps/README.txt (from rev 3576, trunk/tests/cdm/README.txt) =================================================================== --- trunk/tests/cdm-ps/README.txt (rev 0) +++ trunk/tests/cdm-ps/README.txt 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1,5 @@ + +000 series : noop tests +200 series : DIRECT tests +300 series : BROADCAST test + Copied: trunk/tests/cdm-ps/fs.template.data (from rev 3576, trunk/tests/cdm/fs.template.data) =================================================================== --- trunk/tests/cdm-ps/fs.template.data (rev 0) +++ trunk/tests/cdm-ps/fs.template.data 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1 @@ +rule .*output.txt DIRECT _PWD_/201 Copied: trunk/tests/cdm-ps/title.txt (from rev 3576, trunk/tests/cdm/title.txt) =================================================================== --- trunk/tests/cdm-ps/title.txt (rev 0) +++ trunk/tests/cdm-ps/title.txt 2010-08-30 17:16:13 UTC (rev 3579) @@ -0,0 +1 @@ +CDM tests From noreply at svn.ci.uchicago.edu Mon Aug 30 12:17:51 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 12:17:51 -0500 (CDT) Subject: [Swift-commit] r3580 - trunk/tests/cdm-ps Message-ID: <20100830171751.D2D719CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 12:17:51 -0500 (Mon, 30 Aug 2010) New Revision: 3580 Added: trunk/tests/cdm-ps/swift.properties Log: Copy of etc/swift.properties Copied: trunk/tests/cdm-ps/swift.properties (from rev 3566, trunk/etc/swift.properties) =================================================================== --- trunk/tests/cdm-ps/swift.properties (rev 0) +++ trunk/tests/cdm-ps/swift.properties 2010-08-30 17:17:51 UTC (rev 3580) @@ -0,0 +1,352 @@ +sites.file=${swift.home}/etc/sites.xml +tc.file=${swift.home}/etc/tc.data + +# +# The host name of the submit machine is used by GRAM as a callback +# address to report the status of submitted jobs. In general, Swift +# can automatically detect the host name of the local machine. +# However, if the machine host name is improperly configured or if +# it does not represent a valid DNS entry, certain services (such as +# GRAM) will not be able to send job status notifications back to +# the client. The value of this property can be an IP address. +# +# Format: +# hostname=string +# + + +#hostname=localhost + +# +# A TCP port range can be specified to restrict the ports on which GRAM +# callback services are started. This is likely needed if your submit +# host is behind a firewall, in which case the firewall should be +# configured to allow incoming connections on ports in the range. +# +# Format: +# tcp.port.range=start,end +# + +#tcp.port.range=50000,50100 + +# +# false - means an error will be immediately reported and cause the +# workflow to abort. At this time remote jobs that are already +# running will not be canceled +# true - means that Swift will try to do as much work as possible and +# report all errors encountered at the end. However, "errors" +# here only applies to job execution errors. Certain errors +# that are related to the Swift implementation (should such +# errors occur) will still be reported eagerly. +# +# Default: false +# +lazy.errors=false + +# +# What algorithm to use for caching of remote files. LRU (as in what +# files to purge) is the only implementation right now. One can set +# a target size (in bytes) for a host by using the swift:storagesize +# profile for a host in sites.xml +# +# Default: LRU +# +caching.algorithm=LRU + +# +# true - generate a provenance graph in .dot format (Swift will +# choose a random file name) +# false - do not generate a provenance graph +# - generate a provenange graph in the give file name +# +# Default: false +# +pgraph=false + + +# +# graph properties for the provenance graph (.dot specific) +# +# Default: splines="compound", rankdir="TB" +# +pgraph.graph.options=splines="compound", rankdir="TB" + + +# +# node properties for the provenance graph (.dot specific) +# +# Default: color="seagreen", style="filled" +# +pgraph.node.options=color="seagreen", style="filled" + +# +# true - clustering of small jobs is enabled. Clustering works in the +# following way: If a job is clusterable (meaning that it has the +# GLOBUS::maxwalltime profile specified in tc.data and its value +# is less than the value of the "clustering.min.time" property) it will +# be put in a clustering queue. The queue is processed at intervals +# specified by the "clustering.queue.delay" property. The processing +# of the clustering queue consists of selecting compatible jobs and +# grouping them in clusters whose max wall time does not exceed twice +# the value of the "clustering.min.time" property. Two or more jobs are +# considered compatible if they share the same site and do not have +# conflicting profiles (e.g. different values for the same environment +# variable). +# false - clustering of small jobs is disabled. +# +# Default: false +# +clustering.enabled=false + + +# +# - the intervals at which the clustering queue is processed +# +# Default: 4 +# +clustering.queue.delay=4 + +# +# - the threshold time for clustering +# +# Default: 60 +# +clustering.min.time=60 + +# +# Kickstart is a useful tool that can be used to gather various information +# about a remote process. Before it can be used it must be installed on the +# remote site and the corresponding entry be set in the sites file. +# This option allows controlling of how Swift uses Kickstart. The following +# values are possible: +# false - do not use Kickstart +# true - use Kickstart. If a job is scheduled on a site that does not have +# Kickstart installed, that job will fail. +# maybe - Use Kickstart if installed (i.e. the entry is present in the sites +# file) +# +# Default: maybe +# + +kickstart.enabled=maybe + +# +# Indicates when Kickstart records should be fetched from the remote site: +# true - always transfer Kickstart records if Kickstart was used (see +# kickstart.enabled) +# false - only transfer Kickstart records if the job fails +# +# Default: false +# + +kickstart.always.transfer=false + +# +# Indicates when wrapper logs should be fetched from the remote site: +# true - always transfer wrapper logs +# false - only transfer wrapper logs if the job fails +# +# Default: false +# + +wrapperlog.always.transfer=false + +########################################################################### +# Throttling options # +########################################################################### +# +# For the throttling parameters, valid values are either a positive integer +# or "off" (without the quotes). +# + +# +# Limits the number of concurrent submissions for a workflow instance. This +# throttle only limits the number of concurrent tasks (jobs) that are being +# sent to sites, not the total number of concurrent jobs that can be run. +# The submission stage in GRAM is one of the most CPU expensive stages (due +# mostly to the mutual authentication and delegation). Having too many +# concurrent submissions can overload either or both the submit host CPU +# and the remote host/head node causing degraded performance. +# +# Default: 4 +# + +throttle.submit=4 +#throttle.submit=off + +# +# Limits the number of concurrent submissions for any of the sites Swift will +# try to send jobs to. In other words it guarantees that no more than the +# value of this throttle jobs sent to any site will be concurrently in a state +# of being submitted. +# +# Default: 2 +# + +throttle.host.submit=2 +#throttle.host.submit=off + +# +# The Swift scheduler has the ability to limit the number of concurrent jobs +# allowed on a site based on the performance history of that site. Each site +# is assigned a score (initially 1), which can increase or decrease based +# on whether the site yields successful or faulty job runs. The score for a +# site can take values in the (0.1, 100) interval. The number of allowed jobs +# is calculated using the following formula: +# 2 + score*throttle.score.job.factor +# This means a site will always be allowed at least two concurrent jobs and +# at most 2 + 100*throttle.score.job.factor. With a default of 4 this means +# at least 2 jobs and at most 402. +# +# Default: 4 +# + +throttle.score.job.factor=0.2 +#throttle.score.job.factor=off + + +# +# Limits the total number of concurrent file transfers that can happen at any +# given time. File transfers consume bandwidth. Too many concurrent transfers +# can cause the network to be overloaded preventing various other signalling +# traffic from flowing properly. +# +# Default: 4 +# + +throttle.transfers=4 +#throttle.transfers=off + +# Limits the total number of concurrent file operations that can happen at any +# given time. File operations (like transfers) require an exclusive connection +# to a site. These connections can be expensive to establish. A large number +# of concurrent file operations may cause Swift to attempt to establish many +# such expensive connections to various sites. Limiting the number of concurrent +# file operations causes Swift to use a small number of cached connections and +# achieve better overall performance. +# +# Default: 8 +# + +throttle.file.operations=8 +#throttle.file.operations=off + +# Indicates whether the working directory on the remote site should be +# left intact even when the workflow completes successfully. This can be +# used to inspect the site working directory for debugging purposes. +# +# Default: false +# + +sitedir.keep=false + +# number of time a job will be retried if it fails (giving a maximum of +# 1 + execution.retries attempts at execution) +# + +execution.retries=2 + + +# Enables/disables replication. Replication is used to deal with jobs sitting +# in batch queues for abnormally large amounts of time. If replication is enabled +# and certain conditions are met, Swift creates and submits replicas of jobs, and +# allows multiple instances of a job to compete. +# + +replication.enabled=false + +# If replication is enabled, this value specifies the minimum time, in seconds, +# a job needs to be queued in a batch queue in order to be considered for +# replication +# + +replication.min.queue.time=60 + +# The maximum number of replicas that Swift should attempt. + +replication.limit=3 + +# +# WARNING: This option is deprecated. Please use the hostname option. +# +# The IP address of the submit machine is used by GRAM as a callback +# address to report the status of submitted jobs. In general, Swift +# can automatically detect the IP address of the local machine. +# However, if the machine has more than one network interface, Swift +# will pick the first one, which may not be the right choice. It is +# recommended that this property is set properly before attempting to +# run jobs through GRAM. +# +# Format: +# ip.address=x.y.z.w +# + +#ip.address=127.0.0.1 + + +# Controls how Swift will communicate the result code of running user programs +# from workers to the submit side. In files mode, a file +# indicating success or failure will be created on the site shared filesystem. +# In provider mode, the execution provider job status will +# be used. Notably, GRAM2 does not return job statuses correctly, and so +# provider mode will not work with GRAM2. With other +# providers, it can be used to reduce the amount of filesystem access compared +# to files mode. +# +# status.mode=files + +# Controls how swift will supply parameters to the remote wrapper script. +# 'args' mode will pass parameters on the command line +# 'files' mode will pass parameters through an additional input file +# +# valid values: args, files +# Default: files +# +# wrapper.parameter.mode=args + +# 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 + +# +# Limits the number of concurrent iterations that each foreach statement +# can have at one time. This conserves memory for swift programs that +# have large numbers of iterations (which would otherwise all be executed +# in parallel). +# +# Default: 1024 +# + +foreach.max.threads=16384 + +# controls whether the log file will contain provenance information +# enabling this will increase the size of log files, sometimes +# significantly. + +provenance.log=false + +# Controls whether file staging is done by swift or by the execution +# provider. If set to false, the standard swift staging mechanism is +# used. If set to true, swift does not stage files. Instead, the +# execution provider is instructed to stage files in and out. +# +# Provider staging is experimental. +# +# When enabled, and when coasters are used as an execution provider, +# a staging mechanism can be selected for each site +# using the swift:stagingMethod site profile in sites.xml. The +# following is a list of accepted mechanisms: +# +# * file: Staging is done from a filesystem accessible to the +# coaster service (typically running on the head node) +# * proxy: Staging is done from a filesystem accessible to the +# client machine that swift is running on, and is proxied +# through the coaster service +# * sfs: (short for "shared filesystem") Staging is done by +# copying files to and from a filesystem accessible +# by the compute node (such as an NFS or GPFS mount). + + +use.provider.staging=false \ No newline at end of file From noreply at svn.ci.uchicago.edu Mon Aug 30 12:18:21 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 12:18:21 -0500 (CDT) Subject: [Swift-commit] r3581 - trunk/tests/cdm-ps Message-ID: <20100830171821.C56EA9CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 12:18:21 -0500 (Mon, 30 Aug 2010) New Revision: 3581 Modified: trunk/tests/cdm-ps/swift.properties Log: These tests will use provider staging Modified: trunk/tests/cdm-ps/swift.properties =================================================================== --- trunk/tests/cdm-ps/swift.properties 2010-08-30 17:17:51 UTC (rev 3580) +++ trunk/tests/cdm-ps/swift.properties 2010-08-30 17:18:21 UTC (rev 3581) @@ -4,10 +4,10 @@ # # The host name of the submit machine is used by GRAM as a callback # address to report the status of submitted jobs. In general, Swift -# can automatically detect the host name of the local machine. +# can automatically detect the host name of the local machine. # However, if the machine host name is improperly configured or if # it does not represent a valid DNS entry, certain services (such as -# GRAM) will not be able to send job status notifications back to +# GRAM) will not be able to send job status notifications back to # the client. The value of this property can be an IP address. # # Format: @@ -20,7 +20,7 @@ # # A TCP port range can be specified to restrict the ports on which GRAM # callback services are started. This is likely needed if your submit -# host is behind a firewall, in which case the firewall should be +# host is behind a firewall, in which case the firewall should be # configured to allow incoming connections on ports in the range. # # Format: @@ -33,10 +33,10 @@ # false - means an error will be immediately reported and cause the # workflow to abort. At this time remote jobs that are already # running will not be canceled -# true - means that Swift will try to do as much work as possible and +# true - means that Swift will try to do as much work as possible and # report all errors encountered at the end. However, "errors" # here only applies to job execution errors. Certain errors -# that are related to the Swift implementation (should such +# that are related to the Swift implementation (should such # errors occur) will still be reported eagerly. # # Default: false @@ -46,7 +46,7 @@ # # What algorithm to use for caching of remote files. LRU (as in what # files to purge) is the only implementation right now. One can set -# a target size (in bytes) for a host by using the swift:storagesize +# a target size (in bytes) for a host by using the swift:storagesize # profile for a host in sites.xml # # Default: LRU @@ -56,7 +56,7 @@ # # true - generate a provenance graph in .dot format (Swift will # choose a random file name) -# false - do not generate a provenance graph +# false - do not generate a provenance graph # - generate a provenange graph in the give file name # # Default: false @@ -65,7 +65,7 @@ # -# graph properties for the provenance graph (.dot specific) +# graph properties for the provenance graph (.dot specific) # # Default: splines="compound", rankdir="TB" # @@ -73,25 +73,25 @@ # -# node properties for the provenance graph (.dot specific) +# node properties for the provenance graph (.dot specific) # # Default: color="seagreen", style="filled" # pgraph.node.options=color="seagreen", style="filled" # -# true - clustering of small jobs is enabled. Clustering works in the +# true - clustering of small jobs is enabled. Clustering works in the # following way: If a job is clusterable (meaning that it has the # GLOBUS::maxwalltime profile specified in tc.data and its value # is less than the value of the "clustering.min.time" property) it will -# be put in a clustering queue. The queue is processed at intervals +# be put in a clustering queue. The queue is processed at intervals # specified by the "clustering.queue.delay" property. The processing # of the clustering queue consists of selecting compatible jobs and # grouping them in clusters whose max wall time does not exceed twice -# the value of the "clustering.min.time" property. Two or more jobs are +# the value of the "clustering.min.time" property. Two or more jobs are # considered compatible if they share the same site and do not have # conflicting profiles (e.g. different values for the same environment -# variable). +# variable). # false - clustering of small jobs is disabled. # # Default: false @@ -123,7 +123,7 @@ # true - use Kickstart. If a job is scheduled on a site that does not have # Kickstart installed, that job will fail. # maybe - Use Kickstart if installed (i.e. the entry is present in the sites -# file) +# file) # # Default: maybe # @@ -164,9 +164,9 @@ # throttle only limits the number of concurrent tasks (jobs) that are being # sent to sites, not the total number of concurrent jobs that can be run. # The submission stage in GRAM is one of the most CPU expensive stages (due -# mostly to the mutual authentication and delegation). Having too many +# mostly to the mutual authentication and delegation). Having too many # concurrent submissions can overload either or both the submit host CPU -# and the remote host/head node causing degraded performance. +# and the remote host/head node causing degraded performance. # # Default: 4 # @@ -176,7 +176,7 @@ # # Limits the number of concurrent submissions for any of the sites Swift will -# try to send jobs to. In other words it guarantees that no more than the +# try to send jobs to. In other words it guarantees that no more than the # value of this throttle jobs sent to any site will be concurrently in a state # of being submitted. # @@ -192,7 +192,7 @@ # is assigned a score (initially 1), which can increase or decrease based # on whether the site yields successful or faulty job runs. The score for a # site can take values in the (0.1, 100) interval. The number of allowed jobs -# is calculated using the following formula: +# is calculated using the following formula: # 2 + score*throttle.score.job.factor # This means a site will always be allowed at least two concurrent jobs and # at most 2 + 100*throttle.score.job.factor. With a default of 4 this means @@ -220,11 +220,11 @@ # Limits the total number of concurrent file operations that can happen at any # given time. File operations (like transfers) require an exclusive connection # to a site. These connections can be expensive to establish. A large number -# of concurrent file operations may cause Swift to attempt to establish many +# of concurrent file operations may cause Swift to attempt to establish many # such expensive connections to various sites. Limiting the number of concurrent # file operations causes Swift to use a small number of cached connections and -# achieve better overall performance. -# +# achieve better overall performance. +# # Default: 8 # @@ -240,7 +240,7 @@ sitedir.keep=false -# number of time a job will be retried if it fails (giving a maximum of +# number of time a job will be retried if it fails (giving a maximum of # 1 + execution.retries attempts at execution) # @@ -256,7 +256,7 @@ replication.enabled=false # If replication is enabled, this value specifies the minimum time, in seconds, -# a job needs to be queued in a batch queue in order to be considered for +# a job needs to be queued in a batch queue in order to be considered for # replication # @@ -271,7 +271,7 @@ # # The IP address of the submit machine is used by GRAM as a callback # address to report the status of submitted jobs. In general, Swift -# can automatically detect the IP address of the local machine. +# can automatically detect the IP address of the local machine. # However, if the machine has more than one network interface, Swift # will pick the first one, which may not be the right choice. It is # recommended that this property is set properly before attempting to @@ -312,7 +312,7 @@ # # Limits the number of concurrent iterations that each foreach statement -# can have at one time. This conserves memory for swift programs that +# can have at one time. This conserves memory for swift programs that # have large numbers of iterations (which would otherwise all be executed # in parallel). # @@ -327,11 +327,11 @@ provenance.log=false -# Controls whether file staging is done by swift or by the execution +# Controls whether file staging is done by swift or by the execution # provider. If set to false, the standard swift staging mechanism is -# used. If set to true, swift does not stage files. Instead, the +# used. If set to true, swift does not stage files. Instead, the # execution provider is instructed to stage files in and out. -# +# # Provider staging is experimental. # # When enabled, and when coasters are used as an execution provider, @@ -339,14 +339,14 @@ # using the swift:stagingMethod site profile in sites.xml. The # following is a list of accepted mechanisms: # -# * file: Staging is done from a filesystem accessible to the -# coaster service (typically running on the head node) +# * file: Staging is done from a filesystem accessible to the +# coaster service (typically running on the head node) # * proxy: Staging is done from a filesystem accessible to the # client machine that swift is running on, and is proxied # through the coaster service # * sfs: (short for "shared filesystem") Staging is done by # copying files to and from a filesystem accessible -# by the compute node (such as an NFS or GPFS mount). - +# by the compute node (such as an NFS or GPFS mount). -use.provider.staging=false \ No newline at end of file + +use.provider.staging=true From noreply at svn.ci.uchicago.edu Mon Aug 30 13:06:16 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:06:16 -0500 (CDT) Subject: [Swift-commit] r3582 - trunk/libexec Message-ID: <20100830180616.B45909CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:06:16 -0500 (Mon, 30 Aug 2010) New Revision: 3582 Modified: trunk/libexec/_swiftwrap trunk/libexec/cdm_lib.sh Log: Make sure CDM does not do anything when not enabled Modified: trunk/libexec/_swiftwrap =================================================================== --- trunk/libexec/_swiftwrap 2010-08-30 17:18:21 UTC (rev 3581) +++ trunk/libexec/_swiftwrap 2010-08-30 18:06:16 UTC (rev 3582) @@ -367,23 +367,25 @@ fi done -logstate "LINK_CDM_OUTPUTS" -SKIPPED_OUTPUT=() -GATHER_OUTPUT=() -for L in $OUTF ; do - CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) - if [[ $CDM_POLICY != "DEFAULT" && - $CDM_POLICY != "BROADCAST"* ]]; then - log "CDM_POLICY: $L -> $CDM_POLICY" - eval cdm_action $DIR "OUTPUT" $L $CDM_POLICY - SKIPPED_OUTPUT=( $SKIPPED_OUTPUT $L ) - fi - if [ $CDM_POLICY == "GATHER" ]; then - GATHER_OUTPUT=( $GATHER_OUTPUT $L ) - elif [ $CDM_POLICY == "LOCAL" ]; then - CDM_LOCAL_OUTPUT=( $CDM_LOCAL_OUTPUT $L ) - fi -done +if [ ! -z $CDM_FILE ]; then + logstate "LINK_CDM_OUTPUTS" + SKIPPED_OUTPUT=() + GATHER_OUTPUT=() + for L in $OUTF ; do + CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) + if [[ $CDM_POLICY != "DEFAULT" && + $CDM_POLICY != "BROADCAST"* ]]; then + log "CDM_POLICY: $L -> $CDM_POLICY" + eval cdm_action $DIR "OUTPUT" $L $CDM_POLICY + SKIPPED_OUTPUT=( $SKIPPED_OUTPUT $L ) + fi + if [ $CDM_POLICY == "GATHER" ]; then + GATHER_OUTPUT=( $GATHER_OUTPUT $L ) + elif [ $CDM_POLICY == "LOCAL" ]; then + CDM_LOCAL_OUTPUT=( $CDM_LOCAL_OUTPUT $L ) + fi + done +fi logstate "EXECUTE" cd $DIR @@ -490,5 +492,7 @@ # Local Variables: # mode: sh -# sh-basic-offset: 8 +# sh-basic-offset: 4 +# tab-width: 4 +# indent-tabs-mode: 1 # End: Modified: trunk/libexec/cdm_lib.sh =================================================================== --- trunk/libexec/cdm_lib.sh 2010-08-30 17:18:21 UTC (rev 3581) +++ trunk/libexec/cdm_lib.sh 2010-08-30 18:06:16 UTC (rev 3582) @@ -10,7 +10,7 @@ FILE=$3 RESULT="DEFAULT" - if [ -f $CDM_PL ]; then + if [ ! -z $CDM_FILE ] && [ -f $CDM_PL ] && [ -f $CDM_FILE ]; then RESULT=$( perl $CDM_PL lookup $FILE < $CDM_FILE 2> $INFO ) checkError 254 "cdm_lookup(): failed! (malformed CDM file?)" fi From noreply at svn.ci.uchicago.edu Mon Aug 30 13:23:36 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:23:36 -0500 (CDT) Subject: [Swift-commit] r3583 - trunk/tests Message-ID: <20100830182336.51C1E9CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:23:36 -0500 (Mon, 30 Aug 2010) New Revision: 3583 Modified: trunk/tests/nightly.sh Log: Enable custom-per-GROUP sites.xml files Also, always transfer wrapper log and get hostname for Coasters Modified: trunk/tests/nightly.sh =================================================================== --- trunk/tests/nightly.sh 2010-08-30 18:06:16 UTC (rev 3582) +++ trunk/tests/nightly.sh 2010-08-30 18:23:36 UTC (rev 3583) @@ -551,7 +551,8 @@ CDM= [ -r fs.data ] && CDM="-cdm.file fs.data" - monitored_exec swift -config swift.properties \ + monitored_exec swift -wrapperlog.always.transfer true \ + -config swift.properties \ -sites.file sites.xml \ -tc.file tc.data \ $CDM $SWIFTSCRIPT @@ -596,6 +597,19 @@ out package "swift-$DATE.tar.gz" } +GLOBUS_HOSTNAME=$( ifconfig | grep inet | head -1 | cut -d ':' -f 2 | \ + awk '{print $1}' ) +group_sites_xml() { + TEMPLATE=$GROUP/sites.template.xml + if [ -f $TEMPLATE ]; then + sed "s at _WORK_@$PWD/work@;s at _HOST_@$GLOBUS_HOSTNAME@" < $TEMPLATE > sites.xml + [ $? != 0 ] && crash "Could not create sites.xml!" + else + sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml + [ $? != 0 ] && crash "Could not create sites.xml!" + fi +} + group_tc_data() { if [ -f $GROUP/tc.template.data ]; then sed "s at _DIR_@$GROUP@" < $GROUP/tc.template.data > tc.data @@ -635,6 +649,7 @@ test_group() { + group_sites_xml group_tc_data group_fs_data group_swift_properties @@ -710,14 +725,14 @@ fi TESTDIR=$TOPDIR/cog/modules/swift/tests -sed "s at _WORK_@$PWD/work@" < $TESTDIR/sites/localhost.xml > sites.xml SKIP_COUNTER=0 GROUPLIST=( $TESTDIR/language/working \ $TESTDIR/local \ $TESTDIR/language/should-not-work \ - $TESTDIR/cdm ) + $TESTDIR/cdm \ + $TESTDIR/cdm-ps ) echo ${GROUPLIST[@]} From noreply at svn.ci.uchicago.edu Mon Aug 30 13:24:37 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:24:37 -0500 (CDT) Subject: [Swift-commit] r3584 - trunk/tests/cdm-ps Message-ID: <20100830182437.D103D9CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:24:37 -0500 (Mon, 30 Aug 2010) New Revision: 3584 Added: trunk/tests/cdm-ps/sites.template.xml trunk/tests/cdm-ps/tc.template.data Modified: trunk/tests/cdm-ps/title.txt Log: First CDM provider staging test works Added: trunk/tests/cdm-ps/sites.template.xml =================================================================== --- trunk/tests/cdm-ps/sites.template.xml (rev 0) +++ trunk/tests/cdm-ps/sites.template.xml 2010-08-30 18:24:37 UTC (rev 3584) @@ -0,0 +1,24 @@ + + + + + + _WORK_ + file + + + + + + _HOST_ + 2.55 + 10000 + 4 + 8 + 1000 + 1 + 4 + _WORK_ + + + Added: trunk/tests/cdm-ps/tc.template.data =================================================================== --- trunk/tests/cdm-ps/tc.template.data (rev 0) +++ trunk/tests/cdm-ps/tc.template.data 2010-08-30 18:24:37 UTC (rev 3584) @@ -0,0 +1,19 @@ +#This is the transformation catalog. +# +#It comes pre-configured with a number of simple transformations with +#paths that are likely to work on a linux box. However, on some systems, +#the paths to these executables will be different (for example, sometimes +#some of these programs are found in /usr/bin rather than in /bin) +# +#NOTE WELL: fields in this file must be separated by tabs, not spaces; and +#there must be no trailing whitespace at the end of each line. +# +# sitename transformation path INSTALLED platform profiles +localhost echo /bin/echo INSTALLED INTEL32::LINUX null +localhost cat /bin/cat INSTALLED INTEL32::LINUX null +localhost ls /bin/ls INSTALLED INTEL32::LINUX null +localhost grep /bin/grep INSTALLED INTEL32::LINUX null +localhost sort /bin/sort INSTALLED INTEL32::LINUX null +localhost paste /bin/paste INSTALLED INTEL32::LINUX null + +coasterslocal cp /bin/cp INSTALLED INTEL32::LINUX null Modified: trunk/tests/cdm-ps/title.txt =================================================================== --- trunk/tests/cdm-ps/title.txt 2010-08-30 18:23:36 UTC (rev 3583) +++ trunk/tests/cdm-ps/title.txt 2010-08-30 18:24:37 UTC (rev 3584) @@ -1 +1 @@ -CDM tests +CDM tests with provider staging From noreply at svn.ci.uchicago.edu Mon Aug 30 13:25:21 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:25:21 -0500 (CDT) Subject: [Swift-commit] r3585 - trunk/tests/local Message-ID: <20100830182521.C8DCE9CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:25:21 -0500 (Mon, 30 Aug 2010) New Revision: 3585 Added: trunk/tests/local/title.txt Log: Local tests title Added: trunk/tests/local/title.txt =================================================================== --- trunk/tests/local/title.txt (rev 0) +++ trunk/tests/local/title.txt 2010-08-30 18:25:21 UTC (rev 3585) @@ -0,0 +1 @@ +Local Tests From noreply at svn.ci.uchicago.edu Mon Aug 30 13:26:11 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:26:11 -0500 (CDT) Subject: [Swift-commit] r3586 - trunk/libexec Message-ID: <20100830182611.29F6F9CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:26:11 -0500 (Mon, 30 Aug 2010) New Revision: 3586 Modified: trunk/libexec/_swiftwrap.staging Log: Support CDM DIRECT for output with provider staging Modified: trunk/libexec/_swiftwrap.staging =================================================================== --- trunk/libexec/_swiftwrap.staging 2010-08-30 18:25:21 UTC (rev 3585) +++ trunk/libexec/_swiftwrap.staging 2010-08-30 18:26:11 UTC (rev 3586) @@ -242,6 +242,11 @@ log "CDM_POLICY: $F -> $CDM_POLICY" eval cdm_action $PWD "INPUT" $F $CDM_POLICY done + for F in $OUTF ; do + CDM_POLICY=$( cdm_lookup cdm.pl $CDM_FILE $F ) + log "CDM_POLICY: $F -> $CDM_POLICY" + eval cdm_action $PWD "OUTPUT" $F $CDM_POLICY + done fi logstate "EXECUTE" From noreply at svn.ci.uchicago.edu Mon Aug 30 13:27:24 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 13:27:24 -0500 (CDT) Subject: [Swift-commit] r3587 - trunk/tests/local Message-ID: <20100830182724.5AC849CC87@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 13:27:24 -0500 (Mon, 30 Aug 2010) New Revision: 3587 Modified: trunk/tests/local/array_iteration.clean.sh Log: This requires bash? Modified: trunk/tests/local/array_iteration.clean.sh =================================================================== --- trunk/tests/local/array_iteration.clean.sh 2010-08-30 18:26:11 UTC (rev 3586) +++ trunk/tests/local/array_iteration.clean.sh 2010-08-30 18:27:24 UTC (rev 3587) @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -x From noreply at svn.ci.uchicago.edu Mon Aug 30 14:16:01 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 14:16:01 -0500 (CDT) Subject: [Swift-commit] r3588 - in trunk/tests: cdm cdm-ps Message-ID: <20100830191601.2F2989CC98@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-30 14:16:01 -0500 (Mon, 30 Aug 2010) New Revision: 3588 Added: trunk/tests/cdm-ps/202-direct-io.check.sh trunk/tests/cdm-ps/202-direct-io.clean.sh trunk/tests/cdm-ps/202-direct-io.setup.sh trunk/tests/cdm-ps/202-direct-io.swift trunk/tests/cdm-ps/merge.sh Modified: trunk/tests/cdm-ps/201-direct-output.check.sh trunk/tests/cdm-ps/201-direct-output.clean.sh trunk/tests/cdm-ps/201-direct-output.swift trunk/tests/cdm-ps/fs.template.data trunk/tests/cdm-ps/tc.template.data trunk/tests/cdm/201-direct-output.check.sh Log: CDM-PS input/output test and related fixes Modified: trunk/tests/cdm/201-direct-output.check.sh =================================================================== --- trunk/tests/cdm/201-direct-output.check.sh 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm/201-direct-output.check.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -3,6 +3,6 @@ set -x grep $( uname -m ) 201-input.txt || exit 1 -grep $( uname -m ) 201/output.txt || exit 1 +grep $( uname -m ) 201/201-output.txt || exit 1 exit 0 Modified: trunk/tests/cdm-ps/201-direct-output.check.sh =================================================================== --- trunk/tests/cdm-ps/201-direct-output.check.sh 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm-ps/201-direct-output.check.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -3,6 +3,6 @@ set -x grep $( uname -m ) 201-input.txt || exit 1 -grep $( uname -m ) 201/output.txt || exit 1 +grep $( uname -m ) 201/201-output.txt || exit 1 exit 0 Modified: trunk/tests/cdm-ps/201-direct-output.clean.sh =================================================================== --- trunk/tests/cdm-ps/201-direct-output.clean.sh 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm-ps/201-direct-output.clean.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -2,6 +2,6 @@ set -x -rm -rv 201-input.txt 201 +rm -rv 201-input.txt 201 || exit 1 exit 0 Modified: trunk/tests/cdm-ps/201-direct-output.swift =================================================================== --- trunk/tests/cdm-ps/201-direct-output.swift 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm-ps/201-direct-output.swift 2010-08-30 19:16:01 UTC (rev 3588) @@ -9,6 +9,6 @@ file f1<"201-input.txt">; // Will be transformed by CDM to 201/output.txt: -file f2<"output.txt">; +file f2<"201-output.txt">; f2 = copy(f1); Added: trunk/tests/cdm-ps/202-direct-io.check.sh =================================================================== --- trunk/tests/cdm-ps/202-direct-io.check.sh (rev 0) +++ trunk/tests/cdm-ps/202-direct-io.check.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -0,0 +1,11 @@ +#!/bin/sh + +set -x + +grep $( uname -m ) 202/202-input-1.txt || exit 1 +grep $( hostname ) 202/202-input-1.txt || exit 1 + +grep $( uname -m ) 202/202-output.txt || exit 1 +grep $( hostname ) 202/202-output.txt || exit 1 + +exit 0 Property changes on: trunk/tests/cdm-ps/202-direct-io.check.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm-ps/202-direct-io.clean.sh =================================================================== --- trunk/tests/cdm-ps/202-direct-io.clean.sh (rev 0) +++ trunk/tests/cdm-ps/202-direct-io.clean.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -0,0 +1,7 @@ +#!/bin/sh + +set -x + +rm -rv 202 || exit 1 + +exit 0 Property changes on: trunk/tests/cdm-ps/202-direct-io.clean.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm-ps/202-direct-io.setup.sh =================================================================== --- trunk/tests/cdm-ps/202-direct-io.setup.sh (rev 0) +++ trunk/tests/cdm-ps/202-direct-io.setup.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -0,0 +1,17 @@ +#!/bin/sh + +set -x + +mkdir -v 202 + +{ + uname -a + date +} > 202/202-input-1.txt + +{ + hostname + pwd +} > 202/202-input-2.txt + +exit 0 Property changes on: trunk/tests/cdm-ps/202-direct-io.setup.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/tests/cdm-ps/202-direct-io.swift =================================================================== --- trunk/tests/cdm-ps/202-direct-io.swift (rev 0) +++ trunk/tests/cdm-ps/202-direct-io.swift 2010-08-30 19:16:01 UTC (rev 3588) @@ -0,0 +1,16 @@ + +type file; + +app (file o) merge (file i, file j) +{ + merge @i @j @o; +} + +// Will be transformed by CDM to 202/input-[12].txt +file f1<"202-input-1.txt">; +file f2<"202-input-2.txt">; + +// Will be transformed by CDM to 202/output.txt: +file f3<"202-output.txt">; + +f3 = merge(f1, f2); Modified: trunk/tests/cdm-ps/fs.template.data =================================================================== --- trunk/tests/cdm-ps/fs.template.data 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm-ps/fs.template.data 2010-08-30 19:16:01 UTC (rev 3588) @@ -1 +1,4 @@ -rule .*output.txt DIRECT _PWD_/201 +rule .*201-output.txt DIRECT _PWD_/201 + +rule .*202-input.*.txt DIRECT _PWD_/202 +rule .*202-output.txt DIRECT _PWD_/202 Added: trunk/tests/cdm-ps/merge.sh =================================================================== --- trunk/tests/cdm-ps/merge.sh (rev 0) +++ trunk/tests/cdm-ps/merge.sh 2010-08-30 19:16:01 UTC (rev 3588) @@ -0,0 +1,7 @@ +#!/bin/sh + +F1=$1 +F2=$2 +F3=$3 + +cat $F1 $F2 > $F3 Property changes on: trunk/tests/cdm-ps/merge.sh ___________________________________________________________________ Name: svn:executable + * Modified: trunk/tests/cdm-ps/tc.template.data =================================================================== --- trunk/tests/cdm-ps/tc.template.data 2010-08-30 18:27:24 UTC (rev 3587) +++ trunk/tests/cdm-ps/tc.template.data 2010-08-30 19:16:01 UTC (rev 3588) @@ -17,3 +17,4 @@ localhost paste /bin/paste INSTALLED INTEL32::LINUX null coasterslocal cp /bin/cp INSTALLED INTEL32::LINUX null +coasterslocal merge _DIR_/merge.sh INSTALLED INTEL32::LINUX null From noreply at svn.ci.uchicago.edu Mon Aug 30 23:48:13 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Mon, 30 Aug 2010 23:48:13 -0500 (CDT) Subject: [Swift-commit] r3589 - trunk/libexec Message-ID: <20100831044813.961069CC87@vm-125-59.ci.uchicago.edu> Author: wilde Date: 2010-08-30 23:48:13 -0500 (Mon, 30 Aug 2010) New Revision: 3589 Modified: trunk/libexec/_swiftwrap.staging Log: Check for null directory before making input or output data directories. This error was obscured in _swiftwrap but caused mkdir -p to fail in _swiftwrap.staging. Also Corrected a minor typo in an error leg, STDER -> STDERR. Modified: trunk/libexec/_swiftwrap.staging =================================================================== --- trunk/libexec/_swiftwrap.staging 2010-08-30 19:16:01 UTC (rev 3588) +++ trunk/libexec/_swiftwrap.staging 2010-08-31 04:48:13 UTC (rev 3589) @@ -58,7 +58,7 @@ exit 0 else if [ "X$STDERR" != "X" ]; then - echo "$@" >>$STDER + echo "$@" >>$STDERR fi exit $EC fi @@ -231,7 +231,9 @@ logstate "CREATE_INPUTDIR" for D in $DIRS ; do - mkdir -p "$D" 2>&1 >>"$INFO" + if [ _$D != _ ]; then + mkdir -p "$D" 2>&1 >>"$INFO" + fi checkError 254 "Failed to create input directory $D" log "Created output directory: $D" done From noreply at svn.ci.uchicago.edu Tue Aug 31 16:38:01 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 31 Aug 2010 16:38:01 -0500 (CDT) Subject: [Swift-commit] r3590 - trunk/libexec Message-ID: <20100831213801.2DF9A9CCC6@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-31 16:38:01 -0500 (Tue, 31 Aug 2010) New Revision: 3590 Modified: trunk/libexec/_swiftwrap Log: CDM bug fix Modified: trunk/libexec/_swiftwrap =================================================================== --- trunk/libexec/_swiftwrap 2010-08-31 04:48:13 UTC (rev 3589) +++ trunk/libexec/_swiftwrap 2010-08-31 21:38:01 UTC (rev 3590) @@ -348,7 +348,10 @@ logstate "LINK_INPUTS" for L in $INF ; do - CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) + CDM_POLICY="DEFAULT" + if [ ! -z $CDM_FILE ]; then + CDM_POLICY=$( cdm_lookup shared/cdm.pl $CDM_FILE $L ) + fi if [ $CDM_POLICY != "DEFAULT" ]; then log "CDM_POLICY: $L -> $CDM_POLICY" eval cdm_action $DIR "INPUT" $L $CDM_POLICY From noreply at svn.ci.uchicago.edu Tue Aug 31 16:38:21 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 31 Aug 2010 16:38:21 -0500 (CDT) Subject: [Swift-commit] r3591 - in trunk/tests: cdm local Message-ID: <20100831213821.C6EFA9CCC6@vm-125-59.ci.uchicago.edu> Author: wozniak Date: 2010-08-31 16:38:21 -0500 (Tue, 31 Aug 2010) New Revision: 3591 Modified: trunk/tests/cdm/201-direct-output.swift trunk/tests/local/diamond.check.sh trunk/tests/local/range.check.sh Log: tests fixes Modified: trunk/tests/cdm/201-direct-output.swift =================================================================== --- trunk/tests/cdm/201-direct-output.swift 2010-08-31 21:38:01 UTC (rev 3590) +++ trunk/tests/cdm/201-direct-output.swift 2010-08-31 21:38:21 UTC (rev 3591) @@ -9,6 +9,6 @@ file f1<"201-input.txt">; // Will be transformed by CDM to 201/output.txt: -file f2<"output.txt">; +file f2<"201-output.txt">; f2 = copy(f1); Modified: trunk/tests/local/diamond.check.sh =================================================================== --- trunk/tests/local/diamond.check.sh 2010-08-31 21:38:01 UTC (rev 3590) +++ trunk/tests/local/diamond.check.sh 2010-08-31 21:38:21 UTC (rev 3591) @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash set -x -COUNT=( $( ls f*.txt ) ) +COUNT=( $( ls f[a-d].txt ) ) (( ${#COUNT[@]} == 4 )) || exit 1 LINES=$( wc -l < fd.txt ) Modified: trunk/tests/local/range.check.sh =================================================================== --- trunk/tests/local/range.check.sh 2010-08-31 21:38:01 UTC (rev 3590) +++ trunk/tests/local/range.check.sh 2010-08-31 21:38:21 UTC (rev 3591) @@ -4,7 +4,7 @@ ls stdout.txt || exit 1 -COUNT=$( grep -c "num:" < stdout.txt ) +COUNT=$( grep -c "trace:" stdout.txt ) (( $COUNT == 11 )) || exit 1 exit 0 From noreply at svn.ci.uchicago.edu Tue Aug 31 18:30:46 2010 From: noreply at svn.ci.uchicago.edu (noreply at svn.ci.uchicago.edu) Date: Tue, 31 Aug 2010 18:30:46 -0500 (CDT) Subject: [Swift-commit] r3592 - usertools/swift/swiftconfig/bin Message-ID: <20100831233046.2F15C9CCC6@vm-125-59.ci.uchicago.edu> Author: davidk Date: 2010-08-31 18:30:46 -0500 (Tue, 31 Aug 2010) New Revision: 3592 Modified: usertools/swift/swiftconfig/bin/swiftrun Log: Remove debug message Modified: usertools/swift/swiftconfig/bin/swiftrun =================================================================== --- usertools/swift/swiftconfig/bin/swiftrun 2010-08-31 21:38:21 UTC (rev 3591) +++ usertools/swift/swiftconfig/bin/swiftrun 2010-08-31 23:30:46 UTC (rev 3592) @@ -84,7 +84,6 @@ } foreach my $current_app_file(@all_apps) { chomp($current_app_file); - print "About to open $current_app_file\n"; open(CURRENT_APP, $current_app_file) || die "Unable to open app file $current_app_file\n"; my @current_app_data = ; close(CURRENT_APP);