Merge pull request #276 from broadinstitute/md_gatkreport_cleanup
Remove STANDARD option from GATKRunReport
This commit is contained in:
commit
d93bed5d61
|
|
@ -69,8 +69,8 @@ public class GATKArgumentCollection {
|
||||||
//
|
//
|
||||||
// --------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@Argument(fullName = "phone_home", shortName = "et", doc="What kind of GATK run report should we generate? STANDARD is the default, can be NO_ET so nothing is posted to the run repository. Please see " + UserException.PHONE_HOME_DOCS_URL + " for details.", required = false)
|
@Argument(fullName = "phone_home", shortName = "et", doc="What kind of GATK run report should we generate? AWS is the default, can be NO_ET so nothing is posted to the run repository. Please see " + UserException.PHONE_HOME_DOCS_URL + " for details.", required = false)
|
||||||
public GATKRunReport.PhoneHomeOption phoneHomeType = GATKRunReport.PhoneHomeOption.STANDARD;
|
public GATKRunReport.PhoneHomeOption phoneHomeType = GATKRunReport.PhoneHomeOption.AWS;
|
||||||
|
|
||||||
@Argument(fullName = "gatk_key", shortName = "K", doc="GATK Key file. Required if running with -et NO_ET. Please see " + UserException.PHONE_HOME_DOCS_URL + " for details.", required = false)
|
@Argument(fullName = "gatk_key", shortName = "K", doc="GATK Key file. Required if running with -et NO_ET. Please see " + UserException.PHONE_HOME_DOCS_URL + " for details.", required = false)
|
||||||
public File gatkKeyFile = null;
|
public File gatkKeyFile = null;
|
||||||
|
|
|
||||||
|
|
@ -78,22 +78,6 @@ public class GATKRunReport {
|
||||||
|
|
||||||
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH.mm.ss");
|
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH.mm.ss");
|
||||||
|
|
||||||
/**
|
|
||||||
* The root file system directory where we keep common report data
|
|
||||||
*/
|
|
||||||
private final static File REPORT_DIR = new File("/humgen/gsa-hpprojects/GATK/reports");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The full path to the direct where submitted (and uncharacterized) report files are written
|
|
||||||
*/
|
|
||||||
private final static File REPORT_SUBMIT_DIR = new File(REPORT_DIR.getAbsolutePath() + "/submitted");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Full path to the sentinel file that controls whether reports are written out. If this file doesn't
|
|
||||||
* exist, no long will be written
|
|
||||||
*/
|
|
||||||
private final static File REPORT_SENTINEL = new File(REPORT_DIR.getAbsolutePath() + "/ENABLE");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* our log
|
* our log
|
||||||
*/
|
*/
|
||||||
|
|
@ -181,8 +165,6 @@ public class GATKRunReport {
|
||||||
public enum PhoneHomeOption {
|
public enum PhoneHomeOption {
|
||||||
/** Disable phone home */
|
/** Disable phone home */
|
||||||
NO_ET,
|
NO_ET,
|
||||||
/** Standard option. Writes to local repository if it can be found, or S3 otherwise */
|
|
||||||
STANDARD,
|
|
||||||
/** Forces the report to go to S3 */
|
/** Forces the report to go to S3 */
|
||||||
AWS,
|
AWS,
|
||||||
/** Force output to STDOUT. For debugging only */
|
/** Force output to STDOUT. For debugging only */
|
||||||
|
|
@ -365,14 +347,9 @@ public class GATKRunReport {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NO_ET: // don't do anything
|
case NO_ET: // don't do anything
|
||||||
return false;
|
return false;
|
||||||
case STANDARD:
|
|
||||||
case AWS:
|
case AWS:
|
||||||
if ( type == PhoneHomeOption.STANDARD && repositoryIsOnline() ) {
|
wentToAWS = true;
|
||||||
return postReportToLocalDisk(getLocalReportFullPath()) != null;
|
return postReportToAWSS3() != null;
|
||||||
} else {
|
|
||||||
wentToAWS = true;
|
|
||||||
return postReportToAWSS3() != null;
|
|
||||||
}
|
|
||||||
case STDOUT:
|
case STDOUT:
|
||||||
return postReportToStream(System.out);
|
return postReportToStream(System.out);
|
||||||
default:
|
default:
|
||||||
|
|
@ -404,50 +381,6 @@ public class GATKRunReport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the full path as a file where we'll write this report to local disl
|
|
||||||
* @return a non-null File
|
|
||||||
*/
|
|
||||||
@Ensures("result != null")
|
|
||||||
protected File getLocalReportFullPath() {
|
|
||||||
return new File(REPORT_SUBMIT_DIR, getReportFileName());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the local GATKRunReport repository available for writing reports?
|
|
||||||
*
|
|
||||||
* @return true if and only if the common run report repository is available and online to receive reports
|
|
||||||
*/
|
|
||||||
private boolean repositoryIsOnline() {
|
|
||||||
return false; // REPORT_SENTINEL.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Main entry point to writing reports to disk. Posts the XML report to the common GATK run report repository.
|
|
||||||
* If this process fails for any reason, all exceptions are handled and this routine merely prints a warning.
|
|
||||||
* That is, postReport() is guarenteed not to fail for any reason.
|
|
||||||
*
|
|
||||||
* @return the path where the file was written, or null if any failure occurred
|
|
||||||
*/
|
|
||||||
@Requires("destination != null")
|
|
||||||
private File postReportToLocalDisk(final File destination) {
|
|
||||||
try {
|
|
||||||
final BufferedOutputStream out = new BufferedOutputStream(
|
|
||||||
new GZIPOutputStream(
|
|
||||||
new FileOutputStream(destination)));
|
|
||||||
postReportToStream(out);
|
|
||||||
out.close();
|
|
||||||
logger.debug("Wrote report to " + destination);
|
|
||||||
return destination;
|
|
||||||
} catch ( Exception e ) {
|
|
||||||
// we catch everything, and no matter what eat the error
|
|
||||||
exceptDuringRunReport("Couldn't read report file", e);
|
|
||||||
destination.delete();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Code for sending reports to s3
|
// Code for sending reports to s3
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ public class WalkerTest extends BaseTest {
|
||||||
String args = this.args;
|
String args = this.args;
|
||||||
if ( includeImplicitArgs ) {
|
if ( includeImplicitArgs ) {
|
||||||
args = args + (ENABLE_PHONE_HOME_FOR_TESTS ?
|
args = args + (ENABLE_PHONE_HOME_FOR_TESTS ?
|
||||||
String.format(" -et %s ", GATKRunReport.PhoneHomeOption.STANDARD) :
|
String.format(" -et %s ", GATKRunReport.PhoneHomeOption.AWS) :
|
||||||
String.format(" -et %s -K %s ", GATKRunReport.PhoneHomeOption.NO_ET, gatkKeyFile));
|
String.format(" -et %s -K %s ", GATKRunReport.PhoneHomeOption.NO_ET, gatkKeyFile));
|
||||||
if ( includeShadowBCF && GENERATE_SHADOW_BCF )
|
if ( includeShadowBCF && GENERATE_SHADOW_BCF )
|
||||||
args = args + " --generateShadowBCF ";
|
args = args + " --generateShadowBCF ";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue