When @Gather annotation is missing (probably due to an unclean build) printing out the full field+class name for debugging purposes.

Custom gatherer prints out the class name in the logs.
Try to retrieve mail domain from /etc/mailname before falling back to the hostname.
Building oneoff jars during ant oneoffs.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5540 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kshakir 2011-03-30 21:43:37 +00:00
parent 328f89f66a
commit d5ac822e97
9 changed files with 87 additions and 29 deletions

View File

@ -401,6 +401,16 @@
</manifest>
</jar>
<subant target="dist" genericantfile="build.xml">
<property name="build.dir" value="${external.build.dir}" />
<property name="dist.dir" value="${external.dist.dir}" />
<property name="gatk.classpath" value="${external.gatk.classpath}" />
<fileset dir="${external.dir}" includes="*/build.xml" erroronmissingdir="false" />
</subant>
</target>
<target name="gatk.oneoffs.jar" depends="gatk.compile, init.jar"
description="generate the GATK oneoffs distribution" if="include.oneoffs">
<jar jarfile="${dist.dir}/CompareBAMAlignments.jar" whenmanifestonly="skip">
<fileset dir="${java.classes}">
<include name="**/tools/**/*.class" />
@ -409,13 +419,6 @@
<attribute name="Main-Class" value="org.broadinstitute.sting.oneoffprojects.tools.CompareBAMAlignments" />
</manifest>
</jar>
<subant target="dist" genericantfile="build.xml">
<property name="build.dir" value="${external.build.dir}" />
<property name="dist.dir" value="${external.dist.dir}" />
<property name="gatk.classpath" value="${external.gatk.classpath}" />
<fileset dir="${external.dir}" includes="*/build.xml" erroronmissingdir="false" />
</subant>
</target>
<target name="scala.jar" depends="scala.compile, init.jar" if="scala.include">
@ -440,7 +443,7 @@
</jar>
</target>
<target name="sting.jar" depends="sting-utils.jar, gatk.jar, queue.jar" />
<target name="sting.jar" depends="sting-utils.jar, gatk.jar, gatk.oneoffs.jar, queue.jar" />
<target name="init.manifests" depends="sting.jar">
<pathconvert property="jar.classpath" pathsep=" ">
@ -472,6 +475,9 @@
</manifest>
</jar>
</target>
<target name="gatk.oneoffs.manifests" depends="gatk.oneoffs.jar, init.manifests" if="include.oneoffs">
<jar jarfile="${dist.dir}/CompareBAMAlignments.jar" update="true" whenmanifestonly="skip">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
@ -487,7 +493,7 @@
</jar>
</target>
<target name="sting.manifests" depends="sting-utils.manifests, gatk.manifests, queue.manifests" />
<target name="sting.manifests" depends="sting-utils.manifests, gatk.manifests, gatk.oneoffs.manifests, queue.manifests" />
<target name="dist" depends="sting.manifests" />

View File

