From 2c56bfd89e14cbce6355b9ce7059523244935298 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 29 Jun 2023 15:16:21 +0200 Subject: [PATCH 01/62] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bd3c07..81bc017 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,23 @@ git clone https://github.com/ClusterCockpit/cc-backend.git cd ./cc-backend ./startDemo.sh ``` + +You can also try the demo using the lates release binary. +Create a folder and put the release binary `cc-backend` into this folder. +Execute the following steps: +``` +$ ./cc-backend -init +$ vim config.json (Add a second cluster entry and name the clusters alex and fritz) +$ wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-demo.tar +$ tar xf job-archive-demo.tar +$ ./cc-backend -init-db -add-user demo:admin:demo -loglevel info +$ ./cc-backend -server -dev -loglevel info +``` + You can access the web interface at http://localhost:8080. Credentials for login are `demo:demo`. Please note that some views do not work without a metric backend (e.g., the -Systems and Status views). +Analysis, Systems and Status views). ## Howto build and run From 55943cacbfba53a9bdb07e2df75e25ec9003ca7d Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 17 Jul 2023 12:19:49 +0200 Subject: [PATCH 02/62] Fix frontend render for users with api role --- internal/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index ea6c9f2..c4b0898 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -166,10 +166,10 @@ func GetValidRoles(user *User) ([]string, error) { return vals, fmt.Errorf("%s: only admins are allowed to fetch a list of roles", user.Username) } -// Called by routerConfig web.page setup in backend: Only requires known user and/or not API user +// Called by routerConfig web.page setup in backend: Only requires known user func GetValidRolesMap(user *User) (map[string]Role, error) { named := make(map[string]Role) - if user.HasNotRoles([]Role{RoleApi, RoleAnonymous}) { + if user.HasNotRoles([]Role{RoleAnonymous}) { for i := RoleApi; i < RoleError; i++ { named[GetRoleString(i)] = i } From 58c7b0d1b4ade79d1d139eeff23cec41438c97b0 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 17 Jul 2023 14:26:24 +0200 Subject: [PATCH 03/62] fix: check if acc metrics are acc scope by default - Fixes #180 --- web/frontend/src/Job.root.svelte | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/web/frontend/src/Job.root.svelte b/web/frontend/src/Job.root.svelte index 2ec1ade..21f0c7f 100644 --- a/web/frontend/src/Job.root.svelte +++ b/web/frontend/src/Job.root.svelte @@ -48,7 +48,8 @@ `); const ccconfig = getContext("cc-config"), - clusters = getContext("clusters"); + clusters = getContext("clusters"), + metrics = getContext("metrics") let isMetricsSelectionOpen = false, selectedMetrics = [], @@ -74,16 +75,26 @@ ccconfig[`job_view_nodestats_selectedMetrics`]), ]); - // Select default Scopes to load - if (job.numAcc === 0) { - // No Accels + // Select default Scopes to load: Check before if accelerator metrics are not on accelerator scope by default + const accMetrics = ['acc_utilization', 'acc_mem_used', 'acc_power', 'nv_mem_util', 'nv_sm_clock', 'nv_temp'] + const accNodeOnly = [...toFetch].some(function(m) { + if (accMetrics.includes(m)) { + const mc = metrics(job.cluster, m) + return mc.scope !== 'accelerator' + } else { + return false + } + }) + + if (job.numAcc === 0 || accNodeOnly === true) { + // No Accels or Accels on Node Scope startFetching( job, [...toFetch], job.numNodes > 2 ? ["node"] : ["node", "core"] ); } else { - // Accels + // Accels and not on node scope startFetching( job, [...toFetch], From eed8bb2d442444f63bafc7efdc99ba93d65ad132 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 17 Jul 2023 15:45:40 +0200 Subject: [PATCH 04/62] fix: add scrambling to user names and projectIds --- web/frontend/src/List.root.svelte | 12 ++++++------ web/frontend/src/joblist/JobInfo.svelte | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/frontend/src/List.root.svelte b/web/frontend/src/List.root.svelte index 57cd291..c004736 100644 --- a/web/frontend/src/List.root.svelte +++ b/web/frontend/src/List.root.svelte @@ -119,10 +119,10 @@ - - - - + {({ + USER: "Username", + PROJECT: "Project Name", + })[type]}