Unverified Commit e693af6c by Simon Pasquier Committed by GitHub

.circleci/config.yml: check mixins (#6895)

* .circleci/config.yml: check mixins
Signed-off-by: 's avatarSimon Pasquier <spasquie@redhat.com>

* Run jsonnetfmt
Signed-off-by: 's avatarSimon Pasquier <spasquie@redhat.com>

* Install tools in the image instead of using coreos/jsonnet-ci

The latter is deprecated
Signed-off-by: 's avatarSimon Pasquier <spasquie@redhat.com>

* Update jsonnetfile.json
Signed-off-by: 's avatarSimon Pasquier <spasquie@redhat.com>
parent a5beb627
...@@ -54,6 +54,7 @@ jobs: ...@@ -54,6 +54,7 @@ jobs:
- /home/circleci/.cache/yarn - /home/circleci/.cache/yarn
- store_test_results: - store_test_results:
path: test-results path: test-results
test_windows: test_windows:
executor: win/default executor: win/default
working_directory: /go/src/github.com/prometheus/prometheus working_directory: /go/src/github.com/prometheus/prometheus
...@@ -72,6 +73,28 @@ jobs: ...@@ -72,6 +73,28 @@ jobs:
environment: environment:
GOGC: "20" GOGC: "20"
GOOPTS: "-p 2 -mod=vendor" GOOPTS: "-p 2 -mod=vendor"
test_mixins:
executor: golang
steps:
- checkout
- run: go install -mod=vendor ./cmd/promtool/.
- run:
command: go install -mod=readonly github.com/google/go-jsonnet/cmd/jsonnet github.com/google/go-jsonnet/cmd/jsonnetfmt github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
working_directory: ~/project/documentation/prometheus-mixin
- run:
command: make clean
working_directory: ~/project/documentation/prometheus-mixin
- run:
command: jb install
working_directory: ~/project/documentation/prometheus-mixin
- run:
command: make
working_directory: ~/project/documentation/prometheus-mixin
- run:
command: git diff --exit-code
working_directory: ~/project/documentation/prometheus-mixin
fuzzit_regression: fuzzit_regression:
executor: fuzzit executor: fuzzit
working_directory: /go/src/github.com/prometheus/prometheus working_directory: /go/src/github.com/prometheus/prometheus
...@@ -79,6 +102,7 @@ jobs: ...@@ -79,6 +102,7 @@ jobs:
- checkout - checkout
- setup_remote_docker - setup_remote_docker
- run: ./fuzzit.sh local-regression - run: ./fuzzit.sh local-regression
fuzzit_fuzzing: fuzzit_fuzzing:
executor: fuzzit executor: fuzzit
working_directory: /go/src/github.com/prometheus/prometheus working_directory: /go/src/github.com/prometheus/prometheus
...@@ -101,6 +125,10 @@ workflows: ...@@ -101,6 +125,10 @@ workflows:
filters: filters:
tags: tags:
only: /.*/ only: /.*/
- test_mixins:
filters:
tags:
only: /.*/
- test_windows: - test_windows:
filters: filters:
tags: tags:
......
...@@ -99,7 +99,7 @@ local template = grafana.template; ...@@ -99,7 +99,7 @@ local template = grafana.template;
), ),
// Remote write specific dashboard. // Remote write specific dashboard.
'prometheus-remote-write.json': 'prometheus-remote-write.json':
local timestampComparison = local timestampComparison =
graphPanel.new( graphPanel.new(
'Highest Timestamp In vs. Highest Timestamp Sent', 'Highest Timestamp In vs. Highest Timestamp Sent',
datasource='$datasource', datasource='$datasource',
...@@ -116,7 +116,7 @@ local template = grafana.template; ...@@ -116,7 +116,7 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}', legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}',
)); ));
local timestampComparisonRate = local timestampComparisonRate =
graphPanel.new( graphPanel.new(
'Rate[5m]', 'Rate[5m]',
datasource='$datasource', datasource='$datasource',
...@@ -206,8 +206,8 @@ local template = grafana.template; ...@@ -206,8 +206,8 @@ local template = grafana.template;
'prometheus_remote_storage_shard_capacity{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_shard_capacity{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}' legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}'
)); ));
local pendingSamples = local pendingSamples =
graphPanel.new( graphPanel.new(
'Pending Samples', 'Pending Samples',
...@@ -219,7 +219,7 @@ local template = grafana.template; ...@@ -219,7 +219,7 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}' legendFormat='{{cluster}}:{{instance}} {{remote_name}}:{{url}}'
)); ));
local walSegment = local walSegment =
graphPanel.new( graphPanel.new(
'TSDB Current Segment', 'TSDB Current Segment',
datasource='$datasource', datasource='$datasource',
...@@ -231,7 +231,7 @@ local template = grafana.template; ...@@ -231,7 +231,7 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{instance}}' legendFormat='{{cluster}}:{{instance}}'
)); ));
local queueSegment = local queueSegment =
graphPanel.new( graphPanel.new(
'Remote Write Current Segment', 'Remote Write Current Segment',
datasource='$datasource', datasource='$datasource',
...@@ -288,7 +288,7 @@ local template = grafana.template; ...@@ -288,7 +288,7 @@ local template = grafana.template;
)); ));
dashboard.new('Prometheus Remote Write', dashboard.new('Prometheus Remote Write',
editable=true) editable=true)
.addTemplate( .addTemplate(
{ {
hide: 0, hide: 0,
...@@ -312,7 +312,7 @@ local template = grafana.template; ...@@ -312,7 +312,7 @@ local template = grafana.template;
text: 'All', text: 'All',
value: '$__all', value: '$__all',
}, },
includeAll=true, includeAll=true,
) )
) )
.addTemplate( .addTemplate(
...@@ -326,7 +326,7 @@ local template = grafana.template; ...@@ -326,7 +326,7 @@ local template = grafana.template;
text: 'All', text: 'All',
value: '$__all', value: '$__all',
}, },
includeAll=true, includeAll=true,
) )
) )
.addTemplate( .addTemplate(
...@@ -335,7 +335,7 @@ local template = grafana.template; ...@@ -335,7 +335,7 @@ local template = grafana.template;
'$datasource', '$datasource',
'label_values(prometheus_remote_storage_shards{cluster=~"$cluster", instance=~"$instance"}, url)' % $._config, 'label_values(prometheus_remote_storage_shards{cluster=~"$cluster", instance=~"$instance"}, url)' % $._config,
refresh='time', refresh='time',
includeAll=true, includeAll=true,
) )
) )
.addRow( .addRow(
...@@ -348,7 +348,8 @@ local template = grafana.template; ...@@ -348,7 +348,8 @@ local template = grafana.template;
.addPanel(samplesRate) .addPanel(samplesRate)
) )
.addRow( .addRow(
row.new('Shards' row.new(
'Shards'
) )
.addPanel(currentShards) .addPanel(currentShards)
.addPanel(maxShards) .addPanel(maxShards)
...@@ -371,6 +372,6 @@ local template = grafana.template; ...@@ -371,6 +372,6 @@ local template = grafana.template;
.addPanel(failedSamples) .addPanel(failedSamples)
.addPanel(retriedSamples) .addPanel(retriedSamples)
.addPanel(enqueueRetries) .addPanel(enqueueRetries)
) ),
}, },
} }
module github.com/prometheus/prometheus/documentation/prometheus-mixin
go 1.15
require (
github.com/google/go-jsonnet v0.16.0
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0
)
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/google/go-jsonnet v0.16.0 h1:Nb4EEOp+rdeGGyB1rQ5eisgSAqrTnhf9ip+X6lzZbY0=
github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0 h1:4BKZ6LDqPc2wJDmaKnmYD/vDjUptJtnUpai802MibFc=
github.com/jsonnet-bundler/jsonnet-bundler v0.4.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
{ {
"version": 1,
"dependencies": [ "dependencies": [
{ {
"name": "grafana-builder",
"source": { "source": {
"git": { "git": {
"remote": "https://github.com/grafana/jsonnet-libs", "remote": "https://github.com/grafana/grafonnet-lib.git",
"subdir": "grafana-builder" "subdir": "grafonnet"
} }
}, },
"version": "master" "version": "master"
}, },
{ {
"name": "grafonnet",
"source": { "source": {
"git": { "git": {
"remote": "https://github.com/grafana/grafonnet-lib", "remote": "https://github.com/grafana/jsonnet-libs.git",
"subdir": "grafonnet" "subdir": "grafana-builder"
} }
}, },
"version": "master" "version": "master"
} }
] ],
"legacyImports": true
} }
// Copyright 2020 The prometheus Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//+build tools
// Package tools tracks dependencies for tools that used in the build process.
// See https://github.com/golang/go/issues/25922
package tools
import (
_ "github.com/google/go-jsonnet/cmd/jsonnet"
_ "github.com/google/go-jsonnet/cmd/jsonnetfmt"
_ "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment