Skip to content

Commit

Permalink
Merge pull request #852 from prometheus/superq/yamllint
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkoyun authored Feb 20, 2025
2 parents 2fb3b53 + 0d99db6 commit 51b2051
Show file tree
Hide file tree
Showing 26 changed files with 121 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
registry: docker.io
organization: "$DOCKER_ORG"
login_variable: DOCKER_LOGIN
password_variable: DOCKER_PASSWORD
password_variable: DOCKER_PASSWORD
workflows:
version: 2
test-infra:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: CI
on:
pull_request:
push:

jobs:
yamllint:
name: Yaml lint
runs-on: ubuntu-latest
container:
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
image: quay.io/prometheus/golang-builder:1.23-base
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: make yamllint
6 changes: 3 additions & 3 deletions .github/workflows/generate-dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
name: Verify Dashboard Generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify dashboard generation
run: make --always-make generate-dashboards-cm && git diff --exit-code
- uses: actions/checkout@v4
- name: Verify dashboard generation
run: make --always-make generate-dashboards-cm && git diff --exit-code
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build:
- name: tools/load-generator
path: ./tools/load-generator
- name: tools/block-sync
path: ./tools/block-sync
path: ./tools/block-sync
flags: -a -tags netgo
crossbuild:
platforms:
Expand Down
25 changes: 25 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
extends: default
ignore: |
**/node_modules

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
indent-sequences: consistent
key-duplicates:
ignore: |
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
check-keys: false
2 changes: 1 addition & 1 deletion prombench/manifests/cluster-infra/1b_secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ metadata:
name: whsecret
type: Opaque
data:
whsecret: "{{ .WH_SECRET }}"
whsecret: "{{ .WH_SECRET }}"
Original file line number Diff line number Diff line change
Expand Up @@ -664,4 +664,3 @@ spec:
kubernetes.io/os: linux
restartPolicy: OnFailure
serviceAccountName: ingress-nginx-admission

4 changes: 2 additions & 2 deletions prombench/manifests/cluster-infra/3b_prometheus-meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: prometheus-meta
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 1000Gi # If you change this make sure to update the prometheus meta disk retention settings.
Expand Down Expand Up @@ -45,7 +45,7 @@ data:
alerting:
alertmanagers:
- kubernetes_sd_configs:
- role: pod
- role: pod
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,3 @@ spec:
protocol: TCP
selector:
k8s-app: kube-state-metrics

