This adds a way to set the log level of buildkitd outside of using
`--debug` or `--trace` which allows increasing the log level rather than
only lowering it.
The `--debug` and `--trace` options are now deprecated along with the
configuration options. A warning will be printed to the log when they
are used.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Modifies the hack/compose script to use a newer otel collector and try
to suppress miscellaneous logs when it fails to export traces. Disable
jaeger, prometheus, and grafana by default.
It also adds a metrics pipeline that goes to a nop exporter. This is
force the otel collector to start the metrics service and prevent an
error when buildkit exports metrics to the otel collector related to the
metrics service being missing.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
The prune logic would prune multiple times because one prune could cause
more things to be capable of pruning and change the logic. This was done
through a recursive invocation.
Since go doesn't have support for function tail calls, this would result
in a new stack entry for each loop. This unrolls the logic so the prune
function is invoked iteratively rather than recursively.
`prune` and `pruneOnce` have also had their names swapped. In general,
`pruneOnce` implies that it runs a single prune while `prune` sounds
like the top level function. The current code had this reversed and
`pruneOnce` would call `prune` and `prune` would call itself
recursively.
I've also updated a section in the controller that invoked prune on each
worker. In older versions of Go, the current version was correct because
those versions of Go would reuse the location for each loop which would
cause goroutines to all reference the same worker instead of different
workers.
Recent versions of Go have changed the behavior so this is no longer
needed.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Starts a prometheus server that automatically scrapes buildkit for
metrics using the `/metrics` endpoint. Also configures a grafana
instance to use prometheus as the default connection.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
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>
This adds a simple docker compose file for development. The development
version of buildkit will build with the dockerfile, set debug to true,
use a tcp address to be compatible with the remote driver, and enable
the debug image through delve to allow for remote debugging.
It also configures additional services for help with development. At
the moment, this only includes jaeger for collecting traces but can also
include additional services in the future for things like metrics
collection.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>