Liking cljdoc? Tell your friends :D

hive-compose.adapter.suite-runner

ISuiteRunner over the host and docker (hc-8, hc-16b): one suite runner run to its end under its resource caps, its OOM kill diagnosed, every secret it resolved scrubbed from what it answers.

A host command runs as systemd-run --user --scope --quiet --unit=hc-suite-<test>-<ms> -p MemoryMax=<cap> -p MemorySwapMax=0 -- <command> so a runaway is OOM-killed inside its own scope and cannot take the host down; the scope's Result (oom-kill) is read after the run and the unit reset. Without a systemd user manager the command runs under ulimit -v and the answer's :cap :note says so.

A container runs as docker image inspect, then docker pull when the image is absent (under its own :pull-timeout-ms, default 10 min, never the run's), docker create (name, view network, --mount binds, labels, -e VAR by NAME only, --memory <cap> --memory-swap <cap> --cpus n), docker network connect to each of :extra-networks, docker start -a with its output discarded (never drained into this heap) and read back through docker logs --tail, docker inspect (State.OOMKilled, ExitCode), then docker rm -f, which also runs after a failed step, a timeout or a throw. rm -f is never -v: volumes are never removed, so an image that declares a VOLUME leaves its anonymous volume behind, one per cell (docker volume ls -f dangling=true lists them).

Env values never reach an argv: secret references in :env are read here, at spawn, through the injected resolver (hive-compose.adapter.secrets), and travel in the env of the process (docker copies the named ones in). Every answer, ok or error, carries :scrub (fn [text]) -> text, which replaces every value resolved from a reference by that reference's rendering; the output, the OOM finding and every error message are already scrubbed.

Everything outside is injected: :exec (hive-system shell.core/exec! shape: argv, {:dir :env :timeout-ms} -> Result<{:exit :stdout :stderr}>), :now (epoch ms), :systemd? and :resolver.

ISuiteRunner over the host and docker (hc-8, hc-16b): one suite runner run
to its end under its resource caps, its OOM kill diagnosed, every secret
it resolved scrubbed from what it answers.

A host command runs as
  systemd-run --user --scope --quiet --unit=hc-suite-<test>-<ms>
              -p MemoryMax=<cap> -p MemorySwapMax=0 -- <command>
so a runaway is OOM-killed inside its own scope and cannot take the host
down; the scope's Result (oom-kill) is read after the run and the unit
reset. Without a systemd user manager the command runs under `ulimit -v`
and the answer's :cap :note says so.

A container runs as `docker image inspect`, then `docker pull` when the
image is absent (under its own `:pull-timeout-ms`, default 10 min, never
the run's), `docker create` (name, view network, `--mount` binds, labels,
`-e VAR` by NAME only, `--memory <cap> --memory-swap <cap> --cpus n`),
`docker network connect` to each of `:extra-networks`, `docker start -a`
with its output discarded (never drained into this heap) and read back
through `docker logs --tail`, `docker inspect` (State.OOMKilled,
ExitCode), then `docker rm -f`, which also runs after a failed step, a
timeout or a throw. `rm -f` is never `-v`: volumes are never removed, so
an image that declares a VOLUME leaves its anonymous volume behind, one
per cell (`docker volume ls -f dangling=true` lists them).

Env values never reach an argv: secret references in `:env` are read here,
at spawn, through the injected resolver (`hive-compose.adapter.secrets`),
and travel in the env of the process (docker copies the named ones in).
Every answer, ok or error, carries `:scrub` (fn [text]) -> text, which
replaces every value resolved from a reference by that reference's
rendering; the output, the OOM finding and every error message are
already scrubbed.

Everything outside is injected: `:exec` (hive-system `shell.core/exec!`
shape: argv, {:dir :env :timeout-ms} -> Result<{:exit :stdout :stderr}>),
`:now` (epoch ms), `:systemd?` and `:resolver`.
raw docstring

connect-argvclj

(connect-argv network container)
source

create-argvclj

(create-argv spec cs)

The docker create argv of container spec under cs {:mem :cpus}. Not --rm: the container is inspected after it ends, then removed.

The `docker create` argv of container `spec` under `cs` {:mem :cpus}. Not
--rm: the container is inspected after it ends, then removed.
sourceraw docstring

default-pull-timeout-msclj

How long a missing image may take to pull.

How long a missing image may take to pull.
sourceraw docstring

default-timeout-msclj

A runner with no :timeout-ms of its own may run this long (1 h).

A runner with no :timeout-ms of its own may run this long (1 h).
sourceraw docstring

env-argsclj

(env-args env)

-e VAR for every variable of env, sorted: names only.

`-e VAR` for every variable of `env`, sorted: names only.
sourceraw docstring

inspect-image-argvclj

(inspect-image-argv image)
source

make-runnerclj

(make-runner opts)

SuiteRunner. opts: :exec (default hive-system shell.core/exec!), :now (default System/currentTimeMillis), :compose/systemd-scope? (default: whether a systemd user manager answers; false falls back to ulimit -v), :compose/resolver ({scheme ISecretBackend}, default pass over that exec).

SuiteRunner. `opts`: :exec (default hive-system `shell.core/exec!`), :now
(default `System/currentTimeMillis`), :compose/systemd-scope? (default:
whether a systemd user manager answers; false falls back to ulimit -v),
:compose/resolver ({scheme ISecretBackend}, default `pass` over that exec).
sourceraw docstring

mount-argsclj

(mount-args mounts)

--mount type=bind,... per mount: unlike -v, a : in a path is no separator.

`--mount type=bind,...` per mount: unlike `-v`, a `:` in a path is no separator.
sourceraw docstring

pull-argvclj

(pull-argv image)
source

rm-argvclj

(rm-argv container)
source

run-command!clj

(run-command! {:keys [exec now systemd?]} spec resolved scrub)

Run the host command of spec under its caps, its env resolved.

Run the host command of `spec` under its caps, its env `resolved`.
sourceraw docstring

run-container!clj

(run-container! {:keys [exec now]} spec resolved scrub)

Run the container of spec under its caps, its env resolved.

Run the container of `spec` under its caps, its env `resolved`.
sourceraw docstring

start-argvclj

(start-argv container)

docker start -a, its output discarded: it is unbounded, and read back through docker logs --tail instead.

`docker start -a`, its output discarded: it is unbounded, and read back
through `docker logs --tail` instead.
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