Commit 2e68923f authored by Pascal Meunier's avatar Pascal Meunier

add support for hydroshare mounts and bug fix for tool parameter support in Docker

parent d43dde06
......@@ -1610,15 +1610,16 @@ class ContainerDocker(Container):
def mount_paths(self, mountlist):
"""Given a list of paths, mount them in the container. Called by maxwell_service when receiving the command mount_paths.
This functionality is needed for the MyGeohub hydroshare connectivity via /srv/irods/external.
Docker implementation: store the information on the mount points until we can start the container."""
Docker implementation: store the information on the mount points until we can start the container.
This container instance is preserved during the call to maxwell_service, which received all
the information it needed with the "startxapp" command."""
for mount_pt in mountlist:
log("mounting %s" % (mount_pt))
log("registering mount point %s" % (mount_pt))
# mount_pt must already exist
if not os.path.exists(mount_pt):
log("trying to mount '%s' but it doesn't exist" % mount_pt)
self.mounts += [mount_pt, 'rw,noatime']
self.mounts += [[mount_pt, 'rw,noatime']]
def groups(self):
""" find last user in /etc/passwd, and get the groups"""
......@@ -1681,7 +1682,7 @@ class ContainerDocker(Container):
def __root_mount(self, point, perm):
"""Build list of mount points to use when creating container. "perm" is intended to be
used as is in the mount command option '-o' """
self.mounts += [point, perm]
self.mounts += [[point, perm]]
def get_status(self):
"""Obtain the status of the services Docker container
......@@ -2270,6 +2271,10 @@ class ContainerDocker(Container):
for pubpath in listing:
if pubpath + ':' + pubpath not in args:
args += ['-v', pubpath + ':' + pubpath + ':ro']
for mount in self.mounts:
if not os.path.exists(mount[0]):
args += ['-v', mount[0] + ':' + mount[0] + ':' + mount[0]]
# USER environment variable used for xauth operation
# Can't use the --user option because we need root to setup account and group information
......@@ -2381,7 +2386,7 @@ class ContainerDocker(Container):
# invoke rewrites the path... Is setting it ourselves useful?
args += ['-e', "PATH=%s" % "/bin:/usr/bin:/usr/bin/X11:/sbin:/usr/sbin"]
if params:
args += ['-e', "TOOL_PARAMETERS=\"%s\"" % account.int_params_path(session_id)]
args += ['-e', "TOOL_PARAMETERS=%s" % account.int_params_path(session_id)]
if self.k["EXTRA_ENV_CMD"] != "":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment