Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): migrate mock-acpi workflow to GH runner #1882

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/acpi-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will run mock-acpi compose on GH runner and run validator tool

name: Validate ACPI

on: # yamllint disable-line rule:truthy
workflow_call:

jobs:
validate-acpi:
name: Validate ACPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
vprashar2929 marked this conversation as resolved.
Show resolved Hide resolved

- name: install hatch
run: |
python -m pip install --upgrade pip
pip install hatch

- name: Run mock-acpi compose
working-directory: manifests/compose/mock-acpi
run: |
docker compose up -d

- name: Warm up for 60 seconds
run: |
echo "Warm up for 60 seconds before running validator"
sleep 60
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from robust part of view, can we make a timeout? as a loop with condition to wait for compose up and timeout break as failure?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, it should be warm-up time for Kepler to start producing metrics. I have updated this step


- name: Run mock-acpi validator tool
working-directory: e2e/tools/validator
run: |
hatch run validator -f ./validator.mock-acpi.yaml validate-acpi -d 1m
3 changes: 3 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
# for each PR run integration test
integration_test:
uses: ./.github/workflows/integration_test.yml
# for each PR run ACPI validation
acpi_validation:
uses: ./.github/workflows/acpi-validation.yml
SamYuan1990 marked this conversation as resolved.
Show resolved Hide resolved

changes_image:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions e2e/tools/validator/acpi_validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ validations:
}}[{rate_interval}]
)
)
max_mse: 0.0001
# max_mape: 0
max_mse: 0.01
max_mape: 0.01
5 changes: 3 additions & 2 deletions e2e/tools/validator/src/validator/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import matplotlib.pyplot as plt
import numpy as np
import numpy.typing as npt
from click.exceptions import Exit
from matplotlib import ticker
from matplotlib.dates import DateFormatter

Expand Down Expand Up @@ -598,7 +599,7 @@ def run_validation(
show_default=True,
)
@pass_config
def validate_acpi(cfg: config.Validator, duration: datetime.timedelta, report_dir: str) -> int:
def validate_acpi(cfg: config.Validator, duration: datetime.timedelta, report_dir: str) -> None:
results_dir, tag = create_report_dir(report_dir)
res = TestResult(tag)

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

return int(res.validations.passed)
raise Exit(1) if not res.validations.passed else Exit(0)


def write_json_report(results_dir: str, res: TestResult):
Expand Down
6 changes: 5 additions & 1 deletion e2e/tools/validator/validator.mock-acpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ prometheus:

url: http://localhost:9090 # Prometheus server URL
rate_interval: 20s # Rate interval for Promql, default is 20s, typically 4 x $scrape_interval
steps: 3s # Step duration for Prometheus range queries
step: 5s # Step duration for Prometheus range queries

stressor:
total_runtime_seconds: 1200
curve_type: default

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