Liking cljdoc? Tell your friends :D
Clojure only.

hive-compose.promote.pack

Pure: the suite x project matrix packed into a memory budget (hc-16b), instead of run at a fixed concurrency.

Each cell weighs its runner's memory cap. pack answers waves: the cells of one wave run together, and the caps of one wave sum to at most the budget left once the stack itself (its capped instances) is paid for. Cells go heaviest first, each into the first wave it fits (first-fit decreasing), so the number of waves stays near the minimum. Ties break on the cell key, so the answer never depends on the order the cells came in.

A cell with no cap weighs :default-mem. A cell heavier than the whole budget can never run; pack refuses the matrix and names it rather than run it over the budget. With no budget at all there is one wave of every cell, capped by :max-parallel when it is given.

No IO: the budget, the stack's capped total and the caps arrive as bytes.

Pure: the suite x project matrix packed into a memory budget (hc-16b),
instead of run at a fixed concurrency.

Each cell weighs its runner's memory cap. `pack` answers waves: the cells
of one wave run together, and the caps of one wave sum to at most the
budget left once the stack itself (its capped instances) is paid for.
Cells go heaviest first, each into the first wave it fits (first-fit
decreasing), so the number of waves stays near the minimum. Ties break on
the cell key, so the answer never depends on the order the cells came in.

A cell with no cap weighs `:default-mem`. A cell heavier than the whole
budget can never run; `pack` refuses the matrix and names it rather than
run it over the budget. With no budget at all there is one wave of every
cell, capped by `:max-parallel` when it is given.

No IO: the budget, the stack's capped total and the caps arrive as bytes.
raw docstring

cell-keyclj

(cell-key cell)

[suite project] of a cell.

[suite project] of a cell.
sourceraw docstring

packclj

(pack cells {:keys [budget stack-mem default-mem max-parallel]})

Result<{:waves [[cell ..] ..] :budget/limit bytes-or-nil :budget/stack bytes :budget/cells bytes :weights {[suite project] bytes}}> of cells (each {:suite/id :project :mem bytes-or-nil}).

opts: :budget bytes the matrix may hold at once, stack included (nil: no budget) :stack-mem the stack's capped memory, paid before any cell (0) :default-mem the weight of a cell with no cap (512m) :max-parallel at most this many cells in one wave (nil: no limit)

Errors: :compose/over-budget (hc-16a OverBudget, :basis :budget, plus :scope :matrix) {:limit :total-mem :over :instances [{:instance test-id :mem bytes}] :message} when the stack alone, or the stack plus one cell, exceeds the budget.

Result<{:waves [[cell ..] ..] :budget/limit bytes-or-nil :budget/stack bytes
:budget/cells bytes :weights {[suite project] bytes}}> of `cells` (each
{:suite/id :project :mem bytes-or-nil}).

`opts`:
  :budget        bytes the matrix may hold at once, stack included (nil:
                 no budget)
  :stack-mem     the stack's capped memory, paid before any cell (0)
  :default-mem   the weight of a cell with no cap (512m)
  :max-parallel  at most this many cells in one wave (nil: no limit)

Errors: :compose/over-budget (hc-16a OverBudget, :basis :budget, plus
:scope :matrix) {:limit :total-mem :over
:instances [{:instance test-id :mem bytes}] :message} when the stack alone,
or the stack plus one cell, exceeds the budget.
sourceraw docstring

peakclj

(peak {:keys [waves weights] :budget/keys [stack]})

The most memory any wave of packed holds, the stack included.

The most memory any wave of `packed` holds, the stack included.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close