Skip to content

Console: attention view and stalled devices #275

Closed

Description

@V3RON

Part of #88.

Scope

The operator sees, in one place, everything that needs their attention:
workers that are disconnected, incompatible or drained; quarantined
devices; devices stuck provisioning or reclaiming; a host over its RAM
budget. Each item appears within about a second of happening and leaves
when it clears. The shell shows how many items there are, from any view.

Technical spec

Modules touched

  • src/core/doctor.ts: the stall test inside stalledTransitionFinding
    becomes its own exported function, isStalledTransition, taking the
    device, its driver, the stalledTransition config, the claims and the
    time. The doctor's finding calls it. Behaviour does not change.
  • src/daemon/dispatcher.ts: #decorateDevice sets stalled: true on a
    device for which isStalledTransition holds. The dispatcher gains what
    that needs: the drivers by platform, the config, the device operation
    claims.
  • src/contract/schemas.ts: the status device schema gains optional
    stalled. Worker views carry it because they copy status devices.
  • ui/: the Attention view and the count in the shell, both derived from
    GET /v1/workers:
    • a worker whose connection is disconnected or incompatible, or
      whose drained is true;
    • a device whose state is quarantined;
    • a device with stalled: true;
    • a worker whose capacity reports ramBudget.overLimit: true.
      Each item names its worker and links to it.
  • src/cli/index.ts: simlock status marks a stalled device next to it,
    the way it marks a quarantined one.
  • docs/HTTP-API.md (the stalled field), docs/CLI.md (the marker),
    docs/CONSOLE.md (the Attention view and each condition).

Contract and event changes

  • stalled (optional boolean) on status devices, on list.get devices and
    on worker view devices. Absent means not stalled. Additive; no protocol
    version change.
  • No event changes. A stall is not a new event: the doctor's
    device.stalled-transition-detected keeps its meaning.

Rules in play

  • architecture.md rule on one place: the stall rule lives in one
    function; the doctor and the status decoration both call it.
  • testing.md: prove the doctor's finding is unchanged.

Tests

  • isStalledTransition holds for a provisioning device past its threshold with no claim
  • isStalledTransition does not hold for a device with a live operation claim
  • the doctor's stalled-transition finding is unchanged
  • status marks a stalled device with stalled: true and leaves others without it
  • a gateway's worker view carries a worker device's stalled flag
  • simlock status marks a stalled device
  • the attention list holds a disconnected, an incompatible and a drained worker
  • the attention list holds a quarantined device and a stalled device
  • the attention list holds a worker over its RAM budget
  • an item leaves the attention list when its condition clears
  • Browser lane, in Chromium, Firefox and WebKit:
    • draining a worker adds it to the attention view within a second
    • undraining it removes it within a second
    • stopping a worker adds it as disconnected within a second
    • the attention count shows in the shell from every view
    • the Attention view has no horizontal scroll at 360px wide
    • the Attention view is usable with the keyboard alone

Done when

  • Each condition listed under Scope appears in the Attention view on a
    gateway, and the ones that apply to one machine also on a single host.
  • Each appears within a second of happening and leaves when it clears.
  • simlock doctor reports the same stalls as before.
  • The browser lane passes in all three browsers.

Out of scope

  • Fixing anything from the console.
  • Notifications outside the page.

Depends on

Approval

  • Approved for delivery

Written by an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:draft

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions