Skip to content

Commit

Permalink
The initial work on supporting multiple concurrent exporters was
Browse files Browse the repository at this point in the history
unfinished in the sense that exporter responses (which are abstracted as
a map of key/value pairs) are combined into a single map at the end of
the export: https://github.com/moby/buildkit/blob/55a7483b0564a7ad5b2ce5e62512789dce327bca/solver/llbsolver/solver.go#L808-L809

In order to provide the correct exporter response, each response
(currently at least each container image exporter) needs to be dedicated
to the exporter instance.

To achieve this, assign and propagate exporter IDs from the client and
have corresponding exporters annotate their responses with the
respective ID so the client can order outputs per exporter instance.

Fixes #5556.

Output descriptors in container image exporters with backwards-compatible fallbacks. Move the exporter set up to a public helper API so that users that custom-initialize the session can benefit from being able to configure exporters correctly.
Remove ids from the exporter implementation further shifting the burden of managing exporter identities to the control/client so it can be unified and kept an implementation detail as much as possible. Implement support for multiple exporter responses in APIs.

Signed-off-by: a-palchikov <[email protected]>
  • Loading branch information
a-palchikov committed Dec 11, 2024
1 parent 7d7a919 commit 7aa45a8
Show file tree
Hide file tree
Showing 14 changed files with 1,515 additions and 603 deletions.
941 changes: 548 additions & 393 deletions api/services/control/control.pb.go

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions api/services/control/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ message PruneRequest {
}

message DiskUsageRequest {
repeated string filter = 1;
repeated string filter = 1;
}

message DiskUsageResponse {
Expand Down Expand Up @@ -105,7 +105,12 @@ message CacheOptionsEntry {
}

message SolveResponse {
map<string, string> ExporterResponse = 1;
// ExporterResponseDeprecated is a combined exporter response - it aggregates
// responses from all exporters running in parallel.
// It is deprecated in favor of the structured exporter response but will be
// populated as long as it is supported.
map<string, string> ExporterResponseDeprecated = 1;
repeated ExporterResponse exporterResponses = 2;
}

message StatusRequest {
Expand Down Expand Up @@ -245,4 +250,21 @@ message Exporter {
string Type = 1;
// Attrs specifies exporter configuration
map<string, string> Attrs = 2;
// ID identifies this exporter.
// ID should be treated by the exporter as opaque.
string ID = 3;
}

// ExporterResponse describes the output of an exporter
message ExporterResponse {
// Metadata describes the exporter
ExporterMetadata metadata = 1;
// Data is the exporter's output
map<string, string> data = 2;
}

// ExporterMetadata describes the output exporter
message ExporterMetadata {
// ID identifies the exporter
string ID = 1;
}
Loading

0 comments on commit 7aa45a8

Please sign in to comment.