morca · API · ui

orca.ui.parts

Pieces several pages draw: durations, times and partitions in a table's cells, a runs table with each row's actions, links to code, and a run's grant and usage as facts.

Functions

took_text

def took_text(seconds: Int) -> String

A duration as 42s, 3m 07s or 2h 05m; empty for a negative one.

took_long

def took_long(seconds: Int) -> String

A duration as 42 s, 3 min 21 s or 2 h 5 min.

partitions_fact

def partitions_fact(mut h: Html, partitions: String)

A run's partitions on its page: all of them if few, else first … last (N partitions) with the whole list in a fold.

step_cell

def step_cell(mut h: Html, name: String, links: CodeLinks, attempt: Int = Int(-1))

A step's name, then a link to its function where the code is known. With attempt (0 for none yet), the name shows the step's card (orca.ui.step_cards), and that attempt's on a run's page.

source_html

def source_html(mut h: Html, v: VersionRow)

The commit, linked to its tree where the host is known.

pause_button

def pause_button(mut h: Html, name: String, paused: Bool)

Resume a paused pipeline, or pause an active one.

cancel_tell

def cancel_tell(r: RunRow) -> String

What cancelling r does, as its Cancel's dialog says it (orca.actions.cancel_run).

row_actions

def row_actions(mut h: Html, r: RunRow)

A runs table row's Cancel (queued or running) or Retry (failed).

runs_table_html

def runs_table_html(mut h: Html, runs: List[RunRow], show_pipeline: Bool, pick: Bool = False, code: Dict[Int, RunCode] = Dict())

A table of runs; with pick, a checkbox before each, for the list's bulk actions (form="bulk-runs", orca.ui.runs.runs_bulk_html), and one in the header that ticks the page's (with JavaScript). With a run's code, its pipeline's name shows the pipeline's declaration on hover (data-src, the page's _PEEK) and a failed run names the step that failed, linked to its function, at the commit the run ran.

mb_text

def mb_text(mb: Int) -> String

512 MB, 1.5 GB.

usage_cell

def usage_cell(mut h: Html, u: Usage, limit_mb: Int = Int(0), grant_mb: Int = Int(0))

A <td> of a peak in memory, with the CPU in its title, and after it the attempt's memory limit (orca.cgroup) when it had one.

request_text

def request_text(cpus: String, memory_gb: String) -> String

1..16 CPUs, 2..24 GB; auto as CPUs auto, memory auto..24 GB.

limit_facts

def limit_facts(mut h: Html, limit_mb: Int, max_mb: Int, grant_mb: Int = Int(0))

A Memory limit fact (orca.cgroup), when there was one.

grant_facts

def grant_facts(mut h: Html, r: RunResources)

A run's Requested and Granted facts (orca.resources), when its pipeline asked for any, and its memory limit (orca.cgroup) when it had one.

usage_facts

def usage_facts(mut h: Html, u: Usage, live: Bool)

A run's or an attempt's Peak memory and CPU used facts (orca.usage).

Aliases

comptime TRIES = "Times the run's process was started: 1 is normal; more means retries, a lost instance or a resume."

What a runs table's Tries column counts (orca.runs.starts).

comptime PEAK_HELP = "The most memory its processes held at once: the run's process and what it started (dista's local workers too), sampled every second by the scheduler or worker that started it, and at the end the largest single process. Not measured on EC2 or Kubernetes."
comptime CPU_HELP = "The CPU time its processes used, user and system, and the most cores they kept busy over one sample's second. macOS gives only the time, and only for a process that made one attempt."
comptime LIMIT_HELP = "Its latest start's cgroup (orca.cgroup): past the limit (memory.high, its grant, request or ORCA_RUN_MEMORY_MB) the kernel slows its processes and reclaims their memory; past the kill line (memory.max, ORCA_RUN_MEMORY_MARGIN above) it kills them, and the retry asks for more. None where orca can't make cgroups."