From 0414dba3f12f21bb010247be2a2ae0c5ee2396e4 Mon Sep 17 00:00:00 2001 From: Chi Wang Date: Thu, 1 Aug 2024 14:37:54 +0200 Subject: [PATCH] Dashboard: support for buildkite sharding. (#2014) --- dashboard/client/pages/bazelci.tsx | 4 ++-- dashboard/server/database.sql | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dashboard/client/pages/bazelci.tsx b/dashboard/client/pages/bazelci.tsx index 9b3c541628..5ed84ca64d 100644 --- a/dashboard/client/pages/bazelci.tsx +++ b/dashboard/client/pages/bazelci.tsx @@ -214,7 +214,7 @@ function JobStats({ } const data = stats.data.items; - var group = _.groupBy(data, (item) => item.bazelCITask); + var group = _.groupBy(data, (item) => item.name); return _.map( _.sortBy( @@ -240,7 +240,7 @@ function JobStats({ <> {_.map(sortedGroup, (data) => (
diff --git a/dashboard/server/database.sql b/dashboard/server/database.sql index 9c548b5c07..e9ba255249 100644 --- a/dashboard/server/database.sql +++ b/dashboard/server/database.sql @@ -340,6 +340,9 @@ WITH buildkite_job AS (WITH buildkite_job_data AS (SELECT org, '--task=(\S+)'), SUBSTRING(data ->> 'command' FROM '--platform=(\S+)')) AS bazelci_task, + COALESCE( + (data ->> 'parallel_group_index')::integer, + 0) AS parallel_group_index, data ->> 'state' AS state, (data ->> 'scheduled_at')::timestamptz AS scheduled_at, (data ->> 'created_at')::timestamptz AS created_at, @@ -353,7 +356,8 @@ FROM buildkite_job WHERE bazelci_task is NOT NULL; CREATE UNIQUE INDEX buildkite_job_mview_pkey - ON buildkite_job_mview (org, pipeline, build_number, bazelci_task); + ON buildkite_job_mview (org, pipeline, build_number, bazelci_task, + parallel_group_index); CREATE INDEX buildkite_job_mview_created_at on buildkite_job_mview (created_at); CREATE INDEX buildkite_job_mview_state