buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

Move error to separate struct in history API

Open tonistiigi opened this issue 7 months ago • 0 comments

The history API record contains a nice typed error atm https://github.com/moby/buildkit/blob/v0.14.1/api/services/control/control.proto#L201 retaining information like the stacktraces, source/vertex mapping etc. The problem is that for some errors this structure can grow quite large, eg. source mapping contains the full Dockerfile source so if (in an extreme case) you have 1MB Dockerfile, this error will also be bigger than 1MB . API requests like listing history will need to transfer all these structures and encode/decode them.

Instead, the current error field should become only a short error with the main message and optionally some additional limited information. The full error should still be kept but should be moved to a separate blob in the contentstore as it is done with logs, traces, provenance attestations etc. If client needs a full error they can pull it with a separate request.

tonistiigi avatar Jun 25 '24 23:06 tonistiigi