6 changes: 3 additions & 3 deletions prombench/manifests/cluster-infra/6c_promtail_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ roleRef:
name: promtail-clusterrole
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: promtail
namespace: default
- kind: ServiceAccount
name: promtail
namespace: default
8 changes: 4 additions & 4 deletions prombench/manifests/cluster-infra/6d_promtail_daemon_set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ spec:
mountPath: /var/lib/docker/containers
readOnly: true
env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
ports:
- containerPort: 3101
name: http-metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ data:
* To restart benchmark: `/prombench <branch or git tag to compare with>`
* To stop benchmark: `/prombench cancel`
* To print help: `/prombench help`
**Advanced Flags for `start` and `restart` Commands:**
* `--bench.directory=<sub-directory of github.com/prometheus/test-infra/prombench`
* See the details [here](https://github.com/prometheus/test-infra/tree/master/prombench/manifests/prombench#benchmarking-from-the-different-directory), defaults to `manifests/prombench`.
* `--bench.version=<branch | @commit>`
* See the details [here](https://github.com/prometheus/test-infra/tree/master/prombench/manifests/prombench#benchmarking-from-the-custom-test-infra-commitbranch), defaults to `master`.
**Examples:**
* `/prombench v3.0.0`
* `/prombench v3.0.0 --bench.version=@aca1803ccf5d795eee4b0848707eab26d05965cc --bench.directory=manifests/prombench`
verify_user: true
commands:
- name: cancel
- name: cancel
event_type: prombench_stop
comment_template: |
Benchmark cancel is in progress.
Expand All @@ -41,16 +41,16 @@ data:
⏱️ Welcome (again) to Prometheus Benchmarking Tool. ⏱️
**Compared versions:** [**`PR-{{ index . "PR_NUMBER" }}`**](http://{{ index . "DOMAIN_NAME" }}/{{ index . "PR_NUMBER" }}/prometheus-pr) and [**`{{ index . "RELEASE" }}`**](http://{{ index . "DOMAIN_NAME" }}/{{ index . "PR_NUMBER" }}/prometheus-release)
{{- $version := index . "BENCHMARK_VERSION" }}
{{- $directory := index . "BENCHMARK_DIRECTORY" | print "manifests/prombench" }}
{{- with $version }}
**Custom benchmark version:**
{{- if hasPrefix $version "@" }} [**`{{ trimPrefix $version "@" }}` commit**](https://github.com/prometheus/test-infra/tree/{{ trimPrefix $version "@" }}/prombench/{{ or $directory "manifests/prombench" }})
{{- else }} [**`{{ $version }}` branch**](https://github.com/prometheus/test-infra/tree/{{ $version }}/prombench/{{ or $directory "manifests/prombench" }}){{ end }}
{{- end }}
After successful deployment ([check status here](https://github.com/prometheus/prometheus/actions/workflows/prombench.yml)), the benchmarking results can be viewed at:
- [Prometheus Meta](http://{{ index . "DOMAIN_NAME" }}/prometheus-meta/graph?g0.expr={namespace%3D"prombench-{{ index . "PR_NUMBER" }}"}&g0.tab=1)
Expand All @@ -62,7 +62,7 @@ data:
* To restart benchmark: `/prombench restart {{ index . "RELEASE" }}{{ if index . "BENCHMARK_VERSION" }} --bench.version={{ index . "BENCHMARK_VERSION" }}{{ end }}{{ if index . "BENCHMARK_DIRECTORY" }} --bench.directory={{ index . "BENCHMARK_DIRECTORY" }}{{ end }}`
* To stop benchmark: `/prombench cancel`
* To print help: `/prombench help`
- name: "" # start is a default (empty command).
event_type: prombench_start
arg_regex: (master|main|v[0-9]+\.[0-9]+\.[0-9]+\S*)
Expand All @@ -79,7 +79,7 @@ data:
{{- $version := index . "BENCHMARK_VERSION" }}
{{- $directory := index . "BENCHMARK_DIRECTORY" }}
{{- with $version }}
**Custom benchmark version:**
{{- if hasPrefix $version "@" }} [**`{{ trimPrefix $version "@" }}` commit**](https://github.com/prometheus/test-infra/tree/{{ trimPrefix $version "@" }}/prombench/{{ or $directory "manifests/prombench" }})
{{- else }} [**`{{ $version }}` branch**](https://github.com/prometheus/test-infra/tree/{{ $version }}/prombench/{{ or $directory "manifests/prombench" }}){{ end }}
Expand All @@ -96,4 +96,3 @@ data:
* To restart benchmark: `/prombench restart {{ index . "RELEASE" }}{{ if index . "BENCHMARK_VERSION" }} --bench.version={{ index . "BENCHMARK_VERSION" }}{{ end }}{{ if index . "BENCHMARK_DIRECTORY" }} --bench.directory={{ index . "BENCHMARK_DIRECTORY" }}{{ end }}`
* To stop benchmark: `/prombench cancel`
* To print help: `/prombench help`
10 changes: 5 additions & 5 deletions prombench/manifests/cluster-infra/8a_parca_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ metadata:
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
22 changes: 11 additions & 11 deletions prombench/manifests/cluster-infra/8b_parca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ data:
scrape_interval: 30s
scrape_timeout: 40s
scheme: http
kubernetes_sd_configs:
- role: endpoints
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs:
- action: keep
source_labels: [__meta_kubernetes_service_label_app]
Expand Down Expand Up @@ -76,14 +76,14 @@ spec:
containers:
- image: ghcr.io/parca-dev/parca:v0.22.0
args:
- /parca
- "--http-address=:7070"
- "--config-path=/etc/parca/parca.yaml"
- "--path-prefix=/profiles"
- "--log-level=info"
- "--cors-allowed-origins=*"
- "--debuginfod-upstream-servers=https://debuginfod.systemtap.org"
- "--debuginfod-http-request-timeout=5m"
- /parca
- "--http-address=:7070"
- "--config-path=/etc/parca/parca.yaml"
- "--path-prefix=/profiles"
- "--log-level=info"
- "--cors-allowed-origins=*"
- "--debuginfod-upstream-servers=https://debuginfod.systemtap.org"
- "--debuginfod-http-request-timeout=5m"
name: parca
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ data:
disableDeletion: false
updateIntervalSeconds: 3 #how often Grafana will scan for changed dashboards
options:
path: /var/lib/grafana/dashboards
path: /var/lib/grafana/dashboards
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ data:
url: http://loki:3100
isDefault: false
version: 1
editable: true
editable: true
38 changes: 19 additions & 19 deletions prombench/manifests/cluster-infra/grafana_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ spec:
replicas: 1
selector:
matchLabels:
app: grafana
component: core
app: grafana
component: core
template:
metadata:
labels:
Expand All @@ -25,20 +25,20 @@ spec:
name: grafana-core
imagePullPolicy: IfNotPresent
env:
- name: GF_PATHS_PROVISIONING
value: "/opt/grafana-provision"
- name: GF_SERVER_ROOT_URL
value: "http://{{ .DOMAIN_NAME }}/grafana"
- name: GF_SERVER_SERVE_FROM_SUB_PATH
value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: "Main Org."
- name: GF_SECURITY_ADMIN_PASSWORD
value: "{{ .GRAFANA_ADMIN_PASSWORD }}"
- name: GF_USERS_VIEWERS_CAN_EDIT
value: "true"
- name: GF_PATHS_PROVISIONING
value: "/opt/grafana-provision"
- name: GF_SERVER_ROOT_URL
value: "http://{{ .DOMAIN_NAME }}/grafana"
- name: GF_SERVER_SERVE_FROM_SUB_PATH
value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: "Main Org."
- name: GF_SECURITY_ADMIN_PASSWORD
value: "{{ .GRAFANA_ADMIN_PASSWORD }}"
- name: GF_USERS_VIEWERS_CAN_EDIT
value: "true"
readinessProbe:
httpGet:
path: /login
Expand Down Expand Up @@ -82,9 +82,9 @@ metadata:
spec:
type: NodePort
ports:
- name: grafana-web
port: 80
targetPort: grafana-web
- name: grafana-web
port: 80
targetPort: grafana-web
selector:
app: grafana
component: core
Expand Down
2 changes: 1 addition & 1 deletion prombench/manifests/cluster-infra/node-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
name: scrape
volumeMounts:
- name: proc
readOnly: true
readOnly: true
mountPath: /host/proc
- name: sys
readOnly: true
Expand Down
2 changes: 2 additions & 0 deletions prombench/manifests/cluster_eks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yamllint disable-file
# This file is not valid YAML because of the range template.
cluster:
name: {{ .CLUSTER_NAME }}
version: 1.14
Expand Down
4 changes: 2 additions & 2 deletions prombench/manifests/cluster_gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ projectid: {{ .GKE_PROJECT_ID }}
zone: {{ .ZONE }}
cluster:
name: {{ .CLUSTER_NAME }}

initialclusterversion: 1.25

nodepools:
# This node-pool will be used for running monitoring components
- name: main-node
Expand Down
2 changes: 1 addition & 1 deletion prombench/manifests/prombench/benchmark/1a_namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: prombench-{{ .PR_NUMBER }}
name: prombench-{{ .PR_NUMBER }}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: fake-webserver
namespace: prombench-{{ .PR_NUMBER }}
namespace: prombench-{{ .PR_NUMBER }}
spec:
replicas: 1
selector:
Expand Down
Loading

0 comments on commit 51b2051

Please sign in to comment.