Skip to content

Commit

Permalink
feat(validator): load validations from validations.yaml
Browse files Browse the repository at this point in the history
This commit is rewrite of existing validator. Changes include

* remove queries.json in favour of validations.yaml
* move prometheus job names - metal and vm under `prometheus` field
* Simplify parsing queries making it testable
* Add gen-report command to regenerate reports
* Add logging that can be controlled by `log_level` in validator.yaml
* Fix use of hard-coded ssh-key to generate VM specs
* Fixes tests

Signed-off-by: Sunil Thaha <[email protected]>
  • Loading branch information
sthaha committed Jun 20, 2024
1 parent 4a7bc31 commit 8931d61
Show file tree
Hide file tree
Showing 20 changed files with 1,095 additions and 659 deletions.
1 change: 1 addition & 0 deletions e2e/tools/validator/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
validator.yaml
tmp/
5 changes: 5 additions & 0 deletions e2e/tools/validator/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.pytest.ini_options]
markers = [
"focus", # used in development to mark focused tests
]
43 changes: 0 additions & 43 deletions e2e/tools/validator/query.json

This file was deleted.

1 change: 1 addition & 0 deletions e2e/tools/validator/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
line-length = 120
73 changes: 43 additions & 30 deletions e2e/tools/validator/scripts/stressor.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
#!/bin/bash

# warm up system by waiting for 40 seconds
# idle
stress-ng --cpu $(nproc) --cpu-load 0 --timeout 10s

# # Stress at 10% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 10 --timeout 20s
#
# # Stress at 25% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 25 --timeout 20s
#
# # Stress at 50% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 50 --timeout 20s
#
# Stress at 75% load for 10 seconds
stress-ng --cpu $(nproc) --cpu-load 75 --timeout 20s
#
# # Stress at 50% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 50 --timeout 20s
#
# # Stress at 25% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 25 --timeout 20s
#
# # Stress at 10% load for 20 seconds
# stress-ng --cpu $(nproc) --cpu-load 10 --timeout 20s

# cool off for 40 seconds
# idle
stress-ng --cpu $(nproc) --cpu-load 0 --timeout 10s
#!/usr/bin/env bash

set -eu -o pipefail

trap exit_all INT
exit_all() {
pkill -P $$
}

run() {
echo "$*"
"$@"
echo " ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾"
}

main() {

local cpus
cpus=$(nproc)

# load and time
local -a load_curve=(
0:5
10:20
25:20
50:20
75:20
100:30
75:20
50:20
25:20
10:20
0:5
)

for x in "${load_curve[@]}"; do
local load="${x%%:*}"
local time="${x##*:}s"
run stress-ng --cpu "$cpus" --cpu-load "$load" --timeout "$time"
done
}

main "$@"
93 changes: 0 additions & 93 deletions e2e/tools/validator/src/validator/cases/__init__.py

This file was deleted.

Loading

0 comments on commit 8931d61

Please sign in to comment.