From 79ec3621d0a6abfbbe63e0b8f31d40a004b9438d Mon Sep 17 00:00:00 2001 From: vishnuchalla Date: Thu, 5 Oct 2023 12:12:40 -0400 Subject: [PATCH] using go-jsonnet binaries --- Makefile | 9 ++++----- README.md | 6 +++--- assets/kube-burner-report-ocp-wrapper/queries.libsonnet | 8 ++++---- templates/CPT/kube-burner-report-ocp-wrapper-v2.jsonnet | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index ccc2cec..71dcc65 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +JSONNET := https://github.com/google/go-jsonnet/releases/download/v0.20.0/go-jsonnet_0.20.0_Linux_x86_64.tar.gz JB = https://github.com/jsonnet-bundler/jsonnet-bundler/releases/latest/download/jb-linux-amd64 BINDIR = bin TEMPLATESDIR = templates @@ -7,15 +8,13 @@ SYNCER_IMG_TAG ?= quay.io/cloud-bulldozer/dittybopper-syncer:latest PLATFORM = linux/amd64,linux/arm64,linux/ppc64le,linux/s390x ifeq ($(filter v2,$(MAKECMDGOALS)),v2) - # Set variables and instructions for v2 - TEMPLATES := $(wildcard $(TEMPLATESDIR)/**/*-v2.jsonnet) + # Set variables and instructions for v2 + TEMPLATES := $(wildcard $(TEMPLATESDIR)/**/*-v2.jsonnet) LIBRARY_PATH := $(TEMPLATESDIR)/vendor - JSONNET := https://github.com/cloud-bulldozer/utils/releases/download/v0.0.0/jsonnet-bin-v0.20.0-linux.tar.gz else # Get all templates at $(TEMPLATESDIR) TEMPLATES := $(filter-out %-v2.jsonnet, $(wildcard $(TEMPLATESDIR)/**/*.jsonnet)) LIBRARY_PATH := $(TEMPLATESDIR)/grafonnet-lib - JSONNET := https://github.com/google/jsonnet/releases/download/v0.17.0/jsonnet-bin-v0.17.0-linux.tar.gz endif # Replace $(TEMPLATESDIR)/*.jsonnet by $(OUTPUTDIR)/*.json @@ -64,4 +63,4 @@ build-syncer-image: build podman build --platform=${PLATFORM} -f Dockerfile --manifest=${SYNCER_IMG_TAG} . push-syncer-image: - podman manifest push ${SYNCER_IMG_TAG} ${SYNCER_IMG_TAG} \ No newline at end of file + podman manifest push ${SYNCER_IMG_TAG} ${SYNCER_IMG_TAG} diff --git a/README.md b/README.md index 476c6bc..674f57d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ mkdir -p bin rendered tmp git clone --depth 1 https://github.com/grafana/grafonnet-lib.git templates/grafonnet-lib Cloning into 'templates/grafonnet-lib'... Downloading jsonnet binary -curl -s -L https://github.com/google/jsonnet/releases/download/v0.15.0/jsonnet-bin-v0.15.0-linux.tar.gz | tar xzf - -C bin +curl -s -L https://github.com/google/go-jsonnet/releases/download/v0.20.0/go-jsonnet_0.20.0_Linux_x86_64.tar.gz | tar xz -C bin Formating template templates/ocp-performance.jsonnet bin/jsonnetfmt templates/ocp-performance.jsonnet > tmp/ocp-performance.jsonnet mv tmp/ocp-performance.jsonnet templates/ocp-performance.jsonnet @@ -39,7 +39,7 @@ Similarly for V2, the dashboards that are built using latest grafonnet library, $ make v2 mkdir -p bin rendered Downloading jsonnet binary -curl -s -L https://github.com/cloud-bulldozer/utils/releases/download/v0.0.0/jsonnet-bin-v0.20.0-linux.tar.gz | tar xz -C bin +curl -s -L https://github.com/google/go-jsonnet/releases/download/v0.20.0/go-jsonnet_0.20.0_Linux_x86_64.tar.gz | tar xz -C bin Downloading jb binary curl -s -L https://github.com/jsonnet-bundler/jsonnet-bundler/releases/latest/download/jb-linux-amd64 -o bin/jb chmod +x bin/jb @@ -55,7 +55,7 @@ mkdir -p rendered/General/ bin/jsonnet -J ./templates/vendor templates/General/ocp-performance-v2.jsonnet > rendered/General/ocp-performance-v2.json Rendered the v2 dashboards with latest grafonnet library ``` -Rest all operations reamin same as before. +All other operations remain same as before. In order to clean up the environment execute `make clean`. diff --git a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet index 17b0194..1a4e13e 100644 --- a/assets/kube-burner-report-ocp-wrapper/queries.libsonnet +++ b/assets/kube-burner-report-ocp-wrapper/queries.libsonnet @@ -1203,14 +1203,14 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.bucketAggs.Terms.withId("4") + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") + elasticsearch.bucketAggs.Terms.settings.withSize("10"), elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") + elasticsearch.bucketAggs.Terms.withId("3") + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + elasticsearch.bucketAggs.Terms.settings.withSize("10"), elasticsearch.bucketAggs.DateHistogram.withField("timestamp") @@ -1289,14 +1289,14 @@ local elasticsearch = g.query.elasticsearch; + elasticsearch.bucketAggs.Terms.withId("4") + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount("1") + elasticsearch.bucketAggs.Terms.settings.withSize("10"), elasticsearch.bucketAggs.Terms.withField("labels.container.keyword") + elasticsearch.bucketAggs.Terms.withId("3") + elasticsearch.bucketAggs.Terms.withType('terms') + elasticsearch.bucketAggs.Terms.settings.withOrder('desc') - + elasticsearch.bucketAggs.Terms.settings.withOrderBy('_term') + + elasticsearch.bucketAggs.Terms.settings.withOrderBy('1') + elasticsearch.bucketAggs.Terms.settings.withMinDocCount('1') + elasticsearch.bucketAggs.Terms.settings.withSize("10"), elasticsearch.bucketAggs.DateHistogram.withField("timestamp") diff --git a/templates/CPT/kube-burner-report-ocp-wrapper-v2.jsonnet b/templates/CPT/kube-burner-report-ocp-wrapper-v2.jsonnet index 179df36..22f9f22 100644 --- a/templates/CPT/kube-burner-report-ocp-wrapper-v2.jsonnet +++ b/templates/CPT/kube-burner-report-ocp-wrapper-v2.jsonnet @@ -14,7 +14,7 @@ g.dashboard.new('Kube-burner Report - OCP wrapper') + g.dashboard.timepicker.withRefreshIntervals(['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d']) + g.dashboard.timepicker.withTimeOptions(['5m', '15m', '1h', '6h', '12h', '24h', '2d', '7d', '30d']) + g.dashboard.withRefresh('') -+ g.dashboard.withEditable(true) ++ g.dashboard.withEditable(false) + g.dashboard.graphTooltip.withSharedCrosshair() + g.dashboard.withVariables([ variables.Datasource,