Skip to content

Commit

Permalink
Display RequestMetadata that's part of ActionCache entries
Browse files Browse the repository at this point in the history
This makes it possible to see the build tool's invocation ID and version
number on action and uncached action result pages. This feature will
become a lot more interesting once the following API for remote-apis
lands:

bazelbuild/remote-apis#186

Once we have that, we can display Bazel target names, configuration IDs,
etc., meaning we can finally correlate Build Event Stream events with
individual actions in Buildbarn.
  • Loading branch information
EdSchouten committed Feb 17, 2021
1 parent f0cf469 commit 6b5437f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/bb_browser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path"
"time"

remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
"github.com/buildbarn/bb-browser/pkg/proto/configuration/bb_browser"
"github.com/buildbarn/bb-remote-execution/pkg/proto/resourceusage"
blobstore_configuration "github.com/buildbarn/bb-storage/pkg/blobstore/configuration"
Expand Down Expand Up @@ -98,6 +99,13 @@ func main() {
}
return &pb
},
"to_request_metadata": func(any *any.Any) *remoteexecution.RequestMetadata {
var pb remoteexecution.RequestMetadata
if ptypes.UnmarshalAny(any, &pb) != nil {
return nil
}
return &pb
},
"shellquote": shellquote.Join,
"timestamp_rfc3339": func(t time.Time) string {
// Converts a timestamp to RFC3339 format.
Expand Down
20 changes: 20 additions & 0 deletions cmd/bb_browser/templates/page_action.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,26 @@ <h2 class="my-4">Execution metadata</h2>
</table>

{{range .AuxiliaryMetadata}}
{{with to_request_metadata .}}
<h3 class="my-4">Request metadata</h3>
<table class="table" style="table-layout: fixed">
{{with .ToolDetails}}
<tr>
<th style="width: 25%">Tool:</th>
<td style="width: 75%">{{.ToolName}} {{.ToolVersion}}</td>
</tr>
{{end}}
<tr>
<th style="width: 25%">Tool invocation ID:</th>
<td class="text-monospace" style="width: 75%">{{.ToolInvocationId}}</td>
</tr>
<tr>
<th style="width: 25%">Correlated invocations ID:</th>
<td class="text-monospace" style="width: 75%">{{.CorrelatedInvocationsId}}</td>
</tr>
</table>
{{end}}

{{with to_file_pool_resource_usage .}}
<h3 class="my-4">File pool resource usage</h3>
<table class="table" style="table-layout: fixed">
Expand Down

0 comments on commit 6b5437f

Please sign in to comment.