Skip to content

Commit 15c2547

Browse files
committed
feat: add --force-rm flag to configure removing intermediate docker layers
This commit makes it possible to turn off the removal of intermediate docker layers when building the tfb containers by adding a `--force-rm` flag to the tfb script. This is useful in situations where you want to inspect the intermediate layers for debugging purposes, or for caching builds of dependencies as a docker layer to speed up the build process. Note that the default behavior is to remove the intermediate layers to avoid filling up the disk with unused layers on the citrine server. Fixes: TechEmpower#9718
1 parent c82a834 commit 15c2547

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

toolset/run-tests.py

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ def main(argv=None):
208208
nargs='*',
209209
default=None,
210210
help='Extra docker arguments to be passed to the test container')
211+
parser.add_argument(
212+
'--force-rm',
213+
default=True,
214+
help='Remove intermediate docker containers after running.')
211215

212216
# Network options
213217
parser.add_argument(

toolset/utils/benchmark_config.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def __init__(self, args):
5555
self.cpuset_cpus = args.cpuset_cpus
5656
self.test_container_memory = args.test_container_memory
5757
self.extra_docker_runtime_args = args.extra_docker_runtime_args
58+
self.force_rm_intermediate_docker_layers = args.force_rm
5859

5960
if self.network_mode is None:
6061
self.network = 'tfb'

toolset/utils/docker_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __build(self, base_url, path, build_log_file, log_prefix, dockerfile,
3939
path=path,
4040
dockerfile=dockerfile,
4141
tag=tag,
42-
forcerm=True,
42+
forcerm=self.benchmarker.config.force_rm_intermediate_docker_layers,
4343
timeout=3600,
4444
pull=True,
4545
buildargs=buildargs,

0 commit comments

Comments
 (0)