This commit fixes more issues where vertex progress updates were using
the same ID and incorrectly deduplicating with each other. A previous
commit addressed this in solver/jobs.go but the same problem existed
elsewhere.
The update results in a random ID being used for vertex start/stop
events as it is the simplest approach that works everywhere in a
consistent pattern.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
Currently, bklog overwrites `(github.com/containerd/containerd/log).G` and
doesn't preserve the logger set by
`(github.com/containerd/containerd/log).WithLogger`.
This causes log fields set by
`(github.com/containerd/containerd/log).WithLogger` are dropped.
This commit fixes this issue by allowing `bklog.GetLogger` to get logger set by
`(github.com/containerd/containerd/log).WithLogger`.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
A panic was encountered where writes to progress status hit a nil
writer. While not easy to reproduce, this commit fixes a likely culprit.
The use of atomics in the controller was not safe against a race such as
the following:
1. One goroutine calls Start, incrementing count but not yet setting
writer.
2. A second goroutine calls Start, increments count again but sees that
count >1 and thus doesn't try to set writer.
3. The second goroutine then calls Status, assuming the writer has been
set, but the first goroutine still hasn't set the writer yet, causing
a nil pointer exception.
This commit fixes that issue by just using a mutex instead of atomics.
It also adds a nil check for the writer just to be safe against panics
due to unknown issues in the future as missing a status update is much
better than buildkitd crashing.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
When server does not return expiration time for token
default to 60s. This replaces previous solution
in error handling that broke cross-repo push.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This reverts commit 9b7a5fc618.
This patch casues issues for cross-repo mounts
when user doesn't have credentials for source repo
and fallback needs to happen.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Foreign layers are only kept as foreign at this point if the user
requested it to be.
Since foreign layers are not meant to be pushed, automatically skip
those layers.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This just makes sure the logic for the layer conversion is all in one
place and settable by a common option.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Before this change buildkit was changing the media type for
non-distributable layers to normal layers.
It was also clearing out the urls to get those blobs.
Now the layer mediatype and URL's are preserved.
If a layer blob is seen more than once, if it has extra URL's they will
be appended to the stored value.
On export there is now a new exporter option to preserve the
non-distributable data values.
All URL's seen by buildkit will be added to the exported content.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Previously, vertexes sent to progress might have multiple intervals in
which they started+stopped, but the output only knew about the most
recent interval. Now, all the intervals are tracked and the total time
spent on each (after accounting for overlaps) is displayed. This is
implemented both for normal vertexes and progress group vertexes.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
This allows clients to specify that LLB states should be grouped in
progress output under a custom name. Status updates for all vertexes in
the group will show up under a single vertex in the output.
The intended use cases are for Dockerfile COPY's that use MergeOp as a
backend and for grouping some other internal vertexes during frontend
builds.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
compression-level option can be set on export to
define the preferred speed vs compression ratio. The
value is a number dependent on the compression algorithm.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Working with strings is error-prone because a platform
can be in multiple string forms and less flexible.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>