diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/AlignmentStorageManager.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/AlignmentStorageManager.java index ed151da4947..9dbf2d9223a 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/AlignmentStorageManager.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/AlignmentStorageManager.java @@ -27,23 +27,17 @@ import org.opencb.biodata.tools.alignment.BamUtils; import org.opencb.cellbase.client.rest.CellBaseClient; import org.opencb.cellbase.client.rest.GeneClient; -import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.opencga.analysis.StorageManager; import org.opencb.opencga.analysis.models.FileInfo; import org.opencb.opencga.analysis.models.StudyInfo; -import org.opencb.opencga.analysis.tools.ToolRunner; import org.opencb.opencga.catalog.db.api.FileDBAdaptor; import org.opencb.opencga.catalog.db.api.ProjectDBAdaptor; import org.opencb.opencga.catalog.exceptions.CatalogException; import org.opencb.opencga.catalog.managers.CatalogManager; import org.opencb.opencga.catalog.utils.CatalogFqn; import org.opencb.opencga.catalog.utils.ParamUtils; -import org.opencb.opencga.core.api.ParamConstants; -import org.opencb.opencga.core.exceptions.ToolException; -import org.opencb.opencga.core.models.alignment.AlignmentIndexParams; -import org.opencb.opencga.core.models.alignment.CoverageIndexParams; import org.opencb.opencga.core.models.JwtPayload; import org.opencb.opencga.core.models.file.File; import org.opencb.opencga.core.models.project.Project; @@ -70,6 +64,7 @@ public class AlignmentStorageManager extends StorageManager { private AlignmentStorageEngine alignmentStorageEngine; private String jobId; + private boolean dryRun; private static final Map statsMap = new HashMap<>(); @@ -82,12 +77,13 @@ public AlignmentStorageManager(CatalogManager catalogManager, StorageEngineFacto initStatsMap(); } - public AlignmentStorageManager(CatalogManager catalogManager, StorageEngineFactory storageEngineFactory, String jobId) { + public AlignmentStorageManager(CatalogManager catalogManager, StorageEngineFactory storageEngineFactory, String jobId, boolean dryRun) { super(catalogManager, storageEngineFactory); // TODO: Create this alignmentStorageEngine by reflection this.alignmentStorageEngine = new LocalAlignmentStorageEngine(); this.jobId = jobId; + this.dryRun = dryRun; initStatsMap(); } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/qc/AlignmentQcAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/qc/AlignmentQcAnalysis.java index 6b541da0037..67ac836c36a 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/qc/AlignmentQcAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/alignment/qc/AlignmentQcAnalysis.java @@ -120,7 +120,8 @@ protected void run() throws ToolException { OpenCGAResult flagStatsJobResult = catalogManager.getJobManager() .submit(study, AlignmentFlagStatsAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " - + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), token); + + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), getJobId(), null, + false, token); flagStatsJobId = flagStatsJobResult.first().getId(); addEvent(Event.Type.INFO, "Submit job " + flagStatsJobId + " to compute stats (" + AlignmentFlagStatsAnalysis.ID + ")"); @@ -137,7 +138,8 @@ protected void run() throws ToolException { OpenCGAResult statsJobResult = catalogManager.getJobManager() .submit(study, AlignmentStatsAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " - + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), token); + + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), getJobId(), null, + false, token); statsJobId = statsJobResult.first().getId(); addEvent(Event.Type.INFO, "Submit job " + statsJobId + " to compute stats (" + AlignmentStatsAnalysis.ID + ")"); } @@ -154,7 +156,7 @@ protected void run() throws ToolException { OpenCGAResult fastQcMetricsJobResult = catalogManager.getJobManager() .submit(study, AlignmentFastQcMetricsAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), - token); + getJobId(), null, false, token); fastQcMetricsJobId = fastQcMetricsJobResult.first().getId(); addEvent(Event.Type.INFO, "Submit job " + fastQcMetricsJobId + " to compute FastQC metrics (" + AlignmentFastQcMetricsAnalysis.ID + ")"); diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/ClinicalTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/ClinicalTsvAnnotationLoader.java index 1d2be95e82e..abdbca2e7b5 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/ClinicalTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/ClinicalTsvAnnotationLoader.java @@ -32,7 +32,7 @@ import java.util.Collections; @Tool(id = ClinicalTsvAnnotationLoader.ID, resource = Enums.Resource.CLINICAL_ANALYSIS, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class ClinicalTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "clinical-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/AuxiliarRgaAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/AuxiliarRgaAnalysis.java index 37823aac657..d70f3f3d244 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/AuxiliarRgaAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/AuxiliarRgaAnalysis.java @@ -7,7 +7,7 @@ import org.opencb.opencga.core.tools.annotations.Tool; @Tool(id = AuxiliarRgaAnalysis.ID, resource = Enums.Resource.RGA, type = Tool.Type.OPERATION, - description = AuxiliarRgaAnalysis.DESCRIPTION) + description = AuxiliarRgaAnalysis.DESCRIPTION, priority = Enums.Priority.HIGH) public class AuxiliarRgaAnalysis extends OperationTool { public final static String ID = "rga-aux-index"; public final static String DESCRIPTION = ParamConstants.INDEX_AUXILIAR_COLLECTION_DESCRIPTION; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/RgaAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/RgaAnalysis.java index 0e2a56e644d..132b3d72464 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/RgaAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/clinical/rga/RgaAnalysis.java @@ -6,7 +6,8 @@ import org.opencb.opencga.core.models.common.Enums; import org.opencb.opencga.core.tools.annotations.Tool; -@Tool(id = RgaAnalysis.ID, resource = Enums.Resource.RGA, type = Tool.Type.OPERATION, description = "Index RGA study.") +@Tool(id = RgaAnalysis.ID, resource = Enums.Resource.RGA, type = Tool.Type.OPERATION, description = "Index RGA study.", + priority = Enums.Priority.HIGH) public class RgaAnalysis extends OperationTool { public final static String ID = "rga-index"; public final static String DESCRIPTION = "Generate Recessive Gene Analysis secondary index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/cohort/CohortTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/cohort/CohortTsvAnnotationLoader.java index 82b8c9e1bb4..7dcdc62c8fc 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/cohort/CohortTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/cohort/CohortTsvAnnotationLoader.java @@ -25,7 +25,7 @@ import org.opencb.opencga.core.tools.annotations.Tool; @Tool(id = CohortTsvAnnotationLoader.ID, resource = Enums.Resource.COHORT, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class CohortTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "cohort-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/FamilyTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/FamilyTsvAnnotationLoader.java index 6d4091fdce3..68efcc010b5 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/FamilyTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/family/FamilyTsvAnnotationLoader.java @@ -25,7 +25,7 @@ import org.opencb.opencga.core.tools.annotations.Tool; @Tool(id = FamilyTsvAnnotationLoader.ID, resource = Enums.Resource.FAMILY, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class FamilyTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "family-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FetchAndRegisterTask.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FetchAndRegisterTask.java index c242582b528..3dcd8079060 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FetchAndRegisterTask.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FetchAndRegisterTask.java @@ -46,7 +46,7 @@ import java.util.List; @Tool(id = FetchAndRegisterTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, - description = "Download an external file and register it in OpenCGA.") + description = "Download an external file and register it in OpenCGA.", priority = Enums.Priority.HIGH) public class FetchAndRegisterTask extends OpenCgaToolScopeStudy { public final static String ID = "files-fetch"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileDeleteTask.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileDeleteTask.java index 89edaa6e683..2750435e049 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileDeleteTask.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileDeleteTask.java @@ -42,7 +42,8 @@ import java.io.IOException; import java.util.*; -@Tool(id = FileDeleteTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = "Delete files.") +@Tool(id = FileDeleteTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = "Delete files.", + priority = Enums.Priority.HIGH) public class FileDeleteTask extends OpenCgaTool { public final static String ID = "files-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileLinkTask.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileLinkTask.java index d6506bb6d81..88cb038215a 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileLinkTask.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileLinkTask.java @@ -18,7 +18,8 @@ import java.util.List; import java.util.Map; -@Tool(id = FileLinkTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = FileLinkTask.DESCRIPTION) +@Tool(id = FileLinkTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = FileLinkTask.DESCRIPTION, + priority = Enums.Priority.HIGH) public class FileLinkTask extends OpenCgaToolScopeStudy { public static final String ID = "file-link"; @@ -69,7 +70,7 @@ protected void run() throws Exception { Job postLinkJob = catalogManager.getJobManager() .submit(getStudy(), PostLinkSampleAssociation.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), - getToken()).first(); + getJobId(), null, false, getToken()).first(); logger.info("Submit post-link job : " + postLinkJob.getId()); } } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileTsvAnnotationLoader.java index ddd77ca22af..f52871a7b6e 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileTsvAnnotationLoader.java @@ -32,7 +32,7 @@ import java.util.Collections; @Tool(id = FileTsvAnnotationLoader.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class FileTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "file-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileUnlinkTask.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileUnlinkTask.java index e333d7b3813..24a45fe40b9 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileUnlinkTask.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/FileUnlinkTask.java @@ -38,7 +38,8 @@ import java.util.*; -@Tool(id = FileUnlinkTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = "Unlink files.") +@Tool(id = FileUnlinkTask.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, description = "Unlink files.", + priority = Enums.Priority.HIGH) public class FileUnlinkTask extends OpenCgaTool { public final static String ID = "files-unlink"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/PostLinkSampleAssociation.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/PostLinkSampleAssociation.java index 60d67f05996..d624d2e4828 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/PostLinkSampleAssociation.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/file/PostLinkSampleAssociation.java @@ -24,7 +24,7 @@ import java.util.*; @Tool(id = PostLinkSampleAssociation.ID, resource = Enums.Resource.FILE, type = Tool.Type.OPERATION, - description = PostLinkSampleAssociation.DESCRIPTION) + description = PostLinkSampleAssociation.DESCRIPTION, priority = Enums.Priority.HIGH) public class PostLinkSampleAssociation extends OpenCgaToolScopeStudy { public static final String ID = "postlink"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/individual/IndividualTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/individual/IndividualTsvAnnotationLoader.java index 3c53ac46524..b6776329c50 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/individual/IndividualTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/individual/IndividualTsvAnnotationLoader.java @@ -25,7 +25,7 @@ import org.opencb.opencga.core.tools.annotations.Tool; @Tool(id = IndividualTsvAnnotationLoader.ID, resource = Enums.Resource.INDIVIDUAL, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class IndividualTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "individual-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/SampleTsvAnnotationLoader.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/SampleTsvAnnotationLoader.java index adeb819720b..c3fa3ad84b1 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/SampleTsvAnnotationLoader.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/SampleTsvAnnotationLoader.java @@ -25,7 +25,7 @@ import org.opencb.opencga.core.tools.annotations.Tool; @Tool(id = SampleTsvAnnotationLoader.ID, resource = Enums.Resource.SAMPLE, type = Tool.Type.OPERATION, - description = "Load annotations from TSV file.") + description = "Load annotations from TSV file.", priority = Enums.Priority.HIGH) public class SampleTsvAnnotationLoader extends TsvAnnotationLoader { public final static String ID = "sample-tsv-load"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/qc/SampleQcAnalysis.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/qc/SampleQcAnalysis.java index 54f22745057..b8d460824c1 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/qc/SampleQcAnalysis.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/sample/qc/SampleQcAnalysis.java @@ -225,7 +225,8 @@ protected void run() throws ToolException { OpenCGAResult variantStatsJobResult = catalogManager.getJobManager() .submit(study, SampleVariantStatsAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " - + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), token); + + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), getJobId(), null, + false, token); variantStatsJobId = variantStatsJobResult.first().getId(); addEvent(Event.Type.INFO, "Submit job " + variantStatsJobId + " to compute stats (" + SampleVariantStatsAnalysis.ID + ")"); @@ -267,7 +268,8 @@ protected void run() throws ToolException { OpenCGAResult signatureJobResult = catalogManager.getJobManager() .submit(getStudy(), MutationalSignatureAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " - + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), token); + + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), getJobId(), null, + false, token); signatureJobId = signatureJobResult.first().getId(); logger.info("Submitted job {} to compute the mutational signature analysis {}", signatureJobId, MutationalSignatureAnalysis.ID); @@ -289,7 +291,7 @@ protected void run() throws ToolException { OpenCGAResult genomePlotJobResult = catalogManager.getJobManager() .submit(getStudy(), GenomePlotAnalysis.ID, Enums.Priority.MEDIUM, params, null, "Job generated by " + getId() + " - " + getJobId(), Collections.emptyList(), Collections.emptyList(), - token); + getJobId(), null, false, token); genomePlotJobId = genomePlotJobResult.first().getId(); addEvent(Event.Type.INFO, "Submit job " + genomePlotJobId + " to compute genome plot (" + GenomePlotAnalysis.ID + ")"); diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/templates/TemplateRunner.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/templates/TemplateRunner.java index 08797e1185e..cf8390d1a61 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/templates/TemplateRunner.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/templates/TemplateRunner.java @@ -15,7 +15,7 @@ import java.nio.file.Paths; @Tool(id = TemplateRunner.ID, description = TemplateRunner.DESCRIPTION, type = Tool.Type.OPERATION, resource = Enums.Resource.STUDY, - scope = Tool.Scope.STUDY) + scope = Tool.Scope.STUDY, priority = Enums.Priority.HIGH) public class TemplateRunner extends OperationTool { public static final String ID = "templates"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/OpenCgaTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/OpenCgaTool.java index 8214f04fc33..6024761d596 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/OpenCgaTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/OpenCgaTool.java @@ -67,6 +67,7 @@ public abstract class OpenCgaTool { private String jobId; private String opencgaHome; + private boolean dryRun; protected String token; protected final ObjectMap params; @@ -92,19 +93,20 @@ public OpenCgaTool() { } public final OpenCgaTool setUp(String opencgaHome, CatalogManager catalogManager, StorageEngineFactory engineFactory, - ObjectMap params, Path outDir, String jobId, String token) { + ObjectMap params, Path outDir, String jobId, boolean dryRun, String token) { VariantStorageManager manager = new VariantStorageManager(catalogManager, engineFactory); - return setUp(opencgaHome, catalogManager, manager, params, outDir, jobId, token); + return setUp(opencgaHome, catalogManager, manager, params, outDir, jobId, dryRun, token); } public final OpenCgaTool setUp(String opencgaHome, CatalogManager catalogManager, VariantStorageManager variantStorageManager, - ObjectMap params, Path outDir, String jobId, String token) { + ObjectMap params, Path outDir, String jobId, boolean dryRun, String token) { this.opencgaHome = opencgaHome; this.catalogManager = catalogManager; this.configuration = catalogManager.getConfiguration(); this.variantStorageManager = variantStorageManager; this.storageConfiguration = variantStorageManager.getStorageConfiguration(); this.jobId = jobId; + this.dryRun = dryRun; this.token = token; if (params != null) { this.params.putAll(params); @@ -188,13 +190,14 @@ public final ExecutionResult start() throws ToolException { exception = e; } if (!erm.isClosed()) { - privateLogger.error("Unexpected system shutdown!"); + String message = "Unexpected system shutdown. Job killed by the system."; + privateLogger.error(message); try { if (scratchDir != null) { deleteScratchDirectory(); } if (exception == null) { - exception = new RuntimeException("Unexpected system shutdown"); + exception = new RuntimeException(message); } logException(exception); ExecutionResult result = erm.close(exception); @@ -243,21 +246,32 @@ public final ExecutionResult start() throws ToolException { try { currentStep = "check"; privateCheck(); - check(); - currentStep = null; - erm.setSteps(getSteps()); - run(); + if (dryRun) { + logger.info("Dry run enabled. Sleep for 5 seconds and skip execution."); + Thread.sleep(5000); + } else { + currentStep = null; + erm.setSteps(getSteps()); + run(); + } } catch (ToolException e) { throw e; } catch (Exception e) { throw new ToolException(e); } + Runtime.getRuntime().removeShutdownHook(hook); } catch (Throwable e) { exception = e; + // Do not use a finally block to remove shutdownHook, as finally blocks will be executed even if the JVM is killed, + // and this would throw IllegalStateException("Shutdown in progress"); + try { + Runtime.getRuntime().removeShutdownHook(hook); + } catch (Exception e1) { + e.addSuppressed(e1); + } throw e; } finally { deleteScratchDirectory(); - Runtime.getRuntime().removeShutdownHook(hook); stopMemoryMonitor(); result = erm.close(exception); logException(exception); @@ -308,6 +322,7 @@ private void privateCheck() throws Exception { if (toolParams != null) { toolParams.updateParams(getParams()); } + check(); } /** diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/ToolRunner.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/ToolRunner.java index 830110c7c23..4a1dd9cf02d 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/ToolRunner.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/ToolRunner.java @@ -34,7 +34,6 @@ import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Collections; public class ToolRunner { @@ -106,19 +105,22 @@ public ExecutionResult execute(Job job, String token) throws CatalogException, T * @throws ToolException if the execution fails */ public ExecutionResult execute(Job job, Path outDir, String token) throws CatalogException, ToolException { - return execute(job.getTool().getId(), new ObjectMap(job.getParams()), outDir, job.getId(), token); + return execute(job.getTool().getId(), new ObjectMap(job.getParams()), outDir, job.getId(), job.isDryRun(), token); } /** * Execute a tool + * * @param toolId Tool identifier. It can be either the tool id itself, or the class name. * @param params Params for the execution. * @param outDir Output directory. Mandatory - * @param token session id of the user that will execute the tool. + * @param dryRun Dry-run mode. + * @param token session id of the user that will execute the tool. * @return Execution result * @throws ToolException if the execution fails */ - public ExecutionResult execute(String toolId, ObjectMap params, Path outDir, String jobId, String token) throws ToolException { + public ExecutionResult execute(String toolId, ObjectMap params, Path outDir, String jobId, boolean dryRun, String token) + throws ToolException { OpenCgaTool tool; if (configuration != null && configuration.getAnalysis() != null && CollectionUtils.isNotEmpty(configuration.getAnalysis().getPackages())) { @@ -126,58 +128,67 @@ public ExecutionResult execute(String toolId, ObjectMap params, Path outDir, Str } else { tool = toolFactory.createTool(toolId); } - return tool.setUp(opencgaHome, catalogManager, variantStorageManager, params, outDir, jobId, token) + return tool.setUp(opencgaHome, catalogManager, variantStorageManager, params, outDir, jobId, dryRun, token) .start(); } /** * Execute a tool - * @param tool Tool class - * @param study Study id + * + * @param tool Tool class + * @param study Study id * @param toolParams Specific ToolParams for the execution. - * @param outDir Output directory. Mandatory - * @param jobId Job Id (if any) - * @param token session id of the user that will execute the tool. + * @param outDir Output directory. Mandatory + * @param jobId Job Id (if any) + * @param dryRun Dry-run mode. + * @param token session id of the user that will execute the tool. * @return Execution result * @throws ToolException if the execution fails */ - public ExecutionResult execute(Class tool, String study, ToolParams toolParams, Path outDir, String jobId, String token) + public ExecutionResult execute(Class tool, String study, ToolParams toolParams, Path outDir, String jobId, + boolean dryRun, String token) throws ToolException { ObjectMap params = new ObjectMap(); params.putIfNotEmpty(ParamConstants.STUDY_PARAM, study); - return execute(tool, toolParams, params, outDir, jobId, token); + return execute(tool, toolParams, params, outDir, jobId, dryRun, token); } /** * Execute a tool - * @param tool Tool class + * + * @param tool Tool class * @param toolParams Specific ToolParams for the execution. - * @param params Params for the execution. - * @param outDir Output directory. Mandatory - * @param jobId Job Id (if any) - * @param token session id of the user that will execute the tool. + * @param params Params for the execution. + * @param outDir Output directory. Mandatory + * @param jobId Job Id (if any) + * @param dryRun Dry-run mode. + * @param token session id of the user that will execute the tool. * @return Execution result * @throws ToolException if the execution fails */ - public ExecutionResult execute(Class tool, ToolParams toolParams, ObjectMap params, Path outDir, String jobId, String token) + public ExecutionResult execute(Class tool, ToolParams toolParams, ObjectMap params, Path outDir, String jobId, + boolean dryRun, String token) throws ToolException { if (toolParams != null) { params = toolParams.toObjectMap(params); } - return execute(tool, params, outDir, jobId, token); + return execute(tool, params, outDir, jobId, dryRun, token); } /** * Execute a tool - * @param tool Tool class + * + * @param tool Tool class * @param toolParams Specific ToolParams for the execution. - * @param outDir Output directory. Mandatory - * @param jobId Job Id (if any) - * @param token session id of the user that will execute the tool. + * @param outDir Output directory. Mandatory + * @param jobId Job Id (if any) + * @param dryRun Dry-run mode. + * @param token session id of the user that will execute the tool. * @return Execution result * @throws ToolException if the execution fails */ - public ExecutionResult execute(Class tool, ToolParams toolParams, Path outDir, String jobId, String token) + public ExecutionResult execute(Class tool, ToolParams toolParams, Path outDir, String jobId, boolean dryRun, + String token) throws ToolException { ObjectMap params; if (toolParams != null) { @@ -185,24 +196,27 @@ public ExecutionResult execute(Class tool, ToolParams too } else { params = new ObjectMap(); } - return execute(tool, params, outDir, jobId, token); + return execute(tool, params, outDir, jobId, dryRun, token); } /** * Execute a tool - * @param tool Tool class + * + * @param tool Tool class * @param params Params for the execution. * @param outDir Output directory. Mandatory - * @param jobId Job Id (if any) - * @param token session id of the user that will execute the tool. + * @param jobId Job Id (if any) + * @param dryRun + * @param token session id of the user that will execute the tool. * @return Execution result * @throws ToolException if the execution fails */ - public ExecutionResult execute(Class tool, ObjectMap params, Path outDir, String jobId, String token) throws ToolException { + public ExecutionResult execute(Class tool, ObjectMap params, Path outDir, String jobId, boolean dryRun, + String token) throws ToolException { return toolFactory .createTool(tool) - .setUp(opencgaHome, catalogManager, variantStorageManager, params, outDir, jobId, token) + .setUp(opencgaHome, catalogManager, variantStorageManager, params, outDir, jobId, dryRun, token) .start(); } diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/julie/JulieTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/julie/JulieTool.java index 2c00104e732..49ccd95298a 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/julie/JulieTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/julie/JulieTool.java @@ -25,7 +25,8 @@ resource = Enums.Resource.VARIANT, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - description = JulieTool.DESCRIPTION) + description = JulieTool.DESCRIPTION, + priority = Enums.Priority.HIGH) public class JulieTool extends OpenCgaTool { public static final String ID = "julie"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateFamilyOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateFamilyOperationTool.java index c00f4943e08..57efbe0ef60 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateFamilyOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateFamilyOperationTool.java @@ -25,7 +25,8 @@ @Tool(id = VariantAggregateFamilyOperationTool.ID, description = VariantAggregateFamilyOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantAggregateFamilyOperationTool extends OperationTool { public static final String ID = "variant-aggregate-family"; public static final String DESCRIPTION = "Find variants where not all the samples are present, and fill the empty values."; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateOperationTool.java index 49f799500bd..ab28fd9dea4 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAggregateOperationTool.java @@ -16,14 +16,13 @@ package org.opencb.opencga.analysis.variant.operations; -import org.opencb.opencga.core.tools.annotations.Tool; -import org.opencb.opencga.core.models.operations.variant.VariantAggregateParams; import org.opencb.opencga.core.models.common.Enums; +import org.opencb.opencga.core.models.operations.variant.VariantAggregateParams; +import org.opencb.opencga.core.tools.annotations.Tool; import org.opencb.opencga.core.tools.annotations.ToolParams; -import org.opencb.opencga.storage.core.variant.VariantStorageOptions; @Tool(id = VariantAggregateOperationTool.ID, description = VariantAggregateOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantAggregateOperationTool extends OperationTool { public static final String ID = "variant-aggregate"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationDeleteOperationTool.java index 07f5e396ef7..47d36b85333 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationDeleteOperationTool.java @@ -24,7 +24,7 @@ @Tool(id = VariantAnnotationDeleteOperationTool.ID, description = VariantAnnotationDeleteOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantAnnotationDeleteOperationTool extends OperationTool { public static final String ID = "variant-annotation-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationIndexOperationTool.java index d3405dcaecd..aa08de950c7 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationIndexOperationTool.java @@ -32,7 +32,8 @@ @Tool(id = VariantAnnotationIndexOperationTool.ID, description = VariantAnnotationIndexOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantAnnotationIndexOperationTool extends OperationTool { public static final String ID = "variant-annotation-index"; public static final String DESCRIPTION = "Create and load variant annotations into the database"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationRebuilderOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationRebuilderOperationTool.java index 891838e34b3..b684d612519 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationRebuilderOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationRebuilderOperationTool.java @@ -22,7 +22,8 @@ @Tool(id = VariantAnnotationRebuilderOperationTool.ID, description = VariantAnnotationRebuilderOperationTool.ID, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantAnnotationRebuilderOperationTool extends OperationTool { public static final String ID = "variant-annotation-rebuilder"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationSaveOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationSaveOperationTool.java index 33e400bcb12..9f7994935b0 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationSaveOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantAnnotationSaveOperationTool.java @@ -23,7 +23,8 @@ @Tool(id = VariantAnnotationSaveOperationTool.ID, description = VariantAnnotationSaveOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantAnnotationSaveOperationTool extends OperationTool { public static final String ID = "variant-annotation-save"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFamilyIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFamilyIndexOperationTool.java index c7258c79f74..65dc97676cb 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFamilyIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFamilyIndexOperationTool.java @@ -31,7 +31,7 @@ @Deprecated @Tool(id = VariantFamilyIndexOperationTool.ID, description = VariantFamilyIndexOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantFamilyIndexOperationTool extends OperationTool { public static final String ID = "variant-family-index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileDeleteOperationTool.java index 85b4f8b1b48..db2da6c58e4 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileDeleteOperationTool.java @@ -33,7 +33,7 @@ * @author Jacobo Coll <jacobo167@gmail.com> */ @Tool(id = VariantFileDeleteOperationTool.ID, description = VariantFileDeleteOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantFileDeleteOperationTool extends OperationTool { public static final String ID = "variant-file-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileIndexJobLauncherTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileIndexJobLauncherTool.java index 3dd3f5584ea..f45b7011650 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileIndexJobLauncherTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantFileIndexJobLauncherTool.java @@ -31,7 +31,7 @@ import static org.opencb.opencga.catalog.db.api.FileDBAdaptor.QueryParams.*; @Tool(id = VariantFileIndexJobLauncherTool.ID, description = VariantFileIndexJobLauncherTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantFileIndexJobLauncherTool extends OpenCgaToolScopeStudy { public static final String ID = "variant-index-job-launcher"; @@ -142,7 +142,7 @@ protected void run() throws Exception { String jobId = buildJobId(file); Job job = catalogManager.getJobManager().submit(getStudy(), VariantIndexOperationTool.ID, Enums.Priority.MEDIUM, indexParams.toParams(new ObjectMap(ParamConstants.STUDY_PARAM, study)), jobId, "Job generated by " + getId(), - Collections.emptyList(), jobTags, getToken()).first(); + Collections.emptyList(), jobTags, getJobId(), null, false, getToken()).first(); submittedJobs++; logger.info("[{}] Create variant-index job '{}' for file '{}'{}", submittedJobs, diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantIndexOperationTool.java index 70a882d4d80..d4e7270d2e6 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantIndexOperationTool.java @@ -35,7 +35,7 @@ import static org.opencb.opencga.analysis.variant.manager.operations.VariantFileIndexerOperationManager.*; @Tool(id = VariantIndexOperationTool.ID, description = VariantIndexOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantIndexOperationTool extends OperationTool { public static final String ID = "variant-index"; public static final String DESCRIPTION = "Index variant files into the variant storage"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantPruneOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantPruneOperationTool.java index 58838a2ea1e..f2426fa5f04 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantPruneOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantPruneOperationTool.java @@ -6,7 +6,7 @@ import org.opencb.opencga.core.tools.annotations.ToolParams; @Tool(id = VariantPruneOperationTool.ID, description = VariantPruneOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantPruneOperationTool extends OperationTool { public static final String DESCRIPTION = "Prune orphan variants from studies in a project."; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSampleDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSampleDeleteOperationTool.java index 067367a3f28..8c5620291be 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSampleDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSampleDeleteOperationTool.java @@ -33,7 +33,7 @@ * @author Jacobo Coll <jacobo167@gmail.com> */ @Tool(id = VariantSampleDeleteOperationTool.ID, description = VariantSampleDeleteOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantSampleDeleteOperationTool extends OperationTool { public static final String ID = "variant-sample-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreDeleteOperationTool.java index b2b6734cf87..a26afb81955 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreDeleteOperationTool.java @@ -21,7 +21,7 @@ import org.opencb.opencga.core.models.common.Enums; @Tool(id= VariantScoreDeleteOperationTool.ID, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantScoreDeleteOperationTool extends OperationTool { public static final String ID = "variant-score-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreIndexOperationTool.java index d7049df006e..e863a630167 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantScoreIndexOperationTool.java @@ -16,18 +16,16 @@ package org.opencb.opencga.analysis.variant.operations; -import org.opencb.opencga.core.tools.annotations.Tool; -import org.opencb.opencga.core.models.operations.variant.VariantScoreIndexParams; import org.opencb.opencga.core.common.UriUtils; import org.opencb.opencga.core.models.common.Enums; +import org.opencb.opencga.core.models.operations.variant.VariantScoreIndexParams; +import org.opencb.opencga.core.tools.annotations.Tool; import org.opencb.opencga.storage.core.variant.score.VariantScoreFormatDescriptor; import java.net.URI; -import static org.opencb.opencga.core.api.ParamConstants.STUDY_PARAM; - @Tool(id= VariantScoreIndexOperationTool.ID, description = VariantScoreIndexOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantScoreIndexOperationTool extends OperationTool { public static final String ID = "variant-score-index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryAnnotationIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryAnnotationIndexOperationTool.java index 24f54414f78..a812c8165c5 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryAnnotationIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryAnnotationIndexOperationTool.java @@ -23,7 +23,8 @@ @Tool(id = VariantSecondaryAnnotationIndexOperationTool.ID, description = VariantSecondaryAnnotationIndexOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantSecondaryAnnotationIndexOperationTool extends OperationTool { public static final String ID = "variant-secondary-annotation-index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesDeleteOperationTool.java index b452fffb820..92e5643dedc 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesDeleteOperationTool.java @@ -22,7 +22,8 @@ @Tool(id = VariantSecondaryIndexSamplesDeleteOperationTool.ID, description = VariantSecondaryIndexSamplesDeleteOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) @Deprecated public class VariantSecondaryIndexSamplesDeleteOperationTool extends OperationTool { diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesOperationTool.java index e31f32a62a1..9671c0fbda2 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondaryIndexSamplesOperationTool.java @@ -21,7 +21,7 @@ import org.opencb.opencga.core.models.common.Enums; @Tool(id = VariantSecondaryIndexSamplesOperationTool.ID, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) @Deprecated public class VariantSecondaryIndexSamplesOperationTool extends OperationTool { diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondarySampleIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondarySampleIndexOperationTool.java index d4dd7ab8a89..259433a3b9e 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondarySampleIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantSecondarySampleIndexOperationTool.java @@ -30,7 +30,7 @@ import java.util.List; @Tool(id = VariantSecondarySampleIndexOperationTool.ID, description = VariantSecondarySampleIndexOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantSecondarySampleIndexOperationTool extends OperationTool { public static final String ID = "variant-secondary-sample-index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsDeleteOperationTool.java index 43124238717..0853cfa5d5c 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsDeleteOperationTool.java @@ -25,7 +25,8 @@ @Tool(id = VariantStatsDeleteOperationTool.ID, description = VariantStatsDeleteOperationTool.DESCRIPTION, type = Tool.Type.OPERATION, scope = Tool.Scope.STUDY, - resource = Enums.Resource.VARIANT) + resource = Enums.Resource.VARIANT, + priority = Enums.Priority.HIGH) public class VariantStatsDeleteOperationTool extends OperationTool { public static final String ID = "variant-stats-delete"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsIndexOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsIndexOperationTool.java index adae4198666..4ab8f6c58c9 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsIndexOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStatsIndexOperationTool.java @@ -39,7 +39,7 @@ * Created by jacobo on 06/03/15. */ @Tool(id = VariantStatsIndexOperationTool.ID, resource = Enums.Resource.VARIANT, type = Tool.Type.OPERATION, - description = VariantStatsIndexOperationTool.DESCRIPTION) + description = VariantStatsIndexOperationTool.DESCRIPTION, priority = Enums.Priority.HIGH) public class VariantStatsIndexOperationTool extends OperationTool { public final static String ID = "variant-stats-index"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataRepairTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataRepairTool.java index 47c33107bcf..04606492bff 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataRepairTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataRepairTool.java @@ -26,7 +26,7 @@ import static org.opencb.opencga.core.models.operations.variant.VariantStorageMetadataRepairToolParams.What.*; @Tool(id = VariantStorageMetadataRepairTool.ID, description = VariantStorageMetadataRepairTool.DESCRIPTION, - type = Tool.Type.OPERATION, scope = Tool.Scope.GLOBAL, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, scope = Tool.Scope.GLOBAL, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantStorageMetadataRepairTool extends OperationTool { public static final String ID = "variant-storage-metadata-repair"; public static final String DESCRIPTION = "Execute some repairs on Variant Storage Metadata. Advanced users only."; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataSynchronizeOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataSynchronizeOperationTool.java index 7b5962a0424..8f7cac4f6a2 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataSynchronizeOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStorageMetadataSynchronizeOperationTool.java @@ -6,7 +6,7 @@ import org.opencb.opencga.core.tools.annotations.ToolParams; @Tool(id = VariantStorageMetadataSynchronizeOperationTool.ID, resource = Enums.Resource.VARIANT, type = Tool.Type.OPERATION, - scope = Tool.Scope.STUDY, description = VariantStorageMetadataSynchronizeOperationTool.DESCRIPTION) + scope = Tool.Scope.STUDY, description = VariantStorageMetadataSynchronizeOperationTool.DESCRIPTION, priority = Enums.Priority.HIGH) public class VariantStorageMetadataSynchronizeOperationTool extends OperationTool { public static final String ID = "variant-storage-metadata-synchronize"; public static final String DESCRIPTION = "Synchronize catalog with variant storage metadata"; diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStudyDeleteOperationTool.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStudyDeleteOperationTool.java index 643c2c989d8..baa52c6f2c2 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStudyDeleteOperationTool.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/operations/VariantStudyDeleteOperationTool.java @@ -32,7 +32,7 @@ * @author Jacobo Coll <jacobo167@gmail.com> */ @Tool(id = VariantStudyDeleteOperationTool.ID, description = VariantStudyDeleteOperationTool.DESCRIPTION, - type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT) + type = Tool.Type.OPERATION, resource = Enums.Resource.VARIANT, priority = Enums.Priority.HIGH) public class VariantStudyDeleteOperationTool extends OperationTool { public static final String ID = "variant-study-delete"; diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/alignment/AlignmentAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/alignment/AlignmentAnalysisTest.java index 14a5bbb63e7..9339ddf40e2 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/alignment/AlignmentAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/alignment/AlignmentAnalysisTest.java @@ -278,7 +278,7 @@ public void geneCoverageStatsTest() throws IOException, ToolException, CatalogEx String geneName = "BRCA2"; params.setGenes(Arrays.asList(geneName)); - toolRunner.execute(AlignmentGeneCoverageStatsAnalysis.class, params, new ObjectMap(), outdir, "coverage-job-id", token); + toolRunner.execute(AlignmentGeneCoverageStatsAnalysis.class, params, new ObjectMap(), outdir, "coverage-job-id", false, token); bamFile = catalogManager.getFileManager().link(STUDY, new FileLinkParams(bamFilename, "", "", "", null, null, null, null, null), false, token).first(); @@ -301,7 +301,7 @@ public void testNonReadOnlyAlignmentIndex() throws Exception { AlignmentIndexParams params = new AlignmentIndexParams(); params.setFileId(bamFile.getId()); Path alignmentIndexOutdir = Paths.get(opencga.createTmpOutdir("_alignment_index")); - toolRunner.execute(AlignmentIndexOperation.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-non-readonly-coverage-index", token); + toolRunner.execute(AlignmentIndexOperation.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-non-readonly-coverage-index", false, token); // Checking BAI file Path baiPath = nonReadOnlyDir.resolve(bamFilename + AlignmentConstants.BAI_EXTENSION); @@ -330,7 +330,7 @@ public void testReadOnlyAlignmentIndex() throws Exception { AlignmentIndexParams params = new AlignmentIndexParams(); params.setFileId(bamFile.getId()); Path alignmentIndexOutdir = Paths.get(opencga.createTmpOutdir("_alignment_index")); - toolRunner.execute(AlignmentIndexOperation.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-readonly-coverage-index", token); + toolRunner.execute(AlignmentIndexOperation.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-readonly-coverage-index", false, token); // Checking BAI file Path baiPath = alignmentIndexOutdir.resolve(bamFilename + AlignmentConstants.BAI_EXTENSION); @@ -358,7 +358,7 @@ public void testNonReadOnlyCoverageIndex() throws Exception { AlignmentIndexParams indexParams = new AlignmentIndexParams(); indexParams.setFileId(bamFile.getId()); Path alignmentIndexOutdir = Paths.get(opencga.createTmpOutdir("_alignment_index")); - toolRunner.execute(AlignmentIndexOperation.class, indexParams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-non-readonly-alignment-coverage-index", token); + toolRunner.execute(AlignmentIndexOperation.class, indexParams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-non-readonly-alignment-coverage-index", false, token); // Checking BAI file Path baiPath = nonReadOnlyDir.resolve(bamFilename + AlignmentConstants.BAI_EXTENSION); @@ -374,7 +374,7 @@ public void testNonReadOnlyCoverageIndex() throws Exception { coverageOarams.setBamFileId(bamFile.getId()); coverageOarams.setBaiFileId(baiFile.getId()); Path coverageIndexOutdir = Paths.get(opencga.createTmpOutdir("_coverage_index")); - toolRunner.execute(AlignmentCoverageAnalysis.class, coverageOarams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), coverageIndexOutdir, "jobId-readonly-coverage-index", token); + toolRunner.execute(AlignmentCoverageAnalysis.class, coverageOarams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), coverageIndexOutdir, "jobId-readonly-coverage-index", false, token); // Checking BW file Path bwPath = nonReadOnlyDir.resolve(bamFilename + AlignmentConstants.BIGWIG_EXTENSION); @@ -400,7 +400,7 @@ public void testReadOnlyCoverageIndex() throws Exception { AlignmentIndexParams indexParams = new AlignmentIndexParams(); indexParams.setFileId(bamFile.getId()); Path alignmentIndexOutdir = Paths.get(opencga.createTmpOutdir("_alignment_index")); - toolRunner.execute(AlignmentIndexOperation.class, indexParams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-readonly-coverage-index", token); + toolRunner.execute(AlignmentIndexOperation.class, indexParams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), alignmentIndexOutdir, "jobId-readonly-coverage-index", false, token); // Checking BAI file Path baiPath = readOnlyDir.resolve(bamFilename + AlignmentConstants.BAI_EXTENSION); @@ -419,7 +419,7 @@ public void testReadOnlyCoverageIndex() throws Exception { coverageOarams.setBamFileId(bamFile.getId()); coverageOarams.setBaiFileId(baiFile.getId()); Path coverageIndexOutdir = Paths.get(opencga.createTmpOutdir("_coverage_index")); - toolRunner.execute(AlignmentCoverageAnalysis.class, coverageOarams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), coverageIndexOutdir, "jobId-readonly-coverage-index", token); + toolRunner.execute(AlignmentCoverageAnalysis.class, coverageOarams, new ObjectMap(ParamConstants.STUDY_PARAM, STUDY), coverageIndexOutdir, "jobId-readonly-coverage-index", false, token); // Checking BW file Path bwPath = coverageIndexOutdir.resolve(bamFilename + AlignmentConstants.BIGWIG_EXTENSION); diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java index af5c8d9be8e..91ac3624471 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/family/FamilyAnalysisTest.java @@ -202,7 +202,7 @@ public void testPedigreeGraphAnalysis() throws ToolException, IOException { params.setFamilyId(family.getId()); toolRunner.execute(PedigreeGraphAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, studyId), outDir, null, - sessionIdUser); + false, sessionIdUser); String b64Image = PedigreeGraphUtils.getB64Image(outDir); MatcherAssert.assertThat(b64Image, CoreMatchers.startsWith("iVBORw0KGgoAAAANSUhEUgAAAeAAAAHg")); diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/rga/RgaManagerTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/rga/RgaManagerTest.java index 4fa44f7cd98..74cc8339db8 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/rga/RgaManagerTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/rga/RgaManagerTest.java @@ -165,7 +165,7 @@ public void setUp() throws Throwable { KnockoutAnalysisParams params = new KnockoutAnalysisParams(); params.setSample(file.getSampleIds()); - toolRunner.execute(KnockoutAnalysis.class, params.toObjectMap(), outDir, null, ownerToken); + toolRunner.execute(KnockoutAnalysis.class, params.toObjectMap(), outDir, null, false, ownerToken); File file = catalogManager.getFileManager().link(STUDY, new FileLinkParams() diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java index 740040d19bc..c91909d3abb 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/VariantAnalysisTest.java @@ -314,7 +314,7 @@ public void testMalformedVcfFileIndex() throws Exception { try { toolRunner.execute(VariantIndexOperationTool.class, new VariantIndexParams().setFile(file.getId()).setAnnotate(true), - Paths.get(opencga.createTmpOutdir()), null, token); + Paths.get(opencga.createTmpOutdir()), null, false, token); } catch (ToolException e) { System.out.println(ExceptionUtils.prettyExceptionMessage(e, true, true)); } @@ -330,7 +330,7 @@ public void testVariantStats() throws Exception { VariantStatsAnalysis variantStatsAnalysis = new VariantStatsAnalysis() .setStudy(STUDY) .setSamples(samples.subList(1, 3)); - variantStatsAnalysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + variantStatsAnalysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); ExecutionResult ar = variantStatsAnalysis.start(); checkExecutionResult(ar); @@ -355,7 +355,7 @@ public void testVariantStatsTwoCohorts() throws Exception { VariantStatsAnalysis variantStatsAnalysis = new VariantStatsAnalysis() .setStudy(STUDY) .setCohort(Arrays.asList("c1", "c2")); - variantStatsAnalysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + variantStatsAnalysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); ExecutionResult ar = variantStatsAnalysis.start(); checkExecutionResult(ar); @@ -382,7 +382,7 @@ public void testVariantStatsWithFilter() throws Exception { VariantStatsAnalysisParams params = new VariantStatsAnalysisParams() .setSamples(samples.subList(1, 3)) .setRegion(region); - ExecutionResult ar = toolRunner.execute(VariantStatsAnalysis.class, STUDY, params, outDir, "", token); + ExecutionResult ar = toolRunner.execute(VariantStatsAnalysis.class, STUDY, params, outDir, "", false, token); checkExecutionResult(ar); MutableInt count = new MutableInt(); @@ -480,7 +480,7 @@ private ExecutionResult sampleVariantStats(String region, String indexId, boolea params.getVariantQuery() .appendQuery(query) .setRegion(region); - ExecutionResult result = toolRunner.execute(SampleVariantStatsAnalysis.class, STUDY, params, outDir, null, token); + ExecutionResult result = toolRunner.execute(SampleVariantStatsAnalysis.class, STUDY, params, outDir, null, false, token); if (nothingToDo) { assertEquals("All samples stats indexed. Nothing to do!", result.getEvents().get(0).getMessage()); @@ -516,7 +516,7 @@ public void testCohortStats() throws Exception { CohortVariantStatsAnalysis analysis = new CohortVariantStatsAnalysis(); Path outDir = Paths.get(opencga.createTmpOutdir("_cohort_stats")); System.out.println("output = " + outDir.toAbsolutePath()); - analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); List samples = file.getSampleIds(); analysis.setStudy(STUDY) .setSamplesQuery(new Query(SampleDBAdaptor.QueryParams.ID.key(), samples.subList(0, 3))); @@ -533,7 +533,7 @@ public void testCohortStatsIndex() throws Exception { .setIndex(true); ExecutionResult result = toolRunner.execute(CohortVariantStatsAnalysis.class, STUDY, toolParams, - outDir, null, token); + outDir, null, false, token); checkExecutionResult(result, storageEngine.equals(HadoopVariantStorageEngine.STORAGE_ENGINE_ID)); Cohort cohort = catalogManager.getCohortManager().get(STUDY, StudyEntry.DEFAULT_COHORT, new QueryOptions(), token).first(); @@ -557,7 +557,7 @@ public void testCohortStatsIndex() throws Exception { outDir = Paths.get(opencga.createTmpOutdir("_cohort_stats_index_2")); System.out.println("output = " + outDir.toAbsolutePath()); - result = toolRunner.execute(CohortVariantStatsAnalysis.class, STUDY, toolParams, outDir, null, token); + result = toolRunner.execute(CohortVariantStatsAnalysis.class, STUDY, toolParams, outDir, null, false, token); checkExecutionResult(result, storageEngine.equals(HadoopVariantStorageEngine.STORAGE_ENGINE_ID)); @@ -580,7 +580,7 @@ public void testExport() throws Exception { variantExportParams.setOutputFileName("chr22.vcf"); toolRunner.execute(VariantExportTool.class, - variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); assertTrue(outDir.resolve(variantExportParams.getOutputFileName() + ".gz").toFile().exists()); } @@ -595,7 +595,7 @@ public void testExportVep() throws Exception { variantExportParams.setOutputFileName("chr1-5-22"); variantExportParams.setOutputFileFormat(VariantWriterFactory.VariantOutputFormat.ENSEMBL_VEP.name()); toolRunner.execute(VariantExportTool.class, - variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); } @Test @@ -615,7 +615,7 @@ public void testExportTped() throws Exception { variantExportParams.setInclude("id,studies.samples"); toolRunner.execute(VariantExportTool.class, - variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + variantExportParams.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); System.out.println(outDir); Path tped = outDir.resolve(variantExportParams.getOutputFileName() + ".tped"); @@ -636,7 +636,7 @@ public void testGwas() throws Exception { GwasAnalysis analysis = new GwasAnalysis(); Path outDir = Paths.get(opencga.createTmpOutdir("_gwas")); System.out.println("output = " + outDir.toAbsolutePath()); - analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); List samples = file.getSampleIds(); analysis.setStudy(STUDY) .setCaseCohortSamplesQuery(new Query(SampleDBAdaptor.QueryParams.ID.key(), samples.subList(0, 2))) @@ -650,7 +650,7 @@ public void testGwasByPhenotype() throws Exception { GwasAnalysis analysis = new GwasAnalysis(); Path outDir = Paths.get(opencga.createTmpOutdir("_gwas_phenotype")); System.out.println("output = " + outDir.toAbsolutePath()); - analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); analysis.setStudy(STUDY) .setPhenotype(PHENOTYPE_NAME); @@ -665,7 +665,7 @@ public void testKnockoutGenes() throws Exception { params.setSample(file.getSampleIds()); ExecutionResult er = toolRunner.execute(KnockoutAnalysis.class, - params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); checkExecutionResult(er, false); } @@ -680,7 +680,7 @@ public void testKnockoutGenesSpecificGenes() throws Exception { ExecutionResult er = toolRunner.execute(KnockoutAnalysis.class, params.toObjectMap() .append(ParamConstants.STUDY_PARAM, STUDY) - .append("executionMethod", "byGene"), outDir, null, token); + .append("executionMethod", "byGene"), outDir, null, false, token); checkExecutionResult(er, false); assertEquals(4, er.getAttributes().get("otherGenesCount")); assertEquals(3, er.getAttributes().get("proteinCodingGenesCount")); @@ -696,7 +696,7 @@ public void testKnockoutGenesSpecificGenesAndBiotypeProteinCoding() throws Excep params.setBiotype(VariantAnnotationConstants.PROTEIN_CODING); ExecutionResult er = toolRunner.execute(KnockoutAnalysis.class, - params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); checkExecutionResult(er, false); assertEquals(0, er.getAttributes().get("otherGenesCount")); assertEquals(3, er.getAttributes().get("proteinCodingGenesCount")); @@ -712,7 +712,7 @@ public void testKnockoutGenesSpecificGenesAndBiotypeNMD() throws Exception { params.setBiotype("nonsense_mediated_decay"); ExecutionResult er = toolRunner.execute(KnockoutAnalysis.class, - params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); checkExecutionResult(er, false); assertEquals(3, er.getAttributes().get("otherGenesCount")); // MIR1909 only has miRNA biotype assertEquals(0, er.getAttributes().get("proteinCodingGenesCount")); @@ -749,7 +749,7 @@ public void testKnockoutGenesByBiotype() throws Exception { // + "," + "TR_V_gene"); ExecutionResult er = toolRunner.execute(KnockoutAnalysis.class, - params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); checkExecutionResult(er, false); } @@ -761,7 +761,7 @@ public void testSampleMultiVariantFilterAnalysis() throws Exception { params.setQuery("(biotype=protein_coding AND ct=missense_variant AND gene=BRCA2) OR (gene=BTN3A2)"); ExecutionResult er = toolRunner.execute(SampleEligibilityAnalysis.class, - params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, token); + params.toObjectMap().append(ParamConstants.STUDY_PARAM, STUDY), outDir, null, false, token); // checkExecutionResult(er, false); } @@ -792,7 +792,7 @@ public void testMutationalSignatureFittingSNV() throws Exception { params.setSkip("catalogue"); toolRunner.execute(MutationalSignatureAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), - outDir, null, token); + outDir, null, false, token); java.io.File catalogueFile = outDir.resolve(MutationalSignatureAnalysis.SIGNATURE_COEFFS_FILENAME).toFile(); byte[] bytes = Files.readAllBytes(catalogueFile.toPath()); @@ -852,7 +852,7 @@ public void testMutationalSignatureCatalogueSV() throws Exception { params.setSkip("fitting"); toolRunner.execute(MutationalSignatureAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), - outDir, null, token); + outDir, null, false, token); java.io.File catalogueFile = outDir.resolve(MutationalSignatureAnalysis.CATALOGUES_FILENAME_DEFAULT).toFile(); byte[] bytes = Files.readAllBytes(catalogueFile.toPath()); @@ -912,7 +912,7 @@ public void testMutationalSignatureFittingSV() throws Exception { params.setSkip("catalogue"); toolRunner.execute(MutationalSignatureAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), - outDir, null, token); + outDir, null, false, token); java.io.File catalogueFile = outDir.resolve(MutationalSignatureAnalysis.SIGNATURE_COEFFS_FILENAME).toFile(); byte[] bytes = Files.readAllBytes(catalogueFile.toPath()); @@ -962,7 +962,7 @@ public void testHRDetect() throws Exception { params.setSkip("catalogue"); toolRunner.execute(MutationalSignatureAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), - snvFittingOutDir, null, token); + snvFittingOutDir, null, false, token); java.io.File snvSignatureFittingFile = snvFittingOutDir.resolve(MutationalSignatureAnalysis.MUTATIONAL_SIGNATURE_FITTING_DATA_MODEL_FILENAME).toFile(); assertTrue(snvSignatureFittingFile.exists()); @@ -994,7 +994,7 @@ public void testHRDetect() throws Exception { params.setSkip("catalogue"); toolRunner.execute(MutationalSignatureAnalysis.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), - svFittingOutDir, null, token); + svFittingOutDir, null, false, token); java.io.File svSignatureFittingFile = svFittingOutDir.resolve(MutationalSignatureAnalysis.MUTATIONAL_SIGNATURE_FITTING_DATA_MODEL_FILENAME).toFile(); assertTrue(svSignatureFittingFile.exists()); @@ -1011,7 +1011,7 @@ public void testHRDetect() throws Exception { hrdParams.setIndelQuery("{\"sample\": \"" + cancer_sample + "\", \"type\": \"" + VariantType.INDEL + "\"}"); hrdParams.setBootstrap(true); - toolRunner.execute(HRDetectAnalysis.class, hrdParams, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), hrdetectOutDir, null, token); + toolRunner.execute(HRDetectAnalysis.class, hrdParams, new ObjectMap(ParamConstants.STUDY_PARAM, CANCER_STUDY), hrdetectOutDir, null, false, token); java.io.File hrDetectFile = hrdetectOutDir.resolve(HRDetectAnalysis.HRDETECT_SCORES_FILENAME_DEFAULT).toFile(); assertTrue("File missing : " + hrDetectFile, hrDetectFile.exists()); @@ -1092,7 +1092,7 @@ public void testClinicalAnalysisLoading() throws IOException, ToolException, Cat params.setFile(file.getId()); toolRunner.execute(ClinicalAnalysisLoadTask.class, params, new ObjectMap(ParamConstants.STUDY_PARAM, - CANCER_STUDY), loadingOutDir, null, token); + CANCER_STUDY), loadingOutDir, null, false, token); String ca1Id = "SAP-45016-1"; String ca2Id = "OPA-6607-1"; diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/VariantOperationsTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/VariantOperationsTest.java index 6dc54c598ec..ef2261d388b 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/VariantOperationsTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/VariantOperationsTest.java @@ -47,16 +47,12 @@ import org.opencb.opencga.core.models.file.File; import org.opencb.opencga.core.models.individual.*; import org.opencb.opencga.core.models.job.Job; -import org.opencb.opencga.core.models.operations.variant.VariantAnnotationIndexParams; -import org.opencb.opencga.core.models.operations.variant.VariantSecondaryAnnotationIndexParams; -import org.opencb.opencga.core.models.operations.variant.VariantSecondarySampleIndexParams; +import org.opencb.opencga.core.models.operations.variant.*; import org.opencb.opencga.core.models.organizations.OrganizationCreateParams; import org.opencb.opencga.core.models.organizations.OrganizationUpdateParams; import org.opencb.opencga.core.models.project.ProjectCreateParams; import org.opencb.opencga.core.models.project.ProjectOrganism; import org.opencb.opencga.core.models.sample.*; -import org.opencb.opencga.core.models.operations.variant.VariantIndexParams; -import org.opencb.opencga.core.models.operations.variant.VariantStorageMetadataSynchronizeParams; import org.opencb.opencga.core.response.OpenCGAResult; import org.opencb.opencga.core.testclassification.duration.LongTests; import org.opencb.opencga.core.tools.result.ExecutionResult; @@ -235,10 +231,10 @@ private void loadDataset() throws Throwable { .setFile(file.getId()) .setAnnotate(false) .setLoadHomRef(YesNoAuto.YES.name()), - Paths.get(opencga.createTmpOutdir("_index")), "index", token); + Paths.get(opencga.createTmpOutdir("_index")), "index", false, token); toolRunner.execute(VariantAnnotationIndexOperationTool.class, STUDY, new VariantAnnotationIndexParams(), - Paths.get(opencga.createTmpOutdir("_annotation-index")), "index", token); + Paths.get(opencga.createTmpOutdir("_annotation-index")), "index", false, token); for (int i = 0; i < file.getSampleIds().size(); i++) { if (i % 2 == 0) { @@ -320,7 +316,7 @@ public void testVariantFileReload() throws Exception { new VariantIndexParams() .setForceReload(false) .setFile(file.getId()), - Paths.get(opencga.createTmpOutdir()), "index_reload", token); + Paths.get(opencga.createTmpOutdir()), "index_reload", false, token); fail("Should have thrown an exception"); } catch (ToolException e) { assertEquals(StorageEngineException.class, e.getCause().getClass()); @@ -331,7 +327,7 @@ public void testVariantFileReload() throws Exception { new VariantIndexParams() .setForceReload(true) .setFile(file.getId()), - Paths.get(opencga.createTmpOutdir()), "index_reload", token); + Paths.get(opencga.createTmpOutdir()), "index_reload", false, token); } @@ -346,7 +342,7 @@ public void testVariantSecondaryAnnotationIndex() throws Exception { toolRunner.execute(VariantSecondaryAnnotationIndexOperationTool.class, STUDY, new VariantSecondaryAnnotationIndexParams(), - Paths.get(opencga.createTmpOutdir()), "annotation_index", token); + Paths.get(opencga.createTmpOutdir()), "annotation_index", false, token); for (String sample : samples) { SampleInternalVariantSecondaryAnnotationIndex index = catalogManager.getSampleManager().get(STUDY, sample, new QueryOptions(), token).first().getInternal().getVariant().getSecondaryAnnotationIndex(); @@ -374,7 +370,7 @@ public void testVariantSecondarySampleIndex() throws Exception { new VariantSecondarySampleIndexParams() .setFamilyIndex(true) .setSample(Arrays.asList(mother)), - Paths.get(opencga.createTmpOutdir()), "index", token); + Paths.get(opencga.createTmpOutdir()), "index", false, token); fail("Expected to fail"); } catch (ToolException e) { assertEquals("Exception from step 'familyIndex'", e.getMessage()); @@ -386,7 +382,7 @@ public void testVariantSecondarySampleIndex() throws Exception { new VariantSecondarySampleIndexParams() .setFamilyIndex(true) .setSample(Arrays.asList(ParamConstants.ALL)), - Paths.get(opencga.createTmpOutdir()), "index", token); + Paths.get(opencga.createTmpOutdir()), "index", false, token); assertEquals(0, result.getEvents().size()); for (String sample : samples) { @@ -405,7 +401,7 @@ public void testVariantSecondarySampleIndex() throws Exception { // Initially nothing should change, even after running a manual synchronization toolRunner.execute(VariantStorageMetadataSynchronizeOperationTool.class, new VariantStorageMetadataSynchronizeParams().setStudy(STUDY_FQN), - Paths.get(opencga.createTmpOutdir()), "", catalogManager.getUserManager().loginAsAdmin(TestParamConstants.ADMIN_PASSWORD).getToken()); + Paths.get(opencga.createTmpOutdir()), "", false, catalogManager.getUserManager().loginAsAdmin(TestParamConstants.ADMIN_PASSWORD).getToken()); for (String sample : samples) { SampleInternalVariantSecondarySampleIndex sampleIndex = catalogManager.getSampleManager().get(STUDY, sample, new QueryOptions(), token) @@ -477,7 +473,7 @@ public void testVariantSecondarySampleIndexPartialFamily() throws Exception { new VariantSecondarySampleIndexParams() .setFamilyIndex(true) .setSample(Arrays.asList(daughter)), - Paths.get(opencga.createTmpOutdir()), "index", token); + Paths.get(opencga.createTmpOutdir()), "index", false, token); for (String sample : samples) { SampleInternalVariantSecondarySampleIndex sampleIndex = catalogManager.getSampleManager().get(STUDY, sample, new QueryOptions(), token).first().getInternal().getVariant().getSecondarySampleIndex(); @@ -500,7 +496,7 @@ public void testGwasIndex() throws Exception { GwasAnalysis analysis = new GwasAnalysis(); Path outDir = Paths.get(opencga.createTmpOutdir("_gwas_index")); System.out.println("output = " + outDir.toAbsolutePath()); - analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", token); + analysis.setUp(opencga.getOpencgaHome().toString(), catalogManager, variantStorageManager, executorParams, outDir, "", false, token); List samples = catalogManager.getSampleManager().get(STUDY, file.getSampleIds().subList(0, 2), QueryOptions.empty(), token).getResults(); catalogManager.getCohortManager().create(STUDY, new Cohort().setId("CASE").setSamples(samples), new QueryOptions(), token); diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/AbstractVariantOperationManagerTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/AbstractVariantOperationManagerTest.java index d1dcd2e9353..6063e8f1070 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/AbstractVariantOperationManagerTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/AbstractVariantOperationManagerTest.java @@ -87,8 +87,7 @@ */ public abstract class AbstractVariantOperationManagerTest extends GenericTest { - private String JOB_STATUS_FILE = "status.json"; - private String OUT_LOG_EXTENSION = ".out"; + private String OUT_LOG_EXTENSION = ".log"; private String ERR_LOG_EXTENSION = ".err"; protected CatalogManager catalogManager; @@ -403,8 +402,7 @@ protected List copyResults(Path tmpOutdirPath, String study, String catalo try { logger.info("Scanning files from {} to move to {}", tmpOutdirPath, outDir.getUri()); // Avoid copy the job.status file! - Predicate fileStatusFilter = uri -> !uri.getPath().endsWith(JOB_STATUS_FILE) - && !ExecutionResultManager.isExecutionResultFile(uri.getPath()) + Predicate fileStatusFilter = uri -> !ExecutionResultManager.isExecutionResultFile(uri.getPath()) && !uri.getPath().endsWith(OUT_LOG_EXTENSION) && !uri.getPath().endsWith(ERR_LOG_EXTENSION); files = fileScanner.scan(ORGANIZATION, outDir, tmpOutdirPath.toUri(), FileScanner.FileScannerPolicy.DELETE, false, true, fileStatusFilter, diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/PlatinumFileIndexerTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/PlatinumFileIndexerTest.java index f62d332470b..c343ceff241 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/PlatinumFileIndexerTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/PlatinumFileIndexerTest.java @@ -105,7 +105,7 @@ public void testIndexFamily() throws Exception { params.setFamily(true); ExecutionResult er = toolRunner.execute(VariantIndexOperationTool.class, params.toObjectMap() - .append(ParamConstants.STUDY_PARAM, studyId), outDir, null, sessionId); + .append(ParamConstants.STUDY_PARAM, studyId), outDir, null, false, sessionId); assertEquals(1, er.getSteps().size()); assertEquals("variant-index", er.getSteps().get(0).getId()); @@ -212,7 +212,7 @@ public void testLauncher() throws CatalogException, IOException, ToolException { VariantFileIndexJobLauncherParams params = new VariantFileIndexJobLauncherParams().setDirectory("data/vcfs"); List tags = Arrays.asList("tag1", "tag2"); Job job = catalogManager.getJobManager().submit(studyFqn, VariantFileIndexJobLauncherTool.ID, Enums.Priority.HIGH, - params.toParams(STUDY_PARAM, studyFqn), null, null, null, tags, sessionId).first(); + params.toParams(STUDY_PARAM, studyFqn), null, null, null, tags, null, null, false, sessionId).first(); ExecutionResult result = toolRunner.execute(job, Paths.get(opencga.createTmpOutdir(studyId, "_LOAD_", sessionId)), sessionId); List tagsFromResult = result.getAttributes().getAsStringList(VariantFileIndexJobLauncherTool.JOB_TAGS_ATTRIBUTE); @@ -231,7 +231,7 @@ public void testLauncher() throws CatalogException, IOException, ToolException { //// Execute again, no new jobs should be submitted tags = Arrays.asList("tag10", "tag20"); job = catalogManager.getJobManager().submit(studyFqn, VariantFileIndexJobLauncherTool.ID, Enums.Priority.HIGH, - params.toParams(STUDY_PARAM, studyFqn), null, null, null, tags, sessionId).first(); + params.toParams(STUDY_PARAM, studyFqn), null, null, null, tags, null, null, false, sessionId).first(); result = toolRunner.execute(job, Paths.get(opencga.createTmpOutdir(studyId, "_LOAD_", sessionId)), sessionId); tagsFromResult = result.getAttributes().getAsStringList(VariantFileIndexJobLauncherTool.JOB_TAGS_ATTRIBUTE); diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/StatsVariantStorageTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/StatsVariantStorageTest.java index 09bcacc2ff7..cfe9deeac5f 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/StatsVariantStorageTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/StatsVariantStorageTest.java @@ -212,7 +212,7 @@ public void calculateStats(VariantStatsIndexParams params, QueryOptions options) options.put(ParamConstants.STUDY_PARAM, studyId); ToolRunner toolRunner = new ToolRunner(null, catalogManager, opencga.getStorageEngineFactory()); - toolRunner.execute(VariantStatsIndexOperationTool.class, params, options, Paths.get(tmpOutdir), null, sessionId); + toolRunner.execute(VariantStatsIndexOperationTool.class, params, options, Paths.get(tmpOutdir), null, false, sessionId); } @Test diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantFileIndexerOperationManagerTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantFileIndexerOperationManagerTest.java index e47380db655..ef373cf1cd7 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantFileIndexerOperationManagerTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantFileIndexerOperationManagerTest.java @@ -443,7 +443,7 @@ public void testIndexMalformed() throws Exception { ExecutionResult er = toolRunner.execute(VariantIndexOperationTool.class, params.toObjectMap() .append(ParamConstants.STUDY_PARAM, studyId) .append(VariantStorageOptions.TRANSFORM_FAIL_ON_MALFORMED_VARIANT.key(), false) - , outDir, null, sessionId); + , outDir, null, false, sessionId); assertEquals(Event.Type.WARNING, er.getEvents().get(0).getType()); assertThat(er.getEvents().get(0).getMessage(), CoreMatchers.containsString("Found malformed variants")); @@ -461,7 +461,7 @@ public void testIndexDuplicated() throws Exception { ExecutionResult er = toolRunner.execute(VariantIndexOperationTool.class, params.toObjectMap() .append(ParamConstants.STUDY_PARAM, studyId) .append(VariantStorageOptions.TRANSFORM_FAIL_ON_MALFORMED_VARIANT.key(), false) - , outDir, null, sessionId); + , outDir, null, false, sessionId); assertEquals(Event.Type.WARNING, er.getEvents().get(0).getType()); assertThat(er.getEvents().get(0).getMessage(), CoreMatchers.containsString("Found duplicated variants")); @@ -482,7 +482,7 @@ public void testIndexWeirdFileName() throws Exception { ExecutionResult er = toolRunner.execute(VariantIndexOperationTool.class, params.toObjectMap() .append(ParamConstants.STUDY_PARAM, studyId) - , outDir, null, sessionId); + , outDir, null, false, sessionId); } @Override diff --git a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantVirtualFileIndexTest.java b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantVirtualFileIndexTest.java index efa7e27fad7..fcc6abed280 100644 --- a/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantVirtualFileIndexTest.java +++ b/opencga-analysis/src/test/java/org/opencb/opencga/analysis/variant/manager/operations/VariantVirtualFileIndexTest.java @@ -72,15 +72,15 @@ public void testIndexVirtual() throws Exception { toolRunner.execute(VariantIndexOperationTool.class, new VariantIndexParams() .setFile("chr20.variant-test-file.vcf.gz") .setLoadSplitData("REGION") - , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, sessionId); + , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, false, sessionId); toolRunner.execute(VariantIndexOperationTool.class, new VariantIndexParams() .setFile("chr21.variant-test-file.vcf.gz") .setLoadSplitData("REGION") - , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, sessionId); + , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, false, sessionId); toolRunner.execute(VariantIndexOperationTool.class, new VariantIndexParams() .setFile("chr22.variant-test-file.vcf.gz") .setLoadSplitData("REGION") - , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, sessionId); + , new ObjectMap(ParamConstants.STUDY_PARAM, studyId), Paths.get(opencga.createTmpOutdir()), null, false, sessionId); File file = catalogManager.getFileManager().get(studyId, "chr20.variant-test-file.vcf.gz", null, sessionId).first(); assertTrue(FileUtils.isPartial(file)); diff --git a/opencga-app/app/misc/scripts/hadoop-ssh.sh b/opencga-app/app/misc/scripts/hadoop-ssh.sh index 30141a04074..dc07d1b96f9 100755 --- a/opencga-app/app/misc/scripts/hadoop-ssh.sh +++ b/opencga-app/app/misc/scripts/hadoop-ssh.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash if [ -z "${HADOOP_SSH_USER}" ] ; then @@ -25,6 +25,8 @@ if [ -n "${HADOOP_SSH_KEY}" ] && [ -f "${HADOOP_SSH_KEY}" ] ; then SSH_OPTS="${SSH_OPTS} -i ${HADOOP_SSH_KEY}" fi +trap 'echo "SSH Process interrupted! Run time : ${SECONDS}s" && exit 1 1>&2 ' INT TERM + echo "Connect to Hadoop edge node ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" 1>&2 echo "${SSHPASS_CMD}ssh ${SSH_OPTS} ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" 1>&2 @@ -37,10 +39,12 @@ for arg in "$@" ; do arg=$(echo "$arg" | sed "s/'/'\\\\\\''/g") # aaa'aaa --> 'aaa'\''aaa' CMD="${CMD}'${arg}' " done -echo ${CMD} +echo ${CMD} 1>&2 ${SSHPASS_CMD} ssh ${SSH_OPTS} "${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" /bin/bash << EOF +echo "PID=\$\$" >&2 + export HADOOP_CLASSPATH=${HADOOP_CLASSPATH} export HADOOP_USER_CLASSPATH_FIRST=${HADOOP_USER_CLASSPATH_FIRST} @@ -59,3 +63,10 @@ exec ${CMD} EOF +EXIT_CODE=$? + +echo "SSH Process completed!" 1>&2 +echo " - Run time : ${SECONDS}s" 1>&2 +echo " - Exit code: ${EXIT_CODE}" 1>&2 + +exit ${EXIT_CODE} \ No newline at end of file diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/migration/v2_0_0/VariantStorage200MigrationTool.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/migration/v2_0_0/VariantStorage200MigrationTool.java index ff180f5d284..7ef509bbafc 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/migration/v2_0_0/VariantStorage200MigrationTool.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/admin/executors/migration/v2_0_0/VariantStorage200MigrationTool.java @@ -11,7 +11,8 @@ resource = Enums.Resource.VARIANT, type = Tool.Type.OPERATION, scope = Tool.Scope.PROJECT, - description = VariantStorage200MigrationTool.DESCRIPTION) + description = VariantStorage200MigrationTool.DESCRIPTION, + priority = Enums.Priority.HIGH) public class VariantStorage200MigrationTool extends OpenCgaTool { public static final String ID = "variant-storage-migration-2.0.0"; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/InternalCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/InternalCliOptionsParser.java index 243a3e6918f..96522720e12 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/InternalCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/InternalCliOptionsParser.java @@ -297,6 +297,9 @@ public static class JobOptions { @Parameter(names = {"--job"}, description = "Job id executing the command line", arity = 1) public String jobId; + @Parameter(names = {"--dry-run"}, description = "Dry run mode execution", arity = 0) + public boolean dryRun; + @Parameter(names = {"--job-id"}, hidden = true, description = "Deprecated, use --job", arity = 1) @Deprecated public void setJobId(String job) { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/AlignmentCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/AlignmentCommandExecutor.java index 436fff7b061..699b415da04 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/AlignmentCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/AlignmentCommandExecutor.java @@ -19,7 +19,6 @@ import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.opencga.analysis.alignment.AlignmentCoverageAnalysis; import org.opencb.opencga.analysis.alignment.AlignmentIndexOperation; -import org.opencb.opencga.analysis.alignment.AlignmentStorageManager; import org.opencb.opencga.analysis.alignment.qc.AlignmentGeneCoverageStatsAnalysis; import org.opencb.opencga.analysis.alignment.qc.AlignmentQcAnalysis; import org.opencb.opencga.analysis.wrappers.bwa.BwaWrapperAnalysis; @@ -51,6 +50,7 @@ public class AlignmentCommandExecutor extends InternalCommandExecutor { private AlignmentCommandOptions alignmentCommandOptions; private String jobId; + private boolean dryRun; // private AlignmentStorageEngine alignmentStorageManager; public AlignmentCommandExecutor(AlignmentCommandOptions options) { @@ -66,6 +66,7 @@ public void execute() throws Exception { configure(); jobId = alignmentCommandOptions.internalJobOptions.jobId; + dryRun = alignmentCommandOptions.internalJobOptions.dryRun; switch (subCommandString) { case "index-run": @@ -125,7 +126,7 @@ private void indexRun() throws Exception { cliOptions.overwrite ).toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(AlignmentIndexOperation.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(AlignmentIndexOperation.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } @@ -166,7 +167,7 @@ private void qcRun() throws ToolException { ).toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(AlignmentQcAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(AlignmentQcAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void geneCoverageStatsRun() throws ToolException { @@ -180,7 +181,7 @@ private void geneCoverageStatsRun() throws ToolException { ).toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(AlignmentGeneCoverageStatsAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(AlignmentGeneCoverageStatsAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // private void statsRun() throws ToolException { @@ -243,7 +244,7 @@ private void coverageRun() throws ToolException { cliOptions.windowSize ).toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(AlignmentCoverageAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(AlignmentCoverageAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void delete() { @@ -268,7 +269,7 @@ private void bwa() throws Exception { cliOptions.bwaParams) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(BwaWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(BwaWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // Samtools @@ -283,7 +284,7 @@ private void samtools() throws Exception { cliOptions.samtoolsParams) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(SamtoolsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(SamtoolsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // Deeptools @@ -297,7 +298,7 @@ private void deeptools() throws Exception { cliOptions.deeptoolsParams) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(DeeptoolsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(DeeptoolsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // FastQC @@ -311,7 +312,7 @@ private void fastqc() throws Exception { cliOptions.fastqcParams) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(FastqcWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(FastqcWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // Picard @@ -325,7 +326,7 @@ private void picard() throws Exception { cliOptions.picardParams) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(PicardWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(PicardWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } //------------------------------------------------------------------------- diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ClinicalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ClinicalCommandExecutor.java index d58fca25609..4800ec88c19 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ClinicalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ClinicalCommandExecutor.java @@ -17,7 +17,6 @@ package org.opencb.opencga.app.cli.internal.executors; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -39,33 +38,14 @@ import org.opencb.opencga.analysis.clinical.zetta.ZettaInterpretationConfiguration; import org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils; import org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions; -import org.opencb.opencga.catalog.exceptions.CatalogException; -import org.opencb.opencga.catalog.managers.ClinicalAnalysisManager; -import org.opencb.opencga.catalog.managers.SampleManager; -import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.api.ParamConstants; -import org.opencb.opencga.core.common.JacksonUtils; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.clinical.*; -import org.opencb.opencga.core.models.family.FamilyCreateParams; -import org.opencb.opencga.core.models.individual.Individual; -import org.opencb.opencga.core.models.individual.IndividualUpdateParams; -import org.opencb.opencga.core.models.panel.Panel; -import org.opencb.opencga.core.models.panel.PanelCreateParams; -import org.opencb.opencga.core.models.sample.Sample; -import org.opencb.opencga.core.models.sample.SampleCreateParams; -import org.opencb.opencga.core.models.sample.SampleReferenceParam; -import org.opencb.opencga.core.response.RestResponse; - -import java.io.File; + import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; import static org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions.CancerTieringCommandOptions.CANCER_TIERING_INTERPRETATION_RUN_COMMAND; import static org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions.ExomiserInterpretationCommandOptions.EXOMISER_INTERPRETATION_RUN_COMMAND; @@ -74,8 +54,6 @@ import static org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions.TeamCommandOptions.TEAM_INTERPRETATION_RUN_COMMAND; import static org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions.TieringCommandOptions.TIERING_INTERPRETATION_RUN_COMMAND; import static org.opencb.opencga.app.cli.internal.options.ClinicalCommandOptions.ZettaCommandOptions.ZETTA_INTERPRETATION_RUN_COMMAND; -import static org.opencb.opencga.catalog.utils.ParamUtils.SaveInterpretationAs.PRIMARY; -import static org.opencb.opencga.catalog.utils.ParamUtils.SaveInterpretationAs.SECONDARY; /** * Created on 01/04/20 @@ -137,7 +115,7 @@ private void rgaIndex() throws ToolException { ObjectMap params = new RgaAnalysisParams(options.file) .toObjectMap(options.commonOptions.params) .append(ParamConstants.STUDY_PARAM, options.study); - toolRunner.execute(RgaAnalysis.class, params, outDir, options.jobOptions.jobId, options.commonOptions.token); + toolRunner.execute(RgaAnalysis.class, params, outDir, options.jobOptions.jobId, options.jobOptions.dryRun, options.commonOptions.token); } private void auxRgaIndex() throws ToolException { @@ -147,7 +125,7 @@ private void auxRgaIndex() throws ToolException { ObjectMap params = new ObjectMap() .appendAll(options.commonOptions.params) .append(ParamConstants.STUDY_PARAM, options.study); - toolRunner.execute(AuxiliarRgaAnalysis.class, params, outDir, options.jobOptions.jobId, options.commonOptions.token); + toolRunner.execute(AuxiliarRgaAnalysis.class, params, outDir, options.jobOptions.jobId, options.jobOptions.dryRun, options.commonOptions.token); } private void tiering() throws Exception { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/DiseasePanelInternalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/DiseasePanelInternalCommandExecutor.java index 2529baaee1e..aa39f3d0919 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/DiseasePanelInternalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/DiseasePanelInternalCommandExecutor.java @@ -45,7 +45,8 @@ private void importPanels() throws ToolException { .toObjectMap(options.commonOptions.params) .append(ParamConstants.STUDY_PARAM, options.studyId); - toolRunner.execute(PanelImportTask.class, params, Paths.get(options.outDir), jobId, token); + toolRunner.execute(PanelImportTask.class, params, Paths.get(options.outDir), jobId, + diseasePanelCommandOptions.internalJobOptions.dryRun, token); } } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/FileCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/FileCommandExecutor.java index e79fbae1a4a..04bafdfaada 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/FileCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/FileCommandExecutor.java @@ -90,7 +90,8 @@ private void postlink() throws ToolException { .toObjectMap(options.commonOptions.params) .append(ParamConstants.STUDY_PARAM, options.studyId); - toolRunner.execute(PostLinkSampleAssociation.class, params, outDir, fileCommandOptions.internalJobOptions.jobId, token); + toolRunner.execute(PostLinkSampleAssociation.class, params, outDir, fileCommandOptions.internalJobOptions.jobId, + fileCommandOptions.internalJobOptions.dryRun, token); } private void fetch() throws ToolException { @@ -98,7 +99,7 @@ private void fetch() throws ToolException { Path outDir = Paths.get(options.outDir); - toolRunner.execute(FetchAndRegisterTask.class, new FileFetch(options.url, options.path), outDir, null, options.commonOptions.token); + toolRunner.execute(FetchAndRegisterTask.class, new FileFetch(options.url, options.path), outDir, null, false, options.commonOptions.token); } private void tsvLoad() throws ToolException { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/StudyCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/StudyCommandExecutor.java index 0da33d83bfe..aa4eb7471d8 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/StudyCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/StudyCommandExecutor.java @@ -45,6 +45,6 @@ private void templateRun() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.studyId); - toolRunner.execute(TemplateRunner.class, params, Paths.get(cliOptions.outdir), cliOptions.jobOptions.jobId, token); + toolRunner.execute(TemplateRunner.class, params, Paths.get(cliOptions.outdir), cliOptions.jobOptions.jobId, cliOptions.jobOptions.dryRun, token); } } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ToolsCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ToolsCommandExecutor.java index b075f5de782..ebcf46144db 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ToolsCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/ToolsCommandExecutor.java @@ -53,7 +53,7 @@ public void execute() throws Exception { private void executeTool() throws ToolException { ToolsCommandOptions.ExecuteToolCommandOptions cliOptions = this.toolCommandOptions.executeToolCommandOptions; toolRunner.execute(cliOptions.toolId, new ObjectMap(cliOptions.params), Paths.get(cliOptions.outDir), - toolCommandOptions.internalJobOptions.jobId, token); + toolCommandOptions.internalJobOptions.jobId, toolCommandOptions.internalJobOptions.dryRun, token); } private void executeJob() throws CatalogException, ToolException { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java index f9953557459..7d20deccb09 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/internal/executors/VariantInternalCommandExecutor.java @@ -128,6 +128,7 @@ public class VariantInternalCommandExecutor extends InternalCommandExecutor { // private AnalysisCliOptionsParser.VariantCommandOptions variantCommandOptions; private VariantCommandOptions variantCommandOptions; private String jobId; + private boolean dryRun; public VariantInternalCommandExecutor(VariantCommandOptions variantCommandOptions) { super(variantCommandOptions.commonCommandOptions); @@ -143,6 +144,7 @@ public void execute() throws Exception { configure(); jobId = variantCommandOptions.internalJobOptions.jobId; + dryRun = variantCommandOptions.internalJobOptions.dryRun; switch (subCommandString) { case VARIANT_DELETE_COMMAND: @@ -343,7 +345,7 @@ private void query(VariantCommandOptions.AbstractVariantQueryCommandOptions cliO cliOptions.outputFileName, cliOptions.outputFileFormat, cliOptions.variantsFile); - toolRunner.execute(VariantExportTool.class, toolParams, queryOptions, Paths.get(outdir), jobId, token); + toolRunner.execute(VariantExportTool.class, toolParams, queryOptions, Paths.get(outdir), jobId, dryRun, token); } } @@ -362,7 +364,7 @@ private void fileDelete() throws ToolException { cliOptions.genericVariantDeleteOptions.resume); toolRunner.execute(VariantFileDeleteOperationTool.class, params.toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study), - Paths.get(cliOptions.outdir), jobId, token); + Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void index() throws ToolException { @@ -404,7 +406,7 @@ private void index() throws ToolException { .append(VariantStorageOptions.STDIN.key(), cliOptions.stdin) .append(VariantStorageOptions.STDOUT.key(), cliOptions.stdout); - toolRunner.execute(VariantIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void secondaryIndex() throws ToolException { @@ -419,9 +421,9 @@ private void secondaryIndex() throws ToolException { .append(ParamConstants.PROJECT_PARAM, cliOptions.project); if (CollectionUtils.isEmpty(cliOptions.sample)) { - toolRunner.execute(VariantSecondaryAnnotationIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantSecondaryAnnotationIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } else { - toolRunner.execute(VariantSecondaryIndexSamplesOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantSecondaryIndexSamplesOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } } @@ -454,7 +456,7 @@ private void statsRun() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(VariantStatsAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantStatsAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // private void statsIndex() throws ToolException { @@ -485,7 +487,7 @@ private void scoreLoad() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(VariantScoreIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantScoreIndexOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void scoreRemove() throws ToolException { @@ -498,7 +500,7 @@ private void scoreRemove() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(VariantScoreDeleteOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantScoreDeleteOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void sampleIndex() @@ -516,7 +518,7 @@ private void sampleIndex() toolRunner.execute(VariantSecondarySampleIndexOperationTool.class, params.toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study), Paths.get(cliOptions.outdir), - jobId, token); + jobId, dryRun, token); } private void familyIndex() @@ -532,7 +534,7 @@ private void familyIndex() toolRunner.execute(VariantFamilyIndexOperationTool.class, params.toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study), Paths.get(cliOptions.outdir), - jobId, token); + jobId, dryRun, token); } private void annotate() throws ToolException { @@ -557,7 +559,7 @@ private void annotate() throws ToolException { .append(ParamConstants.PROJECT_PARAM, cliOptions.project) .append(ParamConstants.STUDY_PARAM, cliOptions.study), Paths.get(cliOptions.outdir), - jobId, token); + jobId, dryRun, token); } private void annotationSave() throws ToolException { @@ -567,7 +569,7 @@ private void annotationSave() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.PROJECT_PARAM, cliOptions.project); - toolRunner.execute(VariantAnnotationSaveOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantAnnotationSaveOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void annotationDelete() throws ToolException { @@ -577,7 +579,7 @@ private void annotationDelete() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.PROJECT_PARAM, cliOptions.project); - toolRunner.execute(VariantAnnotationDeleteOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantAnnotationDeleteOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void annotationQuery() throws CatalogException, IOException, StorageEngineException { @@ -645,7 +647,7 @@ private void aggregateFamily() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(VariantAggregateFamilyOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantAggregateFamilyOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void aggregate() throws ToolException { @@ -657,7 +659,7 @@ private void aggregate() throws ToolException { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(VariantAggregateOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(VariantAggregateOperationTool.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void sampleRun() throws Exception { @@ -667,7 +669,7 @@ private void sampleRun() throws Exception { toolRunner.execute(SampleVariantFilterAnalysis.class, cliOptions.toolParams.toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study), - Paths.get(cliOptions.outdir), jobId, token); + Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void gwas() throws Exception { @@ -689,7 +691,7 @@ private void gwas() throws Exception { } GwasAnalysis gwasAnalysis = new GwasAnalysis(); gwasAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); gwasAnalysis.setStudy(cliOptions.study) .setPhenotype(cliOptions.phenotype) .setIndex(cliOptions.index) @@ -723,7 +725,7 @@ private void knockout() throws Exception { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(KnockoutAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(KnockoutAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void sampleEligibility() throws Exception { @@ -736,7 +738,7 @@ private void sampleEligibility() throws Exception { .toObjectMap(cliOptions.commonOptions.params) .append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(SampleEligibilityAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(SampleEligibilityAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void sampleStats() throws Exception { @@ -755,7 +757,7 @@ private void sampleStats() throws Exception { cliOptions.batchSize, variantQuery ); - toolRunner.execute(SampleVariantStatsAnalysis.class, toolParams, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(SampleVariantStatsAnalysis.class, toolParams, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void cohortStats() throws Exception { @@ -774,7 +776,7 @@ private void cohortStats() throws Exception { CohortVariantStatsAnalysis cohortVariantStatsAnalysis = new CohortVariantStatsAnalysis(); cohortVariantStatsAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); cohortVariantStatsAnalysis.setStudy(cliOptions.study) .setCohortName(cliOptions.cohort) .setIndex(cliOptions.index) @@ -795,7 +797,7 @@ private void julie() throws Exception { Path outdir = Paths.get(cliOptions.outdir); - toolRunner.execute(JulieTool.class, toolParams, params, outdir, jobId, token); + toolRunner.execute(JulieTool.class, toolParams, params, outdir, jobId, dryRun, token); } private void mutationalSignature() throws Exception { @@ -823,7 +825,7 @@ private void mutationalSignature() throws Exception { cliOptions.outdir) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(MutationalSignatureAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(MutationalSignatureAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void hrDetect() throws Exception { @@ -845,7 +847,7 @@ private void hrDetect() throws Exception { cliOptions.outdir) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(HRDetectAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(HRDetectAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void genomePlot() throws Exception { @@ -859,7 +861,7 @@ private void genomePlot() throws Exception { cliOptions.outdir) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(GenomePlotAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(GenomePlotAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void mendelianError() throws Exception { @@ -869,7 +871,7 @@ private void mendelianError() throws Exception { MendelianErrorAnalysis mendelianErrorAnalysis = new MendelianErrorAnalysis(); mendelianErrorAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); mendelianErrorAnalysis.setStudy(cliOptions.study) .setFamilyId(cliOptions.family) .setIndividualId(cliOptions.individual) @@ -884,7 +886,7 @@ private void inferredSex() throws Exception { InferredSexAnalysis inferredSexAnalysis = new InferredSexAnalysis(); inferredSexAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); inferredSexAnalysis.setStudyId(cliOptions.study) .setIndividualId(cliOptions.individual) .setSampleId(cliOptions.sample) @@ -898,7 +900,7 @@ private void relatedness() throws Exception { RelatednessAnalysis relatednessAnalysis = new RelatednessAnalysis(); relatednessAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); relatednessAnalysis.setStudyId(cliOptions.study) .setIndividualIds(cliOptions.individuals) .setSampleIds(cliOptions.samples) @@ -914,7 +916,7 @@ private void familyQc() throws Exception { FamilyQcAnalysis familyQcAnalysis = new FamilyQcAnalysis(); familyQcAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); familyQcAnalysis.setStudyId(cliOptions.study) .setFamilyId(cliOptions.family) .setRelatednessMethod(cliOptions.relatednessMethod) @@ -929,7 +931,7 @@ private void individualQc() throws Exception { IndividualQcAnalysis individualQcAnalysis = new IndividualQcAnalysis(); individualQcAnalysis.setUp(appHome, catalogManager, storageEngineFactory, params, Paths.get(cliOptions.outdir), - variantCommandOptions.internalJobOptions.jobId, token); + variantCommandOptions.internalJobOptions.jobId, dryRun, token); individualQcAnalysis.setStudyId(cliOptions.study) .setIndividualId(cliOptions.individual) .setSampleId(cliOptions.sample) @@ -972,7 +974,7 @@ private void sampleQc() throws Exception { cliOptions.outdir) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(SampleQcAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(SampleQcAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } // Wrappers @@ -985,7 +987,7 @@ private void plink() throws Exception { cliOptions.plinkParams) .toObjectMap(cliOptions.basicOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(PlinkWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(PlinkWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void rvtests() throws Exception { @@ -997,7 +999,7 @@ private void rvtests() throws Exception { cliOptions.rvtestsParams) .toObjectMap(cliOptions.basicOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(RvtestsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(RvtestsWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void gatk() throws Exception { @@ -1009,7 +1011,7 @@ private void gatk() throws Exception { cliOptions.gatkParams) .toObjectMap(cliOptions.basicOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(GatkWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(GatkWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void exomiser() throws Exception { @@ -1022,7 +1024,7 @@ private void exomiser() throws Exception { cliOptions.outdir) .toObjectMap(cliOptions.commonOptions.params).append(ParamConstants.STUDY_PARAM, cliOptions.study); - toolRunner.execute(ExomiserWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, token); + toolRunner.execute(ExomiserWrapperAnalysis.class, params, Paths.get(cliOptions.outdir), jobId, dryRun, token); } private void checkSignatureVersion(String sigVersion) throws ClientException { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java index 217d898fcba..4d1ed716a48 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java @@ -49,7 +49,7 @@ public abstract class OpenCgaCompleter implements Completer { .map(Candidate::new) .collect(toList()); - private List jobsList = asList( "acl-update","create","distinct","retry","search","top","acl","delete","info","update","log-head","log-tail") + private List jobsList = asList( "acl-update","create","distinct","retry","search","top","acl","delete","info","update","kill","log-head","log-tail") .stream() .map(Candidate::new) .collect(toList()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java index a171446b03a..d99dbba3488 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java @@ -160,6 +160,7 @@ public OpencgaCliOptionsParser() { jobsSubCommands.addCommand("delete", jobsCommandOptions.deleteCommandOptions); jobsSubCommands.addCommand("info", jobsCommandOptions.infoCommandOptions); jobsSubCommands.addCommand("update", jobsCommandOptions.updateCommandOptions); + jobsSubCommands.addCommand("kill", jobsCommandOptions.killCommandOptions); jobsSubCommands.addCommand("log-head", jobsCommandOptions.headLogCommandOptions); jobsSubCommands.addCommand("log-tail", jobsCommandOptions.tailLogCommandOptions); jobsSubCommands.addCommand("log", jobsCommandOptions.logCommandOptions); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/custom/CustomStudiesCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/custom/CustomStudiesCommandOptions.java index 0a317ace8a8..74ff7b9ce30 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/custom/CustomStudiesCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/custom/CustomStudiesCommandOptions.java @@ -54,16 +54,25 @@ public class RunTemplatesCommandOptions { @Parameter(names = {"--resume"}, description = "Resume study metadata ingestion.", arity = 0) public boolean resume; - @Parameter(names = {"--jobId"}, description = "Job id.", arity = 1) + @Parameter(names = {"--job-id", "--jobId"}, description = "Job id.", arity = 1) public String jobId; - @Parameter(names = {"--jobDependsOn"}, description = "Job depends on.", arity = 1) + @Parameter(names = {"--job-depends-on", "--jobDependsOn"}, description = "Job depends on.", arity = 1) public String jobDependsOn; - @Parameter(names = {"--jobDescription"}, description = "Job description.", arity = 1) + @Parameter(names = {"--job-description", "--jobDescription"}, description = "Job description.", arity = 1) public String jobDescription; - @Parameter(names = {"--jobTags"}, description = "Job tags.", arity = 1) + @Parameter(names = {"--job-tags", "--jobTags"}, description = "Job tags.", arity = 1) public String jobTags; + + @Parameter(names = {"--job-scheduled-start-time"}, description = "Job scheduled start time.", arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Job priority.", arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Job dry-run mode.", arity = 1) + public Boolean jobDryRun; } } \ No newline at end of file diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisAlignmentCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisAlignmentCommandExecutor.java index 88c7345e9da..ddc77f0009b 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisAlignmentCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisAlignmentCommandExecutor.java @@ -121,6 +121,9 @@ private RestResponse runBwa() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -162,6 +165,9 @@ private RestResponse runCoverageIndex() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -200,6 +206,9 @@ private RestResponse coverageQcGeneCoverageStatsRun() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -295,6 +304,9 @@ private RestResponse runDeeptools() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -333,6 +345,9 @@ private RestResponse runFastqc() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -371,6 +386,9 @@ private RestResponse runIndex() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -408,6 +426,9 @@ private RestResponse runPicard() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -446,6 +467,9 @@ private RestResponse runQc() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -517,6 +541,9 @@ private RestResponse runSamtools() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java index 22b4fcf7fa0..cc9aff35696 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java @@ -518,6 +518,9 @@ private RestResponse runInterpreterCancerTiering() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -556,6 +559,9 @@ private RestResponse runInterpreterExomiser() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -593,6 +599,9 @@ private RestResponse runInterpreterTeam() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -632,6 +641,9 @@ private RestResponse runInterpreterTiering() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -671,6 +683,9 @@ private RestResponse runInterpreterZetta() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -757,6 +772,9 @@ private RestResponse load() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -908,6 +926,9 @@ private RestResponse runRgaIndex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotNull("auxiliarIndex", commandOptions.auxiliarIndex); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java index d5ff04dad10..70a773ab501 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisVariantCommandExecutor.java @@ -370,6 +370,9 @@ private RestResponse runCohortStats() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -410,6 +413,9 @@ private RestResponse runExomiser() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -452,6 +458,9 @@ private RestResponse runExport() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -592,6 +601,9 @@ private RestResponse runFamilyQc() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -630,6 +642,9 @@ private RestResponse deleteFile() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); queryParams.putIfNotEmpty("file", commandOptions.file); queryParams.putIfNotNull("resume", commandOptions.resume); @@ -651,6 +666,9 @@ private RestResponse runGatk() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -689,6 +707,9 @@ private RestResponse runGenomePlot() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -729,6 +750,9 @@ private RestResponse runGwas() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -776,6 +800,9 @@ private RestResponse runHrDetect() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -824,6 +851,9 @@ private RestResponse runIndex() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -889,6 +919,9 @@ private RestResponse runIndividualQc() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -928,6 +961,9 @@ private RestResponse runInferredSex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1000,6 +1036,9 @@ private RestResponse runKnockout() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1045,6 +1084,9 @@ private RestResponse runMendelianError() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1137,6 +1179,9 @@ private RestResponse runMutationalSignature() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1188,6 +1233,9 @@ private RestResponse runPlink() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1315,6 +1363,9 @@ private RestResponse runRelatedness() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1355,6 +1406,9 @@ private RestResponse runRvtests() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1428,6 +1482,9 @@ private RestResponse runSampleEligibility() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1466,6 +1523,9 @@ private RestResponse runSampleQc() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1566,6 +1626,9 @@ private RestResponse runSample() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1659,6 +1722,9 @@ private RestResponse runSampleStats() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1731,6 +1797,9 @@ private RestResponse runStatsExport() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1771,6 +1840,9 @@ private RestResponse runStats() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/DiseasePanelsCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/DiseasePanelsCommandExecutor.java index 033aff423b5..00dbbbc130f 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/DiseasePanelsCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/DiseasePanelsCommandExecutor.java @@ -215,6 +215,9 @@ private RestResponse importPanels() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/FilesCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/FilesCommandExecutor.java index b6644a30d88..f9f6f5fedb8 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/FilesCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/FilesCommandExecutor.java @@ -351,6 +351,9 @@ private RestResponse fetch() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -438,6 +441,9 @@ private RestResponse runLink() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -479,6 +485,9 @@ private RestResponse runPostlink() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/JobsCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/JobsCommandExecutor.java index 8f6e674164a..cf28e7983bf 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/JobsCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/JobsCommandExecutor.java @@ -97,6 +97,9 @@ public void execute() throws Exception { case "update": queryResponse = update(); break; + case "kill": + queryResponse = kill(); + break; case "log-head": queryResponse = headLog(); break; @@ -236,6 +239,7 @@ private RestResponse retry() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -400,6 +404,20 @@ private RestResponse update() throws Exception { return openCGAClient.getJobClient().update(commandOptions.jobs, jobUpdateParams, queryParams); } + private RestResponse kill() throws Exception { + logger.debug("Executing kill in Jobs command line"); + + JobsCommandOptions.KillCommandOptions commandOptions = jobsCommandOptions.killCommandOptions; + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("study", commandOptions.study); + if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { + queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); + } + + return openCGAClient.getJobClient().kill(commandOptions.job, queryParams); + } + private RestResponse headLog() throws Exception { logger.debug("Executing headLog in Jobs command line"); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OperationsVariantStorageCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OperationsVariantStorageCommandExecutor.java index f37a119b904..6135886595d 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OperationsVariantStorageCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OperationsVariantStorageCommandExecutor.java @@ -211,6 +211,9 @@ private RestResponse aggregateVariant() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -248,6 +251,9 @@ private RestResponse deleteVariantAnnotation() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); queryParams.putIfNotEmpty("annotationId", commandOptions.annotationId); @@ -264,6 +270,9 @@ private RestResponse indexVariantAnnotation() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { @@ -309,6 +318,9 @@ private RestResponse saveVariantAnnotation() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); @@ -375,6 +387,9 @@ private RestResponse deleteVariant() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -413,6 +428,9 @@ private RestResponse aggregateVariantFamily() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -451,6 +469,9 @@ private RestResponse indexVariantFamily() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -490,6 +511,9 @@ private RestResponse indexVariant() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -555,6 +579,9 @@ private RestResponse launcherVariantIndex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -625,6 +652,9 @@ private RestResponse runVariantJulie() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); @@ -660,6 +690,9 @@ private RestResponse repairVariantMetadata() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); VariantStorageMetadataRepairToolParams variantStorageMetadataRepairToolParams = null; @@ -693,6 +726,9 @@ private RestResponse synchronizeVariantMetadata() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -730,6 +766,9 @@ private RestResponse pruneVariant() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); VariantPruneParams variantPruneParams = null; @@ -764,6 +803,9 @@ private RestResponse deleteVariantSample() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -802,6 +844,9 @@ private RestResponse indexVariantSample() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -868,6 +913,9 @@ private RestResponse deleteVariantScore() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); queryParams.putIfNotEmpty("name", commandOptions.name); queryParams.putIfNotNull("resume", commandOptions.resume); @@ -889,6 +937,9 @@ private RestResponse indexVariantScore() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -930,6 +981,9 @@ private RestResponse variantSecondaryAnnotationIndex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { @@ -969,6 +1023,9 @@ private RestResponse variantSecondarySampleIndex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); @@ -1035,6 +1092,9 @@ private RestResponse secondaryIndexVariant() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("project", commandOptions.project); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { @@ -1074,6 +1134,9 @@ private RestResponse deleteVariantSecondaryIndex() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); queryParams.putIfNotEmpty("samples", commandOptions.samples); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { @@ -1094,6 +1157,9 @@ private RestResponse deleteVariantStats() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1131,6 +1197,9 @@ private RestResponse indexVariantStats() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); } @@ -1171,6 +1240,9 @@ private RestResponse deleteVariantStudy() throws Exception { queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("study", commandOptions.study); if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/StudiesCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/StudiesCommandExecutor.java index 645c65e2974..2e8bd7b0040 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/StudiesCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/StudiesCommandExecutor.java @@ -521,6 +521,9 @@ private RestResponse runTemplates() throws Exception { queryParams.putIfNotEmpty("jobDependsOn", commandOptions.jobDependsOn); queryParams.putIfNotEmpty("jobDescription", commandOptions.jobDescription); queryParams.putIfNotEmpty("jobTags", commandOptions.jobTags); + queryParams.putIfNotEmpty("jobScheduledStartTime", commandOptions.jobScheduledStartTime); + queryParams.putIfNotEmpty("jobPriority", commandOptions.jobPriority); + queryParams.putIfNotNull("jobDryRun", commandOptions.jobDryRun); queryParams.putIfNotEmpty("id", commandOptions.id); queryParams.putIfNotNull("overwrite", commandOptions.overwrite); queryParams.putIfNotNull("resume", commandOptions.resume); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisAlignmentCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisAlignmentCommandOptions.java index f43709391f7..61cc3634fb1 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisAlignmentCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisAlignmentCommandOptions.java @@ -95,6 +95,15 @@ public class RunBwaCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; @@ -142,6 +151,15 @@ public class RunCoverageIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--bam-file-id"}, description = "BAM file ID.", required = false, arity = 1) public String bamFileId; @@ -180,6 +198,15 @@ public class CoverageQcGeneCoverageStatsRunCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--bam-file"}, description = "The body web service bamFile parameter", required = false, arity = 1) public String bamFile; @@ -311,6 +338,15 @@ public class RunDeeptoolsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; @@ -349,6 +385,15 @@ public class RunFastqcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--input-file"}, description = "The body web service inputFile parameter", required = false, arity = 1) public String inputFile; @@ -387,6 +432,15 @@ public class RunIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--file-id"}, description = "File ID, (i.e., BAM/CRAM file ID).", required = false, arity = 1) public String fileId; @@ -422,6 +476,15 @@ public class RunPicardCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; @@ -460,6 +523,15 @@ public class RunQcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--bam-file"}, description = "ID for the BAM file to process.", required = false, arity = 1) public String bamFile; @@ -569,6 +641,15 @@ public class RunSamtoolsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java index 617b422f35c..36f822087db 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java @@ -611,6 +611,15 @@ public class RunInterpreterCancerTieringCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--clinical-analysis"}, description = "The body web service clinicalAnalysis parameter", required = false, arity = 1) public String clinicalAnalysis; @@ -649,6 +658,15 @@ public class RunInterpreterExomiserCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--clinical-analysis"}, description = "Clinical analysis ID.", required = false, arity = 1) public String clinicalAnalysis; @@ -684,6 +702,15 @@ public class RunInterpreterTeamCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--clinical-analysis"}, description = "The body web service clinicalAnalysis parameter", required = false, arity = 1) public String clinicalAnalysis; @@ -725,6 +752,15 @@ public class RunInterpreterTieringCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--clinical-analysis"}, description = "The body web service clinicalAnalysis parameter", required = false, arity = 1) public String clinicalAnalysis; @@ -766,6 +802,15 @@ public class RunInterpreterZettaCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--clinical-analysis"}, description = "The body web service clinicalAnalysis parameter", required = false, arity = 1) public String clinicalAnalysis; @@ -948,6 +993,15 @@ public class LoadCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--file"}, description = "The body web service file parameter", required = false, arity = 1) public String file; @@ -1235,6 +1289,15 @@ public class RunRgaIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--auxiliar-index"}, description = "Index auxiliar collection to improve performance assuming RGA is completely indexed.", required = false, help = true, arity = 0) public boolean auxiliarIndex = false; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java index 638e99e37af..44a0ad64dd7 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisVariantCommandOptions.java @@ -366,6 +366,15 @@ public class RunCohortStatsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--cohort"}, description = "The body web service cohort parameter", required = false, arity = 1) public String cohort; @@ -410,6 +419,15 @@ public class RunExomiserCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--sample"}, description = "Sample ID.", required = false, arity = 1) public String sample; @@ -460,6 +478,15 @@ public class RunExportCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--id"}, description = "The body web service id parameter", required = false, arity = 1) public String id; @@ -776,6 +803,15 @@ public class RunFamilyQcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--family"}, description = "The body web service family parameter", required = false, arity = 1) public String family; @@ -808,6 +844,15 @@ public class DeleteFileCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -846,6 +891,15 @@ public class RunGatkCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; @@ -884,6 +938,15 @@ public class RunGenomePlotCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--sample"}, description = "The body web service sample parameter", required = false, arity = 1) public String sample; @@ -928,6 +991,15 @@ public class RunGwasCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--phenotype"}, description = "The body web service phenotype parameter", required = false, arity = 1) public String phenotype; @@ -993,6 +1065,15 @@ public class RunHrDetectCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--id"}, description = "ID to identify the HRDetect results.", required = false, arity = 1) public String id; @@ -1061,6 +1142,15 @@ public class RunIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--file"}, description = "List of files to be indexed.", required = false, arity = 1) public String file; @@ -1180,6 +1270,15 @@ public class RunIndividualQcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--individual"}, description = "Individual ID", required = false, arity = 1) public String individual; @@ -1221,6 +1320,15 @@ public class RunInferredSexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--individual"}, description = "Individual ID", required = false, arity = 1) public String individual; @@ -1299,6 +1407,15 @@ public class RunKnockoutCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--sample"}, description = "The body web service sample parameter", required = false, arity = 1) public String sample; @@ -1358,6 +1475,15 @@ public class RunMendelianErrorCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--family"}, description = "The body web service family parameter", required = false, arity = 1) public String family; @@ -1496,6 +1622,15 @@ public class RunMutationalSignatureCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--id"}, description = "Signature ID.", required = false, arity = 1) public String id; @@ -1573,6 +1708,15 @@ public class RunPlinkCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--outdir"}, description = "The body web service outdir parameter", required = false, arity = 1) public String outdir; @@ -1847,6 +1991,15 @@ public class RunRelatednessCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--individuals"}, description = "The body web service individuals parameter", required = false, arity = 1) public String individuals; @@ -1891,6 +2044,15 @@ public class RunRvtestsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--command"}, description = "The body web service command parameter", required = false, arity = 1) public String command; @@ -2003,6 +2165,15 @@ public class RunSampleEligibilityCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--query"}, description = "The body web service query parameter", required = false, arity = 1) public String query; @@ -2041,6 +2212,15 @@ public class RunSampleQcCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--sample"}, description = "Sample ID.", required = false, arity = 1) public String sample; @@ -2234,6 +2414,15 @@ public class RunSampleCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--id"}, description = "The body web service id parameter", required = false, arity = 1) public String id; @@ -2406,6 +2595,15 @@ public class RunSampleStatsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--sample"}, description = "The body web service sample parameter", required = false, arity = 1) public String sample; @@ -2546,6 +2744,15 @@ public class RunStatsExportCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--cohorts"}, description = "The body web service cohorts parameter", required = false, arity = 1) public String cohorts; @@ -2590,6 +2797,15 @@ public class RunStatsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--cohort"}, description = "The body web service cohort parameter", required = false, arity = 1) public String cohort; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/DiseasePanelsCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/DiseasePanelsCommandOptions.java index a752ded42f5..d69121d7c21 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/DiseasePanelsCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/DiseasePanelsCommandOptions.java @@ -243,6 +243,15 @@ public class ImportCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--source"}, description = "Comma separated list of sources to import panels from. Current supported sources are 'panelapp' and 'cancer-gene-census'", required = false, arity = 1) public String source; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/FilesCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/FilesCommandOptions.java index 8001c0d6e63..dfbd2cb0e5d 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/FilesCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/FilesCommandOptions.java @@ -363,6 +363,15 @@ public class FetchCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -459,6 +468,15 @@ public class RunLinkCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--uri", "--input", "-i"}, description = "The body web service uri parameter", required = false, arity = 1) public String uri; @@ -506,6 +524,15 @@ public class RunPostlinkCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--files"}, description = "The body web service files parameter", required = false, arity = 1) public String files; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/JobsCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/JobsCommandOptions.java index 3902f2a61a8..327d9487dfb 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/JobsCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/JobsCommandOptions.java @@ -43,6 +43,7 @@ public class JobsCommandOptions extends CustomJobsCommandOptions { public DeleteCommandOptions deleteCommandOptions; public InfoCommandOptions infoCommandOptions; public UpdateCommandOptions updateCommandOptions; + public KillCommandOptions killCommandOptions; public HeadLogCommandOptions headLogCommandOptions; public TailLogCommandOptions tailLogCommandOptions; @@ -60,6 +61,7 @@ public JobsCommandOptions(CommonCommandOptions commonCommandOptions, JCommander this.deleteCommandOptions = new DeleteCommandOptions(); this.infoCommandOptions = new InfoCommandOptions(); this.updateCommandOptions = new UpdateCommandOptions(); + this.killCommandOptions = new KillCommandOptions(); this.headLogCommandOptions = new HeadLogCommandOptions(); this.tailLogCommandOptions = new TailLogCommandOptions(); @@ -257,6 +259,9 @@ public class RetryCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -446,6 +451,26 @@ public class UpdateCommandOptions { } + @Parameters(commandNames = {"kill"}, commandDescription ="Send a signal to kill a pending or running job") + public class KillCommandOptions { + + @ParametersDelegate + public CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"--json-file"}, description = "File with the body data in JSON format. Note, that using this parameter will ignore all the other parameters.", required = false, arity = 1) + public String jsonFile; + + @Parameter(names = {"--json-data-model"}, description = "Show example of file structure for body data.", help = true, arity = 0) + public Boolean jsonDataModel = false; + + @Parameter(names = {"--job"}, description = "Job ID or UUID", required = true, arity = 1) + public String job; + + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) + public String study; + + } + @Parameters(commandNames = {"log-head"}, commandDescription ="Show the first lines of a log file (up to a limit)") public class HeadLogCommandOptions { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/OperationsVariantStorageCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/OperationsVariantStorageCommandOptions.java index 1edc7179439..4d398070124 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/OperationsVariantStorageCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/OperationsVariantStorageCommandOptions.java @@ -157,6 +157,15 @@ public class AggregateVariantCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -186,6 +195,15 @@ public class DeleteVariantAnnotationCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String project; @@ -218,6 +236,15 @@ public class IndexVariantAnnotationCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String project; @@ -277,6 +304,15 @@ public class SaveVariantAnnotationCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String project; @@ -332,6 +368,15 @@ public class DeleteVariantCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -370,6 +415,15 @@ public class AggregateVariantFamilyCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -408,6 +462,15 @@ public class IndexVariantFamilyCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -449,6 +512,15 @@ public class IndexVariantCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -568,6 +640,15 @@ public class LauncherVariantIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -702,6 +783,15 @@ public class RunVariantJulieCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "project", required = false, arity = 1) public String project; @@ -740,6 +830,15 @@ public class RepairVariantMetadataCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--studies"}, description = "The body web service studies parameter", required = false, arity = 1) public String studies; @@ -772,6 +871,15 @@ public class SynchronizeVariantMetadataCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -807,6 +915,15 @@ public class PruneVariantCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "The body web service project parameter", required = false, arity = 1) public String project; @@ -842,6 +959,15 @@ public class DeleteVariantSampleCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -880,6 +1006,15 @@ public class IndexVariantSampleCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -938,6 +1073,15 @@ public class DeleteVariantScoreCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -976,6 +1120,15 @@ public class IndexVariantScoreCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -1023,6 +1176,15 @@ public class VariantSecondaryAnnotationIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String project; @@ -1064,6 +1226,15 @@ public class VariantSecondarySampleIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -1128,6 +1299,15 @@ public class SecondaryIndexVariantCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--project", "-p"}, description = "Project [organization@]project where project can be either the ID or the alias", required = false, arity = 1) public String project; @@ -1163,6 +1343,15 @@ public class DeleteVariantSecondaryIndexCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; @@ -1198,6 +1387,15 @@ public class DeleteVariantStatsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--cohort"}, description = "The body web service cohort parameter", required = false, arity = 1) public String cohort; @@ -1233,6 +1431,15 @@ public class IndexVariantStatsCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--cohort"}, description = "The body web service cohort parameter", required = false, arity = 1) public String cohort; @@ -1277,6 +1484,15 @@ public class DeleteVariantStudyCommandOptions { @Parameter(names = {"--job-tags"}, description = "Job tags", required = false, arity = 1) public String jobTags; + @Parameter(names = {"--job-scheduled-start-time"}, description = "Time when the job is scheduled to start.", required = false, arity = 1) + public String jobScheduledStartTime; + + @Parameter(names = {"--job-priority"}, description = "Priority of the job", required = false, arity = 1) + public String jobPriority; + + @Parameter(names = {"--job-dry-run"}, description = "Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run.", required = false, arity = 1) + public Boolean jobDryRun; + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) public String study; diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_6/SyncCohortsAndSamplesMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_6/SyncCohortsAndSamplesMigration.java new file mode 100644 index 00000000000..6f6f5cbf18d --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v2/v2_12_6/SyncCohortsAndSamplesMigration.java @@ -0,0 +1,73 @@ +package org.opencb.opencga.app.migrations.v2.v2_12_6; + +import com.mongodb.client.MongoCollection; +import com.mongodb.client.model.Filters; +import com.mongodb.client.model.Projections; +import com.mongodb.client.model.Updates; +import org.apache.commons.collections4.CollectionUtils; +import org.bson.Document; +import org.bson.conversions.Bson; +import org.opencb.opencga.catalog.db.api.CohortDBAdaptor; +import org.opencb.opencga.catalog.db.api.SampleDBAdaptor; +import org.opencb.opencga.catalog.db.mongodb.MongoDBAdaptor; +import org.opencb.opencga.catalog.db.mongodb.OrganizationMongoDBAdaptorFactory; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +import java.util.List; +import java.util.stream.Collectors; + +@Migration(id = "syncCohortsAndSamplesMigration" , + description = "Sync array of samples from cohort with array of cohortIds from Sample", + version = "2.12.6", + domain = Migration.MigrationDomain.CATALOG, + language = Migration.MigrationLanguage.JAVA, + date = 20240621 +) +public class SyncCohortsAndSamplesMigration extends MigrationTool { + + @Override + protected void run() throws Exception { + MongoCollection sampleCollection = getMongoCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_COLLECTION); + MongoCollection sampleArchiveCollection = getMongoCollection(OrganizationMongoDBAdaptorFactory.SAMPLE_ARCHIVE_COLLECTION); + + queryMongo(OrganizationMongoDBAdaptorFactory.COHORT_COLLECTION, new Document(), + Projections.include(CohortDBAdaptor.QueryParams.ID.key(), CohortDBAdaptor.QueryParams.SAMPLES.key()), + cohortDoc -> { + String cohortId = cohortDoc.getString(CohortDBAdaptor.QueryParams.ID.key()); + List samples = cohortDoc.getList(CohortDBAdaptor.QueryParams.SAMPLES.key(), Document.class); + if (CollectionUtils.isNotEmpty(samples)) { + List sampleUids = samples + .stream() + .map(s -> s.get(SampleDBAdaptor.QueryParams.UID.key(), Number.class).longValue()) + .collect(Collectors.toList()); + // Ensure all those samples have a reference to the cohortId + Bson query = Filters.and( + Filters.in(SampleDBAdaptor.QueryParams.UID.key(), sampleUids), + Filters.eq(MongoDBAdaptor.LAST_OF_VERSION, true) + ); + Bson update = Updates.addToSet(SampleDBAdaptor.QueryParams.COHORT_IDS.key(), cohortId); + long addedMissingCohort = sampleCollection.updateMany(query, update).getModifiedCount(); + sampleArchiveCollection.updateMany(query, update); + + // Ensure there aren't any samples pointing to this cohort that are not in the samples array + query = Filters.and( + Filters.nin(SampleDBAdaptor.QueryParams.UID.key(), sampleUids), + Filters.eq(SampleDBAdaptor.QueryParams.COHORT_IDS.key(), cohortId), + Filters.eq(MongoDBAdaptor.LAST_OF_VERSION, true) + ); + update = Updates.pull(SampleDBAdaptor.QueryParams.COHORT_IDS.key(), cohortId); + long removedNonAssociatedCohort = sampleCollection.updateMany(query, update).getModifiedCount(); + sampleArchiveCollection.updateMany(query, update); + + if (addedMissingCohort > 0 || removedNonAssociatedCohort > 0) { + logger.info("Fixed cohort '{}' references. " + + "Added missing reference to {} samples. " + + "Removed non-associated reference from {} samples.", + cohortId, addedMissingCohort, removedNonAssociatedCohort); + } + } + }); + } + +} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_2_0/AddNewJobFieldsMigration.java b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_2_0/AddNewJobFieldsMigration.java new file mode 100644 index 00000000000..8e196973bba --- /dev/null +++ b/opencga-app/src/main/java/org/opencb/opencga/app/migrations/v3/v3_2_0/AddNewJobFieldsMigration.java @@ -0,0 +1,34 @@ +package org.opencb.opencga.app.migrations.v3.v3_2_0; + +import com.mongodb.client.MongoCollection; +import com.mongodb.client.model.Filters; +import com.mongodb.client.model.Updates; +import org.bson.Document; +import org.bson.conversions.Bson; +import org.opencb.opencga.catalog.db.mongodb.OrganizationMongoDBAdaptorFactory; +import org.opencb.opencga.catalog.migration.Migration; +import org.opencb.opencga.catalog.migration.MigrationTool; + +import java.util.Arrays; + +@Migration(id = "add_jobParentId_scheduledStartTime", + description = "Add 'jobParentId' and 'scheduledStartTime' to existing jobs #TASK-6171 #TASK-6089", version = "3.2.0", + language = Migration.MigrationLanguage.JAVA, domain = Migration.MigrationDomain.CATALOG, date = 20240506) +public class AddNewJobFieldsMigration extends MigrationTool { + + + @Override + protected void run() throws Exception { + for (String jobCollection : Arrays.asList(OrganizationMongoDBAdaptorFactory.JOB_COLLECTION, + OrganizationMongoDBAdaptorFactory.DELETED_JOB_COLLECTION)) { + MongoCollection mongoCollection = getMongoCollection(jobCollection); + Bson query = Filters.exists("parentId", false); + Bson update = Updates.combine( + Updates.set("parentId", ""), + Updates.set("scheduledStartTime", "") + ); + mongoCollection.updateMany(query, update); + } + } + +} diff --git a/opencga-catalog/pom.xml b/opencga-catalog/pom.xml index 975b4100c94..a7eb78947de 100644 --- a/opencga-catalog/pom.xml +++ b/opencga-catalog/pom.xml @@ -204,10 +204,6 @@ com.microsoft.azure azure - - io.fabric8 - kubernetes-client - com.microsoft.azure azure-batch diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/JobDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/JobDBAdaptor.java index b34721cc1f7..a6016da7441 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/JobDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/JobDBAdaptor.java @@ -126,6 +126,7 @@ enum QueryParams implements QueryParam { INTERNAL_STATUS_DATE("internal.status.date", TEXT, ""), INTERNAL_WEBHOOK("internal.webhook", OBJECT, ""), INTERNAL_EVENTS("internal.events", OBJECT, ""), + INTERNAL_KILL_JOB_REQUESTED("internal.killJobRequested", BOOLEAN, ""), OUT_DIR("outDir", OBJECT, ""), INPUT("input", OBJECT, ""), diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/CohortMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/CohortMongoDBAdaptor.java index f34f5ced849..7f25b1ee7b9 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/CohortMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/CohortMongoDBAdaptor.java @@ -235,22 +235,21 @@ public OpenCGAResult update(long cohortId, ObjectMap parameters, QueryOptions qu @Override public OpenCGAResult update(long cohortUid, ObjectMap parameters, List variableSetList, QueryOptions queryOptions) throws CatalogDBException, CatalogParameterException, CatalogAuthorizationException { - Query query = new Query(QueryParams.UID.key(), cohortUid); - QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, - Arrays.asList(QueryParams.ID.key(), QueryParams.UID.key(), QueryParams.STUDY_UID.key(), - QueryParams.SAMPLES.key() + "." + QueryParams.ID.key())); - OpenCGAResult documentResult = get(query, options); - if (documentResult.getNumResults() == 0) { - throw new CatalogDBException("Could not update cohort. Cohort uid '" + cohortUid + "' not found."); - } - String cohortId = documentResult.first().getId(); - try { - return runTransaction(clientSession -> transactionalUpdate(clientSession, documentResult.first(), parameters, variableSetList, - queryOptions)); - } catch (CatalogDBException e) { - logger.error("Could not update cohort {}: {}", cohortId, e.getMessage(), e); - throw new CatalogDBException("Could not update cohort " + cohortId + ": " + e.getMessage(), e.getCause()); + return runTransaction(clientSession -> { + Query query = new Query(QueryParams.UID.key(), cohortUid); + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, + Arrays.asList(QueryParams.ID.key(), QueryParams.UID.key(), QueryParams.STUDY_UID.key(), + QueryParams.SAMPLES.key() + "." + QueryParams.ID.key())); + OpenCGAResult documentResult = get(clientSession, query, options); + if (documentResult.getNumResults() == 0) { + throw new CatalogDBException("Could not update cohort. Cohort uid '" + cohortUid + "' not found."); + } + return transactionalUpdate(clientSession, documentResult.first(), parameters, variableSetList, queryOptions); + }); + } catch (Exception e) { + logger.error("Could not update cohort {}: {}", cohortUid, e.getMessage(), e); + throw new CatalogDBException("Could not update cohort " + cohortUid + ": " + e.getMessage(), e); } } diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/JobMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/JobMongoDBAdaptor.java index e193c5b9e09..53c9a5f157e 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/JobMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/JobMongoDBAdaptor.java @@ -373,7 +373,7 @@ private UpdateDocument parseAndValidateUpdateParams(ObjectMap parameters, QueryO String[] acceptedParams = {QueryParams.USER_ID.key(), QueryParams.DESCRIPTION.key(), QueryParams.COMMAND_LINE.key()}; filterStringParams(parameters, document.getSet(), acceptedParams); - String[] acceptedBooleanParams = {QueryParams.VISITED.key()}; + String[] acceptedBooleanParams = {QueryParams.VISITED.key(), QueryParams.INTERNAL_KILL_JOB_REQUESTED.key()}; filterBooleanParams(parameters, document.getSet(), acceptedBooleanParams); String[] acceptedStringListParams = {QueryParams.TAGS.key()}; diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogAuthorizationException.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogAuthorizationException.java index 28e0310609e..546d3117203 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogAuthorizationException.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/exceptions/CatalogAuthorizationException.java @@ -20,6 +20,28 @@ * @author Jacobo Coll <jacobo167@gmail.com> */ public class CatalogAuthorizationException extends CatalogException { + + public enum ErrorCode { + KILL_JOB("kill", "Only the job owner or the study administrator can kill a job."); + + private final String permission; + private final String message; + + ErrorCode(String permission, String message) { + this.permission = permission; + this.message = message; + } + + public String getPermission() { + return permission; + } + + public String getMessage() { + return message; + } + } + + public CatalogAuthorizationException(String message) { super(message); } @@ -63,6 +85,16 @@ public static CatalogAuthorizationException deny(String userId, String permissio + resource + " { id: " + id + (name == null || name.isEmpty() ? "" : ", name: \"" + name + "\"") + " }"); } + public static CatalogAuthorizationException deny(String userId, String resource, String id, ErrorCode errorCode) { + return deny(userId, resource, id, errorCode, null); + } + + public static CatalogAuthorizationException deny(String userId, String resource, String id, ErrorCode errorCode, Throwable cause) { + return new CatalogAuthorizationException("Permission denied. " + + (userId == null || userId.isEmpty() ? "" : "User '" + userId + "'") + + " cannot " + errorCode.getPermission() + " " + resource + " { id: " + id + " }. " + errorCode.getMessage(), cause); + } + public static CatalogAuthorizationException deny(String userId, String description) { return new CatalogAuthorizationException("Permission denied. " + (userId == null || userId.isEmpty() ? "" : "User '" + userId + "'") + " cannot " + description); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AuditManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AuditManager.java index 9ef3fd7f6e1..6c25baa36ff 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AuditManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/AuditManager.java @@ -215,6 +215,8 @@ public void audit(String organizationId, String operationId, String userId, Enum try { dbAdaptorFactory.getCatalogAuditDbAdaptor(organizationId).insertAuditRecords(this.auditRecordMap.get(operationId)); } catch (CatalogDBException e) { + // FIXME : How to raise attention on this silent error? + // This is a critical error that should not happen. logger.error("Could not audit operation '{}' -> Error: {}", operationId, e.getMessage(), e); } finally { this.auditRecordMap.get(operationId).clear(); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/JobManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/JobManager.java index 524265e69c0..b8b9ba55bae 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/JobManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/JobManager.java @@ -39,6 +39,7 @@ import org.opencb.opencga.catalog.utils.CatalogFqn; import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.catalog.utils.UuidUtils; +import org.opencb.opencga.core.api.FieldConstants; import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.core.common.TimeUtils; import org.opencb.opencga.core.config.Configuration; @@ -217,9 +218,9 @@ public OpenCGAResult visit(String studyId, String jobId, String token) thro study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); return result; - } catch (CatalogException e) { + } catch (Exception e) { auditManager.audit(organizationId, userId, Enums.Action.VISIT, Enums.Resource.JOB, jobId, "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } @@ -309,14 +310,14 @@ public OpenCGAResult create(String studyStr, Job job, QueryOptions options, auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); return insert; - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditCreate(organizationId, userId, Enums.Resource.JOB, job.getId(), "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } - private void autoCompleteNewJob(String organizationId, Study study, Job job, String token) throws CatalogException { + private void autoCompleteNewJob(String organizationId, Study study, Job job, JwtPayload tokenPayload) throws CatalogException { ParamUtils.checkObj(job, "Job"); // Auto generate id @@ -334,6 +335,27 @@ private void autoCompleteNewJob(String organizationId, Study study, Job job, Str job.setInternal(JobInternal.init()); job.getInternal().setWebhook(new JobInternalWebhook(study.getNotification().getWebhook(), new HashMap<>())); + if (StringUtils.isNotEmpty(job.getParentId())) { + // Check parent job exists + try { + Job tmpJob = internalGet(organizationId, study.getUid(), job.getParentId(), INCLUDE_JOB_IDS, + tokenPayload.getUserId(organizationId)).first(); + job.setParentId(tmpJob.getId()); + } catch (CatalogException e) { + throw new CatalogException("Parent job '" + job.getParentId() + "' not found", e); + } + } else { + job.setParentId(""); + } + + if (StringUtils.isNotEmpty(job.getScheduledStartTime())) { + ParamUtils.checkDateFormat(job.getScheduledStartTime(), FieldConstants.JOB_SCHEDULED_START_TIME); + Date date = TimeUtils.toDate(job.getScheduledStartTime()); + if (date.before(new Date())) { + throw new CatalogException("'" + FieldConstants.JOB_SCHEDULED_START_TIME + "' must be a future date"); + } + } + if (job.getDependsOn() != null && !job.getDependsOn().isEmpty()) { boolean uuidProvided = job.getDependsOn().stream().map(Job::getId).anyMatch(UuidUtils::isOpenCgaUuid); @@ -358,13 +380,61 @@ private void autoCompleteNewJob(String organizationId, Study study, Job job, Str } else { // We only check input files if the job does not depend on other job that might be creating the necessary file. - List inputFiles = getJobInputFilesFromParams(study.getFqn(), job, token); + List inputFiles = getJobInputFilesFromParams(study.getFqn(), job, tokenPayload.getToken()); job.setInput(inputFiles); } job.setAttributes(ParamUtils.defaultObject(job.getAttributes(), HashMap::new)); } + public OpenCGAResult kill(String studyStr, String jobId, String token) throws CatalogException { + JwtPayload tokenPayload = catalogManager.getUserManager().validateToken(token); + CatalogFqn studyFqn = CatalogFqn.extractFqnFromStudy(studyStr, tokenPayload); + String organizationId = studyFqn.getOrganizationId(); + String userId = tokenPayload.getUserId(organizationId); + Study study = catalogManager.getStudyManager().resolveId(studyStr, userId, organizationId); + + ObjectMap auditParams = new ObjectMap() + .append("study", studyStr) + .append("jobId", jobId) + .append("token", token); + String jobUuid = ""; + try { + QueryOptions options = keepFieldInQueryOptions(INCLUDE_JOB_IDS, JobDBAdaptor.QueryParams.USER_ID.key()); + Job job = internalGet(organizationId, study.getUid(), jobId, options, userId).first(); + jobId = job.getId(); + jobUuid = job.getUuid(); + + try { + if (!job.getUserId().equals(userId)) { + // Check if the user is a study administrator + authorizationManager.checkIsAtLeastStudyAdministrator(organizationId, study.getUid(), userId); + } + } catch (CatalogException e) { + throw CatalogAuthorizationException.deny(userId, "job", jobId, CatalogAuthorizationException.ErrorCode.KILL_JOB, e); + } + + if (!job.getInternal().getStatus().getId().equals(Enums.ExecutionStatus.PENDING) + && !job.getInternal().getStatus().getId().equals(Enums.ExecutionStatus.QUEUED) + && !job.getInternal().getStatus().getId().equals(Enums.ExecutionStatus.RUNNING)) { + throw new CatalogException("Cannot kill job '" + jobId + "' in status " + job.getInternal().getStatus().getId()); + } + + ObjectMap params = new ObjectMap(JobDBAdaptor.QueryParams.INTERNAL_KILL_JOB_REQUESTED.key(), true); + OpenCGAResult update = catalogDBAdaptorFactory.getCatalogJobDBAdaptor(organizationId).update(job.getUid(), params, + QueryOptions.empty()); + + auditManager.audit(organizationId, userId, Enums.Action.KILL_JOB, Enums.Resource.JOB, jobId, jobUuid, study.getId(), + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); + return update; + } catch (Exception e) { + auditManager.audit(organizationId, userId, Enums.Action.KILL_JOB, Enums.Resource.JOB, jobId, jobUuid, study.getId(), + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); + throw e; + } + } + + public List getJobInputFilesFromParams(String study, Job job, String token) throws CatalogException { // Look for input files String fileParamSuffix = "file"; @@ -409,7 +479,8 @@ public List getJobInputFilesFromParams(String study, Job job, String token } public OpenCGAResult retry(String studyStr, JobRetryParams jobRetry, Enums.Priority priority, String jobId, String jobDescription, - List jobDependsOn, List jobTags, String token) throws CatalogException { + List jobDependsOn, List jobTags, String jobScheduledStartTime, String token) + throws CatalogException { Job job = get(studyStr, jobRetry.getJob(), new QueryOptions(), token).first(); if (jobRetry.isForce() || job.getInternal().getStatus().getId().equals(Enums.ExecutionStatus.ERROR) @@ -423,8 +494,8 @@ public OpenCGAResult retry(String studyStr, JobRetryParams jobRetry, Enums. if (StringUtils.isEmpty(jobDescription)) { jobDescription = "Retry from job '" + jobRetry.getJob() + "'"; } - return submit(studyStr, job.getTool().getId(), priority, params, jobId, jobDescription, jobDependsOn, jobTags, - attributes, token); + return submit(studyStr, job.getTool().getId(), priority, params, jobId, jobDescription, jobDependsOn, jobTags, job.getId(), + jobScheduledStartTime, job.isDryRun(), attributes, token); } else { throw new CatalogException("Unable to retry job with status " + job.getInternal().getStatus().getId()); } @@ -432,7 +503,7 @@ public OpenCGAResult retry(String studyStr, JobRetryParams jobRetry, Enums. public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority priority, Map params, String token) throws CatalogException { - return submit(studyStr, toolId, priority, params, null, null, null, null, token); + return submit(studyStr, toolId, priority, params, null, null, null, null, null, null, false, token); } public OpenCGAResult submitProject(String projectStr, String toolId, Enums.Priority priority, @@ -450,18 +521,20 @@ public OpenCGAResult submitProject(String projectStr, String toolId, Enums. if (studies.isEmpty()) { throw new CatalogException("Project '" + projectStr + "' not found!"); } - return submit(studies.get(0), toolId, priority, params, jobId, jobDescription, jobDependsOn, jobTags, token); + return submit(studies.get(0), toolId, priority, params, jobId, jobDescription, jobDependsOn, jobTags, null, null, false, token); } public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority priority, Map params, String jobId, - String jobDescription, List jobDependsOn, List jobTags, String token) - throws CatalogException { - return submit(studyStr, toolId, priority, params, jobId, jobDescription, jobDependsOn, jobTags, null, token); + String jobDescription, List jobDependsOn, List jobTags, @Nullable String jobParentId, + @Nullable String scheduledStartTime, Boolean dryRun, String token) throws CatalogException { + return submit(studyStr, toolId, priority, params, jobId, jobDescription, jobDependsOn, jobTags, jobParentId, scheduledStartTime, + dryRun, null, token); } public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority priority, Map params, String jobId, - String jobDescription, List jobDependsOn, List jobTags, Map attributes, - String token) throws CatalogException { + String jobDescription, List jobDependsOn, List jobTags, + @Nullable String jobParentId, @Nullable String scheduledStartTime, Boolean dryRun, + Map attributes, String token) throws CatalogException { JwtPayload tokenPayload = catalogManager.getUserManager().validateToken(token); CatalogFqn studyFqn = CatalogFqn.extractFqnFromStudy(studyStr, tokenPayload); String organizationId = studyFqn.getOrganizationId(); @@ -471,14 +544,16 @@ public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority ObjectMap auditParams = new ObjectMap() .append("study", studyStr) .append("toolId", toolId) - .append("priority", priority) + .append("jobPriority", priority) .append("params", params) .append("jobId", jobId) .append("jobDescription", jobDescription) .append("jobDependsOn", jobDependsOn) .append("jobTags", jobTags) + .append("jobParentId", jobParentId) + .append("jobScheduledStartTime", scheduledStartTime) + .append("jobDryRun", dryRun) .append("token", token); - Job job = new Job(); job.setId(jobId); job.setDescription(jobDescription); @@ -487,13 +562,16 @@ public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority job.setStudy(new JobStudyParam(study.getFqn())); job.setUserId(userId); job.setParams(params); + job.setParentId(jobParentId); + job.setScheduledStartTime(scheduledStartTime); job.setPriority(priority); + job.setDryRun(dryRun != null && dryRun); job.setDependsOn(jobDependsOn != null ? jobDependsOn.stream().map(j -> new Job().setId(j)).collect(Collectors.toList()) : Collections.emptyList()); job.setAttributes(attributes); try { - autoCompleteNewJob(organizationId, study, job, token); + autoCompleteNewJob(organizationId, study, job, tokenPayload); authorizationManager.checkStudyPermission(organizationId, study.getUid(), userId, StudyPermissions.Permissions.EXECUTE_JOBS); @@ -523,9 +601,9 @@ public OpenCGAResult submit(String studyStr, String toolId, Enums.Priority return jobResult; } - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditCreate(organizationId, userId, Enums.Resource.JOB, job.getId(), "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); job.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.ABORTED)); job.getInternal().getStatus().setDescription(e.toString()); @@ -672,9 +750,9 @@ public OpenCGAResult search(String studyId, Query query, QueryOptions optio new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); return queryResult; - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditSearch(organizationId, userId, Enums.Resource.JOB, study.getId(), study.getUuid(), auditParams, - new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } @@ -704,9 +782,9 @@ public OpenCGAResult distinct(String studyId, List fields, Query quer new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); return result; - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditDistinct(organizationId, userId, Enums.Resource.JOB, study.getId(), study.getUuid(), auditParams, - new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } @@ -766,9 +844,9 @@ public OpenCGAResult count(String studyId, Query query, String token) throw return new OpenCGAResult<>(queryResultAux.getTime(), queryResultAux.getEvents(), 0, Collections.emptyList(), queryResultAux.getNumMatches()); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditCount(organizationId, userId, Enums.Resource.JOB, study.getId(), study.getUuid(), auditParams, - new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } @@ -800,9 +878,9 @@ public OpenCGAResult delete(String studyStr, List jobIds, ObjectMap para // If the user is the owner or the admin, we won't check if he has permissions for every single entry long studyId = study.getUid(); checkPermissions = !authorizationManager.isAtLeastStudyAdministrator(organizationId, studyId, userId); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.JOB, "", "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -834,14 +912,14 @@ public OpenCGAResult delete(String studyStr, List jobIds, ObjectMap para auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, jobId, e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Cannot delete job {}: {}", jobId, e.getMessage(), e); auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.FAMILY, jobId, jobUuid, - study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } auditManager.finishAuditBatch(organizationId, operationUuid); @@ -888,9 +966,9 @@ public OpenCGAResult delete(String studyId, Query query, ObjectMap params, boole // If the user is the owner or the admin, we won't check if he has permissions for every single entry long studyId1 = study.getUid(); checkPermissions = !authorizationManager.isAtLeastStudyAdministrator(organizationId, studyId1, userId); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.JOB, "", "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -910,7 +988,7 @@ public OpenCGAResult delete(String studyId, Query query, ObjectMap params, boole auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { String errorMsg = "Cannot delete job " + job.getId() + ": " + e.getMessage(); Event event = new Event(Event.Type.ERROR, job.getId(), e.getMessage()); @@ -919,7 +997,7 @@ public OpenCGAResult delete(String studyId, Query query, ObjectMap params, boole logger.error(errorMsg, e); auditManager.auditDelete(organizationId, operationUuid, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), - study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } auditManager.finishAuditBatch(organizationId, operationUuid); @@ -979,23 +1057,17 @@ public OpenCGAResult log(String studyId, String jobId, long offset, logFile = Paths.get(job.getStderr().getUri()); } else { // The log file hasn't yet been registered - if (!Arrays.asList(Enums.ExecutionStatus.PENDING, Enums.ExecutionStatus.QUEUED, Enums.ExecutionStatus.ABORTED) - .contains(job.getInternal().getStatus().getId()) && job.getOutDir() != null) { - logFile = Paths.get(job.getOutDir().getUri()).resolve(job.getId() + ".err"); - } else { - throw CatalogAuthorizationException.deny(userId, "see stderr log file of job '" + jobId + "'"); - } + logFile = Paths.get(job.getOutDir().getUri()).resolve(job.getId() + ".err"); } } else { if (job.getStdout() != null && job.getStdout().getUri() != null) { logFile = Paths.get(job.getStdout().getUri()); } else { - // The log file hasn't yet been registered - if (!Arrays.asList(Enums.ExecutionStatus.PENDING, Enums.ExecutionStatus.QUEUED, Enums.ExecutionStatus.ABORTED) - .contains(job.getInternal().getStatus().getId()) && job.getOutDir() != null) { + if (job.getOutDir() != null && job.getOutDir().getUri() != null) { + // The log file hasn't yet been registered logFile = Paths.get(job.getOutDir().getUri()).resolve(job.getId() + ".log"); } else { - throw CatalogAuthorizationException.deny(userId, "see stdout log file of job '" + jobId + "'"); + throw CatalogAuthorizationException.deny(userId, "view log file"); } } } @@ -1006,6 +1078,12 @@ public OpenCGAResult log(String studyId, String jobId, long offset, } catch (IOException e) { throw CatalogIOException.ioManagerException(logFile.toUri(), e); } + + if (!ioManager.exists(logFile.toUri())) { + String status = job.getInternal().getStatus().getId(); + throw new CatalogException("Job '" + jobId + "' in status '" + status + "'. Log file '" + type + "' not found"); + } + FileContent fileContent; if (tail) { fileContent = ioManager.tail(logFile, lines); @@ -1018,9 +1096,9 @@ public OpenCGAResult log(String studyId, String jobId, long offset, return new OpenCGAResult<>((int) (System.currentTimeMillis() - startTime), Collections.emptyList(), 1, Collections.singletonList(fileContent), 1); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.audit(organizationId, userId, Enums.Action.VIEW_LOG, Enums.Resource.JOB, jobId, "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } } @@ -1063,9 +1141,9 @@ public OpenCGAResult update(String studyStr, Query query, JobUpdateParams u finalQuery.append(JobDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()); iterator = getJobDBAdaptor(organizationId).iterator(study.getUid(), finalQuery, INCLUDE_JOB_IDS, userId); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, "", "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -1079,14 +1157,14 @@ public OpenCGAResult update(String studyStr, Query query, JobUpdateParams u auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, job.getId(), e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Could not update job {}: {}", job.getId(), e.getMessage(), e); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } auditManager.finishAuditBatch(organizationId, operationId); @@ -1141,14 +1219,14 @@ public OpenCGAResult update(String studyStr, List jobIds, JobUpdate auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, jobId, e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Could not update job {}: {}", jobId, e.getMessage(), e); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, jobId, jobUuid, study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } auditManager.finishAuditBatch(organizationId, operationId); @@ -1216,14 +1294,14 @@ public OpenCGAResult update(String studyStr, String jobId, JobUpdateParams auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, jobId, e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Could not update job {}: {}", jobId, e.getMessage(), e); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, jobId, jobUuid, study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -1345,9 +1423,9 @@ public OpenCGAResult update(String studyId, Query query, ObjectMap paramete finalQuery.append(FamilyDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()); iterator = getJobDBAdaptor(organizationId).iterator(study.getUid(), finalQuery, INCLUDE_JOB_IDS, userId); - } catch (CatalogException e) { + } catch (Exception e) { auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, "", "", study.getId(), study.getUuid(), - auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -1364,14 +1442,14 @@ public OpenCGAResult update(String studyId, Query query, ObjectMap paramete auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, job.getId(), e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Cannot update job {}: {}", job.getId(), e.getMessage()); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } @@ -1419,14 +1497,14 @@ public OpenCGAResult update(String studyId, String jobId, ObjectMap paramet auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, jobId, e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Cannot update job {}: {}", jobId, e.getMessage()); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, jobId, jobUuid, study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); throw e; } @@ -1483,14 +1561,14 @@ public OpenCGAResult update(String studyId, List jobIds, ObjectMap auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, job.getId(), job.getUuid(), study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); - } catch (CatalogException e) { + } catch (Exception e) { Event event = new Event(Event.Type.ERROR, jobId, e.getMessage()); result.getEvents().add(event); result.setNumErrors(result.getNumErrors() + 1); logger.error("Cannot update job {}: {}", jobId, e.getMessage()); auditManager.auditUpdate(organizationId, operationId, userId, Enums.Resource.JOB, jobId, jobUuid, study.getId(), - study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e)); } } @@ -1808,10 +1886,10 @@ public OpenCGAResult> getAcls(String studyId, List< } jobAcls.setResults(resultList); jobAcls.setEvents(eventList); - } catch (CatalogException e) { + } catch (Exception e) { for (String jobId : jobList) { auditManager.audit(organizationId, operationId, userId, Enums.Action.FETCH_ACLS, Enums.Resource.JOB, jobId, "", - study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError()), + study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e), new ObjectMap()); } if (!ignoreException) { @@ -1910,12 +1988,12 @@ public OpenCGAResult> updateAcl(String studyId, Lis new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS), new ObjectMap()); } return queryResultList; - } catch (CatalogException e) { + } catch (Exception e) { if (jobStrList != null) { for (String jobId : jobStrList) { auditManager.audit(organizationId, operationId, userId, Enums.Action.UPDATE_ACLS, Enums.Resource.JOB, jobId, "", - study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, - e.getError()), new ObjectMap()); + study.getId(), study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e), + new ObjectMap()); } } throw e; diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ProjectManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ProjectManager.java index a782ea23ed2..38a03bbf24c 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ProjectManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ProjectManager.java @@ -221,7 +221,8 @@ private void validateProjectForCreation(String organizationId, Project project) } try { CellBaseConfiguration cellBaseConfiguration = ParamUtils.defaultObject(project.getCellbase(), - new CellBaseConfiguration(ParamConstants.CELLBASE_URL, ParamConstants.CELLBASE_VERSION)); + new CellBaseConfiguration(ParamConstants.CELLBASE_URL, ParamConstants.CELLBASE_VERSION, + ParamConstants.CELLBASE_DATA_RELEASE, ParamConstants.CELLBASE_APIKEY)); cellBaseConfiguration = CellBaseValidator.validate(cellBaseConfiguration, project.getOrganism().getScientificName(), project.getOrganism().getAssembly(), true); project.setCellbase(cellBaseConfiguration); diff --git a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java index 6345386e69f..73cab79045b 100644 --- a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java +++ b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/CatalogManagerTest.java @@ -17,9 +17,11 @@ package org.opencb.opencga.catalog.managers; import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.StopWatch; import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -66,6 +68,9 @@ import javax.naming.NamingException; import java.io.IOException; import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import static org.hamcrest.CoreMatchers.allOf; @@ -1270,6 +1275,28 @@ public void testCreateJob() throws CatalogException { QueryOptions.empty(), ownerToken); } + @Test + public void testKillJob() throws CatalogException { + Job job = catalogManager.getJobManager().submit(studyId, "command-subcommand", null, Collections.emptyMap(), ownerToken).first(); + assertFalse(job.getInternal().isKillJobRequested()); + + catalogManager.getJobManager().kill(studyFqn, job.getId(), ownerToken); + job = catalogManager.getJobManager().get(studyFqn, job.getId(), QueryOptions.empty(), ownerToken).first(); + assertTrue(job.getInternal().isKillJobRequested()); + + for (String status : Arrays.asList(Enums.ExecutionStatus.DONE, Enums.ExecutionStatus.ABORTED, Enums.ExecutionStatus.ERROR)) { + job = catalogManager.getJobManager().submit(studyId, "command-subcommand", null, Collections.emptyMap(), ownerToken).first(); + catalogManager.getJobManager().update(studyFqn, job.getId(), + new ObjectMap(JobDBAdaptor.QueryParams.INTERNAL_STATUS.key(), new Enums.ExecutionStatus(status)), + QueryOptions.empty(), ownerToken); + // Try to kill job that is already finished + String jobId = job.getId(); + CatalogException catalogException = assertThrows(CatalogException.class, () -> catalogManager.getJobManager().kill(studyFqn, jobId, ownerToken)); + assertTrue(catalogException.getMessage().contains("status")); + } + + } + @Test public void testCreateJobAndReuse() throws CatalogException { String project1 = catalogManager.getProjectManager().create("testCreateJobAndReuse_project1", "", "", "Homo sapiens", @@ -1290,7 +1317,7 @@ public void testCreateJobAndReuse() throws CatalogException { // Same params, different order, empty jobId OpenCGAResult result = catalogManager.getJobManager().submit(study1, toolId, null, new ObjectMap("key2", 2).append("key", 1), - "", "", Collections.emptyList(), Collections.emptyList(), ownerToken); + "", "", Collections.emptyList(), Collections.emptyList(), null, null, false, ownerToken); assertEquals(job1, result.first().getId()); assertEquals(1, result.getEvents().size()); assertEquals("reuse", result.getEvents().get(0).getId()); @@ -1301,13 +1328,13 @@ public void testCreateJobAndReuse() throws CatalogException { // Same params, but with jobId result = catalogManager.getJobManager().submit(study1, toolId, null, new ObjectMap("key2", 2).append("key", 2), "MyJobId", "", - Collections.emptyList(), Collections.emptyList(), ownerToken); + Collections.emptyList(), Collections.emptyList(), null, null, false, ownerToken); assertNotEquals(job1, result.first().getId()); assertEquals("MyJobId", result.first().getId()); // Same params, but with dependencies result = catalogManager.getJobManager().submit(study1, toolId, null, new ObjectMap("key2", 2).append("key", 2), "", "", - Collections.singletonList(job1), Collections.emptyList(), ownerToken); + Collections.singletonList(job1), Collections.emptyList(), null, null, false, ownerToken); assertNotEquals(job1, result.first().getId()); } @@ -1315,13 +1342,13 @@ public void testCreateJobAndReuse() throws CatalogException { public void submitJobWithDependenciesFromDifferentStudies() throws CatalogException { Job first = catalogManager.getJobManager().submit(studyFqn, "command-subcommand", null, Collections.emptyMap(), ownerToken).first(); Job second = catalogManager.getJobManager().submit(studyFqn2, "command-subcommand2", null, Collections.emptyMap(), null, "", - Collections.singletonList(first.getUuid()), null, ownerToken).first(); + Collections.singletonList(first.getUuid()), null, null, null, false, ownerToken).first(); assertEquals(first.getId(), second.getDependsOn().get(0).getId()); thrown.expect(CatalogException.class); thrown.expectMessage("not found"); catalogManager.getJobManager().submit(studyFqn2, "command-subcommand2", null, Collections.emptyMap(), null, "", - Collections.singletonList(first.getId()), null, ownerToken); + Collections.singletonList(first.getId()), null, null, null, false, ownerToken); } @Test @@ -1387,9 +1414,9 @@ public void submitJobWithDependencies() throws CatalogException { Job job2 = catalogManager.getJobManager().submit(studyFqn, "variant-index", Enums.Priority.MEDIUM, new ObjectMap("param", "file2"), ownerToken).first(); Job job3 = catalogManager.getJobManager().submit(studyFqn, "variant-index", Enums.Priority.MEDIUM, new ObjectMap("param", "file3"), null, null, - Arrays.asList(job1.getId(), job2.getId()), null, ownerToken).first(); + Arrays.asList(job1.getId(), job2.getId()), null, null, null, false, ownerToken).first(); Job job4 = catalogManager.getJobManager().submit(studyFqn, "variant-index", Enums.Priority.MEDIUM, new ObjectMap("param", "file4"), null, null, - Arrays.asList(job1.getUuid(), job2.getUuid()), null, ownerToken).first(); + Arrays.asList(job1.getUuid(), job2.getUuid()), null, null, null, false, ownerToken).first(); assertEquals(2, job3.getDependsOn().size()); assertEquals(job1.getUuid(), job3.getDependsOn().get(0).getUuid()); @@ -1748,6 +1775,88 @@ public void updateSampleCohortTest() throws Exception { } } + @Test + public void updateSampleCohortWithThreadsTest() throws Exception { + Sample sampleId1 = catalogManager.getSampleManager().create(studyFqn, new Sample().setId("SAMPLE_1"), INCLUDE_RESULT, ownerToken).first(); + Sample sampleId2 = catalogManager.getSampleManager().create(studyFqn, new Sample().setId("SAMPLE_2"), INCLUDE_RESULT, ownerToken).first(); + Sample sampleId3 = catalogManager.getSampleManager().create(studyFqn, new Sample().setId("SAMPLE_3"), INCLUDE_RESULT, ownerToken).first(); + catalogManager.getCohortManager().create(studyFqn, new Cohort().setId("MyCohort1") + .setSamples(Arrays.asList(sampleId1)), null, ownerToken).first(); + catalogManager.getCohortManager().create(studyFqn, new Cohort().setId("MyCohort2") + .setSamples(Arrays.asList(sampleId2, sampleId3)), null, ownerToken).first(); + + ExecutorService executorService = Executors.newFixedThreadPool(10, + new ThreadFactoryBuilder() + .setNameFormat("executor-service-%d") + .build()); + + StopWatch stopWatch = StopWatch.createStarted(); + List> sampleIds = new ArrayList<>(5); + List innerArray = new ArrayList<>(50); + for (int i = 0; i < 250; i++) { + if (i % 50 == 0) { + System.out.println("i = " + i); + } + + String sampleId = "SAMPLE_AUTO_" + i; + executorService.submit(() -> { + try { + catalogManager.getSampleManager().create(studyFqn, new Sample().setId(sampleId), QueryOptions.empty(), ownerToken); + } catch (CatalogException e) { + throw new RuntimeException(e); + } + }); + if (innerArray.size() == 50) { + sampleIds.add(new ArrayList<>(innerArray)); + innerArray.clear(); + } + innerArray.add(sampleId); + } + sampleIds.add(new ArrayList<>(innerArray)); + executorService.shutdown(); + executorService.awaitTermination(1, TimeUnit.MINUTES); + + System.out.println("Creating 250 samples took " + stopWatch.getTime(TimeUnit.SECONDS) + " seconds"); + + stopWatch.stop(); + stopWatch.reset(); + stopWatch.start(); + executorService = Executors.newFixedThreadPool(3); + int execution = 0; + Map actionMap = new HashMap<>(); + actionMap.put(CohortDBAdaptor.QueryParams.SAMPLES.key(), ParamUtils.BasicUpdateAction.SET); + QueryOptions queryOptions = new QueryOptions(); + queryOptions.put(Constants.ACTIONS, actionMap); + for (List innerSampleIds : sampleIds) { + Cohort myCohort1 = catalogManager.getCohortManager().get(studyFqn, "MyCohort1", null, ownerToken).first(); + List sampleReferenceParamList = new ArrayList<>(myCohort1.getNumSamples() + innerSampleIds.size()); + sampleReferenceParamList.addAll(myCohort1.getSamples().stream().map(s -> new SampleReferenceParam().setId(s.getId())).collect(Collectors.toList())); + sampleReferenceParamList.addAll(innerSampleIds.stream().map(s -> new SampleReferenceParam().setId(s)).collect(Collectors.toList())); + int executionId = execution++; + executorService.submit(() -> { + try { + catalogManager.getCohortManager().update(studyFqn, "MyCohort1", + new CohortUpdateParams().setSamples(sampleReferenceParamList), + queryOptions, ownerToken); + System.out.println("Execution: " + executionId); + } catch (CatalogException e) { + throw new RuntimeException(e); + } + }); + } + executorService.shutdown(); + executorService.awaitTermination(1, TimeUnit.MINUTES); + System.out.println("Attaching 250 samples took " + stopWatch.getTime(TimeUnit.SECONDS) + " seconds"); + + // Ensure persistence + Query sampleQuery = new Query(SampleDBAdaptor.QueryParams.COHORT_IDS.key(), "MyCohort1"); + OpenCGAResult search = catalogManager.getSampleManager().search(studyFqn, sampleQuery, SampleManager.INCLUDE_SAMPLE_IDS, ownerToken); + Cohort myCohort1 = catalogManager.getCohortManager().get(studyFqn, "MyCohort1", null, ownerToken).first(); + assertEquals(search.getNumResults(), myCohort1.getNumSamples()); + Set sampleIdSet = search.getResults().stream().map(Sample::getId).collect(Collectors.toSet()); + assertTrue(myCohort1.getSamples().stream().map(Sample::getId).collect(Collectors.toSet()).containsAll(sampleIdSet)); + } + @Test public void deleteSampleCohortTest() throws Exception { Sample sampleId1 = catalogManager.getSampleManager().create(studyFqn, new Sample().setId("SAMPLE_1"), INCLUDE_RESULT, ownerToken).first(); diff --git a/opencga-client/src/main/R/R/Alignment-methods.R b/opencga-client/src/main/R/R/Alignment-methods.R index 398851faed5..3c3198d89f8 100644 --- a/opencga-client/src/main/R/R/Alignment-methods.R +++ b/opencga-client/src/main/R/R/Alignment-methods.R @@ -19,19 +19,19 @@ #' #' | endpointName | Endpoint WS | parameters accepted | #' | -- | :-- | --: | -#' | runBwa | /{apiVersion}/analysis/alignment/bwa/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runCoverageIndex | /{apiVersion}/analysis/alignment/coverage/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | coverageQcGeneCoverageStatsRun | /{apiVersion}/analysis/alignment/coverage/qc/geneCoverageStats/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | +#' | runBwa | /{apiVersion}/analysis/alignment/bwa/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runCoverageIndex | /{apiVersion}/analysis/alignment/coverage/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | coverageQcGeneCoverageStatsRun | /{apiVersion}/analysis/alignment/coverage/qc/geneCoverageStats/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | queryCoverage | /{apiVersion}/analysis/alignment/coverage/query | file[*], study, region, gene, offset, onlyExons, range, windowSize, splitResults | #' | ratioCoverage | /{apiVersion}/analysis/alignment/coverage/ratio | file1[*], file2[*], study, skipLog2, region, gene, offset, onlyExons, windowSize, splitResults | #' | statsCoverage | /{apiVersion}/analysis/alignment/coverage/stats | file[*], gene[*], study, threshold | -#' | runDeeptools | /{apiVersion}/analysis/alignment/deeptools/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runFastqc | /{apiVersion}/analysis/alignment/fastqc/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runIndex | /{apiVersion}/analysis/alignment/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runPicard | /{apiVersion}/analysis/alignment/picard/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runQc | /{apiVersion}/analysis/alignment/qc/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | +#' | runDeeptools | /{apiVersion}/analysis/alignment/deeptools/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runFastqc | /{apiVersion}/analysis/alignment/fastqc/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runIndex | /{apiVersion}/analysis/alignment/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runPicard | /{apiVersion}/analysis/alignment/picard/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runQc | /{apiVersion}/analysis/alignment/qc/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | query | /{apiVersion}/analysis/alignment/query | limit, skip, count, file[*], study, region, gene, offset, onlyExons, minMappingQuality, maxNumMismatches, maxNumHits, properlyPaired, maxInsertSize, skipUnmapped, skipDuplicated, regionContained, forceMDField, binQualities, splitResults | -#' | runSamtools | /{apiVersion}/analysis/alignment/samtools/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | +#' | runSamtools | /{apiVersion}/analysis/alignment/samtools/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' #' @md #' @seealso \url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation @@ -49,6 +49,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data BWA parameters. runBwa=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/bwa", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -60,6 +63,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Coverage computation parameters. runCoverageIndex=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/coverage/index", subcategoryId=NULL, action="run", params=params, @@ -72,6 +78,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Gene coverage stats parameters for a given BAM file and a list of genes. coverageQcGeneCoverageStatsRun=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/coverage/qc/geneCoverageStats", subcategoryId=NULL, action="run", params=params, @@ -125,6 +134,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Deeptools parameters. Supported Deeptools commands: bamCoverage, bamCompare. runDeeptools=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/deeptools", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -137,6 +149,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data FastQC parameters. runFastqc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/fastqc", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -148,6 +163,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Alignment index params. runIndex=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/index", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -159,6 +177,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Picard parameters. Supported Picard commands: CollectHsMetrics, CollectWgsMetrics, BedToIntervalList. runPicard=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/picard", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -170,6 +191,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Alignment quality control (QC) parameters. It computes: stats, flag stats and fastqc metrics. The BAM file ID is mandatory and in order to skip some metrics, use the following keywords (separated by commas): stats, flagstats, fastqc. runQc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/qc", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -206,6 +230,9 @@ setMethod("alignmentClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Samtools parameters. Supported Samtools commands: sort, index, view, stats, flagstat, dict, faidx, depth, plot-bamstats. runSamtools=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="alignment/samtools", subcategoryId=NULL, action="run", params=params, httpMethod="POST", diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index 304922f853f..e0ca2cc5c44 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -27,16 +27,16 @@ #' | distinctInterpretation | /{apiVersion}/analysis/clinical/interpretation/distinct | study, id, uuid, clinicalAnalysisId, analystId, methodName, panels, primaryFindings, secondaryFindings, creationDate, modificationDate, status, internalStatus, release, field[*] | #' | searchInterpretation | /{apiVersion}/analysis/clinical/interpretation/search | include, exclude, limit, skip, sort, study, id, uuid, clinicalAnalysisId, analystId, methodName, panels, primaryFindings, secondaryFindings, creationDate, modificationDate, status, internalStatus, release | #' | infoInterpretation | /{apiVersion}/analysis/clinical/interpretation/{interpretations}/info | include, exclude, interpretations[*], study, version, deleted | -#' | runInterpreterCancerTiering | /{apiVersion}/analysis/clinical/interpreter/cancerTiering/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runInterpreterExomiser | /{apiVersion}/analysis/clinical/interpreter/exomiser/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runInterpreterTeam | /{apiVersion}/analysis/clinical/interpreter/team/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runInterpreterTiering | /{apiVersion}/analysis/clinical/interpreter/tiering/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runInterpreterZetta | /{apiVersion}/analysis/clinical/interpreter/zetta/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | load | /{apiVersion}/analysis/clinical/load | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runInterpreterCancerTiering | /{apiVersion}/analysis/clinical/interpreter/cancerTiering/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runInterpreterExomiser | /{apiVersion}/analysis/clinical/interpreter/exomiser/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runInterpreterTeam | /{apiVersion}/analysis/clinical/interpreter/team/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runInterpreterTiering | /{apiVersion}/analysis/clinical/interpreter/tiering/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runInterpreterZetta | /{apiVersion}/analysis/clinical/interpreter/zetta/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | load | /{apiVersion}/analysis/clinical/load | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | aggregationStatsRga | /{apiVersion}/analysis/clinical/rga/aggregationStats | limit, skip, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study, field[*] | #' | queryRgaGene | /{apiVersion}/analysis/clinical/rga/gene/query | include, exclude, limit, skip, count, includeIndividual, skipIndividual, limitIndividual, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | #' | summaryRgaGene | /{apiVersion}/analysis/clinical/rga/gene/summary | limit, skip, count, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | -#' | runRgaIndex | /{apiVersion}/analysis/clinical/rga/index/run | study, jobId, jobDescription, jobDependsOn, jobTags, auxiliarIndex, body[*] | +#' | runRgaIndex | /{apiVersion}/analysis/clinical/rga/index/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, auxiliarIndex, body[*] | #' | queryRgaIndividual | /{apiVersion}/analysis/clinical/rga/individual/query | include, exclude, limit, skip, count, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | #' | summaryRgaIndividual | /{apiVersion}/analysis/clinical/rga/individual/summary | limit, skip, count, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | #' | queryRgaVariant | /{apiVersion}/analysis/clinical/rga/variant/query | include, exclude, limit, skip, count, includeIndividual, skipIndividual, limitIndividual, sampleId, individualId, sex, phenotypes, disorders, numParents, geneId, geneName, chromosome, start, end, transcriptId, variants, dbSnps, knockoutType, filter, type, clinicalSignificance, populationFrequency, consequenceType, study | @@ -204,6 +204,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Cancer tiering interpretation analysis params. runInterpreterCancerTiering=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/interpreter/cancerTiering", subcategoryId=NULL, action="run", params=params, @@ -216,6 +219,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Exomiser interpretation analysis params. runInterpreterExomiser=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/interpreter/exomiser", subcategoryId=NULL, action="run", params=params, @@ -228,6 +234,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data TEAM interpretation analysis params. runInterpreterTeam=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/interpreter/team", subcategoryId=NULL, action="run", params=params, @@ -240,6 +249,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Tiering interpretation analysis params. runInterpreterTiering=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/interpreter/tiering", subcategoryId=NULL, action="run", params=params, @@ -252,6 +264,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Zetta interpretation analysis params. runInterpreterZetta=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical/interpreter/zetta", subcategoryId=NULL, action="run", params=params, @@ -264,6 +279,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Parameters to load clinical analysis in OpenCGA catalog from a file. load=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="clinical", subcategoryId=NULL, action="load", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -370,6 +388,9 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param auxiliarIndex Index auxiliar collection to improve performance assuming RGA is completely indexed. #' @param data Recessive Gene Analysis index params. runRgaIndex=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, diff --git a/opencga-client/src/main/R/R/File-methods.R b/opencga-client/src/main/R/R/File-methods.R index 41ff659c258..da3baba3e62 100644 --- a/opencga-client/src/main/R/R/File-methods.R +++ b/opencga-client/src/main/R/R/File-methods.R @@ -24,11 +24,11 @@ #' | bioformats | /{apiVersion}/files/bioformats | | #' | create | /{apiVersion}/files/create | study, parents, body[*] | #' | distinct | /{apiVersion}/files/distinct | study, id, uuid, name, path, uri, type, bioformat, format, external, status, internalStatus, internalVariantIndexStatus, softwareName, directory, creationDate, modificationDate, description, tags, size, sampleIds, jobId, annotation, acl, deleted, release, field[*] | -#' | fetch | /{apiVersion}/files/fetch | jobId, jobDescription, jobDependsOn, jobTags, study, body[*] | +#' | fetch | /{apiVersion}/files/fetch | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body[*] | #' | formats | /{apiVersion}/files/formats | | #' | link | /{apiVersion}/files/link | study, parents, body[*] | -#' | runLink | /{apiVersion}/files/link/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runPostlink | /{apiVersion}/files/postlink/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | +#' | runLink | /{apiVersion}/files/link/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runPostlink | /{apiVersion}/files/postlink/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | search | /{apiVersion}/files/search | include, exclude, limit, skip, count, flattenAnnotations, study, id, uuid, name, path, uri, type, bioformat, format, external, status, internalStatus, internalVariantIndexStatus, softwareName, directory, creationDate, modificationDate, description, tags, size, sampleIds, jobId, annotation, acl, deleted, release | #' | upload | /{apiVersion}/files/upload | file, fileName, fileFormat, bioformat, checksum, study, relativeFilePath, description, parents | #' | acl | /{apiVersion}/files/{files}/acl | files[*], study, member, silent | @@ -130,6 +130,9 @@ setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, file #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Fetch parameters. fetch=fetchOpenCGA(object=OpencgaR, category="files", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, @@ -156,6 +159,9 @@ setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, file #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data File parameters. runLink=fetchOpenCGA(object=OpencgaR, category="files", categoryId=NULL, subcategory="link", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -167,6 +173,9 @@ setMethod("fileClient", "OpencgaR", function(OpencgaR, annotationSet, file, file #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data File parameters. runPostlink=fetchOpenCGA(object=OpencgaR, category="files", categoryId=NULL, subcategory="postlink", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/R/R/Job-methods.R b/opencga-client/src/main/R/R/Job-methods.R index df80a2c29cc..32df3f06506 100644 --- a/opencga-client/src/main/R/R/Job-methods.R +++ b/opencga-client/src/main/R/R/Job-methods.R @@ -22,13 +22,14 @@ #' | updateAcl | /{apiVersion}/jobs/acl/{members}/update | members[*], action[*], body[*] | #' | create | /{apiVersion}/jobs/create | study, body[*] | #' | distinct | /{apiVersion}/jobs/distinct | study, otherStudies, id, uuid, toolId, toolType, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted, field[*] | -#' | retry | /{apiVersion}/jobs/retry | jobId, jobDescription, jobDependsOn, jobTags, study, body[*] | +#' | retry | /{apiVersion}/jobs/retry | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, study, body[*] | #' | search | /{apiVersion}/jobs/search | include, exclude, limit, skip, count, study, otherStudies, id, uuid, toolId, toolType, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted | #' | top | /{apiVersion}/jobs/top | limit, study, internalStatus, priority, userId, toolId | #' | acl | /{apiVersion}/jobs/{jobs}/acl | jobs[*], member, silent | #' | delete | /{apiVersion}/jobs/{jobs}/delete | study, jobs[*] | #' | info | /{apiVersion}/jobs/{jobs}/info | include, exclude, jobs[*], study, deleted | #' | update | /{apiVersion}/jobs/{jobs}/update | include, exclude, jobs[*], study, includeResult, body | +#' | kill | /{apiVersion}/jobs/{job}/kill | job[*], study | #' | headLog | /{apiVersion}/jobs/{job}/log/head | job[*], study, offset, lines, type | #' | tailLog | /{apiVersion}/jobs/{job}/log/tail | job[*], study, lines, type | #' @@ -88,6 +89,7 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data job. retry=fetchOpenCGA(object=OpencgaR, category="jobs", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, @@ -169,6 +171,13 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi update=fetchOpenCGA(object=OpencgaR, category="jobs", categoryId=jobs, subcategory=NULL, subcategoryId=NULL, action="update", params=params, httpMethod="POST", as.queryParam=NULL, ...), + #' @section Endpoint /{apiVersion}/jobs/{job}/kill: + #' Send a signal to kill a pending or running job. + #' @param job Job ID or UUID. + #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. + kill=fetchOpenCGA(object=OpencgaR, category="jobs", categoryId=job, subcategory=NULL, subcategoryId=NULL, + action="kill", params=params, httpMethod="POST", as.queryParam=NULL, ...), + #' @section Endpoint /{apiVersion}/jobs/{job}/log/head: #' Show the first lines of a log file (up to a limit). #' @param job Job ID or UUID. diff --git a/opencga-client/src/main/R/R/Operation-methods.R b/opencga-client/src/main/R/R/Operation-methods.R index ecd586a9ed7..bd581f1ba5e 100644 --- a/opencga-client/src/main/R/R/Operation-methods.R +++ b/opencga-client/src/main/R/R/Operation-methods.R @@ -20,33 +20,33 @@ #' | endpointName | Endpoint WS | parameters accepted | #' | -- | :-- | --: | #' | configureCellbase | /{apiVersion}/operation/cellbase/configure | project, annotationUpdate, annotationSaveId, body | -#' | aggregateVariant | /{apiVersion}/operation/variant/aggregate | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | deleteVariantAnnotation | /{apiVersion}/operation/variant/annotation/delete | jobId, jobDescription, jobDependsOn, jobTags, project, annotationId | -#' | indexVariantAnnotation | /{apiVersion}/operation/variant/annotation/index | jobId, jobDescription, jobDependsOn, jobTags, project, study, body | -#' | saveVariantAnnotation | /{apiVersion}/operation/variant/annotation/save | jobId, jobDescription, jobDependsOn, jobTags, project, body | +#' | aggregateVariant | /{apiVersion}/operation/variant/aggregate | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | deleteVariantAnnotation | /{apiVersion}/operation/variant/annotation/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, annotationId | +#' | indexVariantAnnotation | /{apiVersion}/operation/variant/annotation/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, study, body | +#' | saveVariantAnnotation | /{apiVersion}/operation/variant/annotation/save | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, body | #' | configureVariant | /{apiVersion}/operation/variant/configure | project, study, body | -#' | deleteVariant | /{apiVersion}/operation/variant/delete | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | aggregateVariantFamily | /{apiVersion}/operation/variant/family/aggregate | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | indexVariantFamily | /{apiVersion}/operation/variant/family/index | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | indexVariant | /{apiVersion}/operation/variant/index | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | launcherVariantIndex | /{apiVersion}/operation/variant/index/launcher | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | runVariantJulie | /{apiVersion}/operation/variant/julie/run | jobId, jobDescription, jobDependsOn, jobTags, project, body[*] | -#' | repairVariantMetadata | /{apiVersion}/operation/variant/metadata/repair | jobId, jobDescription, jobDependsOn, jobTags, body | -#' | synchronizeVariantMetadata | /{apiVersion}/operation/variant/metadata/synchronize | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | pruneVariant | /{apiVersion}/operation/variant/prune | jobId, jobDescription, jobDependsOn, jobTags, body | -#' | deleteVariantSample | /{apiVersion}/operation/variant/sample/delete | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | indexVariantSample | /{apiVersion}/operation/variant/sample/index | jobId, jobDescription, jobDependsOn, jobTags, study, body | +#' | deleteVariant | /{apiVersion}/operation/variant/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | aggregateVariantFamily | /{apiVersion}/operation/variant/family/aggregate | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | indexVariantFamily | /{apiVersion}/operation/variant/family/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | indexVariant | /{apiVersion}/operation/variant/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | launcherVariantIndex | /{apiVersion}/operation/variant/index/launcher | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | runVariantJulie | /{apiVersion}/operation/variant/julie/run | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, body[*] | +#' | repairVariantMetadata | /{apiVersion}/operation/variant/metadata/repair | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body | +#' | synchronizeVariantMetadata | /{apiVersion}/operation/variant/metadata/synchronize | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | pruneVariant | /{apiVersion}/operation/variant/prune | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body | +#' | deleteVariantSample | /{apiVersion}/operation/variant/sample/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | indexVariantSample | /{apiVersion}/operation/variant/sample/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | #' | variantSampleIndexConfigure | /{apiVersion}/operation/variant/sample/index/configure | study, skipRebuild, body | -#' | deleteVariantScore | /{apiVersion}/operation/variant/score/delete | jobId, jobDescription, jobDependsOn, jobTags, study, name, resume, force | -#' | indexVariantScore | /{apiVersion}/operation/variant/score/index | jobId, jobDescription, jobDependsOn, jobTags, study, body | -#' | variantSecondaryAnnotationIndex | /{apiVersion}/operation/variant/secondary/annotation/index | jobId, jobDescription, jobDependsOn, jobTags, project, study, body | -#' | variantSecondarySampleIndex | /{apiVersion}/operation/variant/secondary/sample/index | jobId, jobDescription, jobDependsOn, jobTags, study, body | +#' | deleteVariantScore | /{apiVersion}/operation/variant/score/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, name, resume, force | +#' | indexVariantScore | /{apiVersion}/operation/variant/score/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | +#' | variantSecondaryAnnotationIndex | /{apiVersion}/operation/variant/secondary/annotation/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, study, body | +#' | variantSecondarySampleIndex | /{apiVersion}/operation/variant/secondary/sample/index | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | #' | configureVariantSecondarySampleIndex | /{apiVersion}/operation/variant/secondary/sample/index/configure | study, skipRebuild, body | -#' | secondaryIndexVariant | /{apiVersion}/operation/variant/secondaryIndex | jobId, jobDescription, jobDependsOn, jobTags, project, study, body | -#' | deleteVariantSecondaryIndex | /{apiVersion}/operation/variant/secondaryIndex/delete | jobId, jobDescription, jobDependsOn, jobTags, study, samples | -#' | deleteVariantStats | /{apiVersion}/operation/variant/stats/delete | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | indexVariantStats | /{apiVersion}/operation/variant/stats/index | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | deleteVariantStudy | /{apiVersion}/operation/variant/study/delete | jobId, jobDescription, jobDependsOn, jobTags, study, body | +#' | secondaryIndexVariant | /{apiVersion}/operation/variant/secondaryIndex | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, project, study, body | +#' | deleteVariantSecondaryIndex | /{apiVersion}/operation/variant/secondaryIndex/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, samples | +#' | deleteVariantStats | /{apiVersion}/operation/variant/stats/delete | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | indexVariantStats | /{apiVersion}/operation/variant/stats/index | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | deleteVariantStudy | /{apiVersion}/operation/variant/study/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, body | #' #' @md #' @seealso \url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation @@ -72,6 +72,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant aggregate params. aggregateVariant=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant", @@ -83,6 +86,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param annotationId Annotation identifier. deleteVariantAnnotation=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -95,6 +101,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant annotation index params. @@ -108,6 +117,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param data Variant annotation save params. saveVariantAnnotation=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -128,6 +140,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant delete file params. deleteVariant=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant", @@ -139,6 +154,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant aggregate family params. aggregateVariantFamily=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -151,6 +169,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant family index params. indexVariantFamily=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -163,6 +184,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant index params. indexVariant=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant", @@ -174,6 +198,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data . launcherVariantIndex=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -186,6 +213,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project project. #' @param data Julie tool params. Specify list of cohorts from multiple studies with {study}:{cohort}. runVariantJulie=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -198,6 +228,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant storage metadata repair params. repairVariantMetadata=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant/metadata", subcategoryId=NULL, action="repair", params=params, httpMethod="POST", @@ -209,6 +242,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant storage metadata synchronize params. synchronizeVariantMetadata=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -221,6 +257,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant prune params. Use dry-run to just generate a report with the orphan variants. pruneVariant=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant", subcategoryId=NULL, action="prune", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -231,6 +270,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant delete sample params. deleteVariantSample=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -243,6 +285,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant sample index params. indexVariantSample=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -264,6 +309,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param name Unique name of the score within the study. #' @param resume Resume a previously failed remove. @@ -278,6 +326,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant score index params. scoreName: Unique name of the score within the study. cohort1: Cohort used to compute the score. Use the cohort 'ALL' if all samples from the study where used to compute the score. cohort2: Second cohort used to compute the score, typically to compare against the first cohort. If only one cohort was used to compute the score, leave empty. inputColumns: Indicate which columns to load from the input file. Provide the column position (starting in 0) for the column with the score with 'SCORE=n'. Optionally, the PValue column with 'PVALUE=n'. The, to indicate the variant associated with the score, provide either the columns ['CHROM', 'POS', 'REF', 'ALT'], or the column 'VAR' containing a variant representation with format 'chr:start:ref:alt'. e.g. 'CHROM=0,POS=1,REF=3,ALT=4,SCORE=5,PVALUE=6' or 'VAR=0,SCORE=1,PVALUE=2'. resume: Resume a previously failed indexation. indexVariantScore=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -290,6 +341,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant secondary annotation index params. @@ -303,6 +357,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant sample index params. variantSecondarySampleIndex=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -324,6 +381,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param project Project [organization@]project where project can be either the ID or the alias. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant secondary annotation index params. @@ -337,6 +397,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param samples Samples to remove. Needs to provide all the samples in the secondary index. deleteVariantSecondaryIndex=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, @@ -350,6 +413,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant stats delete params. deleteVariantStats=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant/stats", subcategoryId=NULL, action="delete", params=params, httpMethod="POST", @@ -362,6 +428,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant stats params. indexVariantStats=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, subcategory="variant/stats", subcategoryId=NULL, action="index", params=params, httpMethod="POST", @@ -373,6 +442,9 @@ setMethod("operationClient", "OpencgaR", function(OpencgaR, endpointName, params #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param data Variant delete study params. deleteVariantStudy=fetchOpenCGA(object=OpencgaR, category="operation", categoryId=NULL, diff --git a/opencga-client/src/main/R/R/Panel-methods.R b/opencga-client/src/main/R/R/Panel-methods.R index b23b8043f55..36c512a86f2 100644 --- a/opencga-client/src/main/R/R/Panel-methods.R +++ b/opencga-client/src/main/R/R/Panel-methods.R @@ -22,7 +22,7 @@ #' | updateAcl | /{apiVersion}/panels/acl/{members}/update | study, members[*], action[*], body[*] | #' | create | /{apiVersion}/panels/create | include, exclude, study, includeResult, body | #' | distinct | /{apiVersion}/panels/distinct | study, id, uuid, name, internalStatus, disorders, variants, genes, source, regions, categories, tags, deleted, status, creationDate, modificationDate, acl, release, snapshot, field[*] | -#' | importPanels | /{apiVersion}/panels/import | study, jobId, jobDependsOn, jobDescription, jobTags, body | +#' | importPanels | /{apiVersion}/panels/import | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body | #' | search | /{apiVersion}/panels/search | include, exclude, limit, skip, count, study, id, uuid, name, internalStatus, disorders, variants, genes, source, regions, categories, tags, deleted, status, creationDate, modificationDate, acl, release, snapshot | #' | acl | /{apiVersion}/panels/{panels}/acl | panels[*], study, member, silent | #' | delete | /{apiVersion}/panels/{panels}/delete | study, panels[*] | @@ -90,6 +90,9 @@ setMethod("panelClient", "OpencgaR", function(OpencgaR, members, panels, endpoin #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Panel parameters. importPanels=fetchOpenCGA(object=OpencgaR, category="panels", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, action="import", params=params, httpMethod="POST", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/R/R/Study-methods.R b/opencga-client/src/main/R/R/Study-methods.R index 95104111011..ddbc75ca374 100644 --- a/opencga-client/src/main/R/R/Study-methods.R +++ b/opencga-client/src/main/R/R/Study-methods.R @@ -34,7 +34,7 @@ #' | updateNotes | /{apiVersion}/studies/{study}/notes/{id}/update | include, exclude, study[*], id[*], includeResult, body[*] | #' | permissionRules | /{apiVersion}/studies/{study}/permissionRules | study[*], entity[*] | #' | updatePermissionRules | /{apiVersion}/studies/{study}/permissionRules/update | study[*], entity[*], action, body[*] | -#' | runTemplates | /{apiVersion}/studies/{study}/templates/run | study[*], jobId, jobDependsOn, jobDescription, jobTags, body[*] | +#' | runTemplates | /{apiVersion}/studies/{study}/templates/run | study[*], jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | uploadTemplates | /{apiVersion}/studies/{study}/templates/upload | file, study[*] | #' | deleteTemplates | /{apiVersion}/studies/{study}/templates/{templateId}/delete | study[*], templateId[*] | #' | update | /{apiVersion}/studies/{study}/update | include, exclude, study[*], includeResult, body[*] | @@ -221,6 +221,9 @@ setMethod("studyClient", "OpencgaR", function(OpencgaR, group, id, members, stud #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Template loader parameters. runTemplates=fetchOpenCGA(object=OpencgaR, category="studies", categoryId=study, subcategory="templates", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/R/R/Variant-methods.R b/opencga-client/src/main/R/R/Variant-methods.R index acf4d9b864c..5413a7604b5 100644 --- a/opencga-client/src/main/R/R/Variant-methods.R +++ b/opencga-client/src/main/R/R/Variant-methods.R @@ -25,39 +25,39 @@ #' | runCircos | /{apiVersion}/analysis/variant/circos/run | study, body[*] | #' | deleteCohortStats | /{apiVersion}/analysis/variant/cohort/stats/delete | study, cohort | #' | infoCohortStats | /{apiVersion}/analysis/variant/cohort/stats/info | study, cohort[*] | -#' | runCohortStats | /{apiVersion}/analysis/variant/cohort/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runExomiser | /{apiVersion}/analysis/variant/exomiser/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runExport | /{apiVersion}/analysis/variant/export/run | include, exclude, project, study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runCohortStats | /{apiVersion}/analysis/variant/cohort/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runExomiser | /{apiVersion}/analysis/variant/exomiser/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runExport | /{apiVersion}/analysis/variant/export/run | include, exclude, project, study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | genotypesFamily | /{apiVersion}/analysis/variant/family/genotypes | study, family, clinicalAnalysis, modeOfInheritance[*], penetrance, disorder | -#' | runFamilyQc | /{apiVersion}/analysis/variant/family/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | deleteFile | /{apiVersion}/analysis/variant/file/delete | jobId, jobDescription, jobDependsOn, jobTags, study, file, resume | -#' | runGatk | /{apiVersion}/analysis/variant/gatk/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runGenomePlot | /{apiVersion}/analysis/variant/genomePlot/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runGwas | /{apiVersion}/analysis/variant/gwas/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runHrDetect | /{apiVersion}/analysis/variant/hrDetect/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runIndex | /{apiVersion}/analysis/variant/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, body[*] | -#' | runIndividualQc | /{apiVersion}/analysis/variant/individual/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runInferredSex | /{apiVersion}/analysis/variant/inferredSex/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runFamilyQc | /{apiVersion}/analysis/variant/family/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | deleteFile | /{apiVersion}/analysis/variant/file/delete | jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, study, file, resume | +#' | runGatk | /{apiVersion}/analysis/variant/gatk/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runGenomePlot | /{apiVersion}/analysis/variant/genomePlot/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runGwas | /{apiVersion}/analysis/variant/gwas/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runHrDetect | /{apiVersion}/analysis/variant/hrDetect/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runIndex | /{apiVersion}/analysis/variant/index/run | study, jobId, jobDependsOn, jobDescription, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runIndividualQc | /{apiVersion}/analysis/variant/individual/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runInferredSex | /{apiVersion}/analysis/variant/inferredSex/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | queryKnockoutGene | /{apiVersion}/analysis/variant/knockout/gene/query | limit, skip, study, job | #' | queryKnockoutIndividual | /{apiVersion}/analysis/variant/knockout/individual/query | limit, skip, study, job | -#' | runKnockout | /{apiVersion}/analysis/variant/knockout/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runMendelianError | /{apiVersion}/analysis/variant/mendelianError/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runKnockout | /{apiVersion}/analysis/variant/knockout/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runMendelianError | /{apiVersion}/analysis/variant/mendelianError/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | metadata | /{apiVersion}/analysis/variant/metadata | project, study, file, sample, includeStudy, includeFile, includeSample, include, exclude | #' | queryMutationalSignature | /{apiVersion}/analysis/variant/mutationalSignature/query | study, sample, type, ct, biotype, fileData, filter, qual, region, gene, panel, panelModeOfInheritance, panelConfidence, panelFeatureType, panelRoleInCancer, panelIntersection, msId, msDescription | -#' | runMutationalSignature | /{apiVersion}/analysis/variant/mutationalSignature/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runPlink | /{apiVersion}/analysis/variant/plink/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runMutationalSignature | /{apiVersion}/analysis/variant/mutationalSignature/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runPlink | /{apiVersion}/analysis/variant/plink/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | query | /{apiVersion}/analysis/variant/query | include, exclude, limit, skip, count, sort, summary, approximateCount, approximateCountSamplingSize, savedFilter, id, region, type, reference, alternate, project, study, file, filter, qual, fileData, sample, genotype, sampleData, sampleAnnotation, sampleMetadata, unknownGenotype, sampleLimit, sampleSkip, cohort, cohortStatsRef, cohortStatsAlt, cohortStatsMaf, cohortStatsMgf, cohortStatsPass, missingAlleles, missingGenotypes, score, family, familyDisorder, familySegregation, familyMembers, familyProband, includeStudy, includeFile, includeSample, includeSampleData, includeGenotype, includeSampleId, annotationExists, gene, ct, xref, biotype, proteinSubstitution, conservation, populationFrequencyAlt, populationFrequencyRef, populationFrequencyMaf, transcriptFlag, geneTraitId, go, expression, proteinKeyword, drug, functionalScore, clinical, clinicalSignificance, clinicalConfirmedStatus, customAnnotation, panel, panelModeOfInheritance, panelConfidence, panelRoleInCancer, panelFeatureType, panelIntersection, trait | -#' | runRelatedness | /{apiVersion}/analysis/variant/relatedness/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runRvtests | /{apiVersion}/analysis/variant/rvtests/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runRelatedness | /{apiVersion}/analysis/variant/relatedness/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runRvtests | /{apiVersion}/analysis/variant/rvtests/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | aggregationStatsSample | /{apiVersion}/analysis/variant/sample/aggregationStats | savedFilter, region, type, project, study, file, filter, sample, genotype, sampleAnnotation, family, familyDisorder, familySegregation, familyMembers, familyProband, ct, biotype, populationFrequencyAlt, clinical, clinicalSignificance, clinicalConfirmedStatus, field | -#' | runSampleEligibility | /{apiVersion}/analysis/variant/sample/eligibility/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runSampleQc | /{apiVersion}/analysis/variant/sample/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runSampleEligibility | /{apiVersion}/analysis/variant/sample/eligibility/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runSampleQc | /{apiVersion}/analysis/variant/sample/qc/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | querySample | /{apiVersion}/analysis/variant/sample/query | limit, skip, variant, study, genotype | -#' | runSample | /{apiVersion}/analysis/variant/sample/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runSample | /{apiVersion}/analysis/variant/sample/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | querySampleStats | /{apiVersion}/analysis/variant/sample/stats/query | region, type, study, file, filter, sampleData, ct, biotype, transcriptFlag, populationFrequencyAlt, clinical, clinicalSignificance, clinicalConfirmedStatus, study, filterTranscript, sample[*] | -#' | runSampleStats | /{apiVersion}/analysis/variant/sample/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runStatsExport | /{apiVersion}/analysis/variant/stats/export/run | project, study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | -#' | runStats | /{apiVersion}/analysis/variant/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, body[*] | +#' | runSampleStats | /{apiVersion}/analysis/variant/sample/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runStatsExport | /{apiVersion}/analysis/variant/stats/export/run | project, study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | +#' | runStats | /{apiVersion}/analysis/variant/stats/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' #' @md #' @seealso \url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation @@ -162,6 +162,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Cohort variant stats params. runCohortStats=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/cohort/stats", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -174,6 +177,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Exomiser parameters. runExomiser=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/exomiser", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -188,6 +194,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant export params. runExport=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/export", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -211,6 +220,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Family QC analysis params. Family ID. Relatedness method, by default 'PLINK/IBD'. Minor allele frequence (MAF) is used to filter variants before computing relatedness, e.g.: 1000G:CEU>0.35 or cohort:ALL>0.05. runFamilyQc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/family/qc", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -222,6 +234,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. #' @param file Files to remove. #' @param resume Resume a previously failed indexation. @@ -235,6 +250,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Gatk parameters. Supported Gatk commands: HaplotypeCaller. runGatk=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/gatk", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -246,6 +264,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Genome plot analysis params to customize the plot. The configuration file includes the title, the plot density (i.e., the number of points to display), the general query and the list of tracks. Currently, the supported track types are: COPY-NUMBER, INDEL, REARRANGEMENT and SNV. In addition, each track can contain a specific query. runGenomePlot=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/genomePlot", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -258,6 +279,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Gwas analysis params. runGwas=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/gwas", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -269,6 +293,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data HRDetect analysis parameters. runHrDetect=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/hrDetect", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -280,6 +307,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobDescription Job description. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant index params. runIndex=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/index", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -291,6 +321,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Individual QC analysis params. runIndividualQc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/individual/qc", subcategoryId=NULL, action="run", params=params, @@ -303,6 +336,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Inferred sex analysis params. runInferredSex=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/inferredSex", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -335,6 +371,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Gene knockout analysis params. runKnockout=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/knockout", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -346,6 +385,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Mendelian error analysis params. runMendelianError=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/mendelianError", subcategoryId=NULL, action="run", params=params, @@ -396,6 +438,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Mutational signature analysis parameters to index the genome context for that sample, and to compute both catalogue counts and signature fitting. In order to skip one of them, , use the following keywords: , catalogue, fitting. runMutationalSignature=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/mutationalSignature", subcategoryId=NULL, action="run", params=params, @@ -408,6 +453,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Plink params. runPlink=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/plink", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -501,6 +549,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Relatedness analysis params. runRelatedness=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/relatedness", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -513,6 +564,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data RvTests parameters. Supported RvTests commands: rvtest, vcf2kinship. runRvtests=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/rvtests", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -552,6 +606,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data . runSampleEligibility=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/sample/eligibility", subcategoryId=NULL, action="run", params=params, @@ -564,6 +621,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Sample QC analysis params. Mutational signature and genome plot are calculated for somatic samples only. In order to skip some metrics, use the following keywords (separated by commas): variant-stats, signature, signature-catalogue, signature-fitting, genome-plot. runSampleQc=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/sample/qc", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -586,6 +646,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Sample variant filter params. runSample=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/sample", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), @@ -618,6 +681,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Sample variant stats params. Use index=true and indexId='' to store the result in catalog sample QC. indexId=ALL requires an empty query. Use sample=all to compute sample stats of all samples in the variant storage. runSampleStats=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/sample/stats", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -631,6 +697,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant stats export params. runStatsExport=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/stats/export", subcategoryId=NULL, action="run", params=params, httpMethod="POST", @@ -643,6 +712,9 @@ setMethod("variantClient", "OpencgaR", function(OpencgaR, endpointName, params=N #' @param jobDescription Job description. #' @param jobDependsOn Comma separated list of existing job IDs the job will depend on. #' @param jobTags Job tags. + #' @param jobScheduledStartTime Time when the job is scheduled to start. + #' @param jobPriority Priority of the job. + #' @param jobDryRun Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. #' @param data Variant stats params. runStats=fetchOpenCGA(object=OpencgaR, category="analysis", categoryId=NULL, subcategory="variant/stats", subcategoryId=NULL, action="run", params=params, httpMethod="POST", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java index ca1e1ecc744..238df94066d 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java @@ -65,6 +65,10 @@ public AlignmentClient(String token, ClientConfiguration configuration) { * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -83,6 +87,10 @@ public RestResponse runBwa(BwaWrapperParams data, ObjectMap params) throws * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -101,6 +109,10 @@ public RestResponse runCoverageIndex(CoverageIndexParams data, ObjectMap pa * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -184,6 +196,10 @@ public RestResponse statsCoverage(String file, String gene, O * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -202,6 +218,10 @@ public RestResponse runDeeptools(DeeptoolsWrapperParams data, ObjectMap par * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -220,6 +240,10 @@ public RestResponse runFastqc(FastqcWrapperParams data, ObjectMap params) t * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -239,6 +263,10 @@ public RestResponse runIndex(AlignmentIndexParams data, ObjectMap params) t * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -258,6 +286,10 @@ public RestResponse runPicard(PicardWrapperParams data, ObjectMap params) t * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -309,6 +341,10 @@ public RestResponse query(String file, ObjectMap params) throws C * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java index 012308ea40e..6590b6d5d4f 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java @@ -277,6 +277,10 @@ public RestResponse infoInterpretation(String interpretations, O * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -296,6 +300,10 @@ public RestResponse runInterpreterCancerTiering(CancerTieringInterpretation * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -314,6 +322,10 @@ public RestResponse runInterpreterExomiser(ExomiserInterpretationAnalysisPa * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -332,6 +344,10 @@ public RestResponse runInterpreterTeam(TeamInterpretationAnalysisParams dat * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -350,6 +366,10 @@ public RestResponse runInterpreterTiering(TieringInterpretationAnalysisPara * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -368,6 +388,10 @@ public RestResponse runInterpreterZetta(ZettaInterpretationAnalysisParams d * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -498,6 +522,10 @@ public RestResponse summaryRgaGene(ObjectMap params) thro * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * auxiliarIndex: Index auxiliar collection to improve performance assuming RGA is completely indexed. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java index ead924800fa..15d71d98597 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java @@ -139,6 +139,10 @@ public RestResponse distinct(String field, ObjectMap params) throws Clie * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java index 09cc5ab8c25..dcf3ae18ef8 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java @@ -179,6 +179,10 @@ public RestResponse distinct(String field, ObjectMap params) throws Clie * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -223,6 +227,10 @@ public RestResponse link(FileLinkParams data, ObjectMap params) throws Cli * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -241,6 +249,10 @@ public RestResponse runLink(FileLinkToolParams data, ObjectMap params) thro * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java index 523523ab4b3..77c04be5053 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java @@ -125,6 +125,7 @@ public RestResponse distinct(String field, ObjectMap params) throws Clie * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -254,6 +255,19 @@ public RestResponse update(String jobs, JobUpdateParams data, ObjectMap par return execute("jobs", jobs, null, null, "update", params, POST, Job.class); } + /** + * Send a signal to kill a pending or running job. + * @param job Job ID or UUID. + * @param params Map containing any of the following optional parameters. + * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. + * @return a RestResponse object. + * @throws ClientException ClientException if there is any server error. + */ + public RestResponse kill(String job, ObjectMap params) throws ClientException { + params = params != null ? params : new ObjectMap(); + return execute("jobs", job, null, null, "kill", params, POST, Job.class); + } + /** * Show the first lines of a log file (up to a limit). * @param job Job ID or UUID. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java index 71e89be53fb..e5b054ae283 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java @@ -341,6 +341,10 @@ public RestResponse updatePermissionRules(String study, String e * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java index 0f270a52762..6a68ae8ea82 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java @@ -218,6 +218,10 @@ public RestResponse infoCohortStats(String cohort, ObjectMap pa * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -236,6 +240,10 @@ public RestResponse runCohortStats(CohortVariantStatsAnalysisParams data, O * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -257,6 +265,10 @@ public RestResponse runExomiser(ExomiserWrapperParams data, ObjectMap param * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -294,6 +306,10 @@ public RestResponse genotypesFamily(String modeOfInheritance, ObjectM * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -310,6 +326,10 @@ public RestResponse runFamilyQc(FamilyQcAnalysisParams data, ObjectMap para * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * file: Files to remove. * resume: Resume a previously failed indexation. @@ -330,6 +350,10 @@ public RestResponse deleteFile(ObjectMap params) throws ClientException { * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -350,6 +374,10 @@ public RestResponse runGatk(GatkWrapperParams data, ObjectMap params) throw * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -368,6 +396,10 @@ public RestResponse runGenomePlot(GenomePlotAnalysisParams data, ObjectMap * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -386,6 +418,10 @@ public RestResponse runGwas(GwasAnalysisParams data, ObjectMap params) thro * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -404,6 +440,10 @@ public RestResponse runHrDetect(HRDetectAnalysisParams data, ObjectMap para * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobDescription: Job description. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -422,6 +462,10 @@ public RestResponse runIndex(VariantIndexParams data, ObjectMap params) thr * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -440,6 +484,10 @@ public RestResponse runIndividualQc(IndividualQcAnalysisParams data, Object * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -488,6 +536,10 @@ public RestResponse queryKnockoutIndividual(ObjectMap para * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -506,6 +558,10 @@ public RestResponse runKnockout(KnockoutAnalysisParams data, ObjectMap para * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -597,6 +653,10 @@ public RestResponse queryMutationalSignature(ObjectMap params) throws * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -615,6 +675,10 @@ public RestResponse runMutationalSignature(MutationalSignatureAnalysisParam * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -759,6 +823,10 @@ public RestResponse query(ObjectMap params) throws ClientException { * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -777,6 +845,10 @@ public RestResponse runRelatedness(RelatednessAnalysisParams data, ObjectMa * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -851,6 +923,10 @@ public RestResponse aggregationStatsSample(ObjectMap params) throws * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -872,6 +948,10 @@ public RestResponse runSampleEligibility(SampleEligibilityAnalysisParams da * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -906,6 +986,10 @@ public RestResponse querySample(ObjectMap params) throws ClientExceptio * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -960,6 +1044,10 @@ public RestResponse querySampleStats(String sample, ObjectMa * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -979,6 +1067,10 @@ public RestResponse runSampleStats(SampleVariantStatsAnalysisParams data, O * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -997,6 +1089,10 @@ public RestResponse runStatsExport(VariantStatsExportParams data, ObjectMap * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java index e1b00a66cc5..e3f43735a7d 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java @@ -90,6 +90,10 @@ public RestResponse configureCellbase(CellBaseConfiguration data, ObjectMap * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -107,6 +111,10 @@ public RestResponse aggregateVariant(VariantAggregateParams data, ObjectMap * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: Project [organization@]project where project can be either the ID or the alias. * annotationId: Annotation identifier. * @return a RestResponse object. @@ -125,6 +133,10 @@ public RestResponse deleteVariantAnnotation(ObjectMap params) throws Client * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: Project [organization@]project where project can be either the ID or the alias. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. @@ -144,6 +156,10 @@ public RestResponse indexVariantAnnotation(VariantAnnotationIndexParams dat * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: Project [organization@]project where project can be either the ID or the alias. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -177,6 +193,10 @@ public RestResponse configureVariant(VariantConfigureParams data, Obj * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -195,6 +215,10 @@ public RestResponse deleteVariant(VariantFileDeleteParams data, ObjectMap p * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -213,6 +237,10 @@ public RestResponse aggregateVariantFamily(VariantAggregateFamilyParams dat * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -231,6 +259,10 @@ public RestResponse indexVariantFamily(VariantFamilyIndexParams data, Objec * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -249,6 +281,10 @@ public RestResponse indexVariant(VariantIndexParams data, ObjectMap params) * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -267,6 +303,10 @@ public RestResponse launcherVariantIndex(VariantFileIndexJobLauncherParams * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: project. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -285,6 +325,10 @@ public RestResponse runVariantJulie(JulieParams data, ObjectMap params) thr * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -302,6 +346,10 @@ public RestResponse repairVariantMetadata(VariantStorageMetadataRepairToolP * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -321,6 +369,10 @@ public RestResponse synchronizeVariantMetadata(VariantStorageMetadataSynchr * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -338,6 +390,10 @@ public RestResponse pruneVariant(VariantPruneParams data, ObjectMap params) * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -356,6 +412,10 @@ public RestResponse deleteVariantSample(VariantSampleDeleteParams data, Obj * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -388,6 +448,10 @@ public RestResponse variantSampleIndexConfigure(SampleIndexConfiguration da * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * name: Unique name of the score within the study. * resume: Resume a previously failed remove. @@ -415,6 +479,10 @@ public RestResponse deleteVariantScore(ObjectMap params) throws ClientExcep * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -433,6 +501,10 @@ public RestResponse indexVariantScore(VariantScoreIndexParams data, ObjectM * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: Project [organization@]project where project can be either the ID or the alias. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. @@ -453,6 +525,10 @@ public RestResponse variantSecondaryAnnotationIndex(VariantSecondaryAnnotat * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. @@ -486,6 +562,10 @@ public RestResponse configureVariantSecondarySampleIndex(SampleIndexConfigu * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * project: Project [organization@]project where project can be either the ID or the alias. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. @@ -504,6 +584,10 @@ public RestResponse secondaryIndexVariant(VariantSecondaryAnnotationIndexPa * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * samples: Samples to remove. Needs to provide all the samples in the secondary index. * @return a RestResponse object. @@ -523,6 +607,10 @@ public RestResponse deleteVariantSecondaryIndex(ObjectMap params) throws Cl * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -541,6 +629,10 @@ public RestResponse deleteVariantStats(VariantStatsDeleteParams data, Objec * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ @@ -558,6 +650,10 @@ public RestResponse indexVariantStats(VariantStatsIndexParams data, ObjectM * jobDescription: Job description. * jobDependsOn: Comma separated list of existing job IDs the job will depend on. * jobTags: Job tags. + * jobScheduledStartTime: Time when the job is scheduled to start. + * jobPriority: Priority of the job. + * jobDryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all + * parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. diff --git a/opencga-client/src/main/javascript/Alignment.js b/opencga-client/src/main/javascript/Alignment.js index 0b374aab6a5..fc302177872 100644 --- a/opencga-client/src/main/javascript/Alignment.js +++ b/opencga-client/src/main/javascript/Alignment.js @@ -43,6 +43,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runBwa(data, params) { @@ -58,6 +62,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runCoverageIndex(data, params) { @@ -73,6 +81,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ coverageQcGeneCoverageStatsRun(data, params) { @@ -138,6 +150,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runDeeptools(data, params) { @@ -153,6 +169,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runFastqc(data, params) { @@ -168,6 +188,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runIndex(data, params) { @@ -184,6 +208,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runPicard(data, params) { @@ -200,6 +228,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runQc(data, params) { @@ -246,6 +278,10 @@ export default class Alignment extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runSamtools(data, params) { diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 2bc441b1e6f..bbfb5b090c5 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -209,6 +209,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInterpreterCancerTiering(data, params) { @@ -224,6 +228,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInterpreterExomiser(data, params) { @@ -239,6 +247,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInterpreterTeam(data, params) { @@ -254,6 +266,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInterpreterTiering(data, params) { @@ -269,6 +285,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInterpreterZetta(data, params) { @@ -284,6 +304,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ load(data, params) { @@ -401,6 +425,10 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {Boolean} [params.auxiliarIndex = "false"] - Index auxiliar collection to improve performance assuming RGA is completely * indexed. The default value is false. * @returns {Promise} Promise object in the form of RestResponse instance. diff --git a/opencga-client/src/main/javascript/DiseasePanel.js b/opencga-client/src/main/javascript/DiseasePanel.js index b23920896d2..1aca2e4ef57 100644 --- a/opencga-client/src/main/javascript/DiseasePanel.js +++ b/opencga-client/src/main/javascript/DiseasePanel.js @@ -109,6 +109,10 @@ export default class DiseasePanel extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ importPanels(data, params) { diff --git a/opencga-client/src/main/javascript/File.js b/opencga-client/src/main/javascript/File.js index 80c275318ef..3e1abab6f85 100644 --- a/opencga-client/src/main/javascript/File.js +++ b/opencga-client/src/main/javascript/File.js @@ -131,6 +131,10 @@ export default class File extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -166,6 +170,10 @@ export default class File extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runLink(data, params) { @@ -181,6 +189,10 @@ export default class File extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runPostlink(data, params) { diff --git a/opencga-client/src/main/javascript/Job.js b/opencga-client/src/main/javascript/Job.js index e9014ed296f..f0ebb640147 100644 --- a/opencga-client/src/main/javascript/Job.js +++ b/opencga-client/src/main/javascript/Job.js @@ -95,6 +95,7 @@ export default class Job extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -205,6 +206,16 @@ export default class Job extends OpenCGAParentClass { return this._post("jobs", jobs, null, null, "update", data, params); } + /** Send a signal to kill a pending or running job + * @param {String} job - Job ID or UUID. + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. + * @returns {Promise} Promise object in the form of RestResponse instance. + */ + kill(job, params) { + return this._post("jobs", job, null, null, "kill", params); + } + /** Show the first lines of a log file (up to a limit) * @param {String} job - Job ID or UUID. * @param {Object} [params] - The Object containing the following optional parameters: diff --git a/opencga-client/src/main/javascript/Study.js b/opencga-client/src/main/javascript/Study.js index 1be4598d5bc..9e013fef0dc 100644 --- a/opencga-client/src/main/javascript/Study.js +++ b/opencga-client/src/main/javascript/Study.js @@ -262,6 +262,10 @@ export default class Study extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runTemplates(study, data, params) { diff --git a/opencga-client/src/main/javascript/Variant.js b/opencga-client/src/main/javascript/Variant.js index 2df5dc8d0fc..7d8b01966da 100644 --- a/opencga-client/src/main/javascript/Variant.js +++ b/opencga-client/src/main/javascript/Variant.js @@ -160,6 +160,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runCohortStats(data, params) { @@ -175,6 +179,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runExomiser(data, params) { @@ -193,6 +201,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runExport(data, params) { @@ -224,6 +236,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runFamilyQc(data, params) { @@ -237,6 +253,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @param {String} [params.file] - Files to remove. * @param {Boolean} [params.resume] - Resume a previously failed indexation. @@ -255,6 +275,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runGatk(data, params) { @@ -272,6 +296,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runGenomePlot(data, params) { @@ -287,6 +315,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runGwas(data, params) { @@ -302,6 +334,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runHrDetect(data, params) { @@ -317,6 +353,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runIndex(data, params) { @@ -332,6 +372,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runIndividualQc(data, params) { @@ -347,6 +391,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runInferredSex(data, params) { @@ -386,6 +434,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runKnockout(data, params) { @@ -401,6 +453,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runMendelianError(data, params) { @@ -486,6 +542,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runMutationalSignature(data, params) { @@ -501,6 +561,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runPlink(data, params) { @@ -648,6 +712,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runRelatedness(data, params) { @@ -663,6 +731,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runRvtests(data, params) { @@ -733,6 +805,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runSampleEligibility(data, params) { @@ -751,6 +827,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runSampleQc(data, params) { @@ -779,6 +859,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runSample(data, params) { @@ -826,6 +910,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runSampleStats(data, params) { @@ -842,6 +930,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runStatsExport(data, params) { @@ -857,6 +949,10 @@ export default class Variant extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ runStats(data, params) { diff --git a/opencga-client/src/main/javascript/VariantOperation.js b/opencga-client/src/main/javascript/VariantOperation.js index 6f2ce1afafa..0d79024c496 100644 --- a/opencga-client/src/main/javascript/VariantOperation.js +++ b/opencga-client/src/main/javascript/VariantOperation.js @@ -54,6 +54,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -68,6 +72,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - Project [organization@]project where project can be either the ID or the alias. * @param {String} [params.annotationId] - Annotation identifier. * @returns {Promise} Promise object in the form of RestResponse instance. @@ -84,6 +92,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - Project [organization@]project where project can be either the ID or the alias. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. @@ -100,6 +112,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - Project [organization@]project where project can be either the ID or the alias. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -126,6 +142,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -141,6 +161,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -156,6 +180,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -171,6 +199,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -186,6 +218,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -201,6 +237,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - project. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -216,6 +256,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ repairVariantMetadata(data, params) { @@ -230,6 +274,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -245,6 +293,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ pruneVariant(data, params) { @@ -259,6 +311,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -274,6 +330,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -299,6 +359,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @param {String} [params.name] - Unique name of the score within the study. * @param {Boolean} [params.resume] - Resume a previously failed remove. @@ -324,6 +388,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -339,6 +407,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - Project [organization@]project where project can be either the ID or the alias. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. @@ -355,6 +427,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ @@ -381,6 +457,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.project] - Project [organization@]project where project can be either the ID or the alias. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. @@ -396,6 +476,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @param {String} [params.samples] - Samples to remove. Needs to provide all the samples in the secondary index. * @returns {Promise} Promise object in the form of RestResponse instance. @@ -413,6 +497,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ deleteVariantStats(data, params) { @@ -428,6 +516,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @returns {Promise} Promise object in the form of RestResponse instance. */ indexVariantStats(data, params) { @@ -442,6 +534,10 @@ export default class VariantOperation extends OpenCGAParentClass { * @param {String} [params.jobDescription] - Job description. * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. * @param {String} [params.jobTags] - Job tags. + * @param {String} [params.jobScheduledStartTime] - Time when the job is scheduled to start. + * @param {String} [params.jobPriority] - Priority of the job. + * @param {Boolean} [params.jobDryRun] - Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will + * validate that all parameters and prerequisites are correctly set for successful execution, but the job will not actually run. * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. * @returns {Promise} Promise object in the form of RestResponse instance. */ diff --git a/opencga-client/src/main/python/README.rst b/opencga-client/src/main/python/README.rst index d8c3f51b64c..43b39e1c983 100644 --- a/opencga-client/src/main/python/README.rst +++ b/opencga-client/src/main/python/README.rst @@ -4,34 +4,28 @@ PyOpenCGA ========== This Python client package makes use of the comprehensive RESTful web services API implemented for the `OpenCGA`_ platform. -OpenCGA is an open-source project that implements a high-performance, scalable and secure platform for Genomic data analysis and visualisation +OpenCGA is an open-source project that implements a high-performance, scalable and secure platform for Genomic data analysis and visualisation. OpenCGA implements a secure and high performance platform for Big Data analysis and visualisation in current genomics. -OpenCGA uses the most modern and advanced technologies to scale to petabytes of data. OpenCGA is designed and implemented to work with -few million genomes. It is built on top of three main components: Catalog, Variant and Alignment Storage and Analysis. +OpenCGA uses the most modern and advanced technologies to scale to petabytes of data. OpenCGA is designed and implemented to work with few million genomes. It is built on top of three main components: Catalog, Variant and Alignment Storage and Analysis. -More info about this project in the `OpenCGA Docs`_ +More info about this project in `OpenCGA Docs`_ Installation ------------ -Cloning -``````` -PyOpenCGA can be cloned in your local machine by executing in your terminal:: +PyOpenCGA can be installed from the Pypi repository. Make sure you have pip available in your machine. You can check this by running:: - $ git clone https://github.com/opencb/opencga.git + $ python3 -m pip --version -Once you have downloaded the project you can install the library. We recommend to install it inside a `virtual environment`_:: - $ cd opencga/tree/develop/opencga-client/src/main/python/pyOpenCGA - $ python setup.py install +If you don't have Python or pip, please refer to https://packaging.python.org/en/latest/tutorials/installing-packages/ -Pip install -``````````` -Run the following command in the shell:: +To install PyOpencga, run the following command in the shell:: $ pip install pyopencga + Usage ----- @@ -48,14 +42,14 @@ The first step is to import the ClientConfiguration and OpenCGAClient from pyOpe Setting up server host configuration ```````````````````````````````````` -The second step is to generate a ClientConfiguration instance by passing a configuration dictionary containing the host to point to or a client-configuration.yml file: +The second step is to generate a ClientConfiguration instance by passing a configuration dictionary containing the opencga host OR a client-configuration.yml file with that information: .. code-block:: python >>> config = ClientConfiguration('/opt/opencga/conf/client-configuration.yml') >>> config = ClientConfiguration({ "rest": { - "host": "http://bioinfo.hpc.cam.ac.uk/opencga-demo" + "host": "https://demo.app.zettagenomics.com/opencga" } }) @@ -67,33 +61,22 @@ With this configuration you can initialize the OpenCGAClient, and log in: .. code-block:: python >>> oc = OpenCGAClient(config) - >>> oc.login('user') - -For scripting or using Jupyter Notebooks is preferable to load user credentials from an external JSON file. - -Once you are logged in, it is mandatory to use the token of the session to propagate the access of the clients to the host server: - -.. code-block:: python - - >>> token = oc.token - >>> print(token) - eyJhbGciOi... - - >>> oc = OpenCGAClient(configuration=config_dict, token=token) + >>> oc.login(user='user', password='pass', organization='organization') Examples ```````` -The next step is to get an instance of the clients we may want to use: +The first step is to get an instance of the clients we may want to use: .. code-block:: python - >>> projects = oc.projects # Project client - >>> studies = oc.studies # Study client - >>> samples = oc.samples # Sample client - >>> cohorts = oc.cohorts # Cohort client + >>> projects = oc.projects # Project client + >>> studies = oc.studies # Study client + >>> samples = oc.samples # Sample client + >>> individuals = oc.individuals # Individual client + >>> cohorts = oc.cohorts # Cohort client -Now you can start asking to the OpenCGA RESTful service with pyOpenCGA: +Now you can start querying with pyOpenCGA: .. code-block:: python @@ -103,41 +86,38 @@ Now you can start asking to the OpenCGA RESTful service with pyOpenCGA: project2 [...] -There are two different ways to access to the query response data: +There are two different ways to access query response data: .. code-block:: python - >>> foo_client.method().get_results() # Iterates over all the results of all the QueryResults - >>> foo_client.method().get_responses() # Iterates over all the responses + >>> foo_client.method().get_responses() # Iterates over all the responses + >>> foo_client.method().get_results() # Iterates over all the results of the first response -Data can be accessed specifying comma-separated IDs or a list of IDs: +Data can be accessed specifying comma-separated IDs or a list of IDs. -.. code-block:: python +e.g. Retrieving individual karyotypic sex for a list of individuals: - >>> samples = 'NA12877,NA12878,NA12879' - >>> samples_list = ['NA12877','NA12878','NA12879'] - >>> sc = oc.samples +.. code-block:: python - >>> for result in sc.info(query_id=samples, study='user@project1:study1').get_results(): - ... print(result['id'], result['attributes']['OPENCGA_INDIVIDUAL']['disorders']) - NA12877 [{'id': 'OMIM6500', 'name': "Chron's Disease"}] - NA12878 [] - NA12879 [{'id': 'OMIM6500', 'name': "Chron's Disease"}] + >>> for result in oc.samples.info(samples='NA12877,NA12878,NA12889', study='platinum').get_results(): + ... print(result['id'], result['karyotypicSex']) + NA12877 XY + NA12878 XX + NA12889 XY - >>> for result in sc.info(query_id=samples_list, study='user@project1:study1').get_results(): - ... print(result['id'], result['attributes']['OPENCGA_INDIVIDUAL']['disorders']) - NA12877 [{'id': 'OMIM6500', 'name': "Chron's Disease"}] - NA12878 [] - NA12879 [{'id': 'OMIM6500', 'name': "Chron's Disease"}] + >>> for result in oc.samples.info(samples=['NA12877', 'NA12878', 'NA12889'], study='platinum').get_results(): + ... print(result['id'], result['karyotypicSex']) + NA12877 XY + NA12878 XX + NA12889 XY Optional filters and extra options can be added as key-value parameters (where the values can be a comma-separated string or a list). What can I ask for? ``````````````````` -The best way to know which data can be retrieved for each client check `OpenCGA web services`_ swagger. - +The best way to know which data can be retrieved for each client, log into `OpenCGA Demo`_ and check the **OpenCGA REST API** in the **About** section (at the top right corner of the screen). .. _OpenCGA: https://github.com/opencb/opencga .. _OpenCGA Docs: http://docs.opencb.org/display/opencga -.. _virtual environment: https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-virtualenv-with-Python-3 -.. _OpenCGA web services: http://bioinfodev.hpc.cam.ac.uk/opencga/webservices/ +.. _OpenCGA REST API: https://demo.app.zettagenomics.com/ +.. _OpenCGA Demo: https://demo.app.zettagenomics.com/ diff --git a/opencga-client/src/main/python/pyopencga/__init__.py b/opencga-client/src/main/python/pyopencga/__init__.py index d781d658402..e69de29bb2d 100644 --- a/opencga-client/src/main/python/pyopencga/__init__.py +++ b/opencga-client/src/main/python/pyopencga/__init__.py @@ -1,2 +0,0 @@ -"refactoring from from fork pyCGA 7f2e3e404 branch release-1.4.0" -__author__="dev_team@mgviz.org" \ No newline at end of file diff --git a/opencga-client/src/main/python/pyopencga/opencga_client.py b/opencga-client/src/main/python/pyopencga/opencga_client.py index 0d2937ca638..4c5baf4506e 100644 --- a/opencga-client/src/main/python/pyopencga/opencga_client.py +++ b/opencga-client/src/main/python/pyopencga/opencga_client.py @@ -2,11 +2,15 @@ import time import sys import re +if sys.version_info >= (3, 8): + from importlib.metadata import version +else: + from importlib_metadata import version from pyopencga.opencga_config import ClientConfiguration from pyopencga.rest_clients.admin_client import Admin from pyopencga.rest_clients.alignment_client import Alignment -from pyopencga.rest_clients.clinical_client import Clinical +from pyopencga.rest_clients.clinical_analysis_client import ClinicalAnalysis from pyopencga.rest_clients.cohort_client import Cohort from pyopencga.rest_clients.family_client import Family from pyopencga.rest_clients.file_client import File @@ -21,6 +25,7 @@ from pyopencga.rest_clients.variant_operation_client import VariantOperation from pyopencga.rest_clients.user_client import User from pyopencga.rest_clients.variant_client import Variant +from pyopencga.rest_clients.organization_client import Organization class OpencgaClient(object): @@ -50,8 +55,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.logout() def _check_versions(self): + # Getting client and server versions + client_version = version("pyopencga") server_version = self.meta.about().get_result(0)['Version'].split('-')[0] - client_version = re.findall(r'Client version: (.+)\n', str(self.meta.__doc__))[0] + ansi_reset = "\033[0m" ansi_red = "\033[31m" ansi_yellow = "\033[33m" @@ -60,10 +67,12 @@ def _check_versions(self): ' Some client features may not be implemented in the server.\n'.format(client_version, server_version) sys.stdout.write('{}{}{}'.format(ansi_red, msg, ansi_reset)) elif tuple(server_version.split('.')[:2]) > tuple(client_version.split('.')[:2]): - msg = '[INFO]: Client version ({}) is lower than server version ({}).\n'.format(client_version, server_version) + msg = '[INFO]: Client version ({}) is lower than server version ({}).' \ + ' Some client features may not work as intended.\n'.format(client_version, server_version) sys.stdout.write('{}{}{}'.format(ansi_yellow, msg, ansi_reset)) def _create_clients(self): + self.organizations = Organization(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.users = User(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.projects = Project(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.studies = Study(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) @@ -76,7 +85,7 @@ def _create_clients(self): self.disease_panels = DiseasePanel(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.alignments = Alignment(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.variants = Variant(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) - self.clinical = Clinical(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) + self.clinical = ClinicalAnalysis(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.operations = VariantOperation(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.variant_operations = self.operations # DEPRECATED: use 'self.operations' self.meta = Meta(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) @@ -84,7 +93,7 @@ def _create_clients(self): self.admin = Admin(self.configuration, self.token, self._login_handler, auto_refresh=self.auto_refresh) self.clients = [ - self.users, self.projects, self.studies, self.files, self.jobs, + self.organizations, self.users, self.projects, self.studies, self.files, self.jobs, self.samples, self.individuals, self.families, self.cohorts, self.disease_panels, self.alignments, self.variants, self.clinical, self.variant_operations, self.meta, self.ga4gh, self.admin @@ -93,7 +102,7 @@ def _create_clients(self): for client in self.clients: client.on_retry = self.on_retry - def _make_login_handler(self, user, password): + def _make_login_handler(self, user, password, organization): """ Returns a closure that performs the log-in. This will be called on retries if the current session ever expires. @@ -109,13 +118,15 @@ def login_handler(refresh=False): data = {'user': user, 'password': password} else: data = {'user': user, 'password': password} + if organization: + data.update({'organization': organization}) tokens = User(self.configuration).login(data=data).get_result(0) self.token = tokens['token'] self.refresh_token = tokens['refreshToken'] return self.token return login_handler - def login(self, user=None, password=None): + def login(self, user=None, password=None, organization=None): if user is not None: if password is None: password = getpass.getpass() @@ -125,7 +136,7 @@ def login(self, user=None, password=None): except AssertionError: raise ValueError("User and password required") - self._login_handler = self._make_login_handler(user, password) + self._login_handler = self._make_login_handler(user, password, organization) self._login_handler() for client in self.clients: client.token = self.token @@ -174,15 +185,14 @@ def _get_help_info(self, client_name=None, parameters=False): # Description and path class_docstring = client.__doc__ - cls_desc = re.findall('(.+)\n +Client version', class_docstring)[0] - cls_desc = cls_desc.strip().replace('This class contains methods', 'Client') + cls_desc = re.findall('(This class contains methods .+)\n', class_docstring)[0] cls_path = re.findall('PATH: (.+)\n', class_docstring)[0] # Methods methods = [] method_names = [method_name for method_name in dir(client) if callable(getattr(client, method_name)) - and not method_name.startswith('_')] + and not method_name.startswith('_') and method_name != 'login_handler'] for method_name in method_names: if client_name is None: continue @@ -251,6 +261,9 @@ def help(self, client_name=None, show_parameters=False): )] sys.stdout.write('\n'.join(help_txt) + '\n') + def get_organization_client(self): + return self.organizations + def get_user_client(self): return self.users diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py index 4924a3e1233..0374b6d4ecc 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py @@ -33,6 +33,13 @@ def run_bwa(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/bwa', data=data, **options) @@ -50,6 +57,13 @@ def run_coverage_index(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/coverage/index', data=data, **options) @@ -69,6 +83,13 @@ def coverage_qc_gene_coverage_stats_run(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/coverage/qc/geneCoverageStats', data=data, **options) @@ -164,6 +185,13 @@ def run_deeptools(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/deeptools', data=data, **options) @@ -181,6 +209,13 @@ def run_fastqc(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/fastqc', data=data, **options) @@ -198,6 +233,13 @@ def run_index(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/index', data=data, **options) @@ -219,6 +261,13 @@ def run_picard(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/picard', data=data, **options) @@ -241,6 +290,13 @@ def run_qc(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/qc', data=data, **options) @@ -302,6 +358,13 @@ def run_samtools(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='alignment/samtools', data=data, **options) diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py index 74b78914c44..758dc09416c 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py @@ -264,6 +264,13 @@ def run_interpreter_cancer_tiering(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/cancerTiering', data=data, **options) @@ -282,6 +289,13 @@ def run_interpreter_exomiser(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/exomiser', data=data, **options) @@ -300,6 +314,13 @@ def run_interpreter_team(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/team', data=data, **options) @@ -318,6 +339,13 @@ def run_interpreter_tiering(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/tiering', data=data, **options) @@ -336,6 +364,13 @@ def run_interpreter_zetta(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='clinical/interpreter/zetta', data=data, **options) @@ -355,6 +390,13 @@ def load(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='load', subcategory='clinical', data=data, **options) @@ -489,6 +531,13 @@ def run_rga_index(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param bool auxiliar_index: Index auxiliar collection to improve performance assuming RGA is completely indexed. """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py index dff08d5a0f8..8634c983e2e 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py @@ -133,6 +133,13 @@ def import_panels(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param dict data: Panel parameters. """ diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py index f922f15b910..505d21464b2 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py @@ -162,6 +162,13 @@ def fetch(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. """ @@ -204,6 +211,13 @@ def run_link(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='files', resource='run', subcategory='link', data=data, **options) @@ -223,6 +237,13 @@ def run_postlink(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='files', resource='run', subcategory='postlink', data=data, **options) diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py index 459007a179f..c8425b16e6a 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py @@ -106,6 +106,8 @@ def retry(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. """ @@ -249,6 +251,18 @@ def update(self, jobs, data=None, **options): return self._post(category='jobs', resource='update', query_id=jobs, data=data, **options) + def kill(self, job, **options): + """ + Send a signal to kill a pending or running job. + PATH: /{apiVersion}/jobs/{job}/kill + + :param str job: Job ID or UUID. (REQUIRED) + :param str study: Study [[organization@]project:]study where study and + project can be either the ID or UUID. + """ + + return self._post(category='jobs', resource='kill', query_id=job, **options) + def head_log(self, job, **options): """ Show the first lines of a log file (up to a limit). diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py index 57826554192..93e70823d52 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py @@ -330,6 +330,13 @@ def run_templates(self, study, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='studies', resource='run', query_id=study, subcategory='templates', data=data, **options) diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py index f64f0c66e15..3993f48ba22 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py @@ -194,6 +194,13 @@ def run_cohort_stats(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/cohort/stats', data=data, **options) @@ -212,6 +219,13 @@ def run_exomiser(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/exomiser', data=data, **options) @@ -236,6 +250,13 @@ def run_export(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/export', data=data, **options) @@ -279,6 +300,13 @@ def run_family_qc(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/family/qc', data=data, **options) @@ -294,6 +322,13 @@ def delete_file(self, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param str file: Files to remove. @@ -318,6 +353,13 @@ def run_gatk(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/gatk', data=data, **options) @@ -341,6 +383,13 @@ def run_genome_plot(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/genomePlot', data=data, **options) @@ -359,6 +408,13 @@ def run_gwas(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/gwas', data=data, **options) @@ -377,6 +433,13 @@ def run_hr_detect(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/hrDetect', data=data, **options) @@ -395,6 +458,13 @@ def run_index(self, data=None, **options): the job will depend on. :param str job_description: Job description. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/index', data=data, **options) @@ -414,6 +484,13 @@ def run_individual_qc(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/individual/qc', data=data, **options) @@ -432,6 +509,13 @@ def run_inferred_sex(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/inferredSex', data=data, **options) @@ -475,6 +559,13 @@ def run_knockout(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/knockout', data=data, **options) @@ -493,6 +584,13 @@ def run_mendelian_error(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/mendelianError', data=data, **options) @@ -615,6 +713,13 @@ def run_mutational_signature(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/mutationalSignature', data=data, **options) @@ -633,6 +738,13 @@ def run_plink(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/plink', data=data, **options) @@ -857,6 +969,13 @@ def run_relatedness(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/relatedness', data=data, **options) @@ -876,6 +995,13 @@ def run_rvtests(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/rvtests', data=data, **options) @@ -979,6 +1105,13 @@ def run_sample_eligibility(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/sample/eligibility', data=data, **options) @@ -1003,6 +1136,13 @@ def run_sample_qc(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/sample/qc', data=data, **options) @@ -1036,6 +1176,13 @@ def run_sample(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/sample', data=data, **options) @@ -1102,6 +1249,13 @@ def run_sample_stats(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/sample/stats', data=data, **options) @@ -1122,6 +1276,13 @@ def run_stats_export(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/stats/export', data=data, **options) @@ -1140,6 +1301,13 @@ def run_stats(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='analysis', resource='run', subcategory='variant/stats', data=data, **options) diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py index e726e9dd2db..98dfc7d4c25 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py @@ -47,6 +47,13 @@ def aggregate_variant(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant aggregate params. @@ -65,6 +72,13 @@ def delete_variant_annotation(self, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: Project [organization@]project where project can be either the ID or the alias. :param str annotation_id: Annotation identifier. @@ -83,6 +97,13 @@ def index_variant_annotation(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: Project [organization@]project where project can be either the ID or the alias. :param str study: Study [[organization@]project:]study where study and @@ -103,6 +124,13 @@ def save_variant_annotation(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: Project [organization@]project where project can be either the ID or the alias. :param dict data: Variant annotation save params. @@ -136,6 +164,13 @@ def delete_variant(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant delete file params. @@ -155,6 +190,13 @@ def aggregate_variant_family(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant aggregate family params. @@ -173,6 +215,13 @@ def index_variant_family(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant family index params. @@ -191,6 +240,13 @@ def index_variant(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant index params. @@ -210,6 +266,13 @@ def launcher_variant_index(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: . @@ -231,6 +294,13 @@ def run_variant_julie(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: project. """ @@ -247,6 +317,13 @@ def repair_variant_metadata(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param dict data: Variant storage metadata repair params. """ @@ -263,6 +340,13 @@ def synchronize_variant_metadata(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant storage metadata synchronize params. @@ -281,6 +365,13 @@ def prune_variant(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param dict data: Variant prune params. Use dry-run to just generate a report with the orphan variants. """ @@ -298,6 +389,13 @@ def delete_variant_sample(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant delete sample params. @@ -316,6 +414,13 @@ def index_variant_sample(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant sample index params. @@ -347,6 +452,13 @@ def delete_variant_score(self, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param str name: Unique name of the score within the study. @@ -367,6 +479,13 @@ def index_variant_score(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant score index params. scoreName: Unique name @@ -401,6 +520,13 @@ def variant_secondary_annotation_index(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: Project [organization@]project where project can be either the ID or the alias. :param str study: Study [[organization@]project:]study where study and @@ -421,6 +547,13 @@ def variant_secondary_sample_index(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant sample index params. @@ -452,6 +585,13 @@ def secondary_index_variant(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str project: Project [organization@]project where project can be either the ID or the alias. :param str study: Study [[organization@]project:]study where study and @@ -473,6 +613,13 @@ def delete_variant_secondary_index(self, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param str samples: Samples to remove. Needs to provide all the @@ -495,6 +642,13 @@ def delete_variant_stats(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='operation', resource='delete', subcategory='variant/stats', data=data, **options) @@ -514,6 +668,13 @@ def index_variant_stats(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. """ return self._post(category='operation', resource='index', subcategory='variant/stats', data=data, **options) @@ -529,6 +690,13 @@ def delete_variant_study(self, data=None, **options): :param str job_depends_on: Comma separated list of existing job IDs the job will depend on. :param str job_tags: Job tags. + :param str job_scheduled_start_time: Time when the job is scheduled to + start. + :param str job_priority: Priority of the job. + :param bool job_dry_run: Flag indicating that the job will be executed + in dry-run mode. In this mode, OpenCGA will validate that all + parameters and prerequisites are correctly set for successful + execution, but the job will not actually run. :param str study: Study [[organization@]project:]study where study and project can be either the ID or UUID. :param dict data: Variant delete study params. diff --git a/opencga-client/src/main/python/setup.py b/opencga-client/src/main/python/setup.py index 0764eeda3db..6be7c84c577 100644 --- a/opencga-client/src/main/python/setup.py +++ b/opencga-client/src/main/python/setup.py @@ -21,14 +21,13 @@ url='https://github.com/opencb/opencga/tree/develop/opencga-client/src/main/python/pyopencga', packages=['pyopencga', 'pyopencga.rest_clients'], license='Apache Software License', - author='David Gomez-Peregrina, Pablo Marin-Garcia, Daniel Perez-Gil', - author_email='david.gomez@mgviz.org, pmarin@kanteron.com, dp529@cam.ac.uk', + author='Pablo Marin-Garcia, Daniel Perez-Gil', + author_email='pablo.marin@zettagenomics.com, daniel.perez@zettagenomics.com', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Scientific/Engineering :: Bio-Informatics', 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', ], diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/api/FieldConstants.java b/opencga-core/src/main/java/org/opencb/opencga/core/api/FieldConstants.java index 04e1f550f7f..b4269e394c2 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/api/FieldConstants.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/api/FieldConstants.java @@ -339,16 +339,25 @@ public class FieldConstants { + "ERROR, UNKNOWN, REGISTERING, UNREGISTERED, ABORTED, DELETED."; public static final String JOB_INTERNAL_EVENTS_DESCRIPTION = "Events of the internal job."; public static final String JOB_INTERNAL_WEBHOOK_DESCRIPTION = "Job internal Webhook."; + public static final String JOB_INTERNAL_KILL_JOB_REQUESTED_DESCRIPTION = "Flag used to track whether a user has requested to" + + " terminate the execution of a job before its natural completion. When set to true, it indicates that a request has been" + + " made to prematurely terminate the ongoing job execution. Its value is typically checked periodically during the" + + " execution of the job to determine if termination is necessary."; //JobInternalWebhook public static final String JOB_INTERNAL_WEBHOOK_URL_DESCRIPTION = "Webhook URL."; public static final String JOB_INTERNAL_WEBHOOK_STATUS_DESCRIPTION = "Webhook status map can have the values SUCCESS or ERROR."; + public static final String JOB_PARENT_ID = "jobParentId"; + public static final String JOB_SCHEDULED_START_TIME = "jobScheduledStartTime"; + public static final String JOB_OUT_DIR_DESCRIPTION = "Output dir for the job."; public static final String JOB_INPUT_DESCRIPTION = "List of input files."; public static final String JOB_OUTPUT_DESCRIPTION = "List of output files."; public static final String JOB_TAGS_DESCRIPTION = "List of tags for the job."; public static final String JOB_DEPENDS_ON_DESCRIPTION = "List of jobs the current job depends on."; + public static final String JOB_PARENT_ID_DESCRIPTION = "Id of the job that generated this job (if any)"; + public static final String JOB_SCHEDULED_START_TIME_DESCRIPTION = "Time when the job is scheduled to start."; public static final String JOB_EXECUTION_DESCRIPTION = "Result of the execution."; //ExecutorInfo diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java index 4a0a279af55..a6929d12d79 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/api/ParamConstants.java @@ -80,8 +80,8 @@ public class ParamConstants { private static final String UP_TO_100 = " up to a maximum of 100"; public static final String CELLBASE_URL = "https://ws.zettagenomics.com/cellbase"; - public static final String CELLBASE_VERSION = "v5.2"; - public static final String CELLBASE_DATA_RELEASE = "3"; + public static final String CELLBASE_VERSION = "v5.8"; + public static final String CELLBASE_DATA_RELEASE = "7"; public static final String CELLBASE_APIKEY = ""; public static final String POP_FREQ_1000G_CB_V4 = "1kG_phase3"; @@ -560,6 +560,7 @@ public class ParamConstants { public static final String JOB_USER_PARAM = "userId"; public static final String JOB_USER_DESCRIPTION = "User that created the job"; public static final String JOB_PRIORITY_PARAM = "priority"; + public static final String SUBMIT_JOB_PRIORITY_PARAM = "jobPriority"; public static final String JOB_PRIORITY_DESCRIPTION = "Priority of the job"; public static final String JOB_INTERNAL_STATUS_PARAM = INTERNAL_STATUS_PARAM; public static final String JOB_INTERNAL_STATUS_DESCRIPTION = INTERNAL_STATUS_DESCRIPTION; @@ -570,6 +571,12 @@ public class ParamConstants { public static final String JOB_TAGS = "jobTags"; public static final String JOB_TAGS_PARAM = "tags"; public static final String JOB_TAGS_DESCRIPTION = "Job tags"; + public static final String JOB_SCHEDULED_START_TIME_DESCRIPTION = FieldConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION; + public static final String JOB_SCHEDULED_START_TIME = FieldConstants.JOB_SCHEDULED_START_TIME; + public static final String JOB_DRY_RUN = "jobDryRun"; + public static final String JOB_DRY_RUN_DESCRIPTION = "Flag indicating that the job will be executed in dry-run mode. In this mode," + + " OpenCGA will validate that all parameters and prerequisites are correctly set for successful execution, but the job will" + + " not actually run."; // --------------------------------------------- public static final String JOB_INPUT_FILES_PARAM = "input"; diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/config/storage/CellBaseConfiguration.java b/opencga-core/src/main/java/org/opencb/opencga/core/config/storage/CellBaseConfiguration.java index 2ef6a77cca4..101a822562c 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/config/storage/CellBaseConfiguration.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/config/storage/CellBaseConfiguration.java @@ -46,7 +46,8 @@ public class CellBaseConfiguration { private String apiKey; public CellBaseConfiguration() { - this(ParamConstants.CELLBASE_URL, ParamConstants.CELLBASE_VERSION); + this(ParamConstants.CELLBASE_URL, ParamConstants.CELLBASE_VERSION, ParamConstants.CELLBASE_DATA_RELEASE, + ParamConstants.CELLBASE_APIKEY); } public CellBaseConfiguration(String url, String version) { diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/audit/AuditRecord.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/audit/AuditRecord.java index 312e1f32e87..f8ba4b924bc 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/audit/AuditRecord.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/audit/AuditRecord.java @@ -275,6 +275,11 @@ public Status(Result name, Error error) { this.error = error; } + public Status(Result name, Throwable exception) { + this.name = name; + this.error = new Error(0, exception.getClass().getSimpleName(), exception.getMessage()); + } + public enum Result { SUCCESS, ERROR diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/common/Enums.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/common/Enums.java index 10b270b92c0..2777222715b 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/common/Enums.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/common/Enums.java @@ -250,6 +250,7 @@ public enum Action { MOVE_AND_REGISTER, VISIT, + KILL_JOB, IMPORT, diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/Job.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/Job.java index be3952b1e28..802f5967f2f 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/Job.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/Job.java @@ -19,6 +19,7 @@ import org.opencb.commons.annotations.DataClass; import org.opencb.commons.annotations.DataField; import org.opencb.opencga.core.api.FieldConstants; +import org.opencb.opencga.core.api.ParamConstants; import org.opencb.opencga.core.models.PrivateStudyUid; import org.opencb.opencga.core.models.common.Enums; import org.opencb.opencga.core.models.file.File; @@ -73,7 +74,6 @@ public class Job extends PrivateStudyUid { description = FieldConstants.JOB_COMMAND_LINE) private String commandLine; - @DataField(id = "params", indexed = true, description = FieldConstants.JOB_PARAMS) private Map params; @@ -129,6 +129,17 @@ public class Job extends PrivateStudyUid { description = FieldConstants.JOB_DEPENDS_ON_DESCRIPTION) private List dependsOn; + @DataField(id = FieldConstants.JOB_PARENT_ID, indexed = false, since = "3.2.0", + description = FieldConstants.JOB_PARENT_ID_DESCRIPTION) + private String parentId; + + @DataField(id = FieldConstants.JOB_SCHEDULED_START_TIME, indexed = false, since = "3.2.0", + description = FieldConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) + private String scheduledStartTime; + + @DataField(id = ParamConstants.JOB_DRY_RUN, since = "3.2.0", description = ParamConstants.JOB_DRY_RUN_DESCRIPTION) + private boolean dryRun; + @DataField(id = "execution", indexed = true, description = FieldConstants.JOB_EXECUTION_DESCRIPTION) private ExecutionResult execution; @@ -168,8 +179,9 @@ public Job() { public Job(String id, String uuid, String description, ToolInfo tool, String userId, String commandLine, Map params, String creationDate, String modificationDate, Enums.Priority priority, JobInternal internal, File outDir, - List input, List output, List dependsOn, List tags, ExecutionResult execution, boolean visited, - File stdout, File stderr, int release, JobStudyParam study, Map attributes) { + List input, List output, List dependsOn, String parentId, String scheduledStartTime, boolean dryRun, + List tags, ExecutionResult execution, boolean visited, File stdout, File stderr, int release, JobStudyParam study, + Map attributes) { this.id = id; this.uuid = uuid; this.tool = tool; @@ -185,6 +197,9 @@ public Job(String id, String uuid, String description, ToolInfo tool, String use this.input = input; this.output = output; this.dependsOn = dependsOn; + this.parentId = parentId; + this.scheduledStartTime = scheduledStartTime; + this.dryRun = dryRun; this.tags = tags; this.execution = execution; this.visited = visited; @@ -214,6 +229,9 @@ public String toString() { sb.append(", output=").append(output); sb.append(", tags=").append(tags); sb.append(", dependsOn=").append(dependsOn); + sb.append(", parentId='").append(parentId).append('\''); + sb.append(", scheduledStartTime='").append(scheduledStartTime).append('\''); + sb.append(", dryRun=").append(dryRun); sb.append(", execution=").append(execution); sb.append(", stdout=").append(stdout); sb.append(", stderr=").append(stderr); @@ -375,6 +393,33 @@ public Job setDependsOn(List dependsOn) { return this; } + public String getParentId() { + return parentId; + } + + public Job setParentId(String parentId) { + this.parentId = parentId; + return this; + } + + public String getScheduledStartTime() { + return scheduledStartTime; + } + + public Job setScheduledStartTime(String scheduledStartTime) { + this.scheduledStartTime = scheduledStartTime; + return this; + } + + public boolean isDryRun() { + return dryRun; + } + + public Job setDryRun(boolean dryRun) { + this.dryRun = dryRun; + return this; + } + public List getTags() { return tags; } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobCreateParams.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobCreateParams.java index 278acfed94c..68382ca25c9 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobCreateParams.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobCreateParams.java @@ -271,9 +271,11 @@ public JobCreateParams setAttributes(Map attributes) { public Job toJob() { return new Job(id, null, description, tool, null, commandLine, params, creationDate, null, priority, internal != null ? new org.opencb.opencga.core.models.job.JobInternal(internal.getStatus()) : null, - outDir != null ? outDir.toFile() : null, getInput().stream().map(TinyFile::toFile).collect(Collectors.toList()), - getOutput().stream().map(TinyFile::toFile).collect(Collectors.toList()), Collections.emptyList(), - tags, result, false, stdout != null ? stdout.toFile() : null, stderr != null ? stderr.toFile() : null, 1, null, attributes); + outDir != null ? outDir.toFile() : null, + getInput() != null ? getInput().stream().map(TinyFile::toFile).collect(Collectors.toList()) : Collections.emptyList(), + getOutput() != null ? getOutput().stream().map(TinyFile::toFile).collect(Collectors.toList()) : Collections.emptyList(), + Collections.emptyList(), null, null, false, tags, result, false, stdout != null ? stdout.toFile() : null, + stderr != null ? stderr.toFile() : null, 1, null, attributes); } public static class JobInternal { diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobInternal.java b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobInternal.java index 6bb8d08cdea..123dc8bf70e 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobInternal.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/models/job/JobInternal.java @@ -42,23 +42,34 @@ public class JobInternal extends Internal implements Cloneable { description = FieldConstants.JOB_INTERNAL_EVENTS_DESCRIPTION) private List events; + @DataField(id = "killJobRequested", indexed = false, since = "3.2.0", + description = FieldConstants.JOB_INTERNAL_KILL_JOB_REQUESTED_DESCRIPTION) + private boolean killJobRequested; + public JobInternal() { } public JobInternal(Enums.ExecutionStatus status) { - this(null, null, status, null, null); + this(null, null, status, null, null, false); } + @Deprecated public JobInternal(String registrationDate, String modificationDate, Enums.ExecutionStatus status, JobInternalWebhook webhook, List events) { + this(registrationDate, modificationDate, status, webhook, events, false); + } + + public JobInternal(String registrationDate, String modificationDate, Enums.ExecutionStatus status, JobInternalWebhook webhook, + List events, boolean killJobRequested) { super(null, registrationDate, modificationDate); this.status = status; this.webhook = webhook; this.events = events; + this.killJobRequested = killJobRequested; } public static JobInternal init() { - return new JobInternal(TimeUtils.getTime(), TimeUtils.getTime(), new Enums.ExecutionStatus(), null, new ArrayList<>()); + return new JobInternal(TimeUtils.getTime(), TimeUtils.getTime(), new Enums.ExecutionStatus(), null, new ArrayList<>(), false); } @Override @@ -69,13 +80,14 @@ public String toString() { sb.append(", status=").append(status); sb.append(", webhook=").append(webhook); sb.append(", events=").append(events); + sb.append(", killJobRequested=").append(killJobRequested); sb.append('}'); return sb.toString(); } @Override public JobInternal clone() throws CloneNotSupportedException { - return new JobInternal(registrationDate, lastModified, status, webhook.clone(), new LinkedList<>(events)); + return new JobInternal(registrationDate, lastModified, status, webhook.clone(), new LinkedList<>(events), killJobRequested); } public Enums.ExecutionStatus getStatus() { @@ -122,4 +134,13 @@ public JobInternal setLastModified(String lastModified) { this.lastModified = lastModified; return this; } + + public boolean isKillJobRequested() { + return killJobRequested; + } + + public JobInternal setKillJobRequested(boolean killJobRequested) { + this.killJobRequested = killJobRequested; + return this; + } } diff --git a/opencga-core/src/main/java/org/opencb/opencga/core/tools/annotations/Tool.java b/opencga-core/src/main/java/org/opencb/opencga/core/tools/annotations/Tool.java index ddbfa70636a..3bf38d51053 100644 --- a/opencga-core/src/main/java/org/opencb/opencga/core/tools/annotations/Tool.java +++ b/opencga-core/src/main/java/org/opencb/opencga/core/tools/annotations/Tool.java @@ -52,6 +52,11 @@ */ String description() default ""; + /** + * @return Tool priority. + */ + Enums.Priority priority() default Enums.Priority.MEDIUM; + enum Type { OPERATION, ANALYSIS; diff --git a/opencga-core/src/main/resources/configuration.yml b/opencga-core/src/main/resources/configuration.yml index 72b49efe3f9..2b60051181d 100644 --- a/opencga-core/src/main/resources/configuration.yml +++ b/opencga-core/src/main/resources/configuration.yml @@ -146,6 +146,8 @@ analysis: ## Kubernetes executor configuration example # k8s.masterUrl: "https://192.168.99.100:8443/" k8s.clientTimeout: 30000 # ms + k8s.terminationGracePeriodSeconds: 300 # s + k8s.logToStdout: true k8s.imageName: "opencb/opencga-base:${project.parent.version}-hdp3.1" k8s.imagePullPolicy: "IfNotPresent" # k8s.imagePullSecrets: diff --git a/opencga-master/pom.xml b/opencga-master/pom.xml index 2348ef6f6f7..1369ec8c232 100644 --- a/opencga-master/pom.xml +++ b/opencga-master/pom.xml @@ -62,6 +62,11 @@ org.opencb.opencga opencga-catalog + + org.opencb.opencga + opencga-storage-core + test + org.eclipse.jetty @@ -71,6 +76,11 @@ org.eclipse.jetty jetty-servlet + + org.mortbay.jetty + servlet-api + test + com.microsoft.azure @@ -133,6 +143,18 @@ io.fabric8 kubernetes-model + + io.fabric8 + kubernetes-model-core + + + io.fabric8 + kubernetes-client-api + + + io.fabric8 + kubernetes-model-batch + commons-codec commons-codec diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/AuthorizationDaemon.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/AuthorizationDaemon.java index f97c0b02957..c4c2ab43ae5 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/AuthorizationDaemon.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/AuthorizationDaemon.java @@ -21,7 +21,7 @@ import org.opencb.opencga.catalog.exceptions.CatalogDBException; import org.opencb.opencga.catalog.managers.CatalogManager; -public class AuthorizationDaemon extends MonitorParentDaemon { +public abstract class AuthorizationDaemon extends MonitorParentDaemon { private final String INTERNAL_DELIMITER = "__"; diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemon.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemon.java index cadc1ef4ca7..5956eb68e65 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemon.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemon.java @@ -83,6 +83,7 @@ import org.opencb.opencga.catalog.managers.FileManager; import org.opencb.opencga.catalog.managers.JobManager; import org.opencb.opencga.catalog.managers.StudyManager; +import org.opencb.opencga.catalog.utils.CatalogFqn; import org.opencb.opencga.catalog.utils.Constants; import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.api.ParamConstants; @@ -105,6 +106,7 @@ import org.opencb.opencga.core.tools.result.ExecutionResultManager; import org.opencb.opencga.core.tools.result.Status; import org.opencb.opencga.master.monitor.models.PrivateJobUpdateParams; +import org.opencb.opencga.master.monitor.schedulers.JobScheduler; import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; @@ -112,6 +114,7 @@ import javax.ws.rs.client.Entity; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.io.Closeable; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -134,22 +137,20 @@ /** * Created by imedina on 16/06/16. */ -public class ExecutionDaemon extends MonitorParentDaemon { +public class ExecutionDaemon extends MonitorParentDaemon implements Closeable { public static final String OUTDIR_PARAM = "outdir"; public static final int EXECUTION_RESULT_FILE_EXPIRATION_SECONDS = (int) TimeUnit.MINUTES.toSeconds(10); public static final String REDACTED_TOKEN = "xxxxxxxxxxxxxxxxxxxxx"; private final StorageConfiguration storageConfiguration; - private String internalCli; - private JobManager jobManager; - private FileManager fileManager; + private final String internalCli; + private final JobManager jobManager; + private final FileManager fileManager; private final Map jobsCountByType = new HashMap<>(); private final Map retainedLogsTime = new HashMap<>(); private List packages; - private Path defaultJobDir; - private static final Map TOOL_CLI_MAP; // Maximum number of jobs of each type (Pending, queued, running) that will be handled on each iteration. @@ -157,13 +158,14 @@ public class ExecutionDaemon extends MonitorParentDaemon { // On first iteration, it will queue 50 out of the 100 pending jobs. It will check up to 50 queue-running changes out of the 65 // (15 + 50 from pending), and it will check up to 50 finished jobs from the running ones. // On second iteration, it will queue the remaining 50 pending jobs, and so on... - private static final int NUM_JOBS_HANDLED = 50; + private static final int MAX_NUM_JOBS = 50; private final Query pendingJobsQuery; private final Query queuedJobsQuery; private final Query runningJobsQuery; private final QueryOptions queryOptions; private final ExecutorService executor = Executors.newSingleThreadExecutor(); + private final JobScheduler jobScheduler; static { TOOL_CLI_MAP = new HashMap() {{ @@ -257,16 +259,17 @@ public ExecutionDaemon(int interval, String token, CatalogManager catalogManager this.storageConfiguration = storageConfiguration; this.internalCli = appHome + "/bin/opencga-internal.sh"; - this.defaultJobDir = Paths.get(catalogManager.getConfiguration().getJobDir()); - pendingJobsQuery = new Query(JobDBAdaptor.QueryParams.INTERNAL_STATUS_ID.key(), Enums.ExecutionStatus.PENDING); queuedJobsQuery = new Query(JobDBAdaptor.QueryParams.INTERNAL_STATUS_ID.key(), Enums.ExecutionStatus.QUEUED); runningJobsQuery = new Query(JobDBAdaptor.QueryParams.INTERNAL_STATUS_ID.key(), Enums.ExecutionStatus.RUNNING); // Sort jobs by priority and creation date queryOptions = new QueryOptions() - .append(QueryOptions.SORT, Arrays.asList(JobDBAdaptor.QueryParams.PRIORITY.key(), - JobDBAdaptor.QueryParams.CREATION_DATE.key())) - .append(QueryOptions.ORDER, QueryOptions.ASCENDING); + .append(QueryOptions.SORT, + Arrays.asList(JobDBAdaptor.QueryParams.PRIORITY.key(), JobDBAdaptor.QueryParams.CREATION_DATE.key())) + .append(QueryOptions.ORDER, QueryOptions.ASCENDING) + .append(QueryOptions.LIMIT, MAX_NUM_JOBS); + + this.jobScheduler = new JobScheduler(catalogManager, token); if (CollectionUtils.isEmpty(packages)) { this.packages = Collections.singletonList(ToolFactory.DEFAULT_PACKAGE); @@ -277,22 +280,13 @@ public ExecutionDaemon(int interval, String token, CatalogManager catalogManager } @Override - public void run() { - while (!exit) { - try { - Thread.sleep(interval); - } catch (InterruptedException e) { - if (!exit) { - e.printStackTrace(); - } - } + public void apply() throws Exception { + checkJobs(); + } - try { - checkJobs(); - } catch (Exception e) { - logger.error("Catch exception " + e.getMessage(), e); - } - } + @Override + public void close() throws IOException { + batchExecutor.close(); try { logger.info("Attempt to shutdown webhook executor"); @@ -311,6 +305,20 @@ public void run() { protected void checkJobs() throws CatalogException { List organizationIds = catalogManager.getAdminManager().getOrganizationIds(token); + + /* + RUNNING JOBS + */ + checkRunningJobs(organizationIds); + + /* + QUEUED JOBS + */ + checkQueuedJobs(organizationIds); + + long totalPendingJobs = 0; + long totalQueuedJobs = 0; + long totalRunningJobs = 0; for (String organizationId : organizationIds) { long pendingJobs = -1; long queuedJobs = -1; @@ -324,29 +332,22 @@ protected void checkJobs() throws CatalogException { } logger.info("----- EXECUTION DAEMON ----- Organization={} --> pending={}, queued={}, running={}", organizationId, pendingJobs, queuedJobs, runningJobs); + totalPendingJobs += pendingJobs; + totalQueuedJobs += queuedJobs; + totalRunningJobs += runningJobs; } - /* - PENDING JOBS - */ - checkPendingJobs(organizationIds); - - /* - QUEUED JOBS - */ - checkQueuedJobs(organizationIds); - - /* - RUNNING JOBS - */ - checkRunningJobs(organizationIds); + if (totalQueuedJobs == 0) { + // Check PENDING jobs + checkPendingJobs(organizationIds); + } } protected void checkRunningJobs(List organizationIds) { for (String organizationId : organizationIds) { int handledRunningJobs = 0; try (DBIterator iterator = jobManager.iteratorInOrganization(organizationId, runningJobsQuery, queryOptions, token)) { - while (handledRunningJobs < NUM_JOBS_HANDLED && iterator.hasNext()) { + while (handledRunningJobs < MAX_NUM_JOBS && iterator.hasNext()) { try { Job job = iterator.next(); handledRunningJobs += checkRunningJob(job); @@ -363,6 +364,23 @@ protected void checkRunningJobs(List organizationIds) { protected int checkRunningJob(Job job) { Enums.ExecutionStatus jobStatus = getCurrentStatus(job); + if (killSignalSent(job)) { + logger.info("[{}] - Kill signal request received for job with status='{}'. Attempting to abort execution.", job.getId(), + job.getInternal().getStatus().getId()); + try { + if (batchExecutor.kill(job.getId())) { + return abortKillJob(job, "Job was already in execution. Job killed by the user."); + } else { + logger.info("[{}] - Kill signal send. Waiting for job to finish.", job.getId()); + return 0; + } + } catch (Exception e) { + // Skip this job. Will be retried next loop iteration + logger.error("[{}] - Error trying to kill the job: {}", job.getId(), e.getMessage(), e); + return 0; + } + } + switch (jobStatus.getId()) { case Enums.ExecutionStatus.RUNNING: ExecutionResult result = readExecutionResult(job); @@ -405,7 +423,7 @@ protected void checkQueuedJobs(List organizationIds) { for (String organizationId : organizationIds) { int handledQueuedJobs = 0; try (DBIterator iterator = jobManager.iteratorInOrganization(organizationId, queuedJobsQuery, queryOptions, token)) { - while (handledQueuedJobs < NUM_JOBS_HANDLED && iterator.hasNext()) { + while (handledQueuedJobs < MAX_NUM_JOBS && iterator.hasNext()) { try { Job job = iterator.next(); handledQueuedJobs += checkQueuedJob(job); @@ -428,6 +446,24 @@ protected void checkQueuedJobs(List organizationIds) { protected int checkQueuedJob(Job job) { Enums.ExecutionStatus status = getCurrentStatus(job); + // If the job is already running, let the running-jobs step check it + if (killSignalSent(job) && !status.getId().equals(Enums.ExecutionStatus.RUNNING)) { + logger.info("[{}] - Kill signal request received for job with status='{}'. Attempting to avoid execution.", job.getId(), + job.getInternal().getStatus().getId()); + try { + if (batchExecutor.kill(job.getId())) { + return abortKillJob(job, "Job was already queued. Job killed by the user."); + } else { + logger.info("[{}] - Kill signal send. Waiting for job to finish.", job.getId()); + return 0; + } + } catch (Exception e) { + logger.error("[{}] - Error trying to kill the job: {}", job.getId(), e.getMessage(), e); + // Skip this job. Will be retried next loop iteration + return 0; + } + } + switch (status.getId()) { case Enums.ExecutionStatus.QUEUED: // Job is still queued @@ -459,17 +495,36 @@ protected void checkPendingJobs(List organizationIds) { // Clear job counts each cycle jobsCountByType.clear(); + // If there are no queued jobs, we can queue new jobs + List pendingJobs = new LinkedList<>(); + List runningJobs = new LinkedList<>(); + for (String organizationId : organizationIds) { - int handledPendingJobs = 0; try (DBIterator iterator = jobManager.iteratorInOrganization(organizationId, pendingJobsQuery, queryOptions, token)) { - while (handledPendingJobs < NUM_JOBS_HANDLED && iterator.hasNext()) { - try { - Job job = iterator.next(); - handledPendingJobs += checkPendingJob(organizationId, job); - } catch (Exception e) { - logger.error("{}", e.getMessage(), e); - } + while (iterator.hasNext()) { + pendingJobs.add(iterator.next()); + } + } catch (Exception e) { + logger.error("Error listing pending jobs from organization {}", organizationId, e); + return; + } + + try (DBIterator iterator = jobManager.iteratorInOrganization(organizationId, runningJobsQuery, queryOptions, token)) { + while (iterator.hasNext()) { + runningJobs.add(iterator.next()); } + } catch (Exception e) { + logger.error("Error listing running jobs from organization {}", organizationId, e); + return; + } + } + + Iterator iterator = jobScheduler.schedule(pendingJobs, Collections.emptyList(), runningJobs); + boolean success = false; + while (iterator.hasNext() && !success) { + Job job = iterator.next(); + try { + success = checkPendingJob(job) > 0; } catch (Exception e) { logger.error("{}", e.getMessage(), e); } @@ -479,19 +534,26 @@ protected void checkPendingJobs(List organizationIds) { /** * Check everything is correct and queues the job. * - * @param organizationId Organization id. * @param job Job object. * @return 1 if the job has changed the status, 0 otherwise. */ - protected int checkPendingJob(String organizationId, Job job) { + protected int checkPendingJob(Job job) { if (StringUtils.isEmpty(job.getStudy().getId())) { - return abortJob(job, "Missing mandatory 'studyUuid' field"); + return abortJob(job, "Missing mandatory 'study' field"); } + CatalogFqn catalogFqn = CatalogFqn.extractFqnFromStudyFqn(job.getStudy().getId()); + String organizationId = catalogFqn.getOrganizationId(); if (StringUtils.isEmpty(job.getTool().getId())) { return abortJob(job, "Tool id '" + job.getTool().getId() + "' not found."); } + if (killSignalSent(job)) { + logger.info("[{}] - Kill signal request received for job with status='{}'. Job did not start the execution.", job.getId(), + job.getInternal().getStatus().getId()); + return abortJob(job, "Job killed by the user."); + } + if (!canBeQueued(organizationId, job)) { return 0; } @@ -606,6 +668,10 @@ protected int checkPendingJob(String organizationId, Job job) { return 1; } + private boolean killSignalSent(Job job) { + return job.getInternal().isKillJobRequested(); + } + protected void checkToolExecutionPermission(String organizationId, Job job) throws Exception { Tool tool = new ToolFactory().getTool(job.getTool().getId(), packages); @@ -755,12 +821,6 @@ private File getValidDefaultOutDir(String organizationId, Job job) throws Catalo try { catalogManager.getIoManagerFactory().get(folder.getUri()).createDirectory(folder.getUri(), true); } catch (CatalogIOException | IOException e) { - // Submit job to delete job folder - ObjectMap params = new ObjectMap() - .append("files", folder.getUuid()) - .append("study", job.getStudy().getId()) - .append(Constants.SKIP_TRASH, true); - jobManager.submit(job.getStudy().getId(), FileDeleteTask.ID, Enums.Priority.LOW, params, token); throw new CatalogException("Cannot create job directory '" + folder.getUri() + "' for path '" + folder.getPath() + "'"); } @@ -787,13 +847,14 @@ private File getValidDefaultOutDir(String organizationId, Job job) throws Catalo public static String buildCli(String internalCli, Job job) { String toolId = job.getTool().getId(); String internalCommand = TOOL_CLI_MAP.get(toolId); - if (StringUtils.isEmpty(internalCommand)) { + if (StringUtils.isEmpty(internalCommand) || job.isDryRun()) { ObjectMap params = new ObjectMap() .append(JOB_PARAM, job.getId()) .append(STUDY_PARAM, job.getStudy().getId()); return buildCli(internalCli, "tools execute-job", params); } else { - return buildCli(internalCli, internalCommand, job.getParams()); + ObjectMap params = new ObjectMap(job.getParams()); + return buildCli(internalCli, internalCommand, params); } } @@ -874,6 +935,14 @@ private boolean canBeQueued(String organizationId, Job job) { return false; } + if (StringUtils.isNotEmpty(job.getScheduledStartTime())) { + Date date = TimeUtils.toDate(job.getScheduledStartTime()); + if (date.after(new Date())) { + logger.debug("Job '{}' can't be queued yet. It is scheduled to start at '{}'.", job.getId(), job.getScheduledStartTime()); + return false; + } + } + Integer maxJobs = catalogManager.getConfiguration().getAnalysis().getExecution().getMaxConcurrentJobs().get(job.getTool().getId()); if (maxJobs == null) { // No limit for this tool @@ -926,10 +995,15 @@ private int abortJob(Job job, String message, Exception e) { } private int abortJob(Job job, String description) { - logger.info("Aborting job: {} - Reason: '{}'", job.getId(), description); + logger.info("[{}] - Aborting job - Reason: '{}'", job.getId(), description); return setStatus(job, new Enums.ExecutionStatus(Enums.ExecutionStatus.ABORTED, description)); } + private int abortKillJob(Job job, String description) { + logger.info("[{}] -Aborting job - Reason: '{}'", job.getId(), description); + return processFinishedJob(job, new Enums.ExecutionStatus(Enums.ExecutionStatus.ABORTED, description)); + } + private int setStatus(Job job, Enums.ExecutionStatus status) { PrivateJobUpdateParams updateParams = new PrivateJobUpdateParams().setInternal(new JobInternal(status)); @@ -989,7 +1063,9 @@ private int processFinishedJob(Job job, Enums.ExecutionStatus status) { logger.info("[{}] - Registering job results from '{}'", job.getId(), Paths.get(job.getOutDir().getUri())); ExecutionResult execution = readExecutionResult(job); - if (execution != null) { + if (execution == null) { + logger.warn("[{}] - Execution result not found", job.getId()); + } else { if (execution.getEnd() == null) { // This could happen if the job finished abruptly logger.info("[{}] Missing end date at ExecutionResult", job.getId()); @@ -1058,29 +1134,35 @@ private int processFinishedJob(Job job, Enums.ExecutionStatus status) { updateParams.setInternal(new JobInternal()); // Check status of analysis result or if there are files that could not be moved to outdir to decide the final result - if (execution == null) { - updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.ERROR, - "Job could not finish successfully. Missing execution result")); - } else if (execution.getStatus().getName().equals(Status.Type.ERROR)) { - updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.ERROR, - "Job could not finish successfully")); - } else { - switch (status.getId()) { - case Enums.ExecutionStatus.DONE: - case Enums.ExecutionStatus.READY: - updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.DONE)); - break; - case Enums.ExecutionStatus.ABORTED: - updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.ERROR, "Job aborted!")); - break; - case Enums.ExecutionStatus.ERROR: - default: + switch (status.getId()) { + case Enums.ExecutionStatus.DONE: + case Enums.ExecutionStatus.READY: + if (execution == null) { + // Regardless of the status, without execution result, we will set the status to ERROR updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.ERROR, - "Job could not finish successfully")); - break; - } + "Job could not finish successfully. Missing execution result")); + } else if (execution.getStatus().getName() == Status.Type.ERROR) { + // Discrepancy between the status in the execution result and the status of the job + status.setDescription("Job could not finish successfully." + + " Execution result status: " + execution.getStatus().getName()); + updateParams.getInternal().setStatus(status); + } else { + updateParams.getInternal().setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.DONE)); + } + break; + case Enums.ExecutionStatus.ABORTED: + updateParams.getInternal().setStatus(status); + break; + case Enums.ExecutionStatus.ERROR: + default: + if (StringUtils.isEmpty(status.getDescription())) { + status.setDescription("Job could not finish successfully"); + } + updateParams.getInternal().setStatus(status); + break; } + logger.info("[{}] - Updating job information", job.getId()); // We update the job information try { @@ -1135,7 +1217,7 @@ private void notifyStatusChange(Job job) { } private void sendWebhookNotification(Job job, URL url) throws URISyntaxException, CatalogException, CloneNotSupportedException { - JobInternal jobInternal = new JobInternal(null, null, null, job.getInternal().getWebhook().clone(), null); + JobInternal jobInternal = new JobInternal(null, null, null, job.getInternal().getWebhook().clone(), null, false); PrivateJobUpdateParams updateParams = new PrivateJobUpdateParams() .setInternal(jobInternal); diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/MonitorParentDaemon.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/MonitorParentDaemon.java index 62f98afa91f..393cb2afdd6 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/MonitorParentDaemon.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/daemons/MonitorParentDaemon.java @@ -16,41 +16,34 @@ package org.opencb.opencga.master.monitor.daemons; -import org.opencb.opencga.catalog.db.DBAdaptorFactory; -import org.opencb.opencga.catalog.db.mongodb.MongoDBAdaptorFactory; -import org.opencb.opencga.catalog.exceptions.CatalogDBException; import org.opencb.opencga.catalog.managers.CatalogManager; import org.opencb.opencga.master.monitor.executors.BatchExecutor; import org.opencb.opencga.master.monitor.executors.ExecutorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.nio.file.Path; +import java.io.Closeable; +import java.io.IOException; /** * Created by imedina on 16/06/16. */ -public abstract class MonitorParentDaemon implements Runnable { +public abstract class MonitorParentDaemon implements Runnable, Closeable { - protected int interval; - protected CatalogManager catalogManager; - // FIXME: This should not be used directly! All the queries MUST go through the CatalogManager - @Deprecated - protected DBAdaptorFactory dbAdaptorFactory; + protected final int interval; + protected final CatalogManager catalogManager; protected BatchExecutor batchExecutor; - protected boolean exit = false; + private volatile boolean exit = false; - protected String token; + protected final String token; + protected final Logger logger; - protected Logger logger; - - public MonitorParentDaemon(int interval, String token, CatalogManager catalogManager) throws CatalogDBException { + public MonitorParentDaemon(int interval, String token, CatalogManager catalogManager) { this.interval = interval; this.catalogManager = catalogManager; this.token = token; logger = LoggerFactory.getLogger(this.getClass()); - dbAdaptorFactory = new MongoDBAdaptorFactory(catalogManager.getConfiguration(), catalogManager.getIoManagerFactory()); ExecutorFactory executorFactory = new ExecutorFactory(catalogManager.getConfiguration()); this.batchExecutor = executorFactory.getExecutor(); } @@ -63,16 +56,42 @@ public void setExit(boolean exit) { this.exit = exit; } - static Path getJobTemporaryFolder(long jobId, Path tempJobFolder) { - return tempJobFolder.resolve(getJobTemporaryFolderName(jobId)); - } + public void run() { + try { + init(); + } catch (Exception e) { + logger.error("Error initializing daemon", e); + throw new RuntimeException(e); + } + + while (!exit) { + try { + Thread.sleep(interval); + } catch (InterruptedException e) { + if (!exit) { + logger.warn("Interrupted while sleeping", e); + } + // If interrupted, stop the daemon + break; + } - static String getJobTemporaryFolderName(long jobId) { - return "J_" + jobId; + try { + apply(); + } catch (Exception e) { + logger.error("Catch exception " + e.getMessage(), e); + } + } + + try { + close(); + } catch (IOException e) { + logger.error("Error closing daemon", e); + } } - public MonitorParentDaemon setBatchExecutor(BatchExecutor batchExecutor) { - this.batchExecutor = batchExecutor; - return this; + public void init() throws Exception { + } + + public abstract void apply() throws Exception; } diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/AzureBatchExecutor.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/AzureBatchExecutor.java index 05c6a10be19..28900481a81 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/AzureBatchExecutor.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/AzureBatchExecutor.java @@ -23,6 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.nio.file.Path; /** @@ -58,7 +59,11 @@ public AzureBatchExecutor(Execution execution) { this.poolInformation = new PoolInformation().withPoolId(batchPoolId); } -// public void submitAzureTask(Job job, String token) throws IOException { + @Override + public void close() throws IOException { + } + + // public void submitAzureTask(Job job, String token) throws IOException { // String jobId = getOrCreateAzureJob(job.getType()); // TaskAddParameter taskToAdd = new TaskAddParameter(); // taskToAdd.withId(job.getId()).withCommandLine(job.getCommandLine()).withContainerSettings( diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/BatchExecutor.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/BatchExecutor.java index 58a811f1538..05c38e18545 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/BatchExecutor.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/BatchExecutor.java @@ -16,12 +16,13 @@ package org.opencb.opencga.master.monitor.executors; +import java.io.Closeable; import java.nio.file.Path; /** * Created by pfurio on 22/08/16. */ -public interface BatchExecutor { +public interface BatchExecutor extends Closeable { String TIMEOUT = "timeout"; String STDOUT = "stdout"; @@ -29,9 +30,7 @@ public interface BatchExecutor { String OUTDIR = "outdir"; String NUM_THREADS = "num_threads"; String MAX_MEM = "max_mem"; - @Deprecated - String JOB_STATUS_FILE = "status.json"; - String OUT_LOG_EXTENSION = ".out"; + String OUT_LOG_EXTENSION = ".log"; String ERR_LOG_EXTENSION = ".err"; void execute(String jobId, String queue, String commandLine, Path stdout, Path stderr) throws Exception; diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/K8SExecutor.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/K8SExecutor.java index 4b55a6acd69..b96dcf6f7e4 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/K8SExecutor.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/K8SExecutor.java @@ -18,9 +18,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.*; -import io.fabric8.kubernetes.api.model.batch.Job; -import io.fabric8.kubernetes.api.model.batch.JobBuilder; -import io.fabric8.kubernetes.api.model.batch.JobSpecBuilder; +import io.fabric8.kubernetes.api.model.batch.v1.Job; +import io.fabric8.kubernetes.api.model.batch.v1.JobBuilder; +import io.fabric8.kubernetes.api.model.batch.v1.JobSpecBuilder; import io.fabric8.kubernetes.client.Config; import io.fabric8.kubernetes.client.ConfigBuilder; import io.fabric8.kubernetes.client.*; @@ -36,6 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.nio.file.Path; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -51,6 +52,8 @@ public class K8SExecutor implements BatchExecutor { public static final String K8S_IMAGE_PULL_POLICY = "k8s.imagePullPolicy"; public static final String K8S_IMAGE_PULL_SECRETS = "k8s.imagePullSecrets"; public static final String K8S_TTL_SECONDS_AFTER_FINISHED = "k8s.ttlSecondsAfterFinished"; + public static final String K8S_TERMINATION_GRACE_PERIOD_SECONDS = "k8s.terminationGracePeriodSeconds"; + public static final String K8S_LOG_TO_STDOUT = "k8s.logToStdout"; public static final String K8S_DIND_ROOTLESS = "k8s.dind.rootless"; public static final String K8S_DIND_IMAGE_NAME = "k8s.dind.imageName"; public static final String K8S_REQUESTS = "k8s.requests"; @@ -87,6 +90,7 @@ public class K8SExecutor implements BatchExecutor { .withMountPath("/usr/share/pod") .build(); private static final String DIND_DONE_FILE = "/usr/share/pod/done"; + public static final String JOB_NAME = "job-name"; private final String namespace; private final String imageName; @@ -109,6 +113,8 @@ public class K8SExecutor implements BatchExecutor { private final String imagePullPolicy; private final List imagePullSecrets; private final int ttlSecondsAfterFinished; + private final boolean logToStdout; + private long terminationGracePeriodSeconds; public K8SExecutor(Configuration configuration) { Execution execution = configuration.getAnalysis().getExecution(); @@ -129,6 +135,8 @@ public K8SExecutor(Configuration configuration) { this.imagePullPolicy = execution.getOptions().getString(K8S_IMAGE_PULL_POLICY, "IfNotPresent"); this.imagePullSecrets = buildLocalObjectReference(execution.getOptions().get(K8S_IMAGE_PULL_SECRETS)); this.ttlSecondsAfterFinished = execution.getOptions().getInt(K8S_TTL_SECONDS_AFTER_FINISHED, 3600); + this.terminationGracePeriodSeconds = execution.getOptions().getInt(K8S_TERMINATION_GRACE_PERIOD_SECONDS, 5 * 60); + this.logToStdout = execution.getOptions().getBoolean(K8S_LOG_TO_STDOUT, true); nodeSelector = getMap(execution.getOptions(), K8S_NODE_SELECTOR); if (execution.getOptions().containsKey(K8S_SECURITY_CONTEXT)) { securityContext = buildObject(execution.getOptions().get(K8S_SECURITY_CONTEXT), SecurityContext.class); @@ -216,7 +224,12 @@ public K8SExecutor(Configuration configuration) { .withEnv(new EnvVar("DOCKER_TLS_CERTDIR", "", null)) // .withResources(resources) // TODO: Should we add resources here? .withCommand("/bin/sh", "-c") - .addToArgs("dockerd-entrypoint.sh & while ! test -f " + DIND_DONE_FILE + "; do sleep 5; done; exit 0") + .addToArgs("dockerd-entrypoint.sh & " + // Add trap to capture TERM signal and finish main process + + "trap '" + + "echo \"Container terminated! ;\n" + + "touch " + DIND_DONE_FILE + " ' TERM ;" + + "while ! test -f " + DIND_DONE_FILE + "; do sleep 5; done; exit 0") .addToVolumeMounts(DOCKER_GRAPH_VOLUMEMOUNT) .addToVolumeMounts(TMP_POD_VOLUMEMOUNT) .addAllToVolumeMounts(volumeMounts) @@ -236,10 +249,9 @@ public void eventReceived(Action action, Job k8Job) { } @Override - public void onClose(KubernetesClientException e) { + public void onClose(WatcherException e) { if (e != null) { logger.error("Catch exception at jobs watcher", e); - throw e; } } }); @@ -261,19 +273,25 @@ public void eventReceived(Action action, Pod pod) { } @Override - public void onClose(KubernetesClientException e) { + public void onClose(WatcherException e) { if (e != null) { logger.error("Catch exception at pods watcher", e); - throw e; } } }); } + @Override + public void close() throws IOException { + podsWatcher.close(); + jobsWatcher.close(); + kubernetesClient.close(); + } + @Override public void execute(String jobId, String queue, String commandLine, Path stdout, Path stderr) throws Exception { String jobName = buildJobName(jobId); - final io.fabric8.kubernetes.api.model.batch.Job k8sJob = new JobBuilder() + final io.fabric8.kubernetes.api.model.batch.v1.Job k8sJob = new JobBuilder() .withApiVersion("batch/v1") .withKind("Job") .withMetadata(new ObjectMetaBuilder() @@ -290,6 +308,7 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, .addToAnnotations("cluster-autoscaler.kubernetes.io/safe-to-evict", "false") .build()) .withSpec(new PodSpecBuilder() + .withTerminationGracePeriodSeconds(terminationGracePeriodSeconds) .withImagePullSecrets(imagePullSecrets) .addToContainers(new ContainerBuilder() .withName("opencga") @@ -297,9 +316,8 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, .withImagePullPolicy(imagePullPolicy) .withResources(resources) .addAllToEnv(envVars) - .withCommand("/bin/sh", "-c") - .withArgs("trap 'touch " + DIND_DONE_FILE + "' EXIT ; " - + getCommandLine(commandLine, stdout, stderr)) + .withCommand("/bin/bash", "-c") + .withArgs(getCommandLine(commandLine, stdout, stderr)) .withVolumeMounts(volumeMounts) .addToVolumeMounts(TMP_POD_VOLUMEMOUNT) .withSecurityContext(securityContext) @@ -330,19 +348,20 @@ private boolean shouldAddDockerDaemon(String queue) { /** * Build a valid K8S job name. - * + *

* DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and * end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation * is '[a-z0-9]([-a-z0-9]*[a-z0-9])?' - * + *

* Max length = 63 - * + *

* DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must * start and end with an alphanumeric character (e.g. 'example.com', regex used for validation * is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') + * * @param jobIdInput job Is - * @link https://github.com/kubernetes/kubernetes/blob/c560907/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L135 * @return valid name + * @link https://github.com/kubernetes/kubernetes/blob/c560907/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L135 */ protected static String buildJobName(String jobIdInput) { String jobId = jobIdInput.replace("_", "-"); @@ -404,7 +423,53 @@ public boolean resume(String jobId) throws Exception { @Override public boolean kill(String jobId) throws Exception { - return false; + String k8sJobName = buildJobName(jobId); + + switch (getStatus(jobId)) { + case Enums.ExecutionStatus.DONE: + case Enums.ExecutionStatus.ERROR: + case Enums.ExecutionStatus.ABORTED: { + return jobPodExists(k8sJobName); + } + case Enums.ExecutionStatus.UNKNOWN: { + logger.warn("K8s Job '" + k8sJobName + "' not found!"); + return jobPodExists(k8sJobName); + } + case Enums.ExecutionStatus.QUEUED: + case Enums.ExecutionStatus.PENDING: + case Enums.ExecutionStatus.RUNNING: { + deleteJobIfAny(k8sJobName); + return jobPodExists(k8sJobName); + } + default: + return false; + } + } + + private void deleteJobIfAny(String k8sJobName) { + Job k8Job = getKubernetesClient() + .batch() + .v1() + .jobs() + .inNamespace(namespace) + .withName(k8sJobName) + .get(); + + if (k8Job != null) { + logger.info("Deleting kubernetes job '" + k8Job.getMetadata().getName() + "'"); + getKubernetesClient() + .batch() + .v1() + .jobs() + .inNamespace(namespace) + .withName(k8sJobName) + .withGracePeriod(terminationGracePeriodSeconds) + .delete(); + } + } + + private boolean jobPodExists(String k8sJobName) { + return getJobPod(k8sJobName) == null; } @Override @@ -412,6 +477,58 @@ public boolean isExecutorAlive() { return false; } + /** + * We do it this way to avoid writing the session id in the command line (avoid display/monitor/logs) attribute of Job. + * + * @param commandLine Basic command line + * @param stdout File where the standard output will be redirected + * @param stderr File where the standard error will be redirected + * @return The complete command line + */ + @Override + public String getCommandLine(String commandLine, Path stdout, Path stderr) { + // Do "exec" the main command to keep the PID 1 on the main process to allow grace kills. + commandLine = "exec " + commandLine; + // https://stackoverflow.com/questions/692000/how-do-i-write-standard-error-to-a-file-while-using-tee-with-a-pipe + if (stderr != null) { + if (logToStdout) { + commandLine = commandLine + " 2> >( tee -a \"" + stderr.toAbsolutePath() + "\" >&2 )"; + } else { + commandLine = commandLine + " 2>> " + stderr.toAbsolutePath(); + } + } + if (stdout != null) { + if (logToStdout) { + commandLine = commandLine + " > >( tee -a \"" + stdout.toAbsolutePath() + "\")"; + } else { + commandLine = commandLine + " >> " + stdout.toAbsolutePath(); + } + } + + // Add trap to capture TERM signal and kill the main process + String trapTerm = "trap '" + + "echo \"Job terminated! Run time : ${SECONDS}s\" ;\n" + + "touch INTERRUPTED ;\n" + + "if [ -s PID ] && ps -p $(cat PID) > /dev/null; then\n" + + " kill -15 $(cat PID) ;\n" + + "fi' TERM ;"; + + // Launch the main process in background. + String mainProcess = commandLine + " &"; + + String wait = "PID=$! ; \n" + + "echo $PID > PID ; \n" + + "while ps -p \"$PID\" >/dev/null; do \n" + + " sleep 1 ; \n" + + "done \n" + + "touch '" + DIND_DONE_FILE + "' \n" + + "if [ -f INTERRUPTED ]; then\n" + + " exit 1\n" + + "fi"; + + return trapTerm + " " + mainProcess + " " + wait; + } + private String getStatusForce(String k8sJobName) { Job k8Job = getKubernetesClient() .batch() @@ -421,7 +538,7 @@ private String getStatusForce(String k8sJobName) { .get(); if (k8Job == null) { - logger.warn("Job " + k8sJobName + " not found!"); + logger.warn("Job '" + k8sJobName + "' not found!"); // Job has been deleted. manually? return Enums.ExecutionStatus.ABORTED; } @@ -430,15 +547,23 @@ private String getStatusForce(String k8sJobName) { if (statusFromK8sJob.equalsIgnoreCase(Enums.ExecutionStatus.UNKNOWN) || statusFromK8sJob.equalsIgnoreCase(Enums.ExecutionStatus.QUEUED)) { logger.warn("Job status " + statusFromK8sJob + " . Fetch POD info"); - List pods = getKubernetesClient().pods().withLabel("job-name", k8sJobName).list(1, null).getItems(); - if (!pods.isEmpty()) { - Pod pod = pods.get(0); + Pod pod = getJobPod(k8sJobName); + if (pod != null) { return getStatusFromPod(pod); } } return statusFromK8sJob; } + private Pod getJobPod(String k8sJobName) { + List pods = getKubernetesClient().pods().withLabel(JOB_NAME, k8sJobName).list(1, null).getItems(); + if (pods.isEmpty()) { + return null; + } else { + return pods.get(0); + } + } + private String getJobName(Pod pod) { if (pod.getMetadata() == null || pod.getMetadata().getLabels() == null @@ -446,7 +571,7 @@ private String getJobName(Pod pod) { || pod.getStatus().getPhase() == null) { return null; } - return pod.getMetadata().getLabels().get("job-name"); + return pod.getMetadata().getLabels().get(JOB_NAME); } private String getStatusFromPod(Pod pod) { @@ -486,7 +611,7 @@ private String getStatusFromK8sJob(Job k8Job, String k8sJobName) { } else if (k8Job.getStatus().getActive() != null && k8Job.getStatus().getActive() > 0) { // status = Enums.ExecutionStatus.RUNNING; status = Enums.ExecutionStatus.QUEUED; - } else { + } else { status = Enums.ExecutionStatus.UNKNOWN; } logger.debug("k8Job '{}}' status = '{}'", k8sJobName, status); @@ -514,6 +639,7 @@ private List buildObjects(List list, Class clazz) { } return ts; } + private T buildObject(Object o, Class clazz) { if (o == null) { return null; diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/LocalExecutor.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/LocalExecutor.java index 5fd46ba866e..901dd7cb3c1 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/LocalExecutor.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/LocalExecutor.java @@ -44,6 +44,7 @@ public class LocalExecutor implements BatchExecutor { private static Logger logger; private final ExecutorService threadPool; private final Map jobStatus; + private final Map runningJobs; private final int maxConcurrentJobs; public LocalExecutor(Execution execution) { @@ -56,6 +57,17 @@ protected boolean removeEldestEntry(Map.Entry eldest) { return size() > 1000; } }); + runningJobs = Collections.synchronizedMap(new LinkedHashMap(1000) { + @Override + protected boolean removeEldestEntry(Map.Entry eldest) { + return size() > 1000; + } + }); + } + + @Override + public void close() throws IOException { + threadPool.shutdown(); } @Override @@ -65,8 +77,9 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, try { Thread.currentThread().setName("LocalExecutor-" + nextThreadNum()); logger.info("Ready to run - {}", commandLine); - jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING); Command com = new Command(commandLine); + runningJobs.put(jobId, com); + jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING); DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(stdout.toFile())); com.setOutputOutputStream(dataOutputStream); @@ -78,6 +91,7 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, logger.info("Running ShutdownHook. Job {id: " + jobId + "} has being aborted."); com.setStatus(RunnableProcess.Status.KILLED); com.setExitValue(-2); + runningJobs.remove(jobId); closeOutputStreams(com); jobStatus.put(jobId, Enums.ExecutionStatus.ERROR); }); @@ -90,9 +104,11 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, try { Runtime.getRuntime().addShutdownHook(hook); + runningJobs.put(jobId, com); com.run(); } finally { Runtime.getRuntime().removeShutdownHook(hook); + runningJobs.remove(jobId); closeOutputStreams(com); } @@ -135,7 +151,13 @@ public boolean resume(String jobId) throws Exception { @Override public boolean kill(String jobId) throws Exception { - return false; + Command command = runningJobs.get(jobId); + if (command != null) { + command.destroy(); + return true; + } else { + return false; + } } @Override diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/SGEExecutor.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/SGEExecutor.java index 1d46dd5b0a0..0d0734deaca 100644 --- a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/SGEExecutor.java +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/executors/SGEExecutor.java @@ -21,6 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.nio.file.Path; /** @@ -36,6 +37,10 @@ public SGEExecutor(Execution execution) { sgeManager = new SGEManager(execution); } + @Override + public void close() throws IOException { + } + @Override public void execute(String jobId, String queue, String commandLine, Path stdout, Path stderr) throws Exception { sgeManager.queueJob(jobId, "", -1, getCommandLine(commandLine, stdout, stderr), null); diff --git a/opencga-master/src/main/java/org/opencb/opencga/master/monitor/schedulers/JobScheduler.java b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/schedulers/JobScheduler.java new file mode 100644 index 00000000000..e17fc25e0ab --- /dev/null +++ b/opencga-master/src/main/java/org/opencb/opencga/master/monitor/schedulers/JobScheduler.java @@ -0,0 +1,232 @@ +package org.opencb.opencga.master.monitor.schedulers; + +import org.apache.commons.lang3.time.StopWatch; +import org.opencb.commons.datastore.core.Query; +import org.opencb.commons.datastore.core.QueryOptions; +import org.opencb.opencga.catalog.db.api.StudyDBAdaptor; +import org.opencb.opencga.catalog.db.api.UserDBAdaptor; +import org.opencb.opencga.catalog.exceptions.CatalogException; +import org.opencb.opencga.catalog.managers.CatalogManager; +import org.opencb.opencga.catalog.managers.OrganizationManager; +import org.opencb.opencga.catalog.utils.CatalogFqn; +import org.opencb.opencga.core.api.ParamConstants; +import org.opencb.opencga.core.common.TimeUtils; +import org.opencb.opencga.core.models.job.Job; +import org.opencb.opencga.core.models.organizations.Organization; +import org.opencb.opencga.core.models.study.Group; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +public class JobScheduler { + + private final CatalogManager catalogManager; + private final String token; + + private Map userRoles; + + private static final float PRIORITY_WEIGHT = 0.6F; + private static final float IDLE_TIME_WEIGHT = 0.4F; +// private static final float OPERATION_WEIGHT = 0.2F; +// private static final float USER_PRIORITY_WEIGHT = 0.2F; + + private final Logger logger = LoggerFactory.getLogger(JobScheduler.class); + + + public JobScheduler(CatalogManager catalogManager, String token) { + this.catalogManager = catalogManager; + this.token = token; + } + + private void getUserRoles() throws CatalogException { + StopWatch stopWatch = StopWatch.createStarted(); + this.userRoles = new HashMap<>(); + + List organizationIds = catalogManager.getOrganizationManager().getOrganizationIds(token); + for (String organizationId : organizationIds) { + if (ParamConstants.ADMIN_ORGANIZATION.equals(organizationId)) { + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, UserDBAdaptor.QueryParams.ID.key()); + catalogManager.getUserManager().search(organizationId, new Query(), options, token).getResults() + .forEach(user -> getUserRole(organizationId, user.getId()).setSuperAdmin(true)); + } else { + Organization organization = catalogManager.getOrganizationManager().get(organizationId, + OrganizationManager.INCLUDE_ORGANIZATION_ADMINS, token).first(); + getUserRole(organizationId, organization.getOwner()).addOrganizationOwner(organizationId); + organization.getAdmins().forEach(user -> getUserRole(organizationId, user).addOrganizationAdmin(organizationId)); + + QueryOptions options = new QueryOptions(QueryOptions.INCLUDE, Arrays.asList(StudyDBAdaptor.QueryParams.FQN.key(), + StudyDBAdaptor.QueryParams.GROUPS.key())); + catalogManager.getStudyManager().searchInOrganization(organizationId, new Query(), options, token).getResults() + .forEach(study -> { + for (Group group : study.getGroups()) { + if (ParamConstants.ADMINS_GROUP.equals(group.getId())) { + group.getUserIds().forEach(user -> getUserRole(organizationId, user).addStudyAdmin(study.getFqn())); + } + } + }); + } + } + + logger.debug("Time spent fetching user roles: {}", TimeUtils.durationToString(stopWatch)); + } + + private UserRole getUserRole(String organizationId, String userId) { + String id = organizationId + "@" + userId; + if (!this.userRoles.containsKey(id)) { + this.userRoles.put(id, new UserRole()); + } + return this.userRoles.get(id); + } + + private float getPriorityWeight(Job job) { + float appPriority; + switch (job.getPriority()) { + case URGENT: + appPriority = 1f; + break; + case HIGH: + appPriority = 0.8f; + break; + case MEDIUM: + appPriority = 0.5f; + break; + case LOW: + case UNKNOWN: + default: + appPriority = 0.2f; + break; + } + + // Increase priority depending on the time the job has been waiting in PENDING status + Calendar todayCalendar = Calendar.getInstance(); + Date date = TimeUtils.toDate(job.getInternal().getRegistrationDate()); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + while (appPriority < 1f) { + calendar.add(Calendar.HOUR, 24); + if (calendar.before(todayCalendar)) { + appPriority = Math.max(1f, appPriority + 0.05f); + } else { + break; + } + } + + // User's priority + float usersPriority; + switch (job.getPriority()) { + case URGENT: + usersPriority = 1f; + break; + case HIGH: + usersPriority = 0.8f; + break; + case MEDIUM: + usersPriority = 0.5f; + break; + case LOW: + case UNKNOWN: + default: + usersPriority = 0.2f; + break; + } + + // Adjust user's priority depending on the user's role + String userId = job.getUserId(); + String organizationId = CatalogFqn.extractFqnFromStudyFqn(job.getStudy().getId()).getOrganizationId(); + + UserRole userRole = getUserRole(organizationId, userId); + if (userRole.isSuperAdmin) { + usersPriority = usersPriority * 1; + } else if (userRole.isOrganizationOwner(organizationId)) { + usersPriority = usersPriority * 0.8f; + } else if (userRole.isOrganizationAdmin(organizationId)) { + usersPriority = usersPriority * 0.75f; + } else if (userRole.isStudyAdmin(job.getStudy().getId())) { + usersPriority = usersPriority * 0.6f; + } else { + usersPriority = usersPriority * 0.4f; + } + + return appPriority * 0.6f + usersPriority * 0.4f; + } + + public Iterator schedule(List pendingJobs, List queuedJobs, List runningJobs) { + TreeMap> jobTreeMap = new TreeMap<>(); + + try { + getUserRoles(); + } catch (CatalogException e) { + throw new RuntimeException("Scheduler exception: " + e.getMessage(), e); + } + + StopWatch stopWatch = StopWatch.createStarted(); + for (Job job : pendingJobs) { + float priority = getPriorityWeight(job); + if (!jobTreeMap.containsKey(priority)) { + jobTreeMap.put(priority, new ArrayList<>()); + } + jobTreeMap.get(priority).add(job); + } + logger.debug("Time spent scheduling jobs: {}", TimeUtils.durationToString(stopWatch)); + + stopWatch.reset(); + stopWatch.start(); + // Obtain iterator + List allJobs = new ArrayList<>(); + for (Float priority : jobTreeMap.descendingKeySet()) { + allJobs.addAll(jobTreeMap.get(priority)); + } + logger.debug("Time spent creating iterator: {}", TimeUtils.durationToString(stopWatch)); + + return allJobs.iterator(); + } + + private static class UserRole { + + private boolean isSuperAdmin; + private Set organizationOwners; + private Set organizationAdmins; + private Set studyAdmins; + + UserRole() { + this.organizationOwners = new HashSet<>(); + this.organizationAdmins = new HashSet<>(); + this.studyAdmins = new HashSet<>(); + } + + public boolean isSuperAdmin() { + return isSuperAdmin; + } + + public UserRole setSuperAdmin(boolean superAdmin) { + isSuperAdmin = superAdmin; + return this; + } + + public void addOrganizationOwner(String userId) { + organizationOwners.add(userId); + } + + public void addOrganizationAdmin(String userId) { + organizationAdmins.add(userId); + } + + public void addStudyAdmin(String userId) { + studyAdmins.add(userId); + } + + public boolean isOrganizationOwner(String organizationId) { + return organizationOwners.contains(organizationId); + } + + public boolean isOrganizationAdmin(String organizationId) { + return organizationAdmins.contains(organizationId); + } + + public boolean isStudyAdmin(String studyFqn) { + return studyAdmins.contains(studyFqn); + } + } + +} diff --git a/opencga-master/src/test/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemonTest.java b/opencga-master/src/test/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemonTest.java index 89f316e1c21..9d2de1bdb42 100644 --- a/opencga-master/src/test/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemonTest.java +++ b/opencga-master/src/test/java/org/opencb/opencga/master/monitor/daemons/ExecutionDaemonTest.java @@ -24,6 +24,7 @@ import org.opencb.commons.datastore.core.Query; import org.opencb.commons.datastore.core.QueryOptions; import org.opencb.opencga.TestParamConstants; +import org.opencb.opencga.analysis.tools.ToolRunner; import org.opencb.opencga.analysis.variant.operations.VariantAnnotationIndexOperationTool; import org.opencb.opencga.analysis.variant.operations.VariantIndexOperationTool; import org.opencb.opencga.catalog.db.api.FileDBAdaptor; @@ -33,6 +34,7 @@ import org.opencb.opencga.catalog.managers.FileManager; import org.opencb.opencga.catalog.utils.ParamUtils; import org.opencb.opencga.core.api.ParamConstants; +import org.opencb.opencga.core.common.TimeUtils; import org.opencb.opencga.core.config.storage.StorageConfiguration; import org.opencb.opencga.core.exceptions.ToolException; import org.opencb.opencga.core.models.AclParams; @@ -52,6 +54,7 @@ import org.opencb.opencga.core.tools.result.ExecutionResultManager; import org.opencb.opencga.master.monitor.executors.BatchExecutor; import org.opencb.opencga.master.monitor.models.PrivateJobUpdateParams; +import org.opencb.opencga.storage.core.StorageEngineFactory; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -214,12 +217,31 @@ public void testNotEmptyOutDir() throws Exception { } @Test - public void testProjectScopeTask() throws Exception { + public void dryRunExecutionTest() throws Exception { + ObjectMap params = new ObjectMap(); + String jobId1 = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, + params, "job1", "", null, null, null, null, true, ownerToken).first().getId(); + daemon.checkJobs(); + Job job = catalogManager.getJobManager().get(studyFqn, jobId1, null, ownerToken).first(); + + StorageConfiguration storageConfiguration = new StorageConfiguration(); + storageConfiguration.getVariant().setDefaultEngine("mongodb"); + ToolRunner toolRunner = new ToolRunner(catalogManagerResource.getOpencgaHome().toString(), catalogManager, + StorageEngineFactory.get(storageConfiguration)); + toolRunner.execute(job, ownerToken); + daemon.checkJobs(); + + job = catalogManager.getJobManager().get(studyFqn, jobId1, null, ownerToken).first(); + assertEquals(Enums.ExecutionStatus.DONE, job.getInternal().getStatus().getId()); + assertEquals(1, job.getExecution().getSteps().size()); + assertEquals("check", job.getExecution().getSteps().get(0).getId()); + } + + @Test + public void testProjectScopeTaskAndScheduler() throws Exception { // User 2 to admins group in study1 but not in study2 catalogManager.getStudyManager().updateGroup(studyFqn, ParamConstants.ADMINS_GROUP, ParamUtils.BasicUpdateAction.ADD, new GroupUpdateParams(Collections.singletonList(normalUserId2)), ownerToken); -// catalogManager.getStudyManager().updateAcl(studyFqn2, normalUserId2, new StudyAclParams().setTemplate(AuthorizationManager.ROLE_VIEW_ONLY), -// ParamUtils.AclAction.SET, ownerToken); // User 3 to admins group in both study1 and study2 catalogManager.getStudyManager().updateGroup(studyFqn, ParamConstants.ADMINS_GROUP, ParamUtils.BasicUpdateAction.ADD, @@ -228,29 +250,97 @@ public void testProjectScopeTask() throws Exception { new GroupUpdateParams(Collections.singletonList(normalUserId3)), ownerToken); HashMap params = new HashMap<>(); - String jobId = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, - params, "job1", "", null, null, ownerToken).first().getId(); + String jobId1 = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, + params, "job1", "", null, null, null, null, false, normalToken2).first().getId(); String jobId2 = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, - params, "job2", "", null, null, normalToken2).first().getId(); + params, "job2", "", null, null, null, null, false, orgAdminToken1).first().getId(); String jobId3 = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, - params, "job3", "", null, null, normalToken3).first().getId(); + params, "job3", "", null, null, null, null, false, ownerToken).first().getId(); + String jobId4 = catalogManager.getJobManager().submit(studyFqn, VariantAnnotationIndexOperationTool.ID, Enums.Priority.MEDIUM, + params, "job4", "", null, null, null, null, false, normalToken3).first().getId(); - daemon.checkPendingJobs(organizationIds); + daemon.checkJobs(); // Job sent by the owner - OpenCGAResult jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId, QueryOptions.empty(), ownerToken); + OpenCGAResult jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId3, QueryOptions.empty(), ownerToken); assertEquals(1, jobOpenCGAResult.getNumResults()); checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.QUEUED); - // Job sent by user2 (admin from study1 but not from study2) + // Job sent by normal user + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId1, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + // Job sent by study administrator + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId4, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId2, QueryOptions.empty(), ownerToken); assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + daemon.checkJobs(); + + // Because there's already a QUEUED job, it should not process any more jobs + // Job sent by the owner + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId3, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.QUEUED); + + // Job sent normal user + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId1, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + // Job sent by study administrator + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId4, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId2, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + // Set to DONE jobId3 so it can process more jobs + catalogManager.getJobManager().update(studyFqn, jobId3, new PrivateJobUpdateParams() + .setInternal(new JobInternal(new Enums.ExecutionStatus(Enums.ExecutionStatus.DONE))), QueryOptions.empty(), ownerToken); + + daemon.checkJobs(); + // Job sent by normal user should still be PENDING + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId1, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + // Job sent by study administrator + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId4, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + // Job sent by org admin + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId2, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.QUEUED); + + // Set to DONE jobId2 so it can process more jobs + catalogManager.getJobManager().update(studyFqn, jobId2, new PrivateJobUpdateParams() + .setInternal(new JobInternal(new Enums.ExecutionStatus(Enums.ExecutionStatus.DONE))), QueryOptions.empty(), ownerToken); + + daemon.checkJobs(); + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId1, QueryOptions.empty(), ownerToken); checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.ABORTED); assertTrue(jobOpenCGAResult.first().getInternal().getStatus().getDescription() .contains("can only be executed by the project owners or members of " + ParamConstants.ADMINS_GROUP)); - // Job sent by user3 (admin from study1 and study2) - jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId3, QueryOptions.empty(), ownerToken); + // Job sent by study administrator + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId4, QueryOptions.empty(), ownerToken); + assertEquals(1, jobOpenCGAResult.getNumResults()); + checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.PENDING); + + daemon.checkJobs(); // to process jobId4 + + // Job sent by study administrator + jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, jobId4, QueryOptions.empty(), ownerToken); assertEquals(1, jobOpenCGAResult.getNumResults()); checkStatus(jobOpenCGAResult.first(), Enums.ExecutionStatus.QUEUED); @@ -259,7 +349,7 @@ public void testProjectScopeTask() throws Exception { jobOpenCGAResult = catalogManager.getJobManager().search(studyFqn2, new Query(), new QueryOptions(ParamConstants.OTHER_STUDIES_FLAG, true), ownerToken); - assertEquals(2, jobOpenCGAResult.getNumResults()); + assertEquals(3, jobOpenCGAResult.getNumResults()); } @Test @@ -267,7 +357,7 @@ public void testDependsOnJobs() throws Exception { HashMap params = new HashMap<>(); String job1 = catalogManager.getJobManager().submit(studyFqn, "files-delete", Enums.Priority.MEDIUM, params, ownerToken).first().getId(); String job2 = catalogManager.getJobManager().submit(studyFqn, "files-delete", Enums.Priority.MEDIUM, params, null, null, - Collections.singletonList(job1), null, ownerToken).first().getId(); + Collections.singletonList(job1), null, null, null, false, ownerToken).first().getId(); daemon.checkPendingJobs(organizationIds); @@ -296,7 +386,7 @@ public void testDependsOnJobs() throws Exception { // And create a new job to simulate a normal successfully dependency String job3 = catalogManager.getJobManager().submit(studyFqn, "files-delete", Enums.Priority.MEDIUM, params, null, null, - Collections.singletonList(job1), null, ownerToken).first().getId(); + Collections.singletonList(job1), null, null, null, false, ownerToken).first().getId(); daemon.checkPendingJobs(organizationIds); jobOpenCGAResult = catalogManager.getJobManager().get(studyFqn, job3, QueryOptions.empty(), ownerToken); @@ -309,7 +399,7 @@ public void testDependsOnMultiStudy() throws Exception { HashMap params = new HashMap<>(); Job firstJob = catalogManager.getJobManager().submit(studyFqn, "files-delete", Enums.Priority.MEDIUM, params, ownerToken).first(); Job job = catalogManager.getJobManager().submit(studyFqn2, "files-delete", Enums.Priority.MEDIUM, params, null, null, - Collections.singletonList(firstJob.getUuid()), null, ownerToken).first(); + Collections.singletonList(firstJob.getUuid()), null, null, null, false, ownerToken).first(); assertEquals(1, job.getDependsOn().size()); assertEquals(firstJob.getId(), job.getDependsOn().get(0).getId()); assertEquals(firstJob.getUuid(), job.getDependsOn().get(0).getUuid()); @@ -417,6 +507,7 @@ public void testCheckLogsNoPermissions() throws Exception { Paths.get(job.getOutDir().getUri()).resolve(job.getId() + ".log").toUri()); thrown.expect(CatalogAuthorizationException.class); + thrown.expectMessage("view log file"); catalogManager.getJobManager().log(studyFqn, jobId, 0, 1, "stdout", true, normalToken2); } @@ -500,6 +591,29 @@ public void testRegisterFilesSuccessfully() throws Exception { assertEquals(16, files.getNumMatches()); } + @Test + public void scheduledJobTest() throws CatalogException, InterruptedException { + HashMap params = new HashMap<>(); + params.put(ExecutionDaemon.OUTDIR_PARAM, "outputDir/"); + Date date = new Date(); + // Create a date object with the current time + 2 seconds + date.setTime(date.getTime() + 2000); + String scheduledTime = TimeUtils.getTime(date); + System.out.println("Scheduled time: " + scheduledTime); + Job job = catalogManager.getJobManager().submit(studyFqn, "variant-index", Enums.Priority.MEDIUM, params, null, null, null, + null, null, scheduledTime, null, ownerToken).first(); + + daemon.checkJobs(); + checkStatus(getJob(job.getId()), Enums.ExecutionStatus.PENDING); + daemon.checkJobs(); + checkStatus(getJob(job.getId()), Enums.ExecutionStatus.PENDING); + + // Sleep for 2 seconds and check again + Thread.sleep(2000); + daemon.checkJobs(); + checkStatus(getJob(job.getId()), Enums.ExecutionStatus.QUEUED); + } + @Test public void testRunJobFail() throws Exception { HashMap params = new HashMap<>(); @@ -604,6 +718,10 @@ public void execute(String jobId, String queue, String commandLine, Path stdout, jobStatus.put(jobId, Enums.ExecutionStatus.QUEUED); } + @Override + public void close() throws IOException { + } + @Override public String getStatus(String jobId) { return jobStatus.getOrDefault(jobId, Enums.ExecutionStatus.UNKNOWN); diff --git a/opencga-master/src/test/java/org/opencb/opencga/master/monitor/executors/LocalExecutorTest.java b/opencga-master/src/test/java/org/opencb/opencga/master/monitor/executors/LocalExecutorTest.java index 5a237749412..44712d2838f 100644 --- a/opencga-master/src/test/java/org/opencb/opencga/master/monitor/executors/LocalExecutorTest.java +++ b/opencga-master/src/test/java/org/opencb/opencga/master/monitor/executors/LocalExecutorTest.java @@ -31,14 +31,18 @@ import java.util.Collections; import java.util.Date; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @Category(ShortTests.class) public class LocalExecutorTest { + public static final int MAX_CONCURRENT_JOBS = 5; private LocalExecutor localExecutor; private Path rootDir; @Before public void setUp() throws Exception { - localExecutor = new LocalExecutor(new Execution().setOptions(new ObjectMap(LocalExecutor.MAX_CONCURRENT_JOBS, 5))); + localExecutor = new LocalExecutor(new Execution().setOptions(new ObjectMap(LocalExecutor.MAX_CONCURRENT_JOBS, MAX_CONCURRENT_JOBS))); rootDir = Paths.get("target/test-data", "junit-opencga-" + new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss.SSS").format(new Date())); Files.createDirectories(rootDir); @@ -58,11 +62,41 @@ public void test() throws Exception { Thread.sleep(1000); } Assert.assertTrue(Files.exists(rootDir.resolve("out_" + i + ".txt"))); - Assert.assertEquals(Collections.singletonList("Hello World"), Files.readAllLines(rootDir.resolve("out_" + i + ".txt"))); + assertEquals(Collections.singletonList("Hello World"), Files.readAllLines(rootDir.resolve("out_" + i + ".txt"))); Assert.assertTrue(Files.exists(rootDir.resolve("err_" + i + ".txt"))); - Assert.assertEquals(Collections.emptyList(), Files.readAllLines(rootDir.resolve("err_" + i + ".txt"))); + assertEquals(Collections.emptyList(), Files.readAllLines(rootDir.resolve("err_" + i + ".txt"))); + } + } + + @Test(timeout = 10000) + public void testKill() throws Exception { + System.out.println(rootDir.toAbsolutePath()); + for (int i = 0; i < 10; i++) { +// System.out.println("Submitting job " + i); + localExecutor.execute("jobId-" + i, "default", "sleep 20", rootDir.resolve("out_" + i + ".txt"), rootDir.resolve("err_" + i + ".txt")); } + // Allow some time for the jobs to start + Thread.sleep(50); + for (int i = 0; i < 10; i++) { + String jobId = "jobId-" + i; +// System.out.println("Checking status of job " + jobId); + if (i < MAX_CONCURRENT_JOBS) { + assertEquals(jobId, "RUNNING", localExecutor.getStatus(jobId)); + } else { + assertEquals(jobId, "QUEUED", localExecutor.getStatus(jobId)); + } + } + for (int i = 0; i < 10; i++) { + String jobId = "jobId-" + i; +// System.out.println("Checking status of job " + jobId); + while(!localExecutor.getStatus(jobId).equals("RUNNING")) { + Thread.sleep(10); + } + assertEquals("RUNNING", localExecutor.getStatus(jobId)); + assertTrue(localExecutor.kill(jobId)); + } } + } \ No newline at end of file diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java index e100ebeb5eb..01be67e5a16 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/FileWSServer.java @@ -98,9 +98,12 @@ public Response downloadAndRegister( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, @ApiParam(name = "body", value = "Fetch parameters", required = true) FileFetch fetchParams) { - return submitJob(FetchAndRegisterTask.ID, studyStr, fetchParams, jobId, jobDescription, dependsOn, jobTags); + return submitJob(FetchAndRegisterTask.ID, studyStr, fetchParams, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -709,8 +712,11 @@ public Response postlink( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(name = "body", value = "File parameters", required = true) PostLinkToolParams params) { - return submitJob(PostLinkSampleAssociation.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags); + return submitJob(PostLinkSampleAssociation.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -722,8 +728,11 @@ public Response linkAsync( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(name = "body", value = "File parameters", required = true) FileLinkToolParams params) { - return submitJob(FileLinkTask.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags); + return submitJob(FileLinkTask.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @DELETE diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/JobWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/JobWSServer.java index e5bfe43f83b..536d692099e 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/JobWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/JobWSServer.java @@ -81,6 +81,7 @@ public Response retryJob( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTagsStr, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String jobScheduledStartTime, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = "job", required = true) JobRetryParams params @@ -99,14 +100,24 @@ public Response retryJob( } else { jobTags = Collections.emptyList(); } - OpenCGAResult result = catalogManager.getJobManager().retry(study, params, - null, jobId, jobDescription, jobDependsOn, jobTags, token); + OpenCGAResult result = catalogManager.getJobManager().retry(study, params, null, jobId, jobDescription, jobDependsOn, + jobTags, jobScheduledStartTime, token); return createOkResponse(result); } catch (Exception e) { return createErrorResponse(e); } } + @POST + @Path("/{job}/kill") + @Consumes(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Send a signal to kill a pending or running job", response = Job.class) + public Response kill( + @ApiParam(value = ParamConstants.JOB_ID_DESCRIPTION, required = true) @PathParam("job") String jobId, + @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study) { + return run(() -> catalogManager.getJobManager().kill(study, jobId, token)); + } + @GET @Path("/{jobs}/info") @ApiOperation(value = "Get job information", response = Job.class) diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/OpenCGAWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/OpenCGAWSServer.java index 686b40cad16..3dae031c245 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/OpenCGAWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/OpenCGAWSServer.java @@ -852,42 +852,46 @@ public Response run(Callable> c) { } } - public Response submitJob(String toolId, String project, String study, Map paramsMap, - String jobName, String jobDescription, String jobDependsOne, String jobTags) { - return run(() -> submitJobRaw(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOne, jobTags)); + public Response submitJob(String toolId, String project, String study, Map paramsMap, String jobName, + String jobDescription, String jobDependsOne, String jobTags, String jobScheduledStartTime, String jobPriority, + Boolean dryRun) { + return run(() -> submitJobRaw(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOne, jobTags, jobScheduledStartTime, jobPriority, dryRun)); } public Response submitJob(String toolId, String study, ToolParams bodyParams, String jobId, String jobDescription, - String jobDependsOnStr, String jobTagsStr) { - return submitJob(toolId, null, study, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr); + String jobDependsOnStr, String jobTagsStr, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { + return submitJob(toolId, null, study, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr, jobScheduledStartTime, jobPriority, dryRun); } public Response submitJobAdmin(String toolId, ToolParams bodyParams, String jobId, String jobDescription, - String jobDependsOnStr, String jobTagsStr) { + String jobDependsOnStr, String jobTagsStr, String jobScheduledStartTime, String jobPriority, + Boolean dryRun) { return run(() -> { JwtPayload jwtPayload = catalogManager.getUserManager().validateToken(token); catalogManager.getAuthorizationManager().checkIsOpencgaAdministrator(jwtPayload, "submit job from tool '" + toolId + "'"); - return submitJobRaw(toolId, null, ADMIN_STUDY_FQN, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr); + return submitJobRaw(toolId, null, ADMIN_STUDY_FQN, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr, jobScheduledStartTime, jobPriority, dryRun); }); } public Response submitJob(String toolId, String project, String study, ToolParams bodyParams, String jobId, String jobDescription, - String jobDependsOnStr, String jobTagsStr) { - return run(() -> submitJobRaw(toolId, project, study, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr)); + String jobDependsOnStr, String jobTagsStr, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { + return run(() -> submitJobRaw(toolId, project, study, bodyParams, jobId, jobDescription, jobDependsOnStr, jobTagsStr, jobScheduledStartTime, jobPriority, dryRun)); } - protected DataResult submitJobRaw(String toolId, String project, String study, ToolParams bodyParams, - String jobId, String jobDescription, String jobDependsOnStr, String jobTagsStr) + protected DataResult submitJobRaw(String toolId, String project, String study, ToolParams bodyParams, String jobId, + String jobDescription, String jobDependsOnStr, String jobTagsStr, String jobScheduledStartTime, + String jobPriority, Boolean dryRun) throws CatalogException { Map paramsMap = bodyParams.toParams(); if (StringUtils.isNotEmpty(study)) { paramsMap.putIfAbsent(ParamConstants.STUDY_PARAM, study); } - return submitJobRaw(toolId, project, study, paramsMap, jobId, jobDescription, jobDependsOnStr, jobTagsStr); + return submitJobRaw(toolId, project, study, paramsMap, jobId, jobDescription, jobDependsOnStr, jobTagsStr, jobScheduledStartTime, jobPriority, dryRun); } - protected DataResult submitJobRaw(String toolId, String project, String study, Map paramsMap, - String jobId, String jobDescription, String jobDependsOnStr, String jobTagsStr) + protected DataResult submitJobRaw(String toolId, String project, String study, Map paramsMap, String jobId, + String jobDescription, String jobDependsOnStr, String jobTagsStr, String jobScheduledStartTime, + String jobPriority, Boolean dryRun) throws CatalogException { if (StringUtils.isNotEmpty(project) && StringUtils.isEmpty(study)) { @@ -918,8 +922,13 @@ protected DataResult submitJobRaw(String toolId, String project, String stu } else { jobDependsOn = Collections.emptyList(); } + Enums.Priority priority = Enums.Priority.MEDIUM; + if (!StringUtils.isEmpty(jobPriority)) { + priority = Enums.Priority.getPriority(jobPriority.toUpperCase()); + } return catalogManager.getJobManager() - .submit(study, toolId, Enums.Priority.MEDIUM, paramsMap, jobId, jobDescription, jobDependsOn, jobTags, token); + .submit(study, toolId, priority, paramsMap, jobId, jobDescription, jobDependsOn, jobTags, null, + jobScheduledStartTime, dryRun, token); } public Response createPendingResponse() { diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/PanelWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/PanelWSServer.java index 2ec062bb84f..7d36dec4386 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/PanelWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/PanelWSServer.java @@ -82,8 +82,11 @@ public Response importPanel( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(name = "body", value = "Panel parameters") PanelImportParams params) { - return submitJob(PanelImportTask.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags); + return submitJob(PanelImportTask.ID, studyStr, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } // @POST diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/StudyWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/StudyWSServer.java index 64bea0e07e1..f6cc3fe8882 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/StudyWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/StudyWSServer.java @@ -547,8 +547,11 @@ public Response executeTemplate( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = TemplateParams.DESCRIPTION, required = true) TemplateParams params) { - return submitJob(TemplateRunner.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(TemplateRunner.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/AlignmentWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/AlignmentWebService.java index 99fa4402fc9..277f289a6b6 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/AlignmentWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/AlignmentWebService.java @@ -83,8 +83,11 @@ public Response indexRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = AlignmentIndexParams.DESCRIPTION, required = true) AlignmentIndexParams params) { - return submitJob(AlignmentIndexOperation.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(AlignmentIndexOperation.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } //------------------------------------------------------------------------- @@ -177,9 +180,12 @@ public Response coverageRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = CoverageIndexParams.DESCRIPTION, required = true) CoverageIndexParams params) { - return submitJob(AlignmentCoverageAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(AlignmentCoverageAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); // logger.debug("ObjectMap: {}", params); // @@ -386,9 +392,12 @@ public Response geneCoverageStatsRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = AlignmentGeneCoverageStatsParams.DESCRIPTION, required = true) AlignmentGeneCoverageStatsParams params) { - return submitJob(AlignmentGeneCoverageStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(AlignmentGeneCoverageStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } //------------------------------------------------------------------------- @@ -404,9 +413,12 @@ public Response qcRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = AlignmentQcParams.DESCRIPTION, required = true) AlignmentQcParams params) { - return submitJob(AlignmentQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(AlignmentQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } //------------------------------------------------------------------------- @@ -422,8 +434,11 @@ public Response bwaRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = BwaWrapperParams.DESCRIPTION, required = true) BwaWrapperParams params) { - return submitJob(BwaWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(BwaWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -435,8 +450,11 @@ public Response samtoolsRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = SamtoolsWrapperParams.DESCRIPTION, required = true) SamtoolsWrapperParams params) { - return submitJob(SamtoolsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(SamtoolsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -448,8 +466,11 @@ public Response deeptoolsRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = DeeptoolsWrapperParams.DESCRIPTION, required = true) DeeptoolsWrapperParams params) { - return submitJob(DeeptoolsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(DeeptoolsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -461,8 +482,11 @@ public Response fastqcRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = FastqcWrapperParams.DESCRIPTION, required = true) FastqcWrapperParams params) { - return submitJob(FastqcWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(FastqcWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -474,8 +498,11 @@ public Response picardRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = PicardWrapperParams.DESCRIPTION, required = true) PicardWrapperParams params) { - return submitJob(PicardWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(PicardWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } //------------------------------------------------------------------------- diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java index d69c237e421..f893c1f5986 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java @@ -170,10 +170,13 @@ public Response load( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ClinicalAnalysisLoadParams.DESCRIPTION, required = true) ClinicalAnalysisLoadParams params) { try { // Execute load as a job - return submitJob(ClinicalAnalysisLoadTask.ID, study, params, jobId, jobDescription, dependsOn, jobTags); + return submitJob(ClinicalAnalysisLoadTask.ID, study, params, jobId, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } catch (Exception e) { return createErrorResponse("Load clinical analyses from file", e.getMessage()); } @@ -1161,6 +1164,9 @@ public Response rgaIndexRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.INDEX_AUXILIAR_COLLECTION_DESCRIPTION, defaultValue = "false") @QueryParam(ParamConstants.INDEX_AUXILIAR_COLLECTION) boolean indexAuxiliarColl, @ApiParam(value = RgaAnalysisParams.DESCRIPTION, required = true) RgaAnalysisParams params) { @@ -1169,9 +1175,9 @@ public Response rgaIndexRun( if (StringUtils.isNotEmpty(study)) { paramsMap.putIfAbsent(ParamConstants.STUDY_PARAM, study); } - return submitJob(AuxiliarRgaAnalysis.ID, null, study, paramsMap, jobName, jobDescription, dependsOn, jobTags); + return submitJob(AuxiliarRgaAnalysis.ID, null, study, paramsMap, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } else { - return submitJob(RgaAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(RgaAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } } @@ -1292,8 +1298,11 @@ public Response interpretationTieringRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = TieringInterpretationAnalysisParams.DESCRIPTION, required = true) TieringInterpretationAnalysisParams params) { - return submitJob(TieringInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(TieringInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @@ -1306,8 +1315,11 @@ public Response interpretationExomiserRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ExomiserInterpretationAnalysisParams.DESCRIPTION, required = true) ExomiserInterpretationAnalysisParams params) { - return submitJob(ExomiserInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(ExomiserInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1319,8 +1331,11 @@ public Response interpretationTeamRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = TeamInterpretationAnalysisParams.DESCRIPTION, required = true) TeamInterpretationAnalysisParams params) { - return submitJob(TeamInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(TeamInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1332,8 +1347,11 @@ public Response interpretationZettaRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ZettaInterpretationAnalysisParams.DESCRIPTION, required = true) ZettaInterpretationAnalysisParams params) { - return submitJob(ZettaInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(ZettaInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1345,7 +1363,10 @@ public Response interpretationCancerTieringRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = CancerTieringInterpretationAnalysisParams.DESCRIPTION, required = true) CancerTieringInterpretationAnalysisParams params) { - return submitJob(CancerTieringInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(CancerTieringInterpretationAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } } diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java index bec35b1bf1b..70748fffb0c 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/VariantWebService.java @@ -95,7 +95,6 @@ import java.util.*; import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.SAVED_FILTER_DESCR; -import static org.opencb.opencga.analysis.variant.manager.VariantCatalogQueryUtils.geneRegionIntersect; import static org.opencb.opencga.core.api.ParamConstants.JOB_DEPENDS_ON; import static org.opencb.opencga.core.common.JacksonUtils.getUpdateObjectMapper; import static org.opencb.opencga.storage.core.variant.adaptors.VariantQueryParam.*; @@ -187,8 +186,11 @@ public Response variantFileIndex( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantIndexParams.DESCRIPTION, required = true) VariantIndexParams params) { - return submitJob(VariantIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @Deprecated @@ -200,11 +202,14 @@ public Response variantFileDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = "Files to remove") @QueryParam("file") String file, @ApiParam(value = "Resume a previously failed indexation") @QueryParam("resume") boolean resume) throws WebServiceException { VariantFileDeleteParams params = new VariantFileDeleteParams(getIdList(file), resume); - return submitJob(VariantFileDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantFileDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -399,8 +404,11 @@ public Response export( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantExportParams.DESCRIPTION, required = true) VariantExportParams params) { - return submitJob(VariantExportTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantExportTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -442,8 +450,11 @@ public Response statsRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantStatsAnalysisParams.DESCRIPTION, required = true) VariantStatsAnalysisParams params) { - return submitJob(VariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -456,8 +467,11 @@ public Response statsExport( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantStatsExportParams.DESCRIPTION, required = true) VariantStatsExportParams params) { - return submitJob("variant-stats-export", project, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob("variant-stats-export", project, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } // public static class StatsDeleteParams extends ToolParams { @@ -559,8 +573,11 @@ public Response sampleRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = SampleVariantFilterParams.DESCRIPTION, required = true) SampleVariantFilterParams params) { - return submitJob(SampleVariantFilterAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(SampleVariantFilterAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -572,8 +589,11 @@ public Response sampleEligibility( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = SampleEligibilityAnalysisParams.DESCRIPTION, required = true) SampleEligibilityAnalysisParams params) { - return submitJob(SampleEligibilityAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(SampleEligibilityAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -585,8 +605,11 @@ public Response exomiserRun( @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ExomiserWrapperParams.DESCRIPTION, required = true) ExomiserWrapperParams params) { - return submitJob(ExomiserWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(ExomiserWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @@ -680,8 +703,11 @@ public Response sampleStatsRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = SampleVariantStatsAnalysisParams.DESCRIPTION, required = true) SampleVariantStatsAnalysisParams params) { - return submitJob(SampleVariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(SampleVariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -729,8 +755,11 @@ public Response cohortStatsRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = CohortVariantStatsAnalysisParams.DESCRIPTION, required = true) CohortVariantStatsAnalysisParams params) { - return submitJob(CohortVariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(CohortVariantStatsAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -902,8 +931,11 @@ public Response gwasRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = GwasAnalysisParams.DESCRIPTION, required = true) GwasAnalysisParams params) { - return submitJob(GwasAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(GwasAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } // @POST @@ -929,8 +961,11 @@ public Response mutationalSignatureRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = MutationalSignatureAnalysisParams.DESCRIPTION, required = true) MutationalSignatureAnalysisParams params) { - return submitJob(MutationalSignatureAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(MutationalSignatureAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -1000,7 +1035,7 @@ public Response mutationalSignatureQuery( MutationalSignatureAnalysis mutationalSignatureAnalysis = new MutationalSignatureAnalysis(); mutationalSignatureAnalysis.setUp(opencgaHome.toString(), catalogManager, storageEngineFactory, new ObjectMap(), outDir, null, - token); + false, token); mutationalSignatureAnalysis.setStudy(query.getString(STUDY.key())); mutationalSignatureAnalysis.setSignatureParams(params); @@ -1044,8 +1079,11 @@ public Response hrDetectRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = HRDetectAnalysisParams.DESCRIPTION, required = true) HRDetectAnalysisParams params) { - return submitJob(HRDetectAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(HRDetectAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1057,8 +1095,11 @@ public Response mendelianErrorRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = MendelianErrorAnalysisParams.DESCRIPTION, required = true) MendelianErrorAnalysisParams params) { - return submitJob(MendelianErrorAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(MendelianErrorAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1070,13 +1111,16 @@ public Response inferredSexRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = InferredSexAnalysisParams.DESCRIPTION, required = true) InferredSexAnalysisParams params) { return run(() -> { // Check before submitting the job InferredSexAnalysis.checkParameters(params.getIndividual(), params.getSample(), study, catalogManager, token); // Submit the inferred sex analysis - return submitJobRaw(InferredSexAnalysis.ID, null, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJobRaw(InferredSexAnalysis.ID, null, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); }); } @@ -1089,8 +1133,11 @@ public Response relatednessRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = RelatednessAnalysisParams.DESCRIPTION, required = true) RelatednessAnalysisParams params) { - return submitJob(RelatednessAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(RelatednessAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1102,8 +1149,11 @@ public Response familyQcRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = FamilyQcAnalysisParams.DESCRIPTION, required = true) FamilyQcAnalysisParams params) { - return submitJob(FamilyQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(FamilyQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1115,6 +1165,9 @@ public Response individualQcRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = IndividualQcAnalysisParams.DESCRIPTION, required = true) IndividualQcAnalysisParams params) { return run(() -> { // Check before submitting the job @@ -1122,7 +1175,7 @@ public Response individualQcRun( catalogManager, token); // Submit the individual QC analysis - return submitJobRaw(IndividualQcAnalysis.ID, null, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJobRaw(IndividualQcAnalysis.ID, null, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); }); } @@ -1135,9 +1188,12 @@ public Response sampleQcRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = SampleQcAnalysisParams.DESCRIPTION, required = true) SampleQcAnalysisParams params) { - return submitJob(SampleQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(SampleQcAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1149,8 +1205,11 @@ public Response plinkRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = PlinkWrapperParams.DESCRIPTION, required = true) PlinkWrapperParams params) { - return submitJob(PlinkWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(PlinkWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1162,8 +1221,11 @@ public Response rvtestsRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = RvtestsWrapperParams.DESCRIPTION, required = true) RvtestsWrapperParams params) { - return submitJob(RvtestsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(RvtestsWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1175,8 +1237,11 @@ public Response gatkRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = GatkWrapperParams.DESCRIPTION, required = true) GatkWrapperParams params) { - return submitJob(GatkWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(GatkWrapperAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -1188,8 +1253,11 @@ public Response knockoutRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = KnockoutAnalysisParams.DESCRIPTION, required = true) KnockoutAnalysisParams params) { - return submitJob(KnockoutAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(KnockoutAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @GET @@ -1229,10 +1297,13 @@ public Response genomePlotRun( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = GenomePlotAnalysisParams.DESCRIPTION, required = true) GenomePlotAnalysisParams params) { // To be sure: do not update quality control sample params.setSample(null); - return submitJob(GenomePlotAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(GenomePlotAnalysis.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java index 77574d73ad9..a2143f45090 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/operations/VariantOperationWebService.java @@ -109,9 +109,12 @@ public Response variantIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantIndexParams.DESCRIPTION) VariantIndexParams params) { - return submitOperation(VariantIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -122,9 +125,12 @@ public Response variantDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantFileDeleteParams.DESCRIPTION) VariantFileDeleteParams params) { - return submitOperation(VariantFileDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantFileDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -135,9 +141,12 @@ public Response variantStudyDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantStudyDeleteParams.DESCRIPTION) VariantStudyDeleteParams params) { - return submitOperation(VariantStudyDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantStudyDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -148,9 +157,12 @@ public Response variantIndexLauncher( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantFileIndexJobLauncherParams.DESCRIPTION) VariantFileIndexJobLauncherParams params) { - return submitOperation(VariantFileIndexJobLauncherTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantFileIndexJobLauncherTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -161,9 +173,12 @@ public Response variantMetadataSynchronize( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantStorageMetadataSynchronizeParams.DESCRIPTION) VariantStorageMetadataSynchronizeParams params) { - return submitJobAdmin(VariantStorageMetadataSynchronizeOperationTool.ID, params, jobName, jobDescription, dependsOn, jobTags); + return submitJobAdmin(VariantStorageMetadataSynchronizeOperationTool.ID, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -174,8 +189,11 @@ public Response variantMetadataRepair( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantStorageMetadataRepairToolParams.DESCRIPTION) VariantStorageMetadataRepairToolParams params) { - return submitJobAdmin(VariantStorageMetadataRepairTool.ID, params, jobName, jobDescription, dependsOn, jobTags); + return submitJobAdmin(VariantStorageMetadataRepairTool.ID, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -187,8 +205,11 @@ public Response statsIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantStatsAnalysisParams.DESCRIPTION, required = true) VariantStatsIndexParams params) { - return submitJob(VariantStatsIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantStatsIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -200,8 +221,11 @@ public Response statsDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantStatsDeleteParams.DESCRIPTION, required = true) VariantStatsDeleteParams params) { - return submitJob(VariantStatsDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitJob(VariantStatsDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @@ -214,10 +238,13 @@ public Response secondaryIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondaryAnnotationIndexParams.DESCRIPTION) VariantSecondaryAnnotationIndexParams params) { - return variantSecondaryAnnotationIndex(jobName, jobDescription, dependsOn, jobTags, project, study, params); + return variantSecondaryAnnotationIndex(jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun, project, study, params); } @POST @@ -228,10 +255,13 @@ public Response variantSecondaryAnnotationIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondaryAnnotationIndexParams.DESCRIPTION) VariantSecondaryAnnotationIndexParams params) { - return submitOperation(VariantSecondaryAnnotationIndexOperationTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantSecondaryAnnotationIndexOperationTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @DELETE @@ -242,12 +272,15 @@ public Response secondaryIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = "Samples to remove. Needs to provide all the samples in the secondary index.") @QueryParam("samples") String samples) { HashMap params = new HashMap<>(); params.put(ParamConstants.STUDY_PARAM, study); params.put("samples", samples); - return submitOperation(VariantSecondaryIndexSamplesDeleteOperationTool.ID, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantSecondaryIndexSamplesDeleteOperationTool.ID, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -258,10 +291,13 @@ public Response annotation( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.PROJECT_DESCRIPTION) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantAnnotationIndexParams.DESCRIPTION) VariantAnnotationIndexParams params) { - return submitOperation(VariantAnnotationIndexOperationTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantAnnotationIndexOperationTool.ID, project, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @DELETE @@ -272,6 +308,9 @@ public Response annotationDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = "Annotation identifier") @QueryParam("annotationId") String annotationId ) { @@ -279,7 +318,7 @@ public Response annotationDelete( params.put(ParamConstants.PROJECT_PARAM, project); params.put("annotationId", annotationId); return submitOperationToProject(VariantAnnotationDeleteOperationTool.ID, project, params, jobName, jobDescription, dependsOn, - jobTags); + jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -290,10 +329,13 @@ public Response annotationSave( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantCatalogQueryUtils.PROJECT_DESC) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = VariantAnnotationSaveParams.DESCRIPTION) VariantAnnotationSaveParams params) { return submitOperationToProject(VariantAnnotationSaveOperationTool.ID, project, params, jobName, jobDescription, dependsOn, - jobTags); + jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -304,9 +346,12 @@ public Response scoreIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantScoreIndexParams.DESCRIPTION) VariantScoreIndexParams params) { - return submitOperation(VariantScoreIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantScoreIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @DELETE @@ -317,6 +362,9 @@ public Response scoreDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = "Unique name of the score within the study") @QueryParam("name") String name, @ApiParam(value = "Resume a previously failed remove") @QueryParam("resume") boolean resume, @@ -327,7 +375,7 @@ public Response scoreDelete( params.put("name", name); if (resume) params.put("resume", ""); if (force) params.put("force", ""); - return submitOperation(VariantScoreDeleteParams.ID, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantScoreDeleteParams.ID, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @Deprecated @@ -360,9 +408,12 @@ public Response sampleGenotypeIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondarySampleIndexParams.DESCRIPTION) VariantSecondarySampleIndexParams params) { - return sampleIndex(jobName, jobDescription, dependsOn, jobTags, study, params); + return sampleIndex(jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun, study, params); } @Deprecated @@ -374,9 +425,12 @@ public Response sampleIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondarySampleIndexParams.DESCRIPTION) VariantSecondarySampleIndexParams params) { - return variantSecondarySampleIndex(jobName, jobDescription, dependsOn, jobTags, study, params); + return variantSecondarySampleIndex(jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun, study, params); } @POST @@ -387,9 +441,12 @@ public Response variantSecondarySampleIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSecondarySampleIndexParams.DESCRIPTION) VariantSecondarySampleIndexParams params) { - return submitOperation(VariantSecondarySampleIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantSecondarySampleIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -400,9 +457,12 @@ public Response variantSampleDelete( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantSampleDeleteParams.DESCRIPTION) VariantSampleDeleteParams params) { - return submitOperation(VariantSampleDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantSampleDeleteOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -414,9 +474,12 @@ public Response familyGenotypeIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantFamilyIndexParams.DESCRIPTION) VariantFamilyIndexParams params) { - return familyIndex(jobName, jobDescription, dependsOn, jobTags, study, params); + return familyIndex(jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun, study, params); } @Deprecated @@ -428,9 +491,12 @@ public Response familyIndex( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantFamilyIndexParams.DESCRIPTION) VariantFamilyIndexParams params) { - return submitOperation(VariantFamilyIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantFamilyIndexOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -441,9 +507,12 @@ public Response aggregateFamily( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantAggregateFamilyParams.DESCRIPTION) VariantAggregateFamilyParams params) { - return submitOperation(VariantAggregateFamilyOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantAggregateFamilyOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -454,9 +523,12 @@ public Response aggregate( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String study, @ApiParam(value = VariantAggregateParams.DESCRIPTION) VariantAggregateParams params) { - return submitOperation(VariantAggregateOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperation(VariantAggregateOperationTool.ID, study, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -467,9 +539,12 @@ public Response julie( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = ParamConstants.PROJECT_PARAM) @QueryParam(ParamConstants.PROJECT_PARAM) String project, @ApiParam(value = JulieParams.DESCRIPTION, required = true) JulieParams params) { - return submitOperationToProject(JulieTool.ID, project, params, jobName, jobDescription, dependsOn, jobTags); + return submitOperationToProject(JulieTool.ID, project, params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } @POST @@ -480,22 +555,25 @@ public Response variantPrune( @ApiParam(value = ParamConstants.JOB_DESCRIPTION_DESCRIPTION) @QueryParam(ParamConstants.JOB_DESCRIPTION) String jobDescription, @ApiParam(value = ParamConstants.JOB_DEPENDS_ON_DESCRIPTION) @QueryParam(JOB_DEPENDS_ON) String dependsOn, @ApiParam(value = ParamConstants.JOB_TAGS_DESCRIPTION) @QueryParam(ParamConstants.JOB_TAGS) String jobTags, + @ApiParam(value = ParamConstants.JOB_SCHEDULED_START_TIME_DESCRIPTION) @QueryParam(ParamConstants.JOB_SCHEDULED_START_TIME) String scheduledStartTime, + @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.SUBMIT_JOB_PRIORITY_PARAM) String jobPriority, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN) Boolean dryRun, @ApiParam(value = VariantPruneParams.DESCRIPTION) VariantPruneParams params) { - return submitOperationToProject(VariantPruneOperationTool.ID, params.getProject(), params, jobName, jobDescription, dependsOn, jobTags); + return submitOperationToProject(VariantPruneOperationTool.ID, params.getProject(), params, jobName, jobDescription, dependsOn, jobTags, scheduledStartTime, jobPriority, dryRun); } - public Response submitOperation(String toolId, String study, ToolParams params, - String jobName, String jobDescription, String jobDependsOn, String jobTags) { - return submitOperation(toolId, null, study, params, jobName, jobDescription, jobDependsOn, jobTags); + public Response submitOperation(String toolId, String study, ToolParams params, String jobName, String jobDescription, + String jobDependsOn, String jobTags, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { + return submitOperation(toolId, null, study, params, jobName, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, dryRun); } public Response submitOperationToProject(String toolId, String project, ToolParams params, String jobName, String jobDescription, - String jobDependsOn, String jobTags) { - return submitOperation(toolId, project, null, params, jobName, jobDescription, jobDependsOn, jobTags); + String jobDependsOn, String jobTags, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { + return submitOperation(toolId, project, null, params, jobName, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, dryRun); } public Response submitOperation(String toolId, String project, String study, ToolParams params, String jobName, String jobDescription, - String jobDependsOn, String jobTags) { + String jobDependsOn, String jobTags, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { try { Map paramsMap = params.toParams(); if (StringUtils.isNotEmpty(study)) { @@ -504,26 +582,31 @@ public Response submitOperation(String toolId, String project, String study, Too if (StringUtils.isNotEmpty(project)) { paramsMap.put(ParamConstants.PROJECT_PARAM, project); } - return submitOperation(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOn, jobTags); + return submitOperation(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, + jobPriority, dryRun); } catch (Exception e) { return createErrorResponse(e); } } public Response submitOperationToProject(String toolId, String project, Map paramsMap, String jobName, - String jobDescription, String jobDependsOn, String jobTags) { - return submitOperation(toolId, project, null, paramsMap, jobName, jobDescription, jobDependsOn, jobTags); + String jobDescription, String jobDependsOn, String jobTags, String jobScheduledStartTime, + String jobPriority, Boolean dryRun) { + return submitOperation(toolId, project, null, paramsMap, jobName, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, + jobPriority, dryRun); } public Response submitOperation(String toolId, Map paramsMap, String jobName, String jobDescription, - String jobDependsOn, String jobTags) { + String jobDependsOn, String jobTags, String jobScheduledStartTime, String jobPriority, Boolean dryRun) { String project = (String) paramsMap.get(ParamConstants.PROJECT_PARAM); String study = (String) paramsMap.get(ParamConstants.STUDY_PARAM); - return submitOperation(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOn, jobTags); + return submitOperation(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, + jobPriority, dryRun); } public Response submitOperation(String toolId, String project, String study, Map paramsMap, String jobName, - String jobDescription, String jobDependsOne, String jobTags) { + String jobDescription, String jobDependsOne, String jobTags, String jobScheduledStartTime, + String jobPriority, Boolean dryRun) { Map dynamicParamsMap = new HashMap<>(); for (String key : this.params.keySet()) { String prefix = "dynamic_"; @@ -534,6 +617,6 @@ public Response submitOperation(String toolId, String project, String study, Map if (dynamicParamsMap.size() > 0) { paramsMap.put("dynamicParams", dynamicParamsMap); } - return submitJob(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOne, jobTags); + return submitJob(toolId, project, study, paramsMap, jobName, jobDescription, jobDependsOne, jobTags, jobScheduledStartTime, jobPriority, dryRun); } } diff --git a/opencga-storage/opencga-storage-core/src/main/resources/storage-configuration.yml b/opencga-storage/opencga-storage-core/src/main/resources/storage-configuration.yml index 4f64a3ad939..b9970d18eaf 100644 --- a/opencga-storage/opencga-storage-core/src/main/resources/storage-configuration.yml +++ b/opencga-storage/opencga-storage-core/src/main/resources/storage-configuration.yml @@ -11,7 +11,7 @@ cellbase: ## URL host to annotate variants, for example: https://uk.ws.zettagenomics.com/cellbase/ url: "${OPENCGA.CELLBASE.REST.HOST}" version: "${OPENCGA.CELLBASE.VERSION}" - dataRelease: "2" + dataRelease: "7" ## Storage Query Server configuration. When CLI is launched in 'server' mode a RESTful web server ## is launched in the specified port. @@ -171,6 +171,7 @@ variant: #storage.hadoop.mr.executor.ssh.key: "~/.ssh/id_rsa" # Hadoop edge node ssh-key file storage.hadoop.mr.executor.ssh.password: "" # Hadoop edge node password. Only if ssh-key is not present. Requires sshpass to run storage.hadoop.mr.executor.ssh.remoteOpenCgaHome: # Remote opencga home location. Only if different than local location. + storage.hadoop.mr.executor.ssh.terminationGracePeriodSeconds: 120 # Termination grace period in seconds for the ssh executor. # Increase the ScannerTimeoutPeriod from 60000 (1min) to 300000 (5min) to avoid ScannerTimeoutExceptions # See opencb/opencga#352 for more info. diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/app/HBaseMain.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/app/HBaseMain.java index e16371af737..509a758f268 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/app/HBaseMain.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/app/HBaseMain.java @@ -258,9 +258,9 @@ private void exec(String tool, List args) throws Exception { engine.setConfiguration(storageConfiguration, HadoopVariantStorageEngine.STORAGE_ENGINE_ID, ""); MRExecutor mrExecutor = engine.getMRExecutor(); - int exitError = mrExecutor.run(tool, args.toArray(new String[0])); - if (exitError != 0) { - throw new Exception("Exec failed with exit number '" + exitError + "'"); + MRExecutor.Result result = mrExecutor.run(tool, args.toArray(new String[0])); + if (result.getExitValue() != 0) { + throw new Exception("Exec failed with exit number '" + result.getExitValue() + "'"); } } @@ -318,7 +318,7 @@ private void exportSnapshot(String storageConfigurationPath, String snapshot, St engine.setConfiguration(storageConfiguration, HadoopVariantStorageEngine.STORAGE_ENGINE_ID, ""); MRExecutor mrExecutor = engine.getMRExecutor(); - int exitError = mrExecutor.run("hbase", args.toArray(new String[0])); + int exitError = mrExecutor.run("hbase", args.toArray(new String[0])).getExitValue(); if (exitError != 0) { throw new Exception("ExportSnapshot failed with exit number '" + exitError + "'"); } diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/utils/AbstractHBaseDriver.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/utils/AbstractHBaseDriver.java index 9bcc56abb56..49fdbf02237 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/utils/AbstractHBaseDriver.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/utils/AbstractHBaseDriver.java @@ -11,16 +11,17 @@ import org.apache.hadoop.hbase.mapreduce.TableInputFormat; import org.apache.hadoop.hbase.mapreduce.TableOutputFormat; import org.apache.hadoop.io.IOUtils; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.MRJobConfig; +import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; +import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.parquet.hadoop.ParquetFileWriter; import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil; import org.opencb.commons.datastore.core.ObjectMap; +import org.opencb.opencga.core.common.ExceptionUtils; import org.opencb.opencga.core.common.TimeUtils; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.hadoop.io.HDFSIOConnector; @@ -52,6 +53,8 @@ public abstract class AbstractHBaseDriver extends Configured implements Tool { public static final String COUNTER_GROUP_NAME = "OPENCGA.HBASE"; public static final String COLUMNS_TO_COUNT = "columns_to_count"; + public static final String MR_APPLICATION_ID = "MR_APPLICATION_ID"; + public static final String ERROR_MESSAGE = "ERROR_MESSAGE"; private static final Logger LOGGER = LoggerFactory.getLogger(AbstractHBaseDriver.class); protected String table; @@ -187,11 +190,19 @@ public final int run(String[] args) throws Exception { boolean succeed = executeJob(job); if (!succeed) { LOGGER.error("error with job!"); + if (!"NA".equals(job.getStatus().getFailureInfo())) { + LOGGER.error("Failure info: " + job.getStatus().getFailureInfo()); + printKeyValue(ERROR_MESSAGE, job.getStatus().getFailureInfo()); + } + } LOGGER.info("================================================="); LOGGER.info("Finish job " + getJobName()); LOGGER.info("Total time : " + TimeUtils.durationToString(stopWatch)); LOGGER.info("================================================="); + for (Counter counter : job.getCounters().getGroup(COUNTER_GROUP_NAME)) { + printKeyValue(counter.getName(), counter.getValue()); + } postExecution(job); close(); @@ -228,23 +239,50 @@ protected void parseFixedParams(String[] args) { private boolean executeJob(Job job) throws IOException, InterruptedException, ClassNotFoundException { Thread hook = new Thread(() -> { + LOGGER.info("Shutdown hook called!"); + LOGGER.info("Gracefully stopping the job '" + job.getJobID() + "' ..."); try { - if (!job.isComplete()) { - job.killJob(); + if (job.getJobState() == JobStatus.State.RUNNING) { + if (!job.isComplete()) { + job.killJob(); + } + LOGGER.info("Job '" + job.getJobID() + "' stopped!"); + } else { + LOGGER.info("Job '" + job.getJobID() + "' is not running. Nothing to do."); } // onError(); - } catch (IOException e) { + } catch (Exception e) { LOGGER.error("Error", e); } }); try { Runtime.getRuntime().addShutdownHook(hook); - return job.waitForCompletion(true); - } finally { + job.submit(); + JobID jobID = job.getJobID(); + String applicationId = jobID.appendTo(new StringBuilder(ApplicationId.appIdStrPrefix)).toString(); + printKeyValue(MR_APPLICATION_ID, applicationId); + boolean completion = job.waitForCompletion(true); Runtime.getRuntime().removeShutdownHook(hook); + return completion; + } catch (Exception e) { + // Do not use a finally block to remove shutdownHook, as finally blocks will be executed even if the JVM is killed, + // and this would throw IllegalStateException("Shutdown in progress"); + try { + Runtime.getRuntime().removeShutdownHook(hook); + } catch (Exception e1) { + e.addSuppressed(e1); + } + throw e; } } + protected static void printKeyValue(String key, Object value) { + // Print key value using System.err directly so it can be read by the MRExecutor + // Do not use logger, as it may be redirected to a file or stdout + // Do not use stdout, as it won't be read by the MRExecutor + System.err.println(key + "=" + value); + } + protected boolean isLocal(Path path) { return HDFSIOConnector.isLocal(path.toUri(), getConf()); } @@ -326,6 +364,7 @@ protected void deleteTemporaryFile(Path outdir) throws IOException { FileSystem fileSystem = outdir.getFileSystem(getConf()); fileSystem.delete(outdir, true); fileSystem.cancelDeleteOnExit(outdir); + LOGGER.info("Temporary file deleted!"); } public class MapReduceOutputFile { @@ -502,6 +541,7 @@ protected static void main(String[] args, Class aClass) { System.exit(code); } catch (Exception e) { LoggerFactory.getLogger(aClass).error("Error executing " + aClass, e); + printKeyValue(ERROR_MESSAGE, ExceptionUtils.prettyExceptionMessage(e, false, true)); System.exit(1); } } diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/AbstractVariantsTableDriver.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/AbstractVariantsTableDriver.java index 0619d56fd30..35305dd4fdc 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/AbstractVariantsTableDriver.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/AbstractVariantsTableDriver.java @@ -25,7 +25,6 @@ import org.apache.hadoop.hbase.filter.*; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.util.Tool; import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.core.metadata.VariantStorageMetadataManager; @@ -34,7 +33,6 @@ import org.opencb.opencga.storage.core.variant.VariantStorageOptions; import org.opencb.opencga.storage.hadoop.utils.AbstractHBaseDriver; import org.opencb.opencga.storage.hadoop.utils.HBaseManager; -import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveDriver; import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveTableHelper; import org.opencb.opencga.storage.hadoop.variant.gaps.FillMissingFromArchiveTask; import org.opencb.opencga.storage.hadoop.variant.metadata.HBaseVariantStorageMetadataDBAdaptorFactory; @@ -54,7 +52,7 @@ /** * Created by mh719 on 21/11/2016. */ -public abstract class AbstractVariantsTableDriver extends AbstractHBaseDriver implements Tool { +public abstract class AbstractVariantsTableDriver extends AbstractHBaseDriver { public static final String CONFIG_VARIANT_TABLE_NAME = "opencga.variant.table.name"; public static final String TIMESTAMP = "opencga.variant.table.timestamp"; @@ -266,7 +264,7 @@ protected String getVariantsTable() { } protected String getArchiveTable() { - return getConf().get(ArchiveDriver.CONFIG_ARCHIVE_TABLE_NAME, StringUtils.EMPTY); + return getConf().get(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME, StringUtils.EMPTY); } protected HBaseVariantTableNameGenerator getTableNameGenerator() { @@ -343,7 +341,7 @@ public static void setNoneTimestamp(Job job) { public static String[] buildArgs(String archiveTable, String variantsTable, int studyId, Collection fileIds, ObjectMap other) { - other.put(ArchiveDriver.CONFIG_ARCHIVE_TABLE_NAME, archiveTable); + other.put(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME, archiveTable); other.put(AbstractVariantsTableDriver.CONFIG_VARIANT_TABLE_NAME, variantsTable); other.put(STUDY_ID, studyId); diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageOptions.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageOptions.java index ab6dfaf87ef..9c1f22ed349 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageOptions.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageOptions.java @@ -58,6 +58,7 @@ public enum HadoopVariantStorageOptions implements ConfigurationOption { MR_EXECUTOR_SSH_REMOTE_OPENCGA_HOME("storage.hadoop.mr.executor.ssh.remoteOpenCgaHome"), MR_EXECUTOR_SSH_HADOOP_SSH_BIN("storage.hadoop.mr.executor.ssh.hadoop-ssh.bin", "misc/scripts/hadoop-ssh.sh"), MR_EXECUTOR_SSH_HADOOP_SCP_BIN("storage.hadoop.mr.executor.ssh.hadoop-scp.bin", "misc/scripts/hadoop-scp.sh"), + MR_EXECUTOR_SSH_HADOOP_TERMINATION_GRACE_PERIOD_SECONDS("storage.hadoop.mr.executor.ssh.terminationGracePeriodSeconds", 120), ///////////////////////// // Variant table configuration diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveDriver.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveDriver.java index 86104fbe0d7..c1de4b9f1b1 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveDriver.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveDriver.java @@ -65,7 +65,6 @@ public class ArchiveDriver extends Configured implements Tool { public static final String CONFIG_ARCHIVE_INPUT_FILE_VCF = "opencga.archive.input.file.vcf"; public static final String CONFIG_ARCHIVE_INPUT_FILE_VCF_META = "opencga.archive.input.file.vcf.meta"; - public static final String CONFIG_ARCHIVE_TABLE_NAME = "opencga.archive.table.name"; private static final Logger LOGGER = LoggerFactory.getLogger(ArchiveDriver.class); @@ -82,7 +81,7 @@ public int run(String[] args) throws Exception { URI inputFile = URI.create(conf.get(CONFIG_ARCHIVE_INPUT_FILE_VCF)); URI inputMetaFile = URI.create(conf.get(CONFIG_ARCHIVE_INPUT_FILE_VCF_META)); - String tableName = conf.get(CONFIG_ARCHIVE_TABLE_NAME); + String tableName = conf.get(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME); int studyId = conf.getInt(HadoopVariantStorageEngine.STUDY_ID, -1); int fileId = conf.getInt(HadoopVariantStorageEngine.FILE_ID, -1); @@ -223,7 +222,7 @@ public static int privateMain(String[] args, Configuration conf) throws Exceptio conf.set(CONFIG_ARCHIVE_INPUT_FILE_VCF, toolArgs[0]); conf.set(CONFIG_ARCHIVE_INPUT_FILE_VCF_META, toolArgs[1]); conf = HBaseManager.addHBaseSettings(conf, toolArgs[2]); - conf.set(CONFIG_ARCHIVE_TABLE_NAME, toolArgs[3]); + conf.set(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME, toolArgs[3]); conf.set(HadoopVariantStorageEngine.STUDY_ID, toolArgs[4]); conf.set(HadoopVariantStorageEngine.FILE_ID, toolArgs[5]); //set the configuration back, so that Tool can configure itself diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveTableHelper.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveTableHelper.java index 7c831e3cc81..3af44e97188 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveTableHelper.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/archive/ArchiveTableHelper.java @@ -54,6 +54,7 @@ public class ArchiveTableHelper extends GenomeHelper { public static final byte[] NON_REF_COLUMN_SUFIX_BYTES = Bytes.toBytes(NON_REF_COLUMN_SUFIX); public static final String REF_COLUMN_SUFIX = "_R"; public static final byte[] REF_COLUMN_SUFIX_BYTES = Bytes.toBytes(REF_COLUMN_SUFIX); + public static final String CONFIG_ARCHIVE_TABLE_NAME = "opencga.archive.table.name"; private final Logger logger = LoggerFactory.getLogger(ArchiveTableHelper.class); private final AtomicReference meta = new AtomicReference<>(); diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/MRExecutor.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/MRExecutor.java index da771b0cb47..a8d9b03745c 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/MRExecutor.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/MRExecutor.java @@ -16,20 +16,25 @@ package org.opencb.opencga.storage.hadoop.variant.executors; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.StopWatch; import org.apache.hadoop.util.Tool; import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.opencga.core.common.GitRepositoryState; import org.opencb.opencga.core.common.TimeUtils; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; +import org.opencb.opencga.storage.hadoop.utils.AbstractHBaseDriver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageOptions.*; @@ -44,6 +49,30 @@ public abstract class MRExecutor { private ObjectMap options; private List env; private static Logger logger = LoggerFactory.getLogger(MRExecutor.class); + private static final Pattern STDOUT_KEY_VALUE_PATTERN = Pattern.compile("^[a-zA-Z0-9_]+=[^=]+$"); + private static final Pattern EXCEPTION = Pattern.compile("^Exception in thread \"main\" ([^:]+: .+)$"); + + public static class Result { + private final int exitValue; + private final ObjectMap result; + + public Result(int exitValue, ObjectMap result) { + this.exitValue = exitValue; + this.result = result; + } + + public int getExitValue() { + return exitValue; + } + + public ObjectMap getResult() { + return result; + } + + public String getErrorMessage() { + return result.getString(AbstractHBaseDriver.ERROR_MESSAGE); + } + } public MRExecutor init(ObjectMap options) { this.options = options; @@ -76,24 +105,32 @@ protected static String getOpencgaHome() { return System.getProperty("app.home", ""); } - public void run(Class execClass, String[] args, String taskDescription) + public ObjectMap run(Class execClass, String[] args, String taskDescription) throws StorageEngineException { StopWatch stopWatch = StopWatch.createStarted(); logger.info("------------------------------------------------------"); logger.info(taskDescription); logger.info("------------------------------------------------------"); - int exitValue = run(execClass, args); + Result result = run(execClass, args); + int exitValue = result.getExitValue(); logger.info("------------------------------------------------------"); logger.info("Exit value: {}", exitValue); logger.info("Total time: {}", TimeUtils.durationToString(stopWatch)); if (exitValue != 0) { - throw new StorageEngineException("Error executing MapReduce for : \"" + taskDescription + "\""); + String message = "Error executing MapReduce for : \"" + taskDescription + "\""; + if (StringUtils.isNotEmpty(result.getErrorMessage())) { + message += " : " + result.getErrorMessage(); + } else { + message += " : Unidentified error executing MapReduce job. Check logs for more information."; + } + throw new StorageEngineException(message); } + return result.getResult(); } - protected int run(Class execClass, String[] args) throws StorageEngineException { + protected Result run(Class execClass, String[] args) throws StorageEngineException { String hadoopRoute = options.getString(MR_HADOOP_BIN.key(), MR_HADOOP_BIN.defaultValue()); String jar = getJarWithDependencies(options); String executable = hadoopRoute + " jar " + jar + ' ' + execClass.getName(); @@ -112,7 +149,7 @@ protected int run(Class execClass, String[] args) throws Sto } } - public abstract int run(String executable, String[] args) throws StorageEngineException; + public abstract Result run(String executable, String[] args) throws StorageEngineException; protected ObjectMap getOptions() { return options; @@ -129,4 +166,28 @@ protected static void redactSecureString(String[] args, String key) { } } + protected static ObjectMap readResult(String output) { + ObjectMap result = new ObjectMap(); + List exceptions = new ArrayList<>(); + for (String line : output.split(System.lineSeparator())) { + if (STDOUT_KEY_VALUE_PATTERN.matcher(line).find()) { + String[] split = line.split("="); + if (split.length == 2) { + Object old = result.put(split[0], split[1]); + if (old != null) { + result.put(split[0], old + "," + split[1]); + } + } + } else if (EXCEPTION.matcher(line).find()) { + Matcher matcher = EXCEPTION.matcher(line); + if (matcher.find()) { + exceptions.add(matcher.group(1)); + } + } + } + if (!exceptions.isEmpty() && !result.containsKey(AbstractHBaseDriver.ERROR_MESSAGE)) { + result.put(AbstractHBaseDriver.ERROR_MESSAGE, String.join(", ", exceptions)); + } + return result; + } } diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SshMRExecutor.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SshMRExecutor.java index 8ef826f153d..b205511f830 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SshMRExecutor.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SshMRExecutor.java @@ -7,14 +7,18 @@ import org.opencb.commons.exec.Command; import org.opencb.opencga.core.common.UriUtils; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; +import org.opencb.opencga.storage.hadoop.utils.AbstractHBaseDriver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.ByteArrayOutputStream; +import java.nio.charset.Charset; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import static org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageOptions.*; @@ -30,6 +34,7 @@ public class SshMRExecutor extends MRExecutor { private static final String HADOOP_SSH_KEY_ENV = "HADOOP_SSH_KEY"; // env-var expected by "sshpass -e" private static final String SSHPASS_ENV = "SSHPASS"; + public static final String PID = "PID"; private static Logger logger = LoggerFactory.getLogger(SshMRExecutor.class); @Override @@ -39,20 +44,83 @@ public SshMRExecutor init(ObjectMap options) { } @Override - public int run(String executable, String[] args) throws StorageEngineException { + public Result run(String executable, String[] args) throws StorageEngineException { String commandLine = buildCommand(executable, args); List env = buildEnv(); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + Thread hook = new Thread(() -> { + logger.info("Shutdown hook. Killing MR jobs"); + logger.info("Read output key-value:"); + ObjectMap result = readResult(new String(outputStream.toByteArray(), Charset.defaultCharset())); + for (Map.Entry entry : result.entrySet()) { + logger.info(" - " + entry.getKey() + ": " + entry.getValue()); + } + String remotePid = result.getString(PID); + logger.info("Remote PID: " + remotePid); + List mrJobs = result.getAsStringList(AbstractHBaseDriver.MR_APPLICATION_ID); + logger.info("MR jobs to kill: " + mrJobs); + for (String mrJob : mrJobs) { + logger.info("Killing MR job " + mrJob); + String commandLineKill = buildCommand("yarn", "application", "-kill", mrJob); + Command command = new Command(commandLineKill, env); + command.run(); + int exitValue = command.getExitValue(); + if (exitValue != 0) { + logger.error("Error killing MR job " + mrJob); + } else { + logger.info("MR job " + mrJob + " killed!"); + } + } + if (remotePid != null) { + int remoteProcessGraceKillPeriod = getOptions() + .getInt(MR_EXECUTOR_SSH_HADOOP_TERMINATION_GRACE_PERIOD_SECONDS.key(), + MR_EXECUTOR_SSH_HADOOP_TERMINATION_GRACE_PERIOD_SECONDS.defaultValue()); + logger.info("Wait up to " + remoteProcessGraceKillPeriod + "s for the remote process to finish"); + String commandLineWaitPid = buildCommand("bash", "-c", "" + + "pid=" + remotePid + "; " + + "i=0; " + + "while [ $(( i++ )) -lt " + remoteProcessGraceKillPeriod + " ] && ps -p $pid > /dev/null; do sleep 1; done; " + + "if ps -p $pid > /dev/null; then " + + " echo \"Kill remote ssh process $pid\"; " + + " ps -p $pid; " + + " kill -15 $pid; " + + "else " + + " echo \"Process $pid finished\"; " + + " fi"); + Command command = new Command(commandLineWaitPid, env); + command.run(); + if (command.getExitValue() != 0) { + logger.error("Error waiting for remote process to finish"); + } else { + logger.info("Remote process finished!"); + } + } + }); + Runtime.getRuntime().addShutdownHook(hook); Command command = new Command(commandLine, env); + command.setErrorOutputStream(outputStream); command.run(); int exitValue = command.getExitValue(); - + Runtime.getRuntime().removeShutdownHook(hook); + ObjectMap result = readResult(new String(outputStream.toByteArray(), Charset.defaultCharset())); if (exitValue == 0) { copyOutputFiles(args, env); } - return exitValue; + return new Result(exitValue, result); } + /** + * Copy output files from remote server to local filesystem. + *

+ * This method will look for the "output" argument in the args array. + * The value of the argument is expected to be a path. + * + * @param args Arguments passed to the executable + * @param env Environment variables + * @return Path to the output file + * @throws StorageEngineException if there is an issue copying the files + */ private Path copyOutputFiles(String[] args, List env) throws StorageEngineException { List argsList = Arrays.asList(args); int outputIdx = argsList.indexOf("output"); @@ -83,6 +151,7 @@ private Path copyOutputFiles(String[] args, List env) throws StorageEngi return Paths.get(targetOutput); } } + // Nothing to copy return null; } diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SystemMRExecutor.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SystemMRExecutor.java index bb226be8d44..b46be099230 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SystemMRExecutor.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/executors/SystemMRExecutor.java @@ -17,8 +17,12 @@ package org.opencb.opencga.storage.hadoop.variant.executors; import org.apache.tools.ant.types.Commandline; +import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.commons.exec.Command; +import java.io.ByteArrayOutputStream; +import java.nio.charset.Charset; + import static org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageOptions.MR_EXECUTOR_SSH_PASSWORD; /** @@ -29,14 +33,13 @@ public class SystemMRExecutor extends MRExecutor { @Override - public int run(String executable, String[] args) { - return run(buildCommandLine(executable, args)); - } - - public int run(String commandLine) { - Command command = new Command(commandLine, getEnv()); + public Result run(String executable, String[] args) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + Command command = new Command(buildCommandLine(executable, args), getEnv()); + command.setErrorOutputStream(outputStream); command.run(); - return command.getExitValue(); + ObjectMap result = readResult(new String(outputStream.toByteArray(), Charset.defaultCharset())); + return new Result(command.getExitValue(), result); } private String buildCommandLine(String executable, String[] args) { diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsFromArchiveMapper.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsFromArchiveMapper.java index 36d408f6fef..9b8df0c579d 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsFromArchiveMapper.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsFromArchiveMapper.java @@ -6,7 +6,7 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.mapreduce.Job; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; -import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveDriver; +import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveTableHelper; import org.opencb.opencga.storage.hadoop.variant.mr.AbstractArchiveTableMapper; import org.opencb.opencga.storage.hadoop.variant.mr.VariantsTableMapReduceHelper; @@ -63,7 +63,7 @@ protected void setup(Context context) throws IOException, InterruptedException { long timestamp = getMrHelper().getTimestamp(); if (isFillGaps(context.getConfiguration())) { Collection samples = getSamples(context.getConfiguration()); - String archiveTableName = context.getConfiguration().get(ArchiveDriver.CONFIG_ARCHIVE_TABLE_NAME); + String archiveTableName = context.getConfiguration().get(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME); String gapsGenotype = context.getConfiguration().get( FILL_GAPS_GAP_GENOTYPE.key(), FILL_GAPS_GAP_GENOTYPE.defaultValue()); diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsMapper.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsMapper.java index 06139af23a5..cacd50da458 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsMapper.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/gaps/FillGapsMapper.java @@ -7,7 +7,7 @@ import org.opencb.biodata.models.variant.Variant; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; import org.opencb.opencga.storage.hadoop.utils.HBaseManager; -import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveDriver; +import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveTableHelper; import org.opencb.opencga.storage.hadoop.variant.mr.VariantMapper; import java.io.IOException; @@ -28,7 +28,7 @@ protected void setup(Context context) throws IOException, InterruptedException { Configuration configuration = context.getConfiguration(); HBaseManager hBaseManager = new HBaseManager(configuration); - String archiveTableName = context.getConfiguration().get(ArchiveDriver.CONFIG_ARCHIVE_TABLE_NAME); + String archiveTableName = context.getConfiguration().get(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME); Collection samples = FillGapsFromArchiveMapper.getSamples(configuration); fillGapsTask = new FillGapsFromVariantTask(hBaseManager, archiveTableName, diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/mr/VariantTableHelper.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/mr/VariantTableHelper.java index a1b12db30fa..3daa349abb1 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/mr/VariantTableHelper.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/main/java/org/opencb/opencga/storage/hadoop/variant/mr/VariantTableHelper.java @@ -30,7 +30,7 @@ import org.opencb.opencga.storage.hadoop.variant.GenomeHelper; import org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageOptions; import org.opencb.opencga.storage.hadoop.variant.adaptors.phoenix.VariantPhoenixKeyFactory; -import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveDriver; +import org.opencb.opencga.storage.hadoop.variant.archive.ArchiveTableHelper; import org.opencb.opencga.storage.hadoop.variant.utils.HBaseVariantTableNameGenerator; import java.io.IOException; @@ -122,7 +122,7 @@ public static String getVariantsTable(Configuration conf) { } public static void setArchiveTable(Configuration conf, String archiveTable) { - conf.set(ArchiveDriver.CONFIG_ARCHIVE_TABLE_NAME, archiveTable); + conf.set(ArchiveTableHelper.CONFIG_ARCHIVE_TABLE_NAME, archiveTable); } public HBaseVariantTableNameGenerator getHBaseVariantTableNameGenerator() { diff --git a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageTest.java b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageTest.java index 787ea7c4412..d11635abe6d 100644 --- a/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageTest.java +++ b/opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core/src/test/java/org/opencb/opencga/storage/hadoop/variant/HadoopVariantStorageTest.java @@ -534,7 +534,7 @@ public static void setStaticConfiguration(Configuration staticConfiguration) { @Override - public int run(Class clazz, String[] args) throws StorageEngineException { + public Result run(Class clazz, String[] args) throws StorageEngineException { try { // Copy configuration Configuration conf = new Configuration(false); @@ -547,14 +547,14 @@ public int run(Class clazz, String[] args) throws StorageEng if (((Number) o).intValue() != 0) { throw new StorageEngineException("Error executing MapReduce. Exit code: " + o); } - return ((Number) o).intValue(); + return new Result(((Number) o).intValue(), new ObjectMap()); } catch (Exception e) { throw new StorageEngineException("Error executing MapReduce.", e); } } @Override - public int run(String executable, String[] args) { + public Result run(String executable, String[] args) { try { // Copy configuration Configuration conf = new Configuration(false); @@ -569,7 +569,7 @@ public int run(String executable, String[] args) { if (((Number) o).intValue() != 0) { throw new RuntimeException("Exit code = " + o); } - return ((Number) o).intValue(); + return new Result(((Number) o).intValue(), new ObjectMap()); } catch (Exception e) { // e.printStackTrace(); diff --git a/pom.xml b/pom.xml index 1885bae4031..e5500bbadd5 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,7 @@ 4.5.6 5.64.4 1.6.1 - 4.3.0 + 6.13.1 3.1.0 1.10.12 4.4.13 @@ -977,6 +977,21 @@ kubernetes-model ${kubernetes.version} + + io.fabric8 + kubernetes-model-core + ${kubernetes.version} + + + io.fabric8 + kubernetes-client-api + ${kubernetes.version} + + + io.fabric8 + kubernetes-model-batch + ${kubernetes.version} + javax.servlet javax.servlet-api @@ -1414,7 +1429,7 @@ https://uk.ws.zettagenomics.com/cellbase/ - v5.2 + v5.8