Cached guest directories.
Entries are keyed, so a rebuild can pick up where the last one left off:
(require '[bsdkrun.cache :as cache])
(let [hit (cache/restore "web" {:key k :restore-keys ["deps-"]})]
(when-not (:restored hit)
(sandbox/exec "web" ["npm" "ci"])
(cache/save "web" "/app/node_modules" {:key k})))
Where entries live — host disk or S3 — is host configuration, not an SDK
concern: set BSDKRUN_CACHE_BACKEND / BSDKRUN_CACHE_S3_*, or write
~/.config/bsdkrun/cache.toml.
Cached guest directories.
Entries are keyed, so a rebuild can pick up where the last one left off:
(require '[bsdkrun.cache :as cache])
(let [hit (cache/restore "web" {:key k :restore-keys ["deps-"]})]
(when-not (:restored hit)
(sandbox/exec "web" ["npm" "ci"])
(cache/save "web" "/app/node_modules" {:key k})))
Where entries live — host disk or S3 — is host configuration, not an SDK
concern: set `BSDKRUN_CACHE_BACKEND` / `BSDKRUN_CACHE_S3_*`, or write
`~/.config/bsdkrun/cache.toml`.(ls)Every stored cache entry, newest first.
Every stored cache entry, newest first.
(restore id {:keys [key path restore-keys]})Restore a stored tree.
Options: :key (required), :path (defaults to where it was saved from),
:restore-keys — prefixes tried in order when the key misses. A miss is not
an error: check :restored on the result.
Restore a stored tree. Options: `:key` (required), `:path` (defaults to where it was saved from), `:restore-keys` — prefixes tried in order when the key misses. A miss is not an error: check `:restored` on the result.
(rm keys)(rm keys {:keys [all]})Remove entries by key, or every one of them with {:all true}. Returns nil.
Remove entries by key, or every one of them with `{:all true}`. Returns nil.
(save id path {:keys [key compression force] :or {compression "gzip"}})Archive the guest directory at path under :key.
Options: :key (required), :compression ("gzip" by default, or "zstd",
"estargz", "none"), :force to replace an existing entry. Returns the
stored entry.
Archive the guest directory at `path` under `:key`.
Options: `:key` (required), `:compression` ("gzip" by default, or "zstd",
"estargz", "none"), `:force` to replace an existing entry. Returns the
stored entry.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |