Skip to content

Commit 912ab8b

Browse files
authored
Adding --cpuset-cpus tfb argument to set it on the server container (#9035)
1 parent 89a139c commit 912ab8b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

toolset/run-tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ def main(argv=None):
6767
''')
6868

6969
# Suite options
70+
# CPU set options
71+
parser.add_argument(
72+
'--cpuset-cpus',
73+
default=None,
74+
help='The cpu set to run framework container on')
7075
parser.add_argument(
7176
'--audit',
7277
action='store_true',

toolset/utils/benchmark_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(self, args):
5252
self.database_docker_host = None
5353
self.client_docker_host = None
5454
self.network = None
55+
self.cpuset_cpus = args.cpuset_cpus
5556
self.test_container_memory = args.test_container_memory
5657
self.extra_docker_runtime_args = args.extra_docker_runtime_args
5758

toolset/utils/docker_helper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ def watch_container(docker_container, docker_file):
189189
'soft': 99
190190
}]
191191

192+
cpuset_cpus = ''
193+
194+
if self.benchmarker.config.cpuset_cpus is not None:
195+
cpuset_cpus = self.benchmarker.config.cpuset_cpus
196+
197+
log("Running docker container with cpu set: %s" %cpuset_cpus)
198+
192199
docker_cmd = ''
193200
if hasattr(test, 'docker_cmd'):
194201
docker_cmd = test.docker_cmd
@@ -235,6 +242,7 @@ def watch_container(docker_container, docker_file):
235242
sysctls=sysctl,
236243
remove=True,
237244
log_config={'type': None},
245+
cpuset_cpus=cpuset_cpus,
238246
**extra_docker_args
239247
)
240248

0 commit comments

Comments
 (0)