Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Add delete experiment functionality #654

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions pkg/ui/v1alpha2/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,20 @@ func (k *KatibUIHandler) SubmitParamsJob(w http.ResponseWriter, r *http.Request)
}
}

// TODO: Add delete job to Katib Client
func (k *KatibUIHandler) DeleteExperiment(w http.ResponseWriter, r *http.Request) {
//enableCors(&w)
experimentName := r.URL.Query()["experimentName"][0]
log.Printf("Experiment Name: %v", experimentName)
experiment, err := k.katibClient.GetExperiment(experimentName)
if err != nil {
log.Printf("GetExperiment failed: %v", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
err = k.katibClient.DeleteExperiment(experiment)
if err != nil {
log.Printf("DeleteExperiment failed: %v", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}

func (k *KatibUIHandler) FetchHPJobInfo(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -259,7 +268,7 @@ func (k *KatibUIHandler) FetchHPJobInfo(w http.ResponseWriter, r *http.Request)
resultText += "\n" + t.Name + "," + strings.Join(trialResText, ",")
}
}
log.Printf("Logs parsed, result: %v", resultText)
log.Printf("Logs parsed, results:\n %v", resultText)
response, err := json.Marshal(resultText)
if err != nil {
log.Printf("Marshal result text for HP job failed: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ui/v1alpha2/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"main.js": "./static/js/main.7d299657.chunk.js",
"main.js": "./static/js/main.f57b5efa.chunk.js",
"runtime~main.js": "./static/js/runtime~main.d653cc00.js",
"static/css/2.3e32d45a.chunk.css": "./static/css/2.3e32d45a.chunk.css",
"static/js/2.ae40dfca.chunk.js": "./static/js/2.ae40dfca.chunk.js",
"index.html": "./index.html",
"precache-manifest.0846a54b7f8ed672e19c89014688f8f5.js": "./precache-manifest.0846a54b7f8ed672e19c89014688f8f5.js",
"precache-manifest.e1ab7686cdd1ee6186be7633c1c70252.js": "./precache-manifest.e1ab7686cdd1ee6186be7633c1c70252.js",
"service-worker.js": "./service-worker.js"
}
2 changes: 1 addition & 1 deletion pkg/ui/v1alpha2/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script type="text/javascript" src="https://d3js.org/d3.v5.min.js"></script><script type="text/javascript" src="https://underscorejs.org/underscore-min.js"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/mode-xml.js"></script><script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script><meta charset="utf-8"/><link rel="shortcut icon" href="./logo.png"/><meta http-equiv="Access-Control-Allow-Origin" content="*"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><style>body{background-color:#f7f7f7,}</style><title>Katib UI</title><link href="./static/css/2.3e32d45a.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="./";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="./static/js/2.ae40dfca.chunk.js"></script><script src="./static/js/main.7d299657.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script type="text/javascript" src="https://d3js.org/d3.v5.min.js"></script><script type="text/javascript" src="https://underscorejs.org/underscore-min.js"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/mode-xml.js"></script><script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script><meta charset="utf-8"/><link rel="shortcut icon" href="./logo.png"/><meta http-equiv="Access-Control-Allow-Origin" content="*"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><style>body{background-color:#f7f7f7,}</style><title>Katib UI</title><link href="./static/css/2.3e32d45a.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="./";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="./static/js/2.ae40dfca.chunk.js"></script><script src="./static/js/main.f57b5efa.chunk.js"></script></body></html>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ self.__precacheManifest = [
"url": "./static/js/runtime~main.d653cc00.js"
},
{
"revision": "a370de493752e44b98ec",
"url": "./static/js/main.7d299657.chunk.js"
"revision": "1904cdf0c9720281771e",
"url": "./static/js/main.f57b5efa.chunk.js"
},
{
"revision": "1356e6af903ab0f4271c",
Expand All @@ -16,7 +16,7 @@ self.__precacheManifest = [
"url": "./static/css/2.3e32d45a.chunk.css"
},
{
"revision": "018435c6fec8e332d4f019d352d5fb29",
"revision": "f3bdb2e07fb544af2ceb2dd2ca9190f1",
"url": "./index.html"
}
];
2 changes: 1 addition & 1 deletion pkg/ui/v1alpha2/frontend/build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(
"./precache-manifest.0846a54b7f8ed672e19c89014688f8f5.js"
"./precache-manifest.e1ab7686cdd1ee6186be7633c1c70252.js"
);

workbox.clientsClaim();
Expand Down

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const DeleteDialog = (props) => {
const classes = useStyles();

const onDelete = () => {
props.deleteExperiment(props.name);
props.deleteExperiment(props.deleteExperimentName);
}

return (
Expand Down