diff --git a/apps/web/src/app/workspaces/workspaces.component.html b/apps/web/src/app/workspaces/workspaces.component.html index 800ce5e429e69d10a5032b965a40424310cd6607..83247bb52310e8747d804cc86152051b4407f4f4 100644 --- a/apps/web/src/app/workspaces/workspaces.component.html +++ b/apps/web/src/app/workspaces/workspaces.component.html @@ -1,7 +1,7 @@ <div class="container-fluid"> <div class="row py-2"> <div class="col"> - <button type="button" class="btn btn-primary" (click)="nullButtonOnClick()">Launch null capability [null -g]</button> + <button type="button" class="btn btn-primary" (click)="downloadButtonOnClick()">Launch null capability [null -g]</button> </div> </div> </div> diff --git a/apps/web/src/app/workspaces/workspaces.component.ts b/apps/web/src/app/workspaces/workspaces.component.ts index 1d58b5a51373b4357be2760a9c3d5c63af9b766f..c7ef91ffc5dd317e686ede32782e3ad80b4b4c84 100644 --- a/apps/web/src/app/workspaces/workspaces.component.ts +++ b/apps/web/src/app/workspaces/workspaces.component.ts @@ -1,7 +1,7 @@ -import {Component, OnInit} from "@angular/core"; -import {CapabilityLauncherService} from "./services/capability-launcher.service"; -import {CapabilityRequest} from "./model/capability-request"; -import {CapabilityExecution} from "./model/capability-execution"; +import { Component, OnInit } from "@angular/core"; +import { CapabilityLauncherService } from "./services/capability-launcher.service"; +import { CapabilityRequest } from "./model/capability-request"; +import { CapabilityExecution } from "./model/capability-execution"; @Component({ selector: "app-workspaces", @@ -19,29 +19,33 @@ export class WorkspacesComponent implements OnInit { /** * OnClick method that creates a capability request for the null capability and submits it */ - nullButtonOnClick(): void { + downloadButtonOnClick(): void { // Create capability request - // TODO: Change this to request download capability execution - this.capabilityLauncher.createRequest("null", "-g").subscribe( - (requestResponse) => { - this.capabilityRequests.push(requestResponse); - if (requestResponse.id) { - // Capability request created; ID found - const requestId = requestResponse.id; - // Submit capability request - this.capabilityLauncher.submit(requestId).subscribe( - (submitResponse) => { - this.capabilityExecutions.push(submitResponse); - }, - (error) => { - console.log(error); - } - ); + this.capabilityLauncher + .createRequest( + "test_download", + "shared/workspaces/test/test_data/spool/724126739/17A-109.sb33151331.eb33786546.57892.65940042824" + ) + .subscribe( + (requestResponse) => { + this.capabilityRequests.push(requestResponse); + if (requestResponse.id) { + // Capability request created; ID found + const requestId = requestResponse.id; + // Submit capability request + this.capabilityLauncher.submit(requestId).subscribe( + (submitResponse) => { + this.capabilityExecutions.push(submitResponse); + }, + (error) => { + console.log(error); + } + ); + } + }, + (error) => { + console.log(error); } - }, - (error) => { - console.log(error); - } - ); + ); } } diff --git a/schema/versions/e50583fc2a8e_ssa_6391_add_download_capability_and_.py b/schema/versions/e50583fc2a8e_ssa_6391_add_download_capability_and_.py index e77646f7318bd65ecf19b07ac1b9700095990dfd..57ab8c9ea3546a9d4e9cac217ace6c7331ca49b3 100644 --- a/schema/versions/e50583fc2a8e_ssa_6391_add_download_capability_and_.py +++ b/schema/versions/e50583fc2a8e_ssa_6391_add_download_capability_and_.py @@ -1,4 +1,4 @@ -"""SSA-6391: add download capability and workflow +"""SSA-6391: add test_download capability and workflow Revision ID: e50583fc2a8e Revises: 21dc67216082 @@ -18,25 +18,25 @@ depends_on = None def upgrade(): op.execute( "INSERT INTO capabilities (capability_name, capability_steps, max_jobs) " - "VALUES ('download', 'await-product\nprepare-and-run-workflow download\nawait-workflow', 2)" + "VALUES ('test_download', 'prepare-and-run-workflow deliver -r,-l\nawait-workflow', 2)" ) - op.execute("INSERT INTO workflows (workflow_name) VALUES ('download')") + op.execute("INSERT INTO workflows (workflow_name) VALUES ('test_download')") op.execute( "INSERT INTO workflow_templates (workflow_name, filename, content) " - "VALUES ('download', 'download.condor', E'executable = download.sh\narguments = {{arguments}}" - "\nerror = download.err\nlog = download.log\n\n\nqueue')" + "VALUES ('test_download', 'test_download.condor', E'executable = test_download.sh\narguments = {{arguments}}" + "\nerror = test_download.err\nlog = test_download.log\n\n\nqueue')" ) op.execute( "INSERT INTO workflow_templates (workflow_name, filename, content) VALUES " - "('download', 'download.sh', E'#!/bin/sh\n\ndatafetcher --product-locator $1\ndeliver -r .\n')" + "('test_download', 'test_download.sh', E'#!/bin/sh\n\ndatafetcher --product-locator $1\ndeliver -r .\n')" ) op.execute( "INSERT INTO workflow_templates (Workflow_name, filename, content)" - "VALUES ('download', 'download.dag', E'JOB download download.condor')" + "VALUES ('test_download', 'test_download.dag', E'JOB test_download test_download.condor')" ) def downgrade(): - op.execute("DELETE FROM capabilities WHERE capability_name = 'download'") - op.execute("DELETE FROM workflows WHERE workflow_name = 'download'") - op.execute("DELETE FROM workflow_templates WHERE workflow_name = 'download'") + op.execute("DELETE FROM capabilities WHERE capability_name = 'test_download'") + op.execute("DELETE FROM workflows WHERE workflow_name = 'test_download'") + op.execute("DELETE FROM workflow_templates WHERE workflow_name = 'test_download'") diff --git a/shared/workspaces/workspaces/capability/helpers.py b/shared/workspaces/workspaces/capability/helpers.py index 24c71836e4ab9f296dbf369ffbf7fc4940433ddb..8f4e74ee3068c78838b31bb0017f283237dd5917 100644 --- a/shared/workspaces/workspaces/capability/helpers.py +++ b/shared/workspaces/workspaces/capability/helpers.py @@ -165,9 +165,7 @@ class PrepareAndRunWorkflow(CapabilityStep): # DO NOT TAKE THIS OUT! Python will yell at you. parameters = json.dumps(parameters) workflow_args = json.loads(parameters) - engine.submit_workflow_request( - execution.id, workflow_name, workflow_args, files - ) + engine.submit_workflow_request(workflow_name, workflow_args, files) class AwaitQa(CapabilityStep):