Skip to content

Commit

Permalink
[Feature]-Device and output path validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndasanayaka committed Apr 18, 2023
1 parent b179d6e commit 05076ef
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/api/DeconvolutionAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ export default {
return data
},

async validate_devices(jobs,mem,gpus){
const { data } = await request.get(`${Vue.prototype.$Config.endpoints.wiener}/api/execute/validateDevices`, {
params: {
jobs: jobs,
mem: mem,
gpus: gpus
}
})
return data

},

// execute
async execute_microvolution(output, instances, mem, devices, executioninfo, jobs, is_test=false) {
let _requestUrl = ""
Expand Down
33 changes: 31 additions & 2 deletions src/views/Deconvolution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@
},
/****************************************************************************** */
/**
* load decon
Expand Down Expand Up @@ -1050,7 +1051,7 @@
},
nextStep(){
async nextStep(){
this.workingItem.step = parseInt(this.workingItem.step)
if(this.workingItem.step === 1) {
Expand All @@ -1068,7 +1069,7 @@
group: 'errornotif',
type: 'error',
title: 'Input Error',
text: "Input Error - Jobs with the same name/path must have unique Output paths/folders to avoid overwrite",
text: "Jobs with the same name/path must have unique Output paths/folders to avoid overwrite",
closeOnClick: true
})
flag = true
Expand Down Expand Up @@ -1144,6 +1145,34 @@
}
}
}
if(this.workingItem.step === 7) { /* validate devices in device tab */
let msg
let jobs = this.workingItem.setting.instances
let mem = this.workingItem.setting.mem
let gpus = this.workingItem.setting.gpus
let response = await DeconvolutionAPI.validate_devices(jobs,mem,gpus)
let output = response.commandResult
if (output.length > 0) {
let json_output = JSON.parse(output[0].out)
if(!json_output.results.success){
let limit_test = json_output.results.limits_test.success
let slurm_test = json_output.results.slurm_test.success
if (!limit_test && !slurm_test || !limit_test && slurm_test){
msg = json_output.results.limits_test.msg
}
else if (limit_test && !slurm_test) {
msg = json_output.results.slurm_test.msg
}
Vue.notify({
group: 'errornotif',
type: 'error',
title: 'Device Selection Error',
text: msg.charAt(0).toUpperCase() + msg.slice(1)
})
return
}
}
}
if(this.workingItem.step === 8)
return
//even if current step is invalid, next will allow it to go if it has been visited
Expand Down

0 comments on commit 05076ef

Please sign in to comment.