Skip to content

Commit

Permalink
Adding --cpuset-cpus tfb argument to set it on the server container
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 committed May 17, 2024
1 parent fa7221b commit 308a130
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toolset/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def main(argv=None):
''')

# Suite options
# CPU set options
parser.add_argument(
'--cpuset-cpus',
default=None,
help='The cpu set to run framework container on')
parser.add_argument(
'--audit',
action='store_true',
Expand Down
1 change: 1 addition & 0 deletions toolset/utils/benchmark_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, args):
self.database_docker_host = None
self.client_docker_host = None
self.network = None
self.cpuset_cpus = args.cpuset_cpus
self.test_container_memory = args.test_container_memory
self.extra_docker_runtime_args = args.extra_docker_runtime_args

Expand Down
8 changes: 8 additions & 0 deletions toolset/utils/docker_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ def watch_container(docker_container, docker_file):
'soft': 99
}]

cpuset_cpus = ''

if self.benchmarker.config.cpuset_cpus is not None:
cpuset_cpus = self.benchmarker.config.cpuset_cpus

log("Running docker container with cpu set: %s" %cpuset_cpus)

docker_cmd = ''
if hasattr(test, 'docker_cmd'):
docker_cmd = test.docker_cmd
Expand Down Expand Up @@ -235,6 +242,7 @@ def watch_container(docker_container, docker_file):
sysctls=sysctl,
remove=True,
log_config={'type': None},
cpuset_cpus=cpuset_cpus,
**extra_docker_args
)

Expand Down

0 comments on commit 308a130

Please sign in to comment.