{# A run started from the builder, as the page that follows it: state, host, the run's own log (uv, Harbor, the tasks, the run), a Stop while it lives. Shown on the job page beside the job, and instead of it while Harbor has not written the job yet. #} {# `csrf` is an argument, not a context lookup: an imported macro sees no template context, so a `{{ csrf }}` inside it rendered empty and every Stop and Continue answered 403. #} {# `own`: this job's own (state, finished) when the run is of several agents - an arm that answered everything is done though a later arm failed; the run's state is said beside it. #} {% macro execution_strip(ex, csrf, waiting=false, own=none) %} {% set shown = own[0] if own else ex.state %}
{{ shown }}{% if not own and ex.step and ex.state in ('preparing', 'running') %} · {{ ex.step }}{% endif %} on {{ ex.plan.host.label if ex.plan.host else 'this machine' }} {% if ex.error and not own %}{{ ex.error }}{% endif %} · the run: {{ ex.state }}{% if ex.error %} · {{ ex.error }}{% endif %} {% if ex.state in ('preparing', 'running', 'paused') %}{% endif %}
{# an agent's run failed with more to come: the question, and the answer #}
{{ ex.question or '' }}
{# what the run is doing: a stepper of the stages before its first unit (a check when done, its number until then), then its units (nullius/progress.py) #} {% set sp = ex.stages() %}
    {% for st in sp.stages %}
  1. {{ st.label }} {%- if st.state == 'cached' %}cached{% elif st.get('seconds') is not none and st.state in ('done', 'failed') %}{{ st.seconds|secs }}{% endif %} {%- if st.state in ('running', 'failed') and st.detail and st.detail != sp.detail %}{{ st.detail }}{% endif %}
  2. {% endfor %}
{% if sp.units %}{% set u = sp.units %}{{ u.done }} / {{ u.n if u.n is not none else '?' }} {{ u.noun }}{% for k in ('passed', 'failed', 'scored', 'errors') if u[k] %} · {{ u[k] }} {{ 'error' + ('' if u[k] == 1 else 's') if k == 'errors' else k }}{% endfor %}{% if u.running %} · {{ u.running }} running{% endif %}{% endif %}
{% if sp.ended == 'refused' %}Refused before its first unit: {{ sp.detail }}{% endif %}
{# a part downloading: its file, how much of it, as a bar #}
Run log
{% endmacro %}