{# docker/service.html — one swarm service (#5302, #5310): a header that says whether it is well and what it runs; its last failure only while it is in trouble; its CPU and memory over time; one table of its tasks, the running ones first with what they use; and the logs of every task it has run. A failure's "Logs →" lands on #logs with ?task= picked. #} {% extends "base.html" %} {% from "_macros.html" import crumbs, status_badge %} {% from "docker/_usage.html" import cpu, mem %} {% block title %}{{ name }} — Docker — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Docker", "/plugins/docker/"), (name, "")]) }}{% endblock %} {% block content %} {% if service is none %}
{{ "No longer running" if task_choices else "Service not found" }} {% if task_choices %} No swarm service named {{ name }} is reported now; it may have been removed. The logs Steward still keeps from its tasks are below. {% else %} No swarm service named {{ name }} is reported, and Steward holds no logs or events for one. It may have been removed. Back to Docker {% endif %}
{% else %} {# ── Header: the verdict, then what it is (#5310). Each fact has one home: what it uses is in Resource history, its tasks and failures in Tasks. #} {% set troubled = row.crash_looping or row.state != 'healthy' %} {% set tone = 'ok' if row.state == 'healthy' else ('warn' if row.state == 'degraded' else 'crit') %} {% set image = (svc.image if svc and svc.image else row.image) %} {% set e = row.last_error %} {# ── What is wrong, only while it is (#5310) ──────────────────────────────── #} {% if troubled and e %}

Last failed task

{{ e.error or e.message or e.state }}{% if e.exit_code %} (exit {{ e.exit_code }}){% endif %} {%- if e.node %} · on {{ e.node }}{% endif %}{% if e.age_s is not none %} · {{ e.age_s|duration }} ago{% endif %} {%- if e.task_id %} · its logs →{% endif %}

{% endif %} {# ── Resource history, summed across replicas ────────────────────────────── #}

Resource history across running replicas

{% include "_time_range.html" %}

Loading…

{# ── Tasks: the running ones with what they use, then Swarm's record ─────── #}

Tasks running first, then Swarm's most recent {%- if row.failures_24h %} · {{ row.failures_24h }} failed in 24h{% endif %}

{% if tasks %} {% for t in tasks %} {% endfor %}
SlotTaskNodeState CPUMemory ExitWhyWhen
{{ t.slot or "—" }} {%- if t.task_id %}{{ t.task_id[:10] }} {%- if t.container and t.host_id %} ↗{% endif %} {%- elif t.container and t.host_id %}{{ t.container|truncate(24, true, "…") }} {%- else %}—{% endif -%} {% if t.host_id %}{{ t.node }}{% else %}{{ t.node }}{% endif %} {%- if t.failed %}{{ status_badge('crit', t.state|capitalize) }} {%- elif t.current %}{{ status_badge('ok', 'Running') }} {%- else %}{{ t.state }}{% endif %} {%- if t.health == 'unhealthy' %} {{ status_badge('crit', 'Unhealthy') }}{% elif t.health == 'starting' %} {{ status_badge('pending', 'Starting') }}{% endif %} {%- if t.desired and t.desired != t.state and not t.current %} → {{ t.desired }}{% endif -%} {% if t.usage %}{{ cpu(t.usage) }}{% else %}—{% endif %} {% if t.usage %}{{ mem(t.usage) }}{% else %}—{% endif %} {% if t.exit_code %}{{ t.exit_code }}{% else %}—{% endif %} {{ t.why or "" }} {% if t.at %}{{ t.at|ago }}{% else %}—{% endif %}
{% else %}

No task is running, and Swarm's record of its tasks has not been reported yet (the manager's agent reports it from version 1.8.0).

{% endif %}
{% endif %} {# ── Logs across every task, newest first ───────────────────────────────── Shown for a removed service too, while its lines are still kept. #} {% if service is not none or task_choices %}

Logs every task, newest first

{% if task_choices|length > 1 %} {% elif focus_task %}{% endif %}

Loading…

{% endif %} {% endblock %}