Skip to content

Commit

Permalink
tweaks to spack monitor analyze (smeagle) interface
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Nov 2, 2021
1 parent 08542c2 commit dabb9db
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 307 deletions.
9 changes: 7 additions & 2 deletions spackmon/apps/main/templates/matrix/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2 style="align:center">Package Matrix</h2>
return "<div class='row'><strong style='color:red'>Error: </strong>This combination of compiler and version is unknown to Spack Monitor.</div>";
}
console.log(d.spec["{{ package }}"])
return "<div class='row'><div class='col-md-12'><strong>Spec: </strong><code> Version: {{ package }} " + d.spec["{{ package }}"]["version"] + "</code><br></div></div><br><div class='row'><div class='col-md-12'><strong>Score: </strong>Out of all the builds for this combination that Spack Monitor knows, the rate of success is " + d.value + "</div></div>";
return "<div class='row'><div class='col-md-12'><strong>Spec: </strong><code> Version: {{ package }} " + d.spec["{{ package }}"]["version"] + "</code><br><br><strong>Summary:</strong><br><table><tr><td>SUCCESS</td><td>"+ d.success +" </td></tr><tr><td>FAILURE</td><td>"+ d.failed +" </td></tr><tr><td>CANCELLED</td><td>"+ d.cancelled + " </td></tr><tr><td>NOT RUN</td><td>"+ d.notrun +" </td></tr><tr><td>TOTAL</td><td>"+ d.total +" </td></tr></table></div></div><br><div class='row'><div class='col-md-12'><strong>Score: </strong>Out of all the builds for this combination that Spack Monitor knows, the rate of success is " + d.value + "</div></div>";
})

var element = document.getElementById("plotarea");
Expand Down Expand Up @@ -154,7 +154,7 @@ <h2 style="align:center">Package Matrix</h2>
// Create rows - so one version across dimension
{% for row in rows %}
row = []{% for entry in row %}
row.push({"spec": {% if entry.spec %}{{ entry.spec.to_json | safe }}{% else %}{}{% endif %}, "value": {{ entry.value }}, "status": "{{ entry.status }}", "spec_id": "{{ entry.spec_id }}"});{% endfor %}
row.push({"spec": {% if entry.spec %}{{ entry.spec.to_json | safe }}{% else %}{}{% endif %}, "value": {{ entry.value }}, "status": "{{ entry.status }}", "spec_id": "{{ entry.spec_id }}", "failed": {{ entry.failed }}, "cancelled": {{ entry.cancelled}}, "success": {{ entry.success }}, "total": {{ entry.total }}, "notrun": {{ entry.notrun }} });{% endfor %}
matrix.push(row);{% endfor %}

console.log(matrix)
Expand Down Expand Up @@ -226,6 +226,11 @@ <h2 style="align:center">Package Matrix</h2>

// Case 1 that we had a run, and a value between 0 and 1 for success
if (d.status == "RUN") {

// all were cancelled
if (d.cancelled == d.total) {
return "#ecb03f";
}
return colorscale(d.value);
}
// Case 2: the build outcome is unknown
Expand Down
43 changes: 37 additions & 6 deletions spackmon/apps/main/templates/smeagle/diffs.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{% endblock %}
{% block content %}

{% include "messages/message.html" %}
<div class="row">
<div class="col-md-12">
<h2 style="align:center">Smeagle (ABI) Diffs</h2>
Expand All @@ -31,12 +32,23 @@ <h2 style="align:center">Smeagle (ABI) Diffs</h2>
{% for pkg in packages %}<option value="{{ pkg }}" {% if pkg == package %}selected{% endif %}>{{ pkg }}</option>{% endfor %}
</select>
</div>
{% if package and versions %}<!-- If we have a package selected, require selecting versions -->
<div class="col-md-3">
<select class="autocomplete" style="width:100%" id="a-select" class="form-select" aria-label="a">
{% for version in versions %}<option value="{{ version.id }}" {% if version.id == A.id %}selected{% endif %}>{{ version.pretty_print }}</option>{% endfor %}
</select>
</div>
<div class="col-md-3">
<select class="autocomplete" style="width:100%" id="b-select" class="form-select" aria-label="b">
{% for version in versions %}<option value="{{ version.id }}" {% if version.id == A.id %}selected{% endif %}>{{ version.pretty_print }}</option>{% endfor %}
</select>
</div>{% endif %}
<div class="col-md-2">
<a href="#" type="button" id="diff-button" class="btn btn-primary" style="padding:5px">View Missing Symbols</a>
</div>
</div>

