Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to use podman container when determining version for vcloud-benchmark #1132

Merged
merged 30 commits into from
Dec 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
db58a2c
wrap the call to the tool to obtain a version inside of a podman cont…
ricffb Dec 3, 2024
d6e65d9
explicitly check for Noneness of tool_base_dir
ricffb Dec 3, 2024
ca7aad9
add setns to libc
ricffb Dec 4, 2024
a2abe90
sort imports
ricffb Dec 4, 2024
6ac1b20
add podman containerized tool
ricffb Dec 4, 2024
a28f1ad
hook into the load toolinfo process
ricffb Dec 4, 2024
6252252
add CustomToolLocator that is used in conjunction with the PodmanCont…
ricffb Dec 4, 2024
dab9a0d
cd into the tool directory in case tools makes calls relative to itself
ricffb Dec 4, 2024
ed499c4
remove erroneous relpath call
ricffb Dec 4, 2024
6a4760b
find the files to upload to vcloud again
ricffb Dec 4, 2024
e673acd
the vcloud executor needs to know about the executable location on th…
ricffb Dec 4, 2024
517fbea
custom tool locator need not now about original tool directory
ricffb Dec 9, 2024
ddecc42
assert tool-directory is set
ricffb Dec 9, 2024
3808261
make it clearer whats the purpose of thee load tool info hook
ricffb Dec 9, 2024
50a7eaf
rename for clarity
ricffb Dec 9, 2024
7a34dd4
use shlex
ricffb Dec 9, 2024
e838dd7
simplify container init
ricffb Dec 9, 2024
a68c0ea
refactor containerized tool info modules for improved code sharing
ricffb Dec 9, 2024
bb2a485
remove wrong initializer
ricffb Dec 9, 2024
5bf07ad
remove config from mk_arg
ricffb Dec 9, 2024
b4a3296
use the defined executable
ricffb Dec 9, 2024
d065835
improve refactoring: keep ContainerizedTool much more like it was bef…
ricffb Dec 9, 2024
dde1397
use podman create, init and rm instead of run and kill
ricffb Dec 9, 2024
374f90b
use Paths, procedual style, and += for list
ricffb Dec 9, 2024
f9ff207
move setup and cleanup specific to ContainerizedTool
ricffb Dec 11, 2024
924e599
report error of missing tool_directory earlier
ricffb Dec 11, 2024
430997f
do not leak a Path instance into benchexec
ricffb Dec 11, 2024
33b0857
add output check to podman inspect call
ricffb Dec 11, 2024
c7c0e54
get rid of custom tool locator
ricffb Dec 11, 2024
195dada
improve checking of valid paths returned from the tool_info_module
ricffb Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use podman create, init and rm instead of run and kill
  • Loading branch information
ricffb committed Dec 9, 2024

Verified

This commit was signed with the committer’s verified signature.
ricffb Henrik Wachowitz
commit dde1397ff11f321ff1f0f220bc09eeaee70ae3ff
22 changes: 17 additions & 5 deletions contrib/vcloud/podman_containerized_tool.py
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ def _init_container(

# Create a container that does nothing but keeps running
ricffb marked this conversation as resolved.
Show resolved Hide resolved
command = (
["podman", "run", "--entrypoint", "tail", "--rm", "-d"]
["podman", "create", "--entrypoint", '[""]', "--rm"]
+ volumes
+ [image, "-F", "/dev/null"]
+ [image, "/bin/sh"]
)

logging.debug(
@@ -71,15 +71,26 @@ def _init_container(
res = subprocess.run(
command,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
check=True,
)

res.check_returncode()
container_id = res.stdout.decode().strip()

subprocess.run(
["podman", "init", container_id],
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
)

container_pid = (
subprocess.run(
["podman", "inspect", "--format", "{{.State.Pid}}", container_id],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
)
.stdout.decode()
.strip()
@@ -161,9 +172,10 @@ def close(self):
return
try:
subprocess.run(
["podman", "kill", "--signal", "SIGKILL", self.container_id],
["podman", "rm", self.container_id],
check=True,
stdout=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
stderr=subprocess.PIPE,
)
except subprocess.CalledProcessError as e: