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

Mounting all the paths ... including ~/SEAMM #14

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
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
17 changes: 9 additions & 8 deletions seamm_exec/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,23 @@ def exec(
)
raise

paths = []
for mount in mounts:
self.logger.debug(f"{mount=}")
if mount["Destination"] == "/home":
path = Path(mount["Source"]).joinpath(*directory.parts[2:])
break
paths.append(f"{path}:/home")
elif mount["Destination"] == "/root/SEAMM":
path = Path(mount["Source"]).joinpath(*directory.parts[3:])
break
else:
paths.append(f"{path}:/root/SEAMM")
if len(paths) == 0:
raise RuntimeError(
"Neither /home or /root/SEAMM were in the mounts for the container!"
"\n{mounts=}"
)
else:
# Not in a Docker container, so use the path as is
path = Path(directory)
paths = [f"{Path(directory)}:/home"]

self.logger.debug(f"path = {path}\n")

Expand Down Expand Up @@ -141,7 +142,7 @@ def exec(
remove=True,
stderr=True,
stdout=True,
volumes=[f"{path}:/home"],
volumes=paths,
working_dir="/home",
)
"""
Expand All @@ -155,7 +156,7 @@ def exec(
remove=True,
stderr=True,
stdout=True,
volumes=[f"{path}:/home"],
volumes=paths,
working_dir="/home",
)
else:
Expand All @@ -168,7 +169,7 @@ def exec(
remove=True,
stderr=True,
stdout=True,
volumes=[f"{path}:/home"],
volumes=paths,
working_dir="/home",
)
"""
Expand All @@ -181,7 +182,7 @@ def exec(
remove=True,
stderr=True,
stdout=True,
volumes=[f"{path}:/home"],
volumes=paths,
working_dir="/home",
)

Expand Down
Loading