Skip to content

Commit 8ab7ff8

Browse files
authored
Merge pull request #1882 from vprashar2929/acpi-wkf
chore(ci): migrate mock-acpi workflow to GH runner
2 parents 878599d + 182ba81 commit 8ab7ff8

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

.github/workflows/acpi-validation.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will run mock-acpi compose on GH runner and run validator tool
2+
3+
name: Validate ACPI
4+
5+
on: # yamllint disable-line rule:truthy
6+
workflow_call:
7+
8+
jobs:
9+
validate-acpi:
10+
name: Validate ACPI
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
21+
- name: install hatch
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install hatch
25+
26+
- name: Run mock-acpi compose
27+
working-directory: manifests/compose/mock-acpi
28+
run: |
29+
docker compose up -d
30+
31+
- name: Warm up for 60 seconds
32+
run: |
33+
echo "Warm up for 60 seconds before running validator"
34+
sleep 60
35+
36+
- name: Run mock-acpi validator tool
37+
working-directory: e2e/tools/validator
38+
run: |
39+
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m

.github/workflows/pull_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
# for each PR run integration test
2727
integration_test:
2828
uses: ./.github/workflows/integration_test.yml
29+
# for each PR run ACPI validation
30+
acpi_validation:
31+
uses: ./.github/workflows/acpi-validation.yml
2932

3033
changes_image:
3134
runs-on: ubuntu-latest

e2e/tools/validator/acpi_validations.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ validations:
1010
}}[{rate_interval}]
1111
)
1212
)
13-
max_mse: 0.0001
14-
# max_mape: 0
13+
max_mse: 0.01
14+
max_mape: 0.01

e2e/tools/validator/src/validator/cli/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import matplotlib.pyplot as plt
1717
import numpy as np
1818
import numpy.typing as npt
19+
from click.exceptions import Exit
1920
from matplotlib import ticker
2021
from matplotlib.dates import DateFormatter
2122

@@ -598,7 +599,7 @@ def run_validation(
598599
show_default=True,
599600
)
600601
@pass_config
601-
def validate_acpi(cfg: config.Validator, duration: datetime.timedelta, report_dir: str) -> int:
602+
def validate_acpi(cfg: config.Validator, duration: datetime.timedelta, report_dir: str) -> None:
602603
results_dir, tag = create_report_dir(report_dir)
603604
res = TestResult(tag)
604605

@@ -617,7 +618,7 @@ def validate_acpi(cfg: config.Validator, duration: datetime.timedelta, report_di
617618
click.secho(" * Generating validate acpi report file and dir", fg="green")
618619
write_md_report(results_dir, res)
619620

620-
return int(res.validations.passed)
621+
raise Exit(1) if not res.validations.passed else Exit(0)
621622

622623

623624
def write_json_report(results_dir: str, res: TestResult):

e2e/tools/validator/validator.mock-acpi.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ prometheus:
1818

1919
url: http://localhost:9090 # Prometheus server URL
2020
rate_interval: 20s # Rate interval for Promql, default is 20s, typically 4 x $scrape_interval
21-
steps: 3s # Step duration for Prometheus range queries
21+
step: 5s # Step duration for Prometheus range queries
22+
23+
stressor:
24+
total_runtime_seconds: 1200
25+
curve_type: default
2226

2327
validations_file: ./acpi_validations.yaml # Path to the validations file, default is ./validations.yaml

0 commit comments

Comments
 (0)