Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hpc-team
strudelv2_spa
Commits
be7d6a28
Commit
be7d6a28
authored
Aug 27, 2019
by
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
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/job.ts
View file @
be7d6a28
...
...
@@ -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
;
...
...
src/app/joblist/joblist.component.html
View file @
be7d6a28
...
...
@@ -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.
app
name && 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>
...
...
src/app/strudelapp.ts
View file @
be7d6a28
...
...
@@ -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
[];
...
...
src/app/strudelapps.service.ts
View file @
be7d6a28
...
...
@@ -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
;
}
...
...
src/app/tes.service.ts
View file @
be7d6a28
...
...
@@ -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
.
app
name
,
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
)
{
...
...
src/assets/config/m3apps.dev.json
View file @
be7d6a28
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment