Skip to content

Commit 84fad69

Browse files
committed
fix: copy rvs config to snap common dir
this is much better than the hack of running the snap binary unconfined (which leads to library/dependency issues)
1 parent 73d9048 commit 84fad69

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

providers/gpgpu/bin/rvs.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
# Default location for ROCm Validation Suite binary.
3434
RVS_BIN = Path("/opt/rocm/bin/rvs")
3535

36+
# ROCm Validation Suite snap common directory for sharing configuration files.
37+
RVS_SNAP_COMMON = Path("/var/snap/rocm-validation-suite/common")
38+
3639
# Location of the RVS module configurations.
3740
PLAINBOX_PROVIDER_DATA = Path(os.getenv("PLAINBOX_PROVIDER_DATA", "."))
3841

@@ -42,16 +45,14 @@ class ModuleRunner:
4245

4346
def __init__(self, rvs: Path, config: Path) -> None:
4447
"""Initializes the module runner."""
48+
self.rvs = rvs
4549
self.config = config
4650

4751
# CHECKBOX-2021: Snap confinement prevents access to /usr/share
4852
snap_bins = ["/snap/bin/rvs", "/snap/bin/rocm-validation-suite"]
4953
if any(rvs.match(p) for p in snap_bins):
50-
# To avoid confinement issues we run the binary directly
51-
snap_current = Path("/snap/rocm-validation-suite/current")
52-
self.rvs = list(snap_current.glob("opt/rocm-*/bin/rvs"))[0]
53-
else:
54-
self.rvs = rvs
54+
shutil.copy(config, RVS_SNAP_COMMON)
55+
self.config = RVS_SNAP_COMMON / config.name
5556

5657
def run(self, module: str):
5758
"""Runs and validates the RVS module.

0 commit comments

Comments
 (0)