Skip to content

Commit 4499447

Browse files
committed
cluster spec sheet: Introduce separate staging env and record into separate table
1 parent 1eef74b commit 4499447

File tree

8 files changed

+404
-200
lines changed

8 files changed

+404
-200
lines changed

ci/plugins/mzcompose/hooks/command

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ cleanup() {
345345
&& [ "$BUILDKITE_LABEL" != "Parallel Benchmark against QA Benchmarking Staging Environment" ] \
346346
&& [[ ! "$BUILDKITE_LABEL" =~ Terraform\ .* ]] \
347347
&& [[ ! "$BUILDKITE_LABEL" =~ Orchestratord\ test\ .* ]] \
348-
&& [ "$BUILDKITE_LABEL" != "Cluster spec sheet" ]; then
348+
&& [[ ! "$BUILDKITE_LABEL" =~ Cluster\ spec\ sheet.* ]]; then
349349
echo "+++ services.log is empty, failing"
350350
exit 1
351351
fi

ci/release-qualification/pipeline.template.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,33 @@ steps:
530530
agents:
531531
queue: hetzner-x86-64-dedi-48cpu-192gb # 1 TB disk
532532

533-
- id: cluster-spec-sheet
534-
label: Cluster spec sheet
535-
depends_on: build-aarch64
536-
timeout_in_minutes: 3600
537-
concurrency: 1
538-
concurrency_group: 'cluster-spec-sheet'
539-
plugins:
540-
- ./ci/plugins/mzcompose:
541-
composition: cluster-spec-sheet
542-
run: default
543-
args: [--cleanup]
544-
agents:
545-
queue: linux-aarch64-small
533+
- group: Cluster spec sheet
534+
key: cluster-spec-sheet
535+
steps:
536+
- id: cluster-spec-sheet-cluster
537+
label: "Cluster spec sheet: Cluster (against Production)"
538+
depends_on: build-aarch64
539+
timeout_in_minutes: 3600
540+
concurrency: 1
541+
concurrency_group: 'cluster-spec-sheet'
542+
plugins:
543+
- ./ci/plugins/mzcompose:
544+
composition: cluster-spec-sheet
545+
run: default
546+
args: [--cleanup, --target=cloud-production, cluster]
547+
agents:
548+
queue: linux-aarch64-small
549+
550+
- id: cluster-spec-sheet-environmentd
551+
label: "Cluster spec sheet: Environmentd (against Staging)"
552+
depends_on: build-aarch64
553+
timeout_in_minutes: 3600
554+
concurrency: 1
555+
concurrency_group: 'cluster-spec-sheet-cluster'
556+
plugins:
557+
- ./ci/plugins/mzcompose:
558+
composition: cluster-spec-sheet
559+
run: default
560+
args: [--cleanup, --target=cloud-staging, environmentd]
561+
agents:
562+
queue: linux-aarch64-small

misc/python/materialize/test_analytics/data/cluster_spec_sheet/cluster_spec_sheet_result_storage.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ class ClusterSpecSheetResultEntry:
2828
time_ms: int | None
2929

3030

31+
@dataclass
32+
class ClusterSpecSheetEnvironmentdResultEntry:
33+
scenario: str
34+
scenario_version: str
35+
scale: int
36+
mode: str
37+
category: str
38+
test_name: str
39+
envd_cpus: int
40+
repetition: int
41+
qps: int | None
42+
43+
3144
class ClusterSpecSheetResultStorage(BaseDataStorage):
3245

3346
def add_result(
@@ -76,3 +89,51 @@ def add_result(
7689
)
7790

7891
self.database_connector.add_update_statements(sql_statements)
92+
93+
94+
class ClusterSpecSheetEnvironmentdResultStorage(BaseDataStorage):
95+
96+
def add_result(
97+
self,
98+
framework_version: str,
99+
results: list[ClusterSpecSheetEnvironmentdResultEntry],
100+
) -> None:
101+
job_id = buildkite.get_var(BuildkiteEnvVar.BUILDKITE_JOB_ID)
102+
103+
sql_statements = []
104+
105+
for result_entry in results:
106+
# TODO: remove NULL castings when database-issues#8100 is resolved
107+
sql_statements.append(
108+
f"""
109+
INSERT INTO cluster_spec_sheet_environmentd_result
110+
(
111+
build_job_id,
112+
framework_version,
113+
scenario,
114+
scenario_version,
115+
scale,
116+
mode,
117+
category,
118+
test_name,
119+
envd_cpus,
120+
repetition,
121+
qps
122+
)
123+
SELECT
124+
{as_sanitized_literal(job_id)},
125+
{as_sanitized_literal(framework_version)},
126+
{as_sanitized_literal(result_entry.scenario)},
127+
{as_sanitized_literal(result_entry.scenario_version)},
128+
{result_entry.scale},
129+
{as_sanitized_literal(result_entry.mode)},
130+
{as_sanitized_literal(result_entry.category)},
131+
{as_sanitized_literal(result_entry.test_name)},
132+
{result_entry.envd_cpus},
133+
{result_entry.repetition},
134+
{result_entry.qps or 'NULL::BIGINT'}
135+
;
136+
"""
137+
)
138+
139+
self.database_connector.add_update_statements(sql_statements)

misc/python/materialize/test_analytics/setup/cleanup/remove-build.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DELETE FROM scalability_framework_result WHERE build_job_id IN (SELECT build_id
1414
DELETE FROM parallel_benchmark_result WHERE build_job_id IN (SELECT build_id FROM build_job WHERE build_id IN (%build-ids%));
1515
DELETE FROM product_limits_result WHERE build_job_id IN (SELECT build_id FROM build_job WHERE build_id IN (%build-ids%));
1616
DELETE FROM cluster_spec_sheet_result WHERE build_job_id IN (SELECT build_id FROM build_job WHERE build_id IN (%build-ids%));
17+
DELETE FROM cluster_spec_sheet_environmentd_result WHERE build_job_id IN (SELECT build_id FROM build_job WHERE build_id IN (%build-ids%));
1718
DELETE FROM build_annotation_error WHERE build_job_id IN (SELECT build_job_id FROM build_annotation WHERE build_id IN (%build-ids%));
1819
DELETE FROM build_annotation WHERE build_id IN (%build-ids%);
1920
DELETE FROM build_job WHERE build_id IN (%build-ids%);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-- Copyright Materialize, Inc. and contributors. All rights reserved.
2+
--
3+
-- Use of this software is governed by the Business Source License
4+
-- included in the LICENSE file at the root of this repository.
5+
--
6+
-- As of the Change Date specified in that file, in accordance with
7+
-- the Business Source License, use of this software will be governed
8+
-- by the Apache License, Version 2.0.
9+
10+
11+
-- result of individual product limits scenarios
12+
CREATE TABLE cluster_spec_sheet_environmentd_result (
13+
build_job_id TEXT NOT NULL,
14+
framework_version TEXT NOT NULL,
15+
scenario TEXT NOT NULL,
16+
scenario_version TEXT NOT NULL,
17+
scale INT NOT NULL,
18+
mode TEXT NOT NULL,
19+
category TEXT NOT NULL,
20+
test_name TEXT NOT NULL,
21+
envd_cpus INT NOT NULL,
22+
repetition INT NOT NULL,
23+
qps BIGINT
24+
);
25+
26+
ALTER TABLE cluster_spec_sheet_environmentd_result OWNER TO qa;
27+
GRANT SELECT, INSERT, UPDATE ON TABLE cluster_spec_sheet_environmentd_result TO "hetzner-ci";

misc/python/materialize/test_analytics/setup/views/100-data-integrity.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ CREATE OR REPLACE VIEW v_data_integrity (table_name, own_item_key, referenced_it
3333
FROM cluster_spec_sheet_result
3434
WHERE build_job_id NOT IN (SELECT build_job_id FROM build_job)
3535
UNION
36+
SELECT 'cluster_spec_sheet_environmentd_result', build_job_id, build_job_id, 'cluster spec sheet environmentd result references missing build job'
37+
FROM cluster_spec_sheet_environmentd_result
38+
WHERE build_job_id NOT IN (SELECT build_job_id FROM build_job)
39+
UNION
3640
SELECT 'build_annotation', build_job_id, build_job_id, 'build annotation references missing build job'
3741
FROM build_annotation
3842
WHERE build_job_id NOT IN (SELECT build_job_id FROM build_job)

misc/python/materialize/test_analytics/test_analytics_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
BuildAnnotationStorage,
2727
)
2828
from materialize.test_analytics.data.cluster_spec_sheet.cluster_spec_sheet_result_storage import (
29+
ClusterSpecSheetEnvironmentdResultStorage,
2930
ClusterSpecSheetResultStorage,
3031
)
3132
from materialize.test_analytics.data.feature_benchmark.feature_benchmark_result_storage import (
@@ -79,6 +80,9 @@ def __init__(self, config: MzDbConfig):
7980
self.cluster_spec_sheet_results = ClusterSpecSheetResultStorage(
8081
self.database_connector
8182
)
83+
self.cluster_spec_sheet_environmentd_results = (
84+
ClusterSpecSheetEnvironmentdResultStorage(self.database_connector)
85+
)
8286

8387
def _create_database_connector(self, config: MzDbConfig) -> DatabaseConnector:
8488
if config.enabled:

0 commit comments

Comments
 (0)