diff --git a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/workflow/NextFlowExecutor.java b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/workflow/NextFlowExecutor.java index ba557e5bf5..83d8d68c7d 100644 --- a/opencga-analysis/src/main/java/org/opencb/opencga/analysis/workflow/NextFlowExecutor.java +++ b/opencga-analysis/src/main/java/org/opencb/opencga/analysis/workflow/NextFlowExecutor.java @@ -163,7 +163,7 @@ protected void run() throws Exception { if (workflow.getRepository() != null && StringUtils.isNotEmpty(workflow.getRepository().getImage())) { // stringBuilder.append(workflow.getRepository().getImage()).append(" -with-docker"); stringBuilder.append(workflow.getRepository().getImage()); - dockerParams.put("-v", "/var/run/docker.sock:/var/run/docker.sock"); +// dockerParams.put("-v", "/var/run/docker.sock:/var/run/docker.sock"); } else { for (WorkflowScript script : workflow.getScripts()) { if (script.isMain()) { 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 ea9e2079b5..6da7fef761 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 @@ -221,6 +221,10 @@ private RestResponse distinct() throws Exception { queryParams.putIfNotEmpty("uuid", commandOptions.uuid); queryParams.putIfNotEmpty("toolId", commandOptions.toolId); queryParams.putIfNotEmpty("toolType", commandOptions.toolType); + queryParams.putIfNotEmpty("toolExternalExecutorId", commandOptions.toolExternalExecutorId); + queryParams.putIfNotEmpty("parentId", commandOptions.parentId); + queryParams.putIfNotNull("dryRun", commandOptions.dryRun); + queryParams.putIfNotNull("internalKillJobRequested", commandOptions.internalKillJobRequested); queryParams.putIfNotEmpty("userId", commandOptions.userId); queryParams.putIfNotEmpty("priority", commandOptions.priority); queryParams.putIfNotEmpty("status", commandOptions.status); @@ -297,6 +301,10 @@ private RestResponse search() throws Exception { queryParams.putIfNotEmpty("uuid", commandOptions.uuid); queryParams.putIfNotEmpty("toolId", commandOptions.toolId); queryParams.putIfNotEmpty("toolType", commandOptions.toolType); + queryParams.putIfNotEmpty("toolExternalExecutorId", commandOptions.toolExternalExecutorId); + queryParams.putIfNotEmpty("parentId", commandOptions.parentId); + queryParams.putIfNotNull("dryRun", commandOptions.dryRun); + queryParams.putIfNotNull("internalKillJobRequested", commandOptions.internalKillJobRequested); queryParams.putIfNotEmpty("userId", commandOptions.userId); queryParams.putIfNotEmpty("priority", commandOptions.priority); queryParams.putIfNotEmpty("status", commandOptions.status); 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 b918e3ee13..ae9004c361 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 @@ -195,6 +195,18 @@ public class DistinctCommandOptions { @Parameter(names = {"--tool-type"}, description = "Tool type executed by the job [OPERATION, ANALYSIS]", required = false, arity = 1) public String toolType; + @Parameter(names = {"--tool.external-executor.id"}, description = "Id of the external executor. This field is only applicable for jobs executed by an external executor.", required = false, arity = 1) + public String toolExternalExecutorId; + + @Parameter(names = {"--parent-id"}, description = "Job id that generated this job (if any).", required = false, arity = 1) + public String parentId; + + @Parameter(names = {"--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 dryRun; + + @Parameter(names = {"--internal.kill-job-requested"}, description = "Flag indicating that the user requested to kill the job.", required = false, arity = 1) + public Boolean internalKillJobRequested; + @Parameter(names = {"--user-id"}, description = "User that created the job", required = false, arity = 1) public String userId; @@ -319,6 +331,18 @@ public class SearchCommandOptions { @Parameter(names = {"--tool-type"}, description = "Tool type executed by the job [OPERATION, ANALYSIS]", required = false, arity = 1) public String toolType; + @Parameter(names = {"--tool.external-executor.id"}, description = "Id of the external executor. This field is only applicable for jobs executed by an external executor.", required = false, arity = 1) + public String toolExternalExecutorId; + + @Parameter(names = {"--parent-id"}, description = "Job id that generated this job (if any).", required = false, arity = 1) + public String parentId; + + @Parameter(names = {"--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 dryRun; + + @Parameter(names = {"--internal.kill-job-requested"}, description = "Flag indicating that the user requested to kill the job.", required = false, arity = 1) + public Boolean internalKillJobRequested; + @Parameter(names = {"--user-id"}, description = "User that created the job", required = false, arity = 1) public String userId; 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 a8f1e717ca..b3f38e8a5c 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 @@ -112,8 +112,10 @@ enum QueryParams implements QueryParam { TOOL("tool", OBJECT, ""), TOOL_ID("tool.id", TEXT, ""), + TOOL_EXTERNAL_EXECUTOR_ID("tool.externalExecutor.id", TEXT, ""), TOOL_TYPE("tool.type", TEXT, ""), TOOL_EXTERNAL_EXECUTOR("tool.externalExecutor", OBJECT, ""), + PARENT_ID("parentId", TEXT, ""), PRIORITY("priority", TEXT, ""), @@ -133,6 +135,7 @@ enum QueryParams implements QueryParam { INPUT("input", OBJECT, ""), OUTPUT("output", OBJECT, ""), DEPENDS_ON("dependsOn", TEXT_ARRAY, ""), + DRY_RUN("dryRun", BOOLEAN, ""), TAGS("tags", TEXT_ARRAY, ""), EXECUTION("execution", OBJECT, ""), diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/WorkflowDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/WorkflowDBAdaptor.java index b2ff9946d4..18a9eb6706 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/WorkflowDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/WorkflowDBAdaptor.java @@ -29,6 +29,7 @@ enum QueryParams implements QueryParam { TAGS("tags", TEXT_ARRAY, ""), COMMAND_LINE("commandLine", TEXT, ""), MANAGER("manager", OBJECT, ""), + MANAGER_ID("manager.id", TEXT, ""), SCRIPTS("scripts", OBJECT, ""), VARIABLES("variables", OBJECT, ""), INTERNAL_REGISTRATION_USER_ID("internal.registrationUserId", TEXT, ""), 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 cb59d9dca0..630e4cb83e 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 @@ -886,7 +886,11 @@ private Bson parseQuery(Query query, Document extraQuery, QueryOptions options, case UUID: case USER_ID: case TOOL_TYPE: - case PRIORITY: // TODO: This filter is not indexed. We should change it and query _priority instead. + case PRIORITY: + case TOOL_EXTERNAL_EXECUTOR_ID: + case PARENT_ID: + case DRY_RUN: + case INTERNAL_KILL_JOB_REQUESTED: // case START_TIME: // case END_TIME: // case OUTPUT_ERROR: diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/WorkflowMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/WorkflowMongoDBAdaptor.java index d84291f6f0..2678f09353 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/WorkflowMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/WorkflowMongoDBAdaptor.java @@ -563,6 +563,7 @@ protected Bson parseQuery(Query query, Document extraQuery, String user) case RELEASE: case VERSION: case INTERNAL_REGISTRATION_USER_ID: + case MANAGER_ID: case TYPE: case DRAFT: addAutoOrQuery(queryParam.key(), queryParam.key(), queryCopy, queryParam.type(), andBsonList); diff --git a/opencga-catalog/src/main/resources/catalog-indexes.txt b/opencga-catalog/src/main/resources/catalog-indexes.txt index eb2c34d47f..7710a8ce03 100644 --- a/opencga-catalog/src/main/resources/catalog-indexes.txt +++ b/opencga-catalog/src/main/resources/catalog-indexes.txt @@ -23,7 +23,6 @@ {"collections": ["job"], "fields": {"tool.externalExecutor.id": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"userId": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"parentId": 1, "studyUid": 1}, "options": {}} -{"collections": ["job"], "fields": {"dependsOn.id": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"outDir.uid": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"input.uid": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"output.uid": 1, "studyUid": 1}, "options": {}} @@ -34,8 +33,6 @@ {"collections": ["job"], "fields": {"internal.status.id": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"internal.status.id": 1, "_priority": 1, "_creationDate": 1}, "options": {}} {"collections": ["job"], "fields": {"internal.killJobRequested": 1, "studyUid": 1}, "options": {}} -{"collections": ["job"], "fields": {"_priority": 1, "_creationDate": 1, "studyUid": 1}, "options": {}} -{"collections": ["job"], "fields": {"_priority": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"_creationDate": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"_modificationDate": 1, "studyUid": 1}, "options": {}} {"collections": ["job"], "fields": {"studyUid": 1, "_acl": 1}, "options": {}} diff --git a/opencga-client/src/main/R/R/Job-methods.R b/opencga-client/src/main/R/R/Job-methods.R index 103fbc7728..745f5578c5 100644 --- a/opencga-client/src/main/R/R/Job-methods.R +++ b/opencga-client/src/main/R/R/Job-methods.R @@ -21,9 +21,9 @@ #' | -- | :-- | --: | #' | 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[*] | +#' | distinct | /{apiVersion}/jobs/distinct | study, otherStudies, id, uuid, toolId, toolType, tool.externalExecutor.id, parentId, dryRun, internal.killJobRequested, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted, field[*] | #' | 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 | +#' | search | /{apiVersion}/jobs/search | include, exclude, limit, skip, count, study, otherStudies, id, uuid, toolId, toolType, tool.externalExecutor.id, parentId, dryRun, internal.killJobRequested, userId, priority, status, internalStatus, creationDate, modificationDate, visited, tags, input, output, acl, release, deleted | #' | buildTool | /{apiVersion}/jobs/tool/build | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | runTool | /{apiVersion}/jobs/tool/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | #' | top | /{apiVersion}/jobs/top | limit, study, internalStatus, priority, userId, toolId | @@ -68,6 +68,10 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi #' @param uuid Comma separated list of job UUIDs up to a maximum of 100. #' @param toolId Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. #' @param toolType Tool type executed by the job [OPERATION, ANALYSIS]. + #' @param tool.externalExecutor.id Id of the external executor. This field is only applicable for jobs executed by an external executor. + #' @param parentId Job id that generated this job (if any). + #' @param dryRun Flag indicating that the job will be executed in dry-run mode. 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 internal.killJobRequested Flag indicating that the user requested to kill the job. #' @param userId User that created the job. #' @param priority Priority of the job. #' @param status Filter by status. @@ -110,6 +114,10 @@ setMethod("jobClient", "OpencgaR", function(OpencgaR, job, jobs, members, endpoi #' @param uuid Comma separated list of job UUIDs up to a maximum of 100. #' @param toolId Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. #' @param toolType Tool type executed by the job [OPERATION, ANALYSIS]. + #' @param tool.externalExecutor.id Id of the external executor. This field is only applicable for jobs executed by an external executor. + #' @param parentId Job id that generated this job (if any). + #' @param dryRun Flag indicating that the job will be executed in dry-run mode. 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 internal.killJobRequested Flag indicating that the user requested to kill the job. #' @param userId User that created the job. #' @param priority Priority of the job. #' @param status Filter by status. diff --git a/opencga-client/src/main/R/R/Workflow-methods.R b/opencga-client/src/main/R/R/Workflow-methods.R index 84e2d99f05..1e7736bac3 100644 --- a/opencga-client/src/main/R/R/Workflow-methods.R +++ b/opencga-client/src/main/R/R/Workflow-methods.R @@ -21,9 +21,9 @@ #' | -- | :-- | --: | #' | updateAcl | /{apiVersion}/workflows/acl/{members}/update | study, members[*], action[*], body[*] | #' | create | /{apiVersion}/workflows/create | include, exclude, study, includeResult, body[*] | -#' | distinct | /{apiVersion}/workflows/distinct | study, id, name, uuid, tags, draft, internal.registrationUserId, type, creationDate, modificationDate, acl, release, snapshot, deleted, field[*] | +#' | distinct | /{apiVersion}/workflows/distinct | study, id, name, uuid, tags, draft, internal.registrationUserId, manager.id, type, creationDate, modificationDate, acl, release, snapshot, deleted, field[*] | #' | run | /{apiVersion}/workflows/run | study, jobId, jobDescription, jobDependsOn, jobTags, jobScheduledStartTime, jobPriority, jobDryRun, body[*] | -#' | search | /{apiVersion}/workflows/search | include, exclude, limit, skip, count, study, id, name, uuid, tags, draft, internal.registrationUserId, type, creationDate, modificationDate, acl, release, snapshot, deleted | +#' | search | /{apiVersion}/workflows/search | include, exclude, limit, skip, count, study, id, name, uuid, tags, draft, internal.registrationUserId, manager.id, type, creationDate, modificationDate, acl, release, snapshot, deleted | #' | update | /{apiVersion}/workflows/{workflowId}/update | include, exclude, workflowId[*], study, includeResult, body | #' | acl | /{apiVersion}/workflows/{workflows}/acl | workflows[*], study, member, silent | #' | delete | /{apiVersion}/workflows/{workflows}/delete | study, workflows[*] | @@ -67,6 +67,7 @@ setMethod("workflowClient", "OpencgaR", function(OpencgaR, members, workflowId, #' @param tags Comma separated list of tags. #' @param draft Boolean field indicating whether the workflow is a draft or not. #' @param internal.registrationUserId UserId that created the workflow. + #' @param manager.id Id of the workflow system (Allowed values: NEXTFLOW). #' @param type Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. #' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. #' @param modificationDate Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. @@ -106,6 +107,7 @@ setMethod("workflowClient", "OpencgaR", function(OpencgaR, members, workflowId, #' @param tags Comma separated list of tags. #' @param draft Boolean field indicating whether the workflow is a draft or not. #' @param internal.registrationUserId UserId that created the workflow. + #' @param manager.id Id of the workflow system (Allowed values: NEXTFLOW). #' @param type Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. #' @param creationDate Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. #' @param modificationDate Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. 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 8d8e12cf5b..cddc9960f4 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 @@ -95,6 +95,11 @@ public RestResponse create(JobCreateParams data, ObjectMap params) throws C * toolId: Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. * '~value' for case sensitive, '~/value/i' for case insensitive search. * toolType: Tool type executed by the job [OPERATION, ANALYSIS]. + * tool.externalExecutor.id: Id of the external executor. This field is only applicable for jobs executed by an external executor. + * parentId: Job id that generated this job (if any). + * dryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters + * and prerequisites are correctly set for successful execution, but the job will not actually run. + * internal.killJobRequested: Flag indicating that the user requested to kill the job. * userId: User that created the job. * priority: Priority of the job. * status: Filter by status. @@ -154,6 +159,11 @@ public RestResponse retry(JobRetryParams data, ObjectMap params) throws Cli * toolId: Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. '~{perl-regex}' e.g. * '~value' for case sensitive, '~/value/i' for case insensitive search. * toolType: Tool type executed by the job [OPERATION, ANALYSIS]. + * tool.externalExecutor.id: Id of the external executor. This field is only applicable for jobs executed by an external executor. + * parentId: Job id that generated this job (if any). + * dryRun: Flag indicating that the job will be executed in dry-run mode. In this mode, OpenCGA will validate that all parameters + * and prerequisites are correctly set for successful execution, but the job will not actually run. + * internal.killJobRequested: Flag indicating that the user requested to kill the job. * userId: User that created the job. * priority: Priority of the job. * status: Filter by status. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/WorkflowClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/WorkflowClient.java index 652f15f93e..7627ba5e73 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/WorkflowClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/WorkflowClient.java @@ -99,6 +99,7 @@ public RestResponse create(WorkflowCreateParams data, ObjectMap params * tags: Comma separated list of tags. * draft: Boolean field indicating whether the workflow is a draft or not. * internal.registrationUserId: UserId that created the workflow. + * manager.id: Id of the workflow system (Allowed values: NEXTFLOW). * type: Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. * creationDate: Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. * modificationDate: Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. @@ -156,6 +157,7 @@ public RestResponse run(NextFlowRunParams data, ObjectMap params) throws Cl * tags: Comma separated list of tags. * draft: Boolean field indicating whether the workflow is a draft or not. * internal.registrationUserId: UserId that created the workflow. + * manager.id: Id of the workflow system (Allowed values: NEXTFLOW). * type: Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. * creationDate: Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. * modificationDate: Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. diff --git a/opencga-client/src/main/javascript/Job.js b/opencga-client/src/main/javascript/Job.js index df1de64c0b..acffe2f30b 100644 --- a/opencga-client/src/main/javascript/Job.js +++ b/opencga-client/src/main/javascript/Job.js @@ -66,6 +66,12 @@ export default class Job extends OpenCGAParentClass { * @param {String} [params.toolId] - Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. * '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. * @param {String} [params.toolType] - Tool type executed by the job [OPERATION, ANALYSIS]. + * @param {String} [params.tool.externalExecutor.id] - Id of the external executor. This field is only applicable for jobs executed by an + * external executor. + * @param {String} [params.parentId] - Job id that generated this job (if any). + * @param {Boolean} [params.dryRun] - Flag indicating that the job will be executed in dry-run mode. 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.internal.killJobRequested] - Flag indicating that the user requested to kill the job. * @param {String} [params.userId] - User that created the job. * @param {String} [params.priority] - Priority of the job. * @param {String} [params.status] - Filter by status. @@ -120,6 +126,12 @@ export default class Job extends OpenCGAParentClass { * @param {String} [params.toolId] - Tool ID executed by the job. Also admits basic regular expressions using the operator '~', i.e. * '~{perl-regex}' e.g. '~value' for case sensitive, '~/value/i' for case insensitive search. * @param {String} [params.toolType] - Tool type executed by the job [OPERATION, ANALYSIS]. + * @param {String} [params.tool.externalExecutor.id] - Id of the external executor. This field is only applicable for jobs executed by an + * external executor. + * @param {String} [params.parentId] - Job id that generated this job (if any). + * @param {Boolean} [params.dryRun] - Flag indicating that the job will be executed in dry-run mode. 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.internal.killJobRequested] - Flag indicating that the user requested to kill the job. * @param {String} [params.userId] - User that created the job. * @param {String} [params.priority] - Priority of the job. * @param {String} [params.status] - Filter by status. diff --git a/opencga-client/src/main/javascript/Workflow.js b/opencga-client/src/main/javascript/Workflow.js index f2dfd10cdf..b1c93077a6 100644 --- a/opencga-client/src/main/javascript/Workflow.js +++ b/opencga-client/src/main/javascript/Workflow.js @@ -72,6 +72,7 @@ export default class Workflow extends OpenCGAParentClass { * @param {String} [params.tags] - Comma separated list of tags. * @param {Boolean} [params.draft] - Boolean field indicating whether the workflow is a draft or not. * @param {String} [params.internal.registrationUserId] - UserId that created the workflow. + * @param {String} [params.manager.id] - Id of the workflow system (Allowed values: NEXTFLOW). * @param {String} [params.type] - Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. * @param {String} [params.creationDate] - Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. * @param {String} [params.modificationDate] - Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. @@ -123,6 +124,7 @@ export default class Workflow extends OpenCGAParentClass { * @param {String} [params.tags] - Comma separated list of tags. * @param {Boolean} [params.draft] - Boolean field indicating whether the workflow is a draft or not. * @param {String} [params.internal.registrationUserId] - UserId that created the workflow. + * @param {String} [params.manager.id] - Id of the workflow system (Allowed values: NEXTFLOW). * @param {String} [params.type] - Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. * @param {String} [params.creationDate] - Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. * @param {String} [params.modificationDate] - Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. 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 9734e86479..aab6342f11 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 @@ -70,6 +70,16 @@ def distinct(self, field, **options): search. :param str tool_type: Tool type executed by the job [OPERATION, ANALYSIS]. + :param str tool.external_executor.id: Id of the external executor. + This field is only applicable for jobs executed by an external + executor. + :param str parent_id: Job id that generated this job (if any). + :param bool 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 internal.kill_job_requested: Flag indicating that the user + requested to kill the job. :param str user_id: User that created the job. :param str priority: Priority of the job. :param str status: Filter by status. @@ -143,6 +153,16 @@ def search(self, **options): search. :param str tool_type: Tool type executed by the job [OPERATION, ANALYSIS]. + :param str tool.external_executor.id: Id of the external executor. + This field is only applicable for jobs executed by an external + executor. + :param str parent_id: Job id that generated this job (if any). + :param bool 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 internal.kill_job_requested: Flag indicating that the user + requested to kill the job. :param str user_id: User that created the job. :param str priority: Priority of the job. :param str status: Filter by status. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/workflow_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/workflow_client.py index fdf242702e..8ac5c76b85 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/workflow_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/workflow_client.py @@ -79,6 +79,8 @@ def distinct(self, field, **options): draft or not. :param str internal.registration_user_id: UserId that created the workflow. + :param str manager.id: Id of the workflow system (Allowed values: + NEXTFLOW). :param str type: Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. :param str creation_date: Creation date. Format: yyyyMMddHHmmss. @@ -154,6 +156,8 @@ def search(self, **options): draft or not. :param str internal.registration_user_id: UserId that created the workflow. + :param str manager.id: Id of the workflow system (Allowed values: + NEXTFLOW). :param str type: Workflow type. Allowed types: [CLINICAL_INTERPRETATION, SECONDARY_ANALYSIS, RESEARCH or OTHER]. :param str creation_date: Creation date. Format: yyyyMMddHHmmss. 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 9a52837423..67f06aa1f3 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 @@ -554,6 +554,14 @@ public class ParamConstants { public static final String JOB_DEPENDS_ON_PARAM = "dependsOn"; public static final String JOB_DEPENDS_ON_DESCRIPTION = "Comma separated list of existing job IDs the job will depend on."; public static final String JOB_TOOL_ID_PARAM = "toolId"; + public static final String JOB_TOOL_EXTERNAL_EXECUTOR_ID_PARAM = "tool.externalExecutor.id"; + public static final String JOB_TOOL_EXTERNAL_EXECUTOR_ID_DESCRIPTION = "Id of the external executor. This field is only applicable for " + + "jobs executed by an external executor."; + public static final String JOB_DRY_RUN_PARAM = "dryRun"; + public static final String JOB_PARENT_ID_PARAM = "parentId"; + public static final String JOB_PARENT_ID_DESCRIPTION = "Job id that generated this job (if any)."; + public static final String JOB_INTERNAL_KILL_JOB_REQUESTED_PARAM = "internal.killJobRequested"; + public static final String JOB_INTERNAL_KILL_JOB_REQUESTED_DESCRIPTION = "Flag indicating that the user requested to kill the job."; public static final String JOB_TOOL_TYPE_PARAM = "toolType"; public static final String JOB_TOOL_ID_DESCRIPTION = "Tool ID executed by the job" + REGEX_SUPPORT; public static final String JOB_TOOL_TYPE_DESCRIPTION = "Tool type executed by the job [OPERATION, ANALYSIS]"; @@ -590,6 +598,7 @@ public class ParamConstants { public static final String WORKFLOWS_TAGS_PARAM = "tags"; public static final String WORKFLOWS_DRAFT_PARAM = "draft"; public static final String WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_PARAM = "internal.registrationUserId"; + public static final String WORKFLOWS_MANAGER_ID_PARAM = "manager.id"; public static final String WORKFLOWS_ID_DESCRIPTION = "Comma separated list of workflow IDs" + UP_TO_100 + REGEX_SUPPORT; public static final String WORKFLOWS_NAME_DESCRIPTION = "Comma separated list of workflow names" + UP_TO_100 + REGEX_SUPPORT; public static final String WORKFLOWS_UUID_DESCRIPTION = "Comma separated list of workflow UUIDs" + UP_TO_100; @@ -598,6 +607,7 @@ public class ParamConstants { public static final String WORKFLOWS_TAGS_DESCRIPTION = "Comma separated list of tags"; public static final String WORKFLOWS_DRAFT_DESCRIPTION = "Boolean field indicating whether the workflow is a draft or not."; public static final String WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_DESCRIPTION = "UserId that created the workflow."; + public static final String WORKFLOWS_MANAGER_ID_DESCRIPTION = "Id of the workflow system (Allowed values: NEXTFLOW)."; public static final String WORKFLOW_SCRIPTS_ACTION_DESCRIPTION = "Action to be performed if the array of scripts is being updated " + "[SET, ADD, REMOVE]"; public static final String WORKFLOW_SCRIPTS_ACTION_PARAM = "scriptsAction"; 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 97c54b3373..67a34804c8 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 @@ -233,6 +233,10 @@ public Response search( @ApiParam(value = ParamConstants.JOB_UUIDS_DESCRIPTION) @QueryParam(ParamConstants.JOB_UUID_PARAM) String uuid, @ApiParam(value = ParamConstants.JOB_TOOL_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_ID_PARAM) String toolId, @ApiParam(value = ParamConstants.JOB_TOOL_TYPE_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_TYPE_PARAM) String toolType, + @ApiParam(value = ParamConstants.JOB_TOOL_EXTERNAL_EXECUTOR_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_EXTERNAL_EXECUTOR_ID_PARAM) String externalExecutorId, + @ApiParam(value = ParamConstants.JOB_PARENT_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_PARENT_ID_PARAM) String parentId, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN_PARAM) Boolean dryRun, + @ApiParam(value = ParamConstants.JOB_INTERNAL_KILL_JOB_REQUESTED_DESCRIPTION) @QueryParam(ParamConstants.JOB_INTERNAL_KILL_JOB_REQUESTED_PARAM) Boolean killRequested, @ApiParam(value = ParamConstants.JOB_USER_DESCRIPTION) @QueryParam(ParamConstants.JOB_USER_PARAM) String user, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.JOB_PRIORITY_PARAM) String priority, @ApiParam(value = ParamConstants.JOB_STATUS_DESCRIPTION) @QueryParam(ParamConstants.JOB_STATUS_PARAM) String status, @@ -264,6 +268,10 @@ public Response distinct( @ApiParam(value = ParamConstants.JOB_UUIDS_DESCRIPTION) @QueryParam(ParamConstants.JOB_UUID_PARAM) String uuid, @ApiParam(value = ParamConstants.JOB_TOOL_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_ID_PARAM) String toolId, @ApiParam(value = ParamConstants.JOB_TOOL_TYPE_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_TYPE_PARAM) String toolType, + @ApiParam(value = ParamConstants.JOB_TOOL_EXTERNAL_EXECUTOR_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_TOOL_EXTERNAL_EXECUTOR_ID_PARAM) String externalExecutorId, + @ApiParam(value = ParamConstants.JOB_PARENT_ID_DESCRIPTION) @QueryParam(ParamConstants.JOB_PARENT_ID_PARAM) String parentId, + @ApiParam(value = ParamConstants.JOB_DRY_RUN_DESCRIPTION) @QueryParam(ParamConstants.JOB_DRY_RUN_PARAM) Boolean dryRun, + @ApiParam(value = ParamConstants.JOB_INTERNAL_KILL_JOB_REQUESTED_DESCRIPTION) @QueryParam(ParamConstants.JOB_INTERNAL_KILL_JOB_REQUESTED_PARAM) Boolean killRequested, @ApiParam(value = ParamConstants.JOB_USER_DESCRIPTION) @QueryParam(ParamConstants.JOB_USER_PARAM) String user, @ApiParam(value = ParamConstants.JOB_PRIORITY_DESCRIPTION) @QueryParam(ParamConstants.JOB_PRIORITY_PARAM) String priority, @ApiParam(value = ParamConstants.JOB_STATUS_DESCRIPTION) @QueryParam(ParamConstants.JOB_STATUS_PARAM) String status, diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/WorkflowWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/WorkflowWSServer.java index 99d86ea8d5..6c766b87d4 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/WorkflowWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/WorkflowWSServer.java @@ -122,6 +122,7 @@ public Response search( @ApiParam(value = ParamConstants.WORKFLOWS_TAGS_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_TAGS_PARAM) String tags, @ApiParam(value = ParamConstants.WORKFLOWS_DRAFT_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_DRAFT_PARAM) Boolean draft, @ApiParam(value = ParamConstants.WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_PARAM) String userId, + @ApiParam(value = ParamConstants.WORKFLOWS_MANAGER_ID_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_MANAGER_ID_PARAM) String systemId, @ApiParam(value = ParamConstants.WORKFLOWS_TYPE_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_TYPE_PARAM) String type, @ApiParam(value = ParamConstants.CREATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.CREATION_DATE_PARAM) String creationDate, @ApiParam(value = ParamConstants.MODIFICATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.MODIFICATION_DATE_PARAM) String modificationDate, @@ -149,6 +150,7 @@ public Response distinct( @ApiParam(value = ParamConstants.WORKFLOWS_TAGS_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_TAGS_PARAM) String tags, @ApiParam(value = ParamConstants.WORKFLOWS_DRAFT_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_DRAFT_PARAM) Boolean draft, @ApiParam(value = ParamConstants.WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_INTERNAL_REGISTRATION_USER_ID_PARAM) String userId, + @ApiParam(value = ParamConstants.WORKFLOWS_MANAGER_ID_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_MANAGER_ID_PARAM) String systemId, @ApiParam(value = ParamConstants.WORKFLOWS_TYPE_DESCRIPTION) @QueryParam(ParamConstants.WORKFLOWS_TYPE_PARAM) String type, @ApiParam(value = ParamConstants.CREATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.CREATION_DATE_PARAM) String creationDate, @ApiParam(value = ParamConstants.MODIFICATION_DATE_DESCRIPTION) @QueryParam(ParamConstants.MODIFICATION_DATE_PARAM) String modificationDate,