Skip to content

Commit 5ec61d3

Browse files
committed
fix: binding current directory
1 parent 05ad1ec commit 5ec61d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DIRAC/Core/scripts/dirac_apptainer_exec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def main():
7474
cmd.extend(["--contain"]) # use minimal /dev and empty other directories (e.g. /tmp and $HOME)
7575
cmd.extend(["--ipc"]) # run container in a new IPC namespace
7676
cmd.extend(["--pid"]) # run container in a new PID namespace
77-
cmd.extend(["--bind", f"{os.getcwd()}:/"]) # bind current directory for dirac_container.sh
77+
cmd.extend(["--bind", f"{os.getcwd()}"]) # bind current directory for dirac_container.sh
7878
if proxy_location:
7979
cmd.extend(["--bind", f"{proxy_location}:/etc/proxy"]) # bind proxy file
8080
cmd.extend(["--bind", f"{getCAsLocation()}:/etc/grid-security/certificates"]) # X509_CERT_DIR
@@ -90,12 +90,12 @@ def main():
9090
cmd.extend(["--bind", f"{bind_path}:{bind_path}"])
9191
else:
9292
gLogger.warning(f"Bind path {bind_path} does not exist, skipping")
93-
cmd.extend(["--cwd", "/"]) # set working directory
93+
cmd.extend(["--cwd", f"{os.getcwd()}"]) # set working directory
9494

9595
rootImage = user_image or gConfig.getValue("/Resources/Computing/Singularity/ContainerRoot") or CONTAINER_DEFROOT
9696

9797
if os.path.isdir(rootImage) or os.path.isfile(rootImage):
98-
cmd.extend([rootImage, "./dirac_container.sh"])
98+
cmd.extend([rootImage, f"{os.getcwd()}/dirac_container.sh"])
9999
else:
100100
# if we are here is because there's no image, or it is not accessible (e.g. not on CVMFS)
101101
gLogger.error("Apptainer image to exec not found: ", rootImage)

0 commit comments

Comments
 (0)