Commit Graph
16 Commits
Author SHA1 Message Date
Tonis Tiigi 3365afc66b db: rework compaction eligibility triggers
Replace the adaptive write watermark and hourly reclaimability checks
with two write-driven triggers. After committed writes, file size is
sampled at most every five minutes and a database at or above the size
watermark is checked for reclaimable space. Every writesPerCheck
writes, reclaimability is checked for any database above sizeWatermark,
so space released by deletions is found even when the file does not
grow. Idle databases are not polled.

After a successful compaction the size watermark is set to the
compacted size plus sizeGrowthPercent, with sizeWatermark as the
minimum, and persisted with the write counter. Compaction is pending
when either reclaim threshold is met. Share the threshold logic
between the scheduler, the compactor and the debug endpoint.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-09-29 16:02:48 +02:00
CrazyMax c2ec75cbdd docs: add a metadata compaction guide
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-09-29 16:02:46 +02:00
CrazyMax 140cc36434 buildkitd: expose on-demand compaction through debug HTTP
Expose database measurements through GET /debug/compaction and stream a single manual attempt through POST. Resolve requests against registered databases rather than opening user-supplied paths, reject cross-origin browser POSTs, and return busy measurements instead of blocking inspection behind maintenance.

Allow manual compaction whenever the debug listener is enabled, independently of automatic scheduling. Bypass the write watermark while retaining the idle period, reclaimability thresholds, free-space checks, and serialization across databases.

Cancel manual attempts cooperatively when writers arrive, clients disconnect, or the scheduler stops. Reject duplicate requests and deliver progress without blocking database maintenance on a slow HTTP client. Reuse the idle timer and share the scheduler's checkpoint cadence while waiting for a manual attempt.

Document the endpoints in the developer guide and test manual-only and combined modes, inspection during maintenance, origin checks, idle waiting, cancellation, duplicate requests, checkpoint timing, and shutdown.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-09-29 16:02:46 +02:00
Jiří Moravčík f85c740c2b solver: add per-step CPU and memory resource limits
Add support for setting cgroup resource limits (memory, memory-swap,
cpu-shares, cpu-period, cpu-quota, cpuset-cpus, cpuset-mems) on
individual build steps.

Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
2026-05-27 11:34:13 +02:00
David Karlsson 47e0e634cb docs: use gh alert syntax for callouts
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-08-16 11:14:14 +02:00
Jonathan A. Sternberg e1c4fda48c hack: configure the otel-collector for hack/compose
Configure the otel-collector for `hack/compose` to use it for processing
traces and forwarding to jaeger. This simplifies the configuration and
also opens up the ability to configure additional behavior around traces
and metrics for debugging.

This also removes the automatic override file and the gitignore file. It
wasn't really working well for me and made it difficult to share
extensions to the development environment. I'm going to try something
different for that in a different change.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-03-13 11:01:30 -05:00
Jonathan A. Sternberg a468561e90 dockerfile: introduce a debug variant for the buildkit docker image
This introduces a debug variant of the buildkit docker image. This
version builds the binary in a way that disables optimizations so that
it can be run properly with delve. It also builds and installs delve
only in the debug variant of the image.

For the debug variant, a shim `buildkitd` binary is created that execs
with the proper arguments to delve and forwards to the underlying
binary.

In order to use this version, you can set `--build-arg BUILD_VARIANT=debug`
and it will pick up this version of the image. The default is `release`.
The debug variant is only available for linux and the variant is ignored
for any other target os. Most other targets don't support `buildkitd` at
all so the only os this affects is freebsd.

delve is exposed on port 5000 by default and this can be accessed from
the host by using `-p 5000:5000`. If there is a port conflict on the
host, `-p XXXX:5000` can be used instead. It's also highly recommended
that you do `-p 127.0.0.1:5000:5000` instead. This is because docker
defaults to exposing ports to any interface which exposes the debug port
to the open internet. This is generally a good practice for running
buildkit on a tcp address anyway and the same applies to delve.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2023-09-26 16:48:55 -05:00
Justin Chadwell 2631f5d76e docs: improve CacheMap developer documentation
This gives a new example for the LLB case, explaining the purpose of
what both the selectors and the content-based caching function can be
used for.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-08-08 09:16:33 +01:00
Tonis Tiigi 875fa2f11d docs: add links to architecture overview session
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-10-24 23:53:16 -07:00
Justin Chadwell 07357d69d7 docs: add bind mount output info to dockerfile->llb docs
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:48:26 +01:00
Justin Chadwell 2f2faaff31 docs: reword request lifecycle diagrams to mermaid
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:38:40 +01:00
Justin Chadwell a672781158 docs: add dev doc README as index page
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:38:40 +01:00
df55fa5df8 docs: add dev doc on the solve request lifecycle
Co-authored-by: Edgar Lee <edgarhinshunlee@gmail.com>
Co-authored-by: coryb <cbennett@netflix.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:38:32 +01:00
d119adb274 docs: add dev doc on dockerfile->llb conversion
Co-authored-by: Edgar Lee <edgarhinshunlee@gmail.com>
Co-authored-by: coryb <cbennett@netflix.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:38:07 +01:00
Justin Chadwell 2e5a01aa96 docs: reformat dev docs
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:36:22 +01:00
Justin Chadwell 4bad7c0990 docs: move developer-specific docs to docs/dev/ folder
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-08-16 12:36:22 +01:00