From 4344c26bef49772fe26a28067fe19679ecd6d07c Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Wed, 19 Jun 2024 13:12:51 +0200 Subject: [PATCH 1/5] fix: make foorprint from statsSeries nullsafe --- web/frontend/src/JobFootprint.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/frontend/src/JobFootprint.svelte b/web/frontend/src/JobFootprint.svelte index 8ed8089..84d6efe 100644 --- a/web/frontend/src/JobFootprint.svelte +++ b/web/frontend/src/JobFootprint.svelte @@ -101,7 +101,10 @@ // Calculate Avg from jobMetrics const jm = jobMetrics.find((jm) => jm.name === fm && jm.scope === "node"); if (jm?.metric?.statisticsSeries) { - mv = round(mean(jm.metric.statisticsSeries.mean), 2); + const noNan = jm.metric.statisticsSeries.mean.filter(function (val) { + return val != null; + }); + mv = round(mean(noNan), 2); } else if (jm?.metric?.series?.length > 1) { const avgs = jm.metric.series.map((jms) => jms.statistics.avg); mv = round(mean(avgs), 2); From 6c0bfc6c352138f390e4f00e8e6bf3c57a28d8f1 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Sat, 22 Jun 2024 08:55:37 +0200 Subject: [PATCH 2/5] Prepare release 1.3.1 --- Makefile | 2 +- ReleaseNotes.md | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c6e1f34..5c50771 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ TARGET = ./cc-backend VAR = ./var CFG = config.json .env FRONTEND = ./web/frontend -VERSION = 1.3.0 +VERSION = 1.3.1 GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development') CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S") LD_FLAGS = '-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}' diff --git a/ReleaseNotes.md b/ReleaseNotes.md index a4f085e..547a1f4 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,12 +1,11 @@ -# `cc-backend` version 1.3.0 +# `cc-backend` version 1.3.1 Supports job archive version 1 and database version 7. -This is a minor release of `cc-backend`, the API backend and frontend +This is a bugfix release of `cc-backend`, the API backend and frontend implementation of ClusterCockpit. For release specific notes visit the [ClusterCockpit Documentation](https://clusterockpit.org/docs/release/). ## Breaking changes -* This release fixes bugs in the MySQL/MariaDB database schema. For this reason - you have to migrate your database using the `-migrate-db` switch. +None From 5c5484b4d225e289b2eeb1a54c45a05f80b8ef25 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Tue, 25 Jun 2024 07:12:46 +0200 Subject: [PATCH 3/5] Export package runtimeEnv --- cmd/cc-backend/main.go | 4 ++-- {internal => pkg}/runtimeEnv/setup.go | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename {internal => pkg}/runtimeEnv/setup.go (100%) diff --git a/cmd/cc-backend/main.go b/cmd/cc-backend/main.go index ed471ac..ad69c58 100644 --- a/cmd/cc-backend/main.go +++ b/cmd/cc-backend/main.go @@ -34,10 +34,10 @@ import ( "github.com/ClusterCockpit/cc-backend/internal/metricdata" "github.com/ClusterCockpit/cc-backend/internal/repository" "github.com/ClusterCockpit/cc-backend/internal/routerConfig" - "github.com/ClusterCockpit/cc-backend/internal/runtimeEnv" "github.com/ClusterCockpit/cc-backend/internal/util" "github.com/ClusterCockpit/cc-backend/pkg/archive" "github.com/ClusterCockpit/cc-backend/pkg/log" + "github.com/ClusterCockpit/cc-backend/pkg/runtimeEnv" "github.com/ClusterCockpit/cc-backend/pkg/schema" "github.com/ClusterCockpit/cc-backend/web" "github.com/go-co-op/gocron" @@ -662,5 +662,5 @@ func main() { } runtimeEnv.SystemdNotifiy(true, "running") wg.Wait() - log.Print("Gracefull shutdown completed!") + log.Print("Graceful shutdown completed!") } diff --git a/internal/runtimeEnv/setup.go b/pkg/runtimeEnv/setup.go similarity index 100% rename from internal/runtimeEnv/setup.go rename to pkg/runtimeEnv/setup.go From 552da005dc06c074efe2377a8320f358f199e5b8 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 26 Jun 2024 05:41:42 +0200 Subject: [PATCH 4/5] Add make target for swagger UI generator --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5c50771..68a8059 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ SVELTE_SRC = $(wildcard $(FRONTEND)/src/*.svelte) \ $(wildcard $(FRONTEND)/src/plots/*.svelte) \ $(wildcard $(FRONTEND)/src/joblist/*.svelte) -.PHONY: clean distclean test tags frontend $(TARGET) +.PHONY: clean distclean test tags frontend swagger $(TARGET) .NOTPARALLEL: @@ -40,6 +40,11 @@ frontend: $(info ===> BUILD frontend) cd web/frontend && npm install && npm run build +swagger: + $(info ===> GENERATE swagger) + @go run github.com/swaggo/swag/cmd/swag init -d ./internal/api,./pkg/schema -g rest.go -o ./api + @mv ./api/docs.go ./internal/api/docs.go + clean: $(info ===> CLEAN) @go clean From e8794b8c79d72c7794e7676889a1fff1c9f2abe5 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Fri, 28 Jun 2024 15:41:11 +0200 Subject: [PATCH 5/5] Add graphql generation target to Makefile --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 68a8059..f54c6ea 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ SVELTE_SRC = $(wildcard $(FRONTEND)/src/*.svelte) \ $(wildcard $(FRONTEND)/src/plots/*.svelte) \ $(wildcard $(FRONTEND)/src/joblist/*.svelte) -.PHONY: clean distclean test tags frontend swagger $(TARGET) +.PHONY: clean distclean test tags frontend swagger graphql $(TARGET) .NOTPARALLEL: @@ -45,6 +45,10 @@ swagger: @go run github.com/swaggo/swag/cmd/swag init -d ./internal/api,./pkg/schema -g rest.go -o ./api @mv ./api/docs.go ./internal/api/docs.go +graphql: + $(info ===> GENERATE graphql) + @go run github.com/99designs/gqlgen + clean: $(info ===> CLEAN) @go clean