@ -58,7 +58,7 @@ class QGraphSettings {
var statusEmailTo: List[String] = Nil
@Argument(fullName="status_email_from", shortName="statusFrom", doc="Email address to send emails from upon completion or on error.", required=false)
var statusEmailFrom: String = System.getProperty("user.name") + "@" + SystemUtils.domainName
var statusEmailFrom: String = System.getProperty("user.name") + "@" + SystemUtils.mailName
@Argument(fullName="dot_graph", shortName="dot", doc="Outputs the queue graph to a .dot file. See: http://en.wikipedia.org/wiki/DOT_language", required=false)
var dotFile: File = _

View File

@ -1,3 +1,27 @@
/*
* Copyright (c) 2011, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.queue.function
/**
@ -5,5 +29,5 @@ package org.broadinstitute.sting.queue.function
*/
trait InProcessFunction extends QFunction {
def run()
def description = (List(this.getClass.getSimpleName) ++ this.outputs.filterNot(file => isLogFile(file)).map(_.getAbsolutePath)).mkString(" ")
def description = this.getClass.getSimpleName + " " + this.commandOutputs.mkString(" ")
}

View File

@ -145,12 +145,6 @@ trait QFunction extends Logging {
Some(files.exists(_.exists))
}
/**
* Returns true if the file should be used for status output.
* @return true if the file should be used for status output.
*/
def useStatusOutput(file: File) = !isLogFile(file)
/**
* Returns true if the file is a log file for this function.
*/
@ -161,9 +155,8 @@ trait QFunction extends Logging {
* Returns the output files for this function.
* @return Set[File] outputs for this function.
*/
private def statusPaths = outputs
.filter(file => useStatusOutput(file))
.map(file => file.getParentFile + "/." + file.getName)
private def statusPaths =
commandOutputs.map(file => file.getParentFile + "/." + file.getName)
/**
* Returns the output files for this function.
@ -203,6 +196,12 @@ trait QFunction extends Logging {
*/
def outputs = getFieldFiles(outputFields)
/**
* Returns the non-log outputs for this function.
* @return the non-log outputs for this function.
*/
def commandOutputs = outputs.filterNot(file => isLogFile(file))
/**
* Returns the set of directories where files may be written.
*/
@ -227,7 +226,7 @@ trait QFunction extends Logging {
* Deletes the output files and all the status files for this function.
*/
def deleteOutputs() = {
outputs.filterNot(file => isLogFile(file)).foreach(file => IOUtils.tryDelete(file))
commandOutputs.foreach(file => IOUtils.tryDelete(file))
doneOutputs.foreach(file => IOUtils.tryDelete(file))
failOutputs.foreach(file => IOUtils.tryDelete(file))
}

View File

@ -62,11 +62,10 @@ class CloneFunction extends CommandLineFunction {
}
}
override def commandOutputs = withScatterPart(() => originalFunction.commandOutputs)
override def dotString = withScatterPart(() => originalFunction.dotString)
override def description = withScatterPart(() => originalFunction.description)
override protected def functionFieldClass = originalFunction.getClass
override def useStatusOutput(file: File) =
!isLogFile(file) && originalFunction.useStatusOutput(file)
def commandLine = withScatterPart(() => originalFunction.commandLine)

View File

@ -38,4 +38,5 @@ class GathererFunction(gathererClass: Class[_ <: Gatherer]) extends InProcessFun
waitForGatherParts
gatherer.gather(this.gatherParts, this.originalOutput)
}
override def description = this.gathererClass.getSimpleName + " " + this.commandOutputs.mkString(" ")
}

View File

@ -252,7 +252,7 @@ trait ScatterGatherableFunction extends CommandLineFunction {
if (ReflectionUtils.hasAnnotation(gatherField.field, classOf[Gather])) {
gatherClass = ReflectionUtils.getAnnotation(gatherField.field, classOf[Gather]).value
} else {
throw new QException("Missing @Gather annotation: " + gatherField.field.getName)
throw new QException("Missing @Gather annotation: " + gatherField.field)
}
}

View File

@ -1,7 +1,33 @@
/*
* Copyright (c) 2011, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.queue.util
import java.lang.management.ManagementFactory
import java.net.InetAddress
import java.io.File
import io.Source
/**
* A collection of various system utilities.
@ -10,8 +36,11 @@ object SystemUtils {
val inetAddress = InetAddress.getLocalHost.getHostAddress
val hostName = InetAddress.getLocalHost.getCanonicalHostName
val domainName = {
if (hostName == inetAddress)
val mailName = {
val mailnameFile = new File("/etc/mailname")
if (mailnameFile.exists)
Source.fromFile(mailnameFile).mkString.trim
else if (hostName == inetAddress)
inetAddress
else
hostName.split('.').takeRight(2).mkString(".")

View File

@ -32,12 +32,12 @@ class SystemUtilsUnitTest {
def testHostInfo {
val inetAddress = SystemUtils.inetAddress
val hostName = SystemUtils.hostName
val domainName = SystemUtils.domainName
val mailName = SystemUtils.mailName
if (inetAddress.split('.').takeRight(2).mkString(".") == domainName)
if (inetAddress.split('.').takeRight(2).mkString(".") == mailName)
Assert.fail("""Invalid domain name generated:
|inetAddress: %s
|hostName: %s
|domainName: %s""".stripMargin.format(inetAddress, hostName, domainName))
|mailName: %s""".stripMargin.format(inetAddress, hostName, mailName))
}
}