diff --git a/result_server/routes/home.py b/result_server/routes/home.py index 593a47b..6f1c095 100644 --- a/result_server/routes/home.py +++ b/result_server/routes/home.py @@ -1,3 +1,5 @@ +import os + from flask import render_template from utils.system_info import get_all_systems_info @@ -7,9 +9,18 @@ "add_app": "https://github.com/RIKEN-RCCS/benchkit/blob/main/docs/guides/add-app.md", "add_site": "https://github.com/RIKEN-RCCS/benchkit/blob/main/docs/guides/add-site.md", "add_estimation": "https://github.com/RIKEN-RCCS/benchkit/blob/main/docs/guides/add-estimation.md", + "perftools": "https://github.com/masaaki-kondo/PerfTools", + "benchpark_fn_apps": "https://github.com/RIKEN-RCCS/benchpark/blob/FN_apps/User_Guide.md", + "benchpark_upstream": "https://github.com/llnl/benchpark", } +def build_guide_links(): + links = dict(GUIDE_LINKS) + links["discord"] = os.environ.get("CX_DISCORD_INVITE_URL", "") + return links + + def register_home_routes(app, prefix=""): def homepage(): systems_info = get_all_systems_info() @@ -30,7 +41,7 @@ def homepage(): "home.html", systems=systems, system_count=len(systems), - guide_links=GUIDE_LINKS, + guide_links=build_guide_links(), ) app.add_url_rule(f"{prefix}/", endpoint="home", view_func=homepage, strict_slashes=False) diff --git a/result_server/templates/home.html b/result_server/templates/home.html index 5c0c494..2461316 100644 --- a/result_server/templates/home.html +++ b/result_server/templates/home.html @@ -283,6 +283,12 @@

For Application Developers

Add Estimation Support Connect application-side result emission to estimation inputs and estimation workflows. + {% if guide_links.discord %} + + Questions and Discussion + Use the invitation-only Discord for lightweight questions, onboarding support, and early coordination before opening issues or pull requests. + + {% endif %} @@ -306,6 +312,30 @@

Operations Views

{% endif %} +
+

GPU Performance Estimation

+

+ CX Portal stores GPU kernel-level estimation artifacts together with benchmark results, including prepared inputs, prediction outputs, logs, and package comparison data. +

+ + +
+
diff --git a/result_server/tests/test_home_template.py b/result_server/tests/test_home_template.py index 1964f00..282957c 100644 --- a/result_server/tests/test_home_template.py +++ b/result_server/tests/test_home_template.py @@ -9,7 +9,8 @@ from routes.home import register_home_routes -def test_home_page_renders_landing_content(): +def test_home_page_renders_landing_content(monkeypatch): + monkeypatch.delenv("CX_DISCORD_INVITE_URL", raising=False) app = build_portal_shell_app( templates_dir=os.path.join(os.path.dirname(__file__), "..", "templates"), include_home_route=False, @@ -24,8 +25,34 @@ def test_home_page_renders_landing_content(): assert "CX Portal" in html assert "Main Entry Points" in html assert "For Application Developers" in html + assert "GPU Performance Estimation" in html assert "Available Systems" in html assert "Add a New Site" in html + assert "PerfTools" in html + assert "RIKEN-RCCS BenchPark FN_apps branch" in html + assert "Upstream BenchPark" in html + assert "https://github.com/masaaki-kondo/PerfTools" in html + assert "https://github.com/RIKEN-RCCS/benchpark/blob/FN_apps/User_Guide.md" in html + assert "https://github.com/llnl/benchpark" in html assert "Browse Results" in html assert "Estimated Results (login required)" in html assert "Login required" in html + assert "Questions and Discussion" not in html + + +def test_home_page_renders_discord_link_when_configured(monkeypatch): + monkeypatch.setenv("CX_DISCORD_INVITE_URL", "https://discord.gg/example") + app = build_portal_shell_app( + templates_dir=os.path.join(os.path.dirname(__file__), "..", "templates"), + include_home_route=False, + ) + register_home_routes(app) + + with app.test_client() as client: + response = client.get("/") + + assert response.status_code == 200 + html = response.get_data(as_text=True) + assert "Questions and Discussion" in html + assert "invitation-only Discord" in html + assert "https://discord.gg/example" in html diff --git a/result_server/tests/test_result_detail_template.py b/result_server/tests/test_result_detail_template.py index 89c209a..7138d47 100644 --- a/result_server/tests/test_result_detail_template.py +++ b/result_server/tests/test_result_detail_template.py @@ -197,7 +197,7 @@ def test_build_info_hidden_when_no_build(self, app): html = _render_result_detail(result, FULL_QUALITY) assert "

Build Information

" not in html - assert "implicit default (s)" in html + assert "not specified" in html def test_no_vector_section_when_no_metrics(self, app): result = {"code": "test", "system": "sys", "Exp": "exp", "FOM": 1.0} diff --git a/result_server/utils/result_detail_view.py b/result_server/utils/result_detail_view.py index c4cb2c7..a8a179c 100644 --- a/result_server/utils/result_detail_view.py +++ b/result_server/utils/result_detail_view.py @@ -23,7 +23,7 @@ def _build_meta_rows(result): ("System", result.get("system", "N/A")), ("Exp", result.get("Exp", "N/A")), ("FOM", format_numeric_value(result.get("FOM", "N/A"))), - ("FOM Unit", result.get("FOM_unit") or "implicit default (s)"), + ("FOM Unit", result.get("FOM_unit") or "not specified"), ("Node Count", result.get("node_count", "N/A")), ])