{% if package and not comps %}<div class="row" style="padding-top:20px; padding-bottom:30px">
{% if package and specA and specB and not comps %}<div class="row" style="padding-top:20px; padding-bottom:30px">
<div class="col-md-12">
<p class="alert alert-info">We don't have any analyzer output for that package.</p>
</div>
Expand All @@ -46,7 +58,7 @@ <h2 style="align:center">Smeagle (ABI) Diffs</h2>
<div class="card-header" id="heading-{{ forloop.counter }}">
<h5 class="mb-0">
<button style="color:black !important; border: none !important; cursor: pointer !important" class="btn btn-link" data-toggle="collapse" data-target="#collapse-{{ forloop.counter }}" aria-expanded="true" aria-controls="collapse-{{ forloop.counter }}">
<span style="color:purple">{{ comp.specA.name }}@{{ comp.specA.version }} {{ comp.A }}</span> vs. <span style="color:blue">{{ comp.specB.name }}@{{ comp.specB.version }} {{ comp.B }}</span>
<span style="color:purple">{{ comp.specA.name }}@{{ comp.specA.version }} %{{ comp.specA.compiler }} {{ comp.A }}</span> vs. <span style="color:blue">{{ comp.specB.name }}@{{ comp.specB.version }} %{{ comp.specB.compiler }} {{ comp.B }}</span>
</button>
</h5>
</div>
Expand Down Expand Up @@ -87,12 +99,31 @@ <h5 class="mb-0">
// Calculate the diff when the user clicks, unless it's the same spec
$("#diff-button").click(function(){
spec = $( "#spec-select option:selected" ).val();
if (spec == null) {
$("#message").html("Please select a package to view analysis for.")
$("#message").show()
} else {

{% if package and versions %}
versionA = $( "#a-select option:selected" ).val();
versionB = $( "#b-select option:selected" ).val();
{% else %}
versionA = null
versionB = null
{% endif %}

if (spec != null && versionA == null && versionB == null) {
$("#fade").show();
document.location = "/analysis/abi/stability/" + spec + "/"
}
if (spec != null && versionA != null && versionB != null && versionA == versionB) {
$("#message").html("Please select different versions to compare.")
$("#message").show()
} else if (spec != null && versionA != null && versionB != null) {
$("#fade").show();
document.location = "/analysis/abi/stability/" + spec + "/" + versionA + "/" + versionB + "/"
} else if (spec == null && (versionA == null || versionB == null) ) {
$("#message").html("Please select a package and two versions to view analysis for.")
$("#message").show()
} else {
$("#message").html("Please select a package to view analysis for.")
$("#message").show()
}
})
});
Expand Down
4 changes: 2 additions & 2 deletions spackmon/apps/main/templates/specs/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h4></h4>
<b><a href="{% url 'main:spec_detail' dep.spec.id %}">{{ dep.spec.name }}</a></b>
</td>
<td class="normal" align="right">{% if dep.spec.build_set.count == 0 %}<span title="NOT RUN means there were no build phases sent for this spec." class="badge badge-secondary">NOT RUN</span>{% else %}
<b>{% for phase in dep.spec.build_set.all %}<span class="badge badge-{% if phase.status == "CANCELLED" %}warning{% elif phase.status == "SUCCESS" %}success{% elif phase.status == "FAILED" %}error{% else %}info{% endif %}">{{ phase.status }}</span>{% endfor %}
<b>{% for phase in dep.spec.build_set.all %}<span class="badge badge-{% if phase.status == "CANCELLED" %}warning{% elif phase.status == "SUCCESS" %}success{% elif phase.status == "FAILED" %}danger{% else %}info{% endif %}">{{ phase.status }}</span>{% endfor %}
</b>{% endif %}
</td>
</tr>{% endfor %}
Expand All @@ -63,7 +63,7 @@ <h4></h4>
<b><a href="{% url 'main:spec_detail' dep.id %}">{{ dep.name }}</a></b>
</td>
<td class="normal" align="right">{% if dep.build_set.count == 0 %}<span title="NOT RUN means there were no build phases sent for this spec." class="badge badge-secondary">NOT RUN</span>{% else %}
<b>{% for phase in dep.build_set.all %}<span class="badge badge-{% if phase.status == "CANCELLED" %}warning{% elif phase.status == "SUCCESS" %}success{% elif phase.status == "FAILED" %}danger{% else %}info{% endif %}">{{ phase.status }}</span>{% endfor %}
<b>{% for phase in dep.build_set.all %}<span class="badge badge-{% if phase.status == "CANCELLED" %}warning{% elif phase.status == "SUCCESS" %}success{% elif phase.status == "ERROR" %}danger{% elif phase.status == "FAILED" %}danger{% else %}info{% endif %}">{{ phase.status }}</span>{% endfor %}
</b>{% endif %}
</td>
</tr>{% endfor %}
Expand Down
5 changes: 5 additions & 0 deletions spackmon/apps/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
name="package-analysis-results",
),
# Smeagle diffs / symbols
path(
"analysis/abi/stability/<str:pkg>/<str:specA>/<str:specB>/",
views.stability_test_package,
name="stability-test-package",
),
path(
"analysis/abi/stability/<str:pkg>/",
views.stability_test_package,
Expand Down

0 comments on commit dabb9db

Please sign in to comment.