Skip to content

Commit

Permalink
Merge pull request PolyJIT#565 from PolyJIT/f-ConfigurableStorageOptions
Browse files Browse the repository at this point in the history
Make storage options configurable
  • Loading branch information
simbuerg authored Aug 22, 2023
2 parents 1e69a6c + b05d4d0 commit e2f829b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
20 changes: 15 additions & 5 deletions benchbuild/environments/adapters/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def path_longer_than_50_chars(path: str) -> bool:
def wrapped_cmd(*args: str) -> BaseCommand:
root = CFG['container']['root']
runroot = CFG['container']['runroot']
storage_driver = CFG['container']['storage_driver']
storage_driver = CFG['container']['storage_driver'].value
storage_opts = CFG['container']['storage_opts'].value

if path_longer_than_50_chars(str(root)):
LOG.error(
Expand All @@ -61,10 +62,19 @@ def wrapped_cmd(*args: str) -> BaseCommand:
'%s - %s', runroot.__to_env_var__(), __MSG_SHORTER_PATH_REQUIRED
)

opts = [
'--root', root, '--runroot', runroot,
'--storage-driver', storage_driver
]
opts = ['--root', root, '--runroot', runroot]

if storage_driver:
opts.append('--storage-driver')
opts.append(storage_driver)

if storage_opts is None:
# ignore options set in 'storage.conf'
opts.append("--storage-opt=''")

for opt in storage_opts:
opts.append('--storage-opt')
opts.append(opt)

cmd = base[opts]
return cmd[args]
Expand Down
8 changes: 7 additions & 1 deletion benchbuild/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,14 @@
"desc": "Path to benchbuild's source directory"
},
"storage_driver": {
"default": "vfs",
"default": None,
"desc": "Storage driver for containers."
"If 'null' use podman's default."
},
"storage_opts": {
"default": [],
"desc": "Storage options for containers."
"If 'null', ignore 'storage.conf'."
},
"input": {
"default": "container.tar.bz2",
Expand Down

0 comments on commit e2f829b

Please sign in to comment.