Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action mnemonic to clickhouse #8092

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ func (s *ExecutionServer) recordExecution(
executionProto := execution.TableExecToProto(&executionPrimaryDB, link)
// Set fields that aren't stored in the primary DB
executionProto.TargetLabel = rmd.GetTargetId()
executionProto.ActionMnemonic = rmd.GetActionMnemonic()
executionProto.DiskBytesRead = md.GetUsageStats().GetCgroupIoStats().GetRbytes()
executionProto.DiskBytesWritten = md.GetUsageStats().GetCgroupIoStats().GetWbytes()
executionProto.DiskWriteOperations = md.GetUsageStats().GetCgroupIoStats().GetWios()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ func testExecuteAndPublishOperation(t *testing.T, test publishTest) {
// Schedule execution
clientCtx, err := bazel_request.WithRequestMetadata(ctx, &repb.RequestMetadata{
ToolInvocationId: invocationID,
TargetId: "//some:test",
ActionMnemonic: "TestRunner",
})
require.NoError(t, err)
for k, v := range test.platformOverrides {
Expand Down Expand Up @@ -538,6 +540,8 @@ func testExecuteAndPublishOperation(t *testing.T, test publishTest) {
RequestedMilliCpu: 1500,
RequestedIsolationType: "oci",
RequestedTimeoutUsec: 10000000,
TargetLabel: "//some:test",
ActionMnemonic: "TestRunner",
}
if test.publishMoreMetadata {
expectedExecution.ExecutionPriority = 999
Expand Down
3 changes: 2 additions & 1 deletion proto/remote_execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,7 @@ message StoredExecution {
string output_path = 31;
string status_message = 32;

// TODO(sluongng): add mnemonic and configuration.
// TODO(sluongng): add configuration.
string target_label = 33;
string action_mnemonic = 57;
}
1 change: 1 addition & 0 deletions server/util/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func buildExecution(in *repb.StoredExecution, inv *sipb.StoredInvocation) *schem
InvocationStatus: inv.GetInvocationStatus(),
Tags: invocation_format.ConvertDBTagsToOLAP(inv.GetTags()),
TargetLabel: in.GetTargetLabel(),
ActionMnemonic: in.GetActionMnemonic(),
}
}

Expand Down
4 changes: 3 additions & 1 deletion server/util/clickhouse/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ type Execution struct {
Stage int64

// RequestMetadata
TargetLabel string
TargetLabel string
ActionMnemonic string

// IOStats
FileDownloadCount int64
Expand Down Expand Up @@ -271,6 +272,7 @@ func (e *Execution) AdditionalFields() []string {
"Tags",
"OutputPath",
"TargetLabel",
"ActionMnemonic",
"DiskBytesRead",
"DiskBytesWritten",
"DiskReadOperations",
Expand Down
Loading