Skip to content

Commit

Permalink
Merge branch 'master' into Refactor-job-footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusband73 committed Jun 28, 2024
2 parents 97c807c + 74d4f00 commit b3c1f39
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand All @@ -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 graphql $(TARGET)

.NOTPARALLEL:

Expand All @@ -40,6 +40,15 @@ 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

graphql:
$(info ===> GENERATE graphql)
@go run github.com/99designs/gqlgen

clean:
$(info ===> CLEAN)
@go clean
Expand Down
7 changes: 3 additions & 4 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions cmd/cc-backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -662,5 +662,5 @@ func main() {
}
runtimeEnv.SystemdNotifiy(true, "running")
wg.Wait()
log.Print("Gracefull shutdown completed!")
log.Print("Graceful shutdown completed!")
}
File renamed without changes.
5 changes: 4 additions & 1 deletion web/frontend/src/JobFootprint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b3c1f39

Please sign in to comment.