Skip to content

Commit 2e0c602

Browse files
committed
The initial work on supporting multiple concurrent exporters was
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 moby#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]>
1 parent 36b0458 commit 2e0c602

File tree

14 files changed

+1264
-616
lines changed

14 files changed

+1264
-616
lines changed

api/services/control/control.pb.go

+295-403
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/control/control.proto

+24-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ message PruneRequest {
3535
}
3636

3737
message DiskUsageRequest {
38-
repeated string filter = 1;
38+
repeated string filter = 1;
3939
}
4040

4141
message DiskUsageResponse {
@@ -105,7 +105,12 @@ message CacheOptionsEntry {
105105
}
106106

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

111116
message StatusRequest {
@@ -247,4 +252,21 @@ message Exporter {
247252
string Type = 1;
248253
// Attrs specifies exporter configuration
249254
map<string, string> Attrs = 2;
255+
// ID identifies this exporter.
256+
// ID should be treated by the exporter as opaque.
257+
string ID = 3;
258+
}
259+
260+
// ExporterResponse describes the output of an exporter
261+
message ExporterResponse {
262+
// Metadata describes the exporter
263+
ExporterMetadata metadata = 1;
264+
// Data is the exporter's output
265+
map<string, string> data = 2;
266+
}
267+
268+
// ExporterMetadata describes the output exporter
269+
message ExporterMetadata {
270+
// ID identifies the exporter
271+
string ID = 1;
250272
}

0 commit comments

Comments
 (0)