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 "
$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 ""
- 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 " | "
@@ -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
|
---|