Commit 86c0d2f5 authored by Chris Hines's avatar Chris Hines
Browse files

Merge branch 'prod' into dev

parents b3245c91 61f20c65
Pipeline #18754 passed with stages
in 8 minutes and 54 seconds
......@@ -29,7 +29,7 @@
"build": "npm run electron:serve-tsc && ng build --base-href ./",
"build:dev": "npm run build -- -c dev",
"build:prod": "npm run build -- -c production",
"ng:serve": "ng serve -c web -o",
"ng:serve": "ng serve ",
"electron:serve-tsc": "tsc -p tsconfig.serve.json",
"electron:serve": "wait-on tcp:4200 && npm run electron:serve-tsc && npx electron . --serve",
"electron:local": "npm run build:prod && npx electron .",
......
......@@ -230,7 +230,7 @@ public getKeys(id?: Identity) {
this.notifications.notify("");
this.agentContents.next(resp)
}),
catchError((e) => { console.error('updateAGentContents error',e) ; return of([])})
catchError((e) => { console.error('updateAgentContents error',e) ; return of([])})
//tap((_) => this.notifications.notify(""))
)
return agentpipe$
......
......@@ -57,7 +57,12 @@ export class ComputesitesService {
getStrudelAppsIdentity(identity: Identity): Observable<Strudelapp[]> {
let uri$ = this.getStrudelAppsUri(identity.site.appCatalogUri);
let cmd$ = this.getStrudelAppsCmd(identity);
return combineLatest([uri$, cmd$]).pipe(map(([uri,cmd]) => (uri.concat(cmd))))
return combineLatest([uri$, cmd$]).pipe(
tap( ([uri,cmd]) => console.log('getStrudelAppsIdentity',uri,cmd)),
map(([uri,cmd]) => (uri.concat(cmd))),
tap((v) => console.log('getStrudelAppsIdentity concat',v))
)
}
......@@ -82,7 +87,7 @@ export class ComputesitesService {
}
private getStrudelAppsCmd(identity: Identity): Observable<Strudelapp[]> {
console.log('running getStrudleAppsCmd',identity)
console.log('running getStrudelAppsCmd',identity)
if (identity.site.appCatalogCmd != null) {
return (this.tesService.runCommand(identity,identity.site.appCatalogCmd) as Observable<Strudelapp[]>)
.pipe(
......@@ -93,36 +98,16 @@ export class ComputesitesService {
}
storeLocalStrudelApps(name: string, apps: any) {
localStorage.setItem(name+'-apps',JSON.stringify(apps))
}
removeLocalStrudelApps() {
var keys = [];
for (var key in localStorage) {
var idx = key.indexOf('-apps');
if (idx !== -1) {
keys.push(key)
}
}
for (var key in keys) {
localStorage.removeItem(key);
}
}
updateStrudelApps(id: Identity, apps) {
var sapps: Strudelapp[];
var localapps: Strudelapp[];
var currentApps: Strudelapp[];
sapps = <Strudelapp[]>apps;
currentApps = id.appCatalog.value;
console.log('updateStrudelApps',currentApps);
localapps = JSON.parse(localStorage.getItem(id.site.name+'-apps'))
if (localapps !== null) {
for (let a of localapps) {
sapps.push(a);
}
}
id.appCatalog.next(sapps);
id.appCatalog.next(currentApps.concat(sapps));
}
private handleError<T> (operation = 'operation', result?: T) {
......@@ -208,7 +193,7 @@ export class ComputesitesService {
if (principal != null) {
let id = new Identity(principal,cs,certs[i].expiry);
identities.push(id);
if (cs.appCatalogUri != null || cs.appCatalogCmd != null) {
if (cs.appCatalogUri !== null || cs.appCatalogCmd !== null || cs.appCatalog !== null) {
appidentities.push(id);
}
if (cs.dtn != null ) {
......
......@@ -22,7 +22,12 @@ export class Identity {
this.systemalerts = new BehaviorSubject<Health[]>(null);
this.accountalerts = new BehaviorSubject<Health[]>(null);
this.joblist = new BehaviorSubject<Job[]>([]);
this.appCatalog = new BehaviorSubject<Strudelapp[]>([]);
if (site !== null) {
console.log('creating a site with appCatalog',site.appCatalog);
this.appCatalog = new BehaviorSubject<Strudelapp[]>(site.appCatalog);
} else {
this.appCatalog = new BehaviorSubject<Strudelapp[]>([]);
}
this.quotas = [];
this.expiry = expiry;
......
......@@ -54,10 +54,8 @@ export class SettingsComponent implements OnInit {
this.config = JSON.parse(e.target.result);
if ('computesites' in this.config) {
this.computeSitesService.storeLocalComputeSites(this.config['computesites'])
}
if ('apps' in this.config) {
this.computeSitesService.storeLocalStrudelApps(this.config['sitename'],this.config['apps']);
this.computeSitesService.storeLocalComputeSites(this.config['computesites']);
console.log('saving compute site',this.config['computesites']);
}
if ('authz' in this.config) {
this.authService.storeLocalAuthZ(this.config['authz'])
......@@ -71,7 +69,6 @@ export class SettingsComponent implements OnInit {
resetConfig() {
this.computeSitesService.removeLocalStrudelApps();
this.computeSitesService.removeLocalComputeSites();
this.authService.removeLocalAuthZ()
}
......
[
{
"url": "https://beta-api.cloud.cvl.org.au/training/",
"name": "Training@CVL@UWA",
"host": "146.118.65.246",
"dtn": "146.118.65.242",
"name": "Training@M3",
"host": "m3.massive.org.au",
"dtn": "m3-dtn1.massive.org.au",
"cafingerprint": "ECDSA SHA256:6wVXdokvvlTNcXPMc9KyvIXA8a8XNfLuhBfNOYeeMdg",
"appCatalog": [],
"appCatalogCmd": "/home/strudel2/bin/getapps-training",
"cancelcmd": "/home/strudel2/bin/s2cancel {jobid}",
"statcmd": "/home/strudel2/bin/s2stat",
"userhealth": "/home/strudel2/bin/uitraining",
"cacheturis": [],
"contact": "<CVL@UWA Support> help@massive.org.au"
"appCatalogCmd": "/usr/local/strudel2_cluster/latest/bin/getapps",
"cancelcmd": "/usr/local/strudel2_cluster/latest/bin/s2cancel {jobid}",
"statcmd": "/usr/local/strudel2_cluster/latest/bin/s2stat",
"cacheturis": ["/assets/config/incidents.json"],
"userhealth": "/usr/local/clusterinfo/0.0.6/bin/uijson"
}
]
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