From 3dafdbdd854e11ca7acdae0c1462fe0b120a1b58 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 12:45:39 -0500 Subject: [PATCH 1/7] add asv output --- extern/regression_testing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/regression_testing b/extern/regression_testing index d8849baff..181dac72b 160000 --- a/extern/regression_testing +++ b/extern/regression_testing @@ -1 +1 @@ -Subproject commit d8849baff56cff9fcd45e2bf05f70a7146305483 +Subproject commit 181dac72bbc58982cecf9335cb5129fc7a705eab From 6a7475098f8c01dfd663c6477d4dd8c3501651e2 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 13:11:10 -0500 Subject: [PATCH 2/7] Update regression_testing submodule to include ASV HTML generation script --- extern/regression_testing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/regression_testing b/extern/regression_testing index 181dac72b..4f8d5cbfe 160000 --- a/extern/regression_testing +++ b/extern/regression_testing @@ -1 +1 @@ -Subproject commit 181dac72bbc58982cecf9335cb5129fc7a705eab +Subproject commit 4f8d5cbfe09ecb29791d984dd9eb943b29c78ef4 From 5bdf402821e006aeb853a94b8d0de767d21a6ec8 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 13:26:53 -0500 Subject: [PATCH 3/7] Update regression_testing submodule with ASV dashboard tools --- extern/regression_testing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/regression_testing b/extern/regression_testing index 4f8d5cbfe..233c61907 160000 --- a/extern/regression_testing +++ b/extern/regression_testing @@ -1 +1 @@ -Subproject commit 4f8d5cbfe09ecb29791d984dd9eb943b29c78ef4 +Subproject commit 233c61907981ee9c8a6a0006a6acdf90636a7739 From df8b659f9cce378b0c36beb969ff05f7b2ad90a4 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 13:37:40 -0500 Subject: [PATCH 4/7] add asv dashboard script --- regression/asv_benchmarks/asv.conf.json | 12 ++++ .../asv_benchmarks/benchmarks/__init__.py | 0 regression/gen_asv_dashboard.py | 70 +++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 regression/asv_benchmarks/asv.conf.json create mode 100644 regression/asv_benchmarks/benchmarks/__init__.py create mode 100755 regression/gen_asv_dashboard.py diff --git a/regression/asv_benchmarks/asv.conf.json b/regression/asv_benchmarks/asv.conf.json new file mode 100644 index 000000000..957f963be --- /dev/null +++ b/regression/asv_benchmarks/asv.conf.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "project": "quokka", + "project_url": "https://github.com/quokka-astro/quokka", + "repo": "../../..", + "branches": ["development"], + "show_commit_url": "https://github.com/quokka-astro/quokka/commit/", + "environment_type": "virtualenv", + "results_dir": "results", + "html_dir": "html", + "pythons": ["3.10"] +} \ No newline at end of file diff --git a/regression/asv_benchmarks/benchmarks/__init__.py b/regression/asv_benchmarks/benchmarks/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/regression/gen_asv_dashboard.py b/regression/gen_asv_dashboard.py new file mode 100755 index 000000000..29de1f47f --- /dev/null +++ b/regression/gen_asv_dashboard.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess +import shutil +import argparse + +def main(): + parser = argparse.ArgumentParser(description="Generate ASV dashboard from regression test results.") + parser.add_argument("bench_dir", help="Path to the benchmark directory (containing the 'asv' subdirectory)") + args = parser.parse_args() + + bench_dir = os.path.abspath(args.bench_dir) + asv_source_dir = os.path.join(bench_dir, "asv") + + if not os.path.isdir(asv_source_dir): + print(f"Error: {asv_source_dir} does not exist. (Expected to find ASV results in /asv/)") + sys.exit(1) + + script_dir = os.path.dirname(os.path.abspath(__file__)) + asv_project_dir = os.path.join(script_dir, "asv_benchmarks") + asv_results_dir = os.path.join(asv_project_dir, "results") + + # Ensure asv_project_dir exists + if not os.path.exists(asv_project_dir): + print(f"Error: ASV project directory {asv_project_dir} not found.") + sys.exit(1) + + # Link results + if os.path.islink(asv_results_dir) or os.path.exists(asv_results_dir): + if os.path.islink(asv_results_dir): + os.unlink(asv_results_dir) + else: + try: + shutil.rmtree(asv_results_dir) + except OSError as e: + print(f"Warning: Could not remove existing results dir: {e}") + + try: + os.symlink(asv_source_dir, asv_results_dir) + print(f"Linked {asv_source_dir} to {asv_results_dir}") + except OSError as e: + print(f"Error creating symlink: {e}") + sys.exit(1) + + # Run asv publish + print("Running 'asv publish'...") + try: + # Check if asv is installed + subprocess.check_call([sys.executable, "-m", "asv", "--version"], stdout=subprocess.DEVNULL) + + subprocess.check_call([sys.executable, "-m", "asv", "publish"], cwd=asv_project_dir) + except subprocess.CalledProcessError as e: + print(f"Error running asv publish: {e}") + sys.exit(1) + except FileNotFoundError: + # Try calling 'asv' directly if 'python -m asv' failed/not found (though less likely if installed in same env) + try: + subprocess.check_call(["asv", "publish"], cwd=asv_project_dir) + except Exception: + print("Error: 'asv' command not found. Please install it with 'pip install asv'.") + sys.exit(1) + + print(f"\nDashboard generated successfully.") + print(f"Open the following file in your browser to view:") + print(f"{os.path.join(asv_project_dir, 'html', 'index.html')}") + +if __name__ == "__main__": + main() From cdc678d0fada3e375c77e05427acaa87e8acaf90 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 13:42:36 -0500 Subject: [PATCH 5/7] copy asv dashboard to github pages --- .ci/azure-pipelines-regression.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/azure-pipelines-regression.yml b/.ci/azure-pipelines-regression.yml index 08fc78567..e9273f4d0 100644 --- a/.ci/azure-pipelines-regression.yml +++ b/.ci/azure-pipelines-regression.yml @@ -58,6 +58,12 @@ jobs: CCACHE_DIR: $(Pipeline.Workspace)/ccache CCACHE_BASEDIR: $(Build.SourcesDirectory) CCACHE_NOHASHDIR: 1 + - script: | + ./regression/gen_asv_dashboard.py /data/mash/cche/azp-agent-in-docker-cuda/azp-agent-avatargpu/regression-tests + mkdir -p /data/mash/cche/azp-agent-in-docker-cuda/azp-agent-avatargpu/regression-tests/web/asv + cp -r regression/asv_benchmarks/html/* /data/mash/cche/azp-agent-in-docker-cuda/azp-agent-avatargpu/regression-tests/web/asv/ + condition: succeededOrFailed() + displayName: 'Generate ASV dashboard' - publish: /data/mash/cche/azp-agent-in-docker-cuda/azp-agent-avatargpu/regression-tests/web condition: succeededOrFailed() artifact: regressionHTMLOutput From 7a4299983cd50b12c327ebb281734b0a3398e0ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 18:44:03 +0000 Subject: [PATCH 6/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- regression/asv_benchmarks/asv.conf.json | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/regression/asv_benchmarks/asv.conf.json b/regression/asv_benchmarks/asv.conf.json index 957f963be..3b72bca4e 100644 --- a/regression/asv_benchmarks/asv.conf.json +++ b/regression/asv_benchmarks/asv.conf.json @@ -1,12 +1,16 @@ { - "version": 1, - "project": "quokka", - "project_url": "https://github.com/quokka-astro/quokka", - "repo": "../../..", - "branches": ["development"], - "show_commit_url": "https://github.com/quokka-astro/quokka/commit/", - "environment_type": "virtualenv", - "results_dir": "results", - "html_dir": "html", - "pythons": ["3.10"] + "version": 1, + "project": "quokka", + "project_url": "https://github.com/quokka-astro/quokka", + "repo": "../../..", + "branches": [ + "development" + ], + "show_commit_url": "https://github.com/quokka-astro/quokka/commit/", + "environment_type": "virtualenv", + "results_dir": "results", + "html_dir": "html", + "pythons": [ + "3.10" + ] } \ No newline at end of file From cb257f1f882f3b29b387636a18865eed02631210 Mon Sep 17 00:00:00 2001 From: Ben Wibking Date: Tue, 2 Dec 2025 13:50:13 -0500 Subject: [PATCH 7/7] update repo path --- regression/asv_benchmarks/asv.conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regression/asv_benchmarks/asv.conf.json b/regression/asv_benchmarks/asv.conf.json index 3b72bca4e..62394a5a2 100644 --- a/regression/asv_benchmarks/asv.conf.json +++ b/regression/asv_benchmarks/asv.conf.json @@ -2,7 +2,7 @@ "version": 1, "project": "quokka", "project_url": "https://github.com/quokka-astro/quokka", - "repo": "../../..", + "repo": "../..", "branches": [ "development" ], @@ -13,4 +13,4 @@ "pythons": [ "3.10" ] -} \ No newline at end of file +}