Skip to content
Snippets Groups Projects
Commit 4334fa2d authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Preparation for testing the button with the download capability

parent 423017a6
No related branches found
No related tags found
No related merge requests found
Pipeline #452 passed
<div class="container-fluid">
<div class="row">
<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>
......
import { Component, OnInit } from "@angular/core";
import { CapabilityLauncherService } from "./services/capability-launcher.service";
import { Observable } from "rxjs";
import { CapabilityRequest } from "./model/capability-request";
import { map } from "rxjs/operators";
import { CapabilityExecution } from "./model/capability-execution";
@Component({
......@@ -21,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);
}
);
);
}
}
"""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'")
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment