Skip to content
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
13 changes: 12 additions & 1 deletion result_server/routes/home.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from flask import render_template

from utils.system_info import get_all_systems_info
Expand All @@ -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()
Expand All @@ -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)
30 changes: 30 additions & 0 deletions result_server/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ <h2 class="section-title">For Application Developers</h2>
<strong>Add Estimation Support</strong>
<span>Connect application-side result emission to estimation inputs and estimation workflows.</span>
</a>
{% if guide_links.discord %}
<a class="home-link-card" href="{{ guide_links.discord }}" target="_blank" rel="noopener noreferrer">
<strong>Questions and Discussion</strong>
<span>Use the invitation-only Discord for lightweight questions, onboarding support, and early coordination before opening issues or pull requests.</span>
</a>
{% endif %}
</div>
</section>

Expand All @@ -306,6 +312,30 @@ <h2 class="section-title">Operations Views</h2>
{% endif %}
</section>

<section class="page-card home-systems-section">
<h2 class="section-title">GPU Performance Estimation</h2>
<p class="section-intro">
CX Portal stores GPU kernel-level estimation artifacts together with benchmark results, including prepared inputs, prediction outputs, logs, and package comparison data.
</p>
<div class="home-link-list home-content-grid-three">
<a class="home-link-card" href="{{ guide_links.perftools }}" target="_blank" rel="noopener noreferrer">
<strong>PerfTools</strong>
<span>GPU performance estimation models used by the current experimental integration.</span>
</a>
<a class="home-link-card" href="{{ guide_links.benchpark_fn_apps }}" target="_blank" rel="noopener noreferrer">
<strong>Application Onboarding</strong>
<span>Use the RIKEN-RCCS BenchPark FN_apps branch for FugakuNEXT/CX application bring-up and local validation.</span>
</a>
<a class="home-link-card" href="{{ guide_links.benchpark_upstream }}" target="_blank" rel="noopener noreferrer">
<strong>Upstream BenchPark</strong>
<span>The RIKEN-RCCS fork is an integration window; upstream BenchPark remains the main upstream project.</span>
</a>
</div>
<p class="section-intro home-section-footer">
GPU kernel estimates are interpreted as source/target scaling factors. Application-level FOM reconstruction also needs application-side section timing for CPU, GPU, communication, and overlap regions.
</p>
</section>

<section class="home-systems-section page-card">
<div class="home-systems-header">
<div>
Expand Down
29 changes: 28 additions & 1 deletion result_server/tests/test_home_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
2 changes: 1 addition & 1 deletion result_server/tests/test_result_detail_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_build_info_hidden_when_no_build(self, app):
html = _render_result_detail(result, FULL_QUALITY)

assert "<h2>Build Information</h2>" 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}
Expand Down
2 changes: 1 addition & 1 deletion result_server/utils/result_detail_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
])

Expand Down
Loading