-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdbt7.py
139 lines (133 loc) · 4.25 KB
/
dbt7.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
"""
These are DBT-7 specific testing steps.
"""
from buildbot.plugins import steps, util
import general
import postgres
CMD = "%(prop:builddir)s/../test/dbt7.conf | tail -n 1 | cut -d '=' -f 2"
SCALE = f"$(grep -i ^scale_factor {CMD})"
DBT7PROPERTIES = [
util.IntParameter(
name="scale",
label="Scale Factor",
default=1,
required=True,
),
] + \
general.PROPERTIES
DBT7STEPS = general.CLEANUP + \
[steps.RemoveDirectory(
name="Remove previous dsgen files",
dir=util.Interpolate("%(prop:builddir)s/load"),
)] + \
postgres.PGINSTALL + \
[steps.Compile(
name="Install auto_explain extension",
command=['make', 'install'],
workdir='build/contrib/auto_explain',
haltOnFailure=True,
)] + \
[steps.Git(
name="Clone DBT-7",
repourl='https://github.com/osdldbt/dbt7.git',
mode='full',
method='fresh',
workdir='dbt7',
branch='main',
alwaysUseLatest=True,
haltOnFailure=True,
)] + \
general.PATCHDBT + \
[steps.Configure(
name="Configure DBT-7",
command=[
'cmake',
'-H.',
'-Bbuilds/release',
'-DCMAKE_INSTALL_PREFIX=/usr',
],
workdir='dbt7',
haltOnFailure=True,
)] + \
[steps.Compile(
name="Build DBT-7",
command=['make', '-f', 'Makefile.cmake', 'release'],
workdir='dbt7',
env={
'PATH': util.Interpolate("%(prop:builddir)s/usr/bin:${PATH}"),
},
haltOnFailure=True,
)] + \
[steps.Compile(
name="Install DBT-7",
command=['make', 'install'],
workdir='dbt7/builds/release',
env={'DESTDIR': util.Interpolate("%(prop:builddir)s")},
haltOnFailure=True,
)] + \
postgres.PGINITDB + \
postgres.PGSTART + \
[steps.Compile(
name="Create database",
command=['createdb', 'dbt7'],
env={
'PATH': util.Interpolate("%(prop:builddir)s/usr/bin:${PATH}"),
},
haltOnFailure=True,
)] + \
[steps.ShellCommand(
name="Performance test",
doStepIf=general.IsNotForceScheduler,
command=[
'/bin/sh', '-c',
util.Interpolate(
"dbt7 run "
"-d postgresqlea "
"--stats "
"--tpcdstools=%(prop:builddir)s/../dsgen "
f"-s {SCALE} "
"pgsql %(prop:builddir)s/results"
),
],
timeout=None,
env={
'PATH': util.Interpolate("%(prop:builddir)s/usr/bin:${PATH}"),
'PGHOST': '/tmp',
},
)] + \
[steps.ShellCommand(
name="Performance test (force)",
doStepIf=general.IsForceScheduler,
command=[
'/bin/sh', '-c',
util.Interpolate(
"dbt7 run "
"-d postgresqlea "
"--stats "
"--tpcdstools=%(prop:builddir)s/../dsgen "
"-s %(prop:scale)s "
"pgsql %(prop:builddir)s/results"
),
],
timeout=None,
env={
'PATH': util.Interpolate("%(prop:builddir)s/usr/bin:${PATH}"),
'PGHOST': '/tmp',
},
)] + \
postgres.PGSTOP + \
[steps.ShellCommand(
name="DBT-7 Summary",
command=[
'cat',
util.Interpolate("%(prop:builddir)s/results/summary.rst"),
],
)] + \
[steps.ShellCommand(
name="Power Test Results",
command=['cat', "results_0.txt"],
workdir='results/power',
alwaysRun=True,
)] + \
general.STATS_SYSTEM + \
general.STATS_DSS