Commit be7d6a28 authored by Chris Hines's avatar Chris Hines
Browse files

You can now search for a history of jobs and view their usage information

parent aa83589b
Pipeline #7756 passed with stages
in 3 minutes and 4 seconds
......@@ -4,6 +4,7 @@ import {Strudelapp, StrudelappInstance } from './strudelapp';
export class Job {
public name: string;
public appname: string;
public jobid: string;
public desc: string;
public state: string;
......
......@@ -15,14 +15,14 @@
<mat-divider></mat-divider>
</mat-list-item>
<div *ngFor="let job of ((identitySubject | async).joblist | async) ; let lastItem = last">
<div *ngIf="(appSubject | async).name == job.name && job.state != 'Finished'">
<div *ngIf="(appSubject | async).name == job.appname && job.state != 'Finished'">
<app-job [jobdata]=job></app-job>
<mat-divider></mat-divider>
</div>
</div>
<mat-divider></mat-divider>
<div *ngFor="let job of ((identitySubject | async).joblist | async) ; let lastItem = last">
<div *ngIf="(appSubject | async).name == job.name && job.state == 'Finished'">
<div *ngIf="(appSubject | async).name == job.app.name && job.state == 'Finished'">
<app-job [jobdata]=job></app-job>
<mat-divider></mat-divider>
</div>
......
......@@ -6,7 +6,7 @@ export class AppAction {
}
export class Strudelapp {
url: string; // A url used to retrieve extra config options. May be null
name: string; // Human readable name
name: string;
startscript: string; // batch script ... should NOT include resource directives
// resource directives like #SBATCH belong in the batchinterface
actions: AppAction[];
......
......@@ -17,9 +17,12 @@ export class StrudelappsService {
app = applist[0];
for ( let item of applist) {
sapp = <Strudelapp>item;
idx = sapp.name.toLowerCase().indexOf(name.toLowerCase())
let sname = sapp.name.toLowerCase().replace(/\s/g, '');
let jname = name.toLowerCase().replace(/\s/g, '');
idx = sname.indexOf(jname)
if (idx == 0) {
app = item;
console.log('matched',jname);
return app;
}
if (sapp.applist != null) {
......@@ -29,6 +32,7 @@ export class StrudelappsService {
}
}
}
console.log('didnt find app',name);
return null;
}
......
......@@ -144,8 +144,8 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
}
for (j of joblist) {
if (j.app === undefined) {
j.app = this.strudelappsService.getApp(j.name,identity.site.appCatalog.value);
if (j.app === undefined || j.app == null) {
j.app = this.strudelappsService.getApp(j.appname,identity.site.appCatalog.value);
}
if (j.identity == undefined) {
j.identity = identity;
......@@ -175,7 +175,6 @@ public setStatusMsg(statusMsg: BehaviorSubject<any>) {
}
private getUserHealthError(error: any, identity: Identity) {
console.log('user health error');
identity.accountalerts.next([]);
this.statusMsg.next("There was an error checking your user account");
//return this.getJobsError(error,identity)
......@@ -286,7 +285,6 @@ addUserHealth(identity,resp) {
if (ci == null) {
ci = []
}
console.log('in add User HEalth');
for (let i of resp) {
let h = new Health();
h.stat = i.stat;
......@@ -301,7 +299,6 @@ addUserHealth(identity,resp) {
ci.push(h);
}
identity.accountalerts.next(ci);
console.log('id health is',identity.accountalerts.value);
}
......@@ -358,7 +355,6 @@ addUserHealth(identity,resp) {
}
submitted(resp: any, identity: Identity ) {
console.log('submitted',resp);
this.getJobs(identity);
}
......@@ -393,7 +389,6 @@ addUserHealth(identity,resp) {
params.set('cmd',JSON.stringify(action.paramscmd));
let paramstr = params.toString();
job.connectionState = 1;
console.log('in getAppInstance');
this.http.get<string>(this.Base+'/appinstance/'+username+'/'+loginhost+'/'+batchhost+'/'+jobid+'?'+paramstr, options)
// .pipe(catchError(this.handleError))
.subscribe(resp => { job.appinst = resp; if (action.client != null) { this.createTunnel(job, action) } else { job.connectionState = 0} },
......@@ -528,7 +523,6 @@ private httperror(errorstr: string) {
private handleAppInstanceError(job: Job, error: any) {
console.log('in handle app instance error');
console.log(error);
job.connectionState=0;
if (error.error !== undefined && error.error.message !== undefined) {
......
......@@ -15,6 +15,12 @@
"client": {"cmd": null, "redir": "index.html?token={token}" },
"states": ["RUNNING","Finished"]
},
{
"name": "View Usage",
"paramscmd": "/usr/local/sv2/dev/desktop/usageparams.py {jobid}",
"client": {"cmd": null, "redir": "index.html?token={token}" },
"states": ["Finished"]
},
{
"name": "Remove log",
"paramscmd": "/usr/local/sv2/dev/rmlog.py {jobid}",
......@@ -42,6 +48,12 @@
"client": {"cmd": null, "redir": "index.html?token={token}" },
"states": ["RUNNING","Finished"]
},
{
"name": "View Usage",
"paramscmd": "/usr/local/sv2/dev/desktop/usageparams.py {jobid}",
"client": {"cmd": null, "redir": "index.html?token={token}" },
"states": ["Finished"]
},
{
"name": "Remove log",
"paramscmd": "/usr/local/sv2/dev/rmlog.py {jobid}",
......@@ -63,6 +75,34 @@
"client": {"cmd": null, "redir": ""}
}],
"localbind": true,
"applist": null
},
{
"url": null,
"name": "History",
"startscript": "#!/bin/bash\n/usr/local/sv2/dev/desktop/desktop.slurm\n ",
"actions": [
{
"name": "Connect",
"paramscmd": "/usr/local/sv2/dev/jupyter/jupyter_params.py {jobid}",
"client": {"cmd": null, "redir": "?token={token}"},
"states": ["RUNNING"]
},
{
"name": "View Usage",
"paramscmd": "/usr/local/sv2/dev/desktop/usageparams.py {jobid}",
"client": {"cmd": null, "redir": "index.html?token={token}" },
"states": ["Finished"]
},
{
"name": "Remove log",
"paramscmd": "/usr/local/sv2/dev/rmlog.py {jobid}",
"client": null,
"states": ["Finished"]
}
],
"localbind": true,
"applist": null
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment