Skip to content

Commit cf228cb

Browse files
hubatishcopybara-github
authored andcommitted
Allow configuring worker count in Trino
PiperOrigin-RevId: 846453023
1 parent 55c54b6 commit cf228cb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

perfkitbenchmarker/providers/gcp/trino.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,18 @@ def _Create(self):
4646
'trino',
4747
'https://trinodb.github.io/charts',
4848
]
49+
yaml_config = {
50+
'server': {
51+
'workers': self.node_count,
52+
}
53+
}
54+
filename = vm_util.WriteYaml([yaml_config])
4955
vm_util.IssueCommand(cmd)
5056
cmd = [
5157
'helm',
5258
'install',
59+
'-f',
60+
filename,
5361
self.name,
5462
'trino/trino',
5563
'--kubeconfig',

tests/providers/gcp/trino_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from absl import flags
44
from absl.testing import flagsaver
55
import mock
6+
from perfkitbenchmarker import vm_util
67
from perfkitbenchmarker.providers.gcp import trino
78
from tests import pkb_common_test_case
89

@@ -35,6 +36,13 @@ def testBuildAndCompile(self):
3536
self.assertEqual(db.name, 'pkb-123')
3637

3738
def testCreate(self):
39+
self.enter_context(
40+
mock.patch.object(
41+
vm_util,
42+
'WriteTemporaryFile',
43+
return_value='trino.yaml',
44+
)
45+
)
3846
db = trino.Trino(EDW_SERVICE_SPEC)
3947
mock_cmd = self.MockIssueCommand({'': [('', '', 0)]})
4048
db._Create()
@@ -49,6 +57,8 @@ def testCreate(self):
4957
mock.call([
5058
'helm',
5159
'install',
60+
'-f',
61+
'trino.yaml',
5262
'pkb-123',
5363
'trino/trino',
5464
'--kubeconfig',

0 commit comments

Comments
 (0)