...
 
...@@ -1610,15 +1610,16 @@ class ContainerDocker(Container): ...@@ -1610,15 +1610,16 @@ class ContainerDocker(Container):
def mount_paths(self, mountlist): 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. """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. 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: for mount_pt in mountlist:
log("mounting %s" % (mount_pt)) log("registering mount point %s" % (mount_pt))
# mount_pt must already exist # mount_pt must already exist
if not os.path.exists(mount_pt): if not os.path.exists(mount_pt):
log("trying to mount '%s' but it doesn't exist" % mount_pt) log("trying to mount '%s' but it doesn't exist" % mount_pt)
continue continue
self.mounts += [mount_pt, 'rw,noatime'] self.mounts += [[mount_pt, 'rw,noatime']]
def groups(self): def groups(self):
""" find last user in /etc/passwd, and get the groups""" """ find last user in /etc/passwd, and get the groups"""
...@@ -1681,7 +1682,7 @@ class ContainerDocker(Container): ...@@ -1681,7 +1682,7 @@ class ContainerDocker(Container):
def __root_mount(self, point, perm): def __root_mount(self, point, perm):
"""Build list of mount points to use when creating container. "perm" is intended to be """Build list of mount points to use when creating container. "perm" is intended to be
used as is in the mount command option '-o' """ used as is in the mount command option '-o' """
self.mounts += [point, perm] self.mounts += [[point, perm]]
def get_status(self): def get_status(self):
"""Obtain the status of the services Docker container """Obtain the status of the services Docker container
...@@ -2270,6 +2271,10 @@ class ContainerDocker(Container): ...@@ -2270,6 +2271,10 @@ class ContainerDocker(Container):
for pubpath in listing: for pubpath in listing:
if pubpath + ':' + pubpath not in args: if pubpath + ':' + pubpath not in args:
args += ['-v', pubpath + ':' + pubpath + ':ro'] args += ['-v', pubpath + ':' + pubpath + ':ro']
for mount in self.mounts:
if not os.path.exists(mount[0]):
continue
args += ['-v', mount[0] + ':' + mount[0] + ':' + mount[0]]
# USER environment variable used for xauth operation # USER environment variable used for xauth operation
# Can't use the --user option because we need root to setup account and group information # Can't use the --user option because we need root to setup account and group information
...@@ -2381,7 +2386,7 @@ class ContainerDocker(Container): ...@@ -2381,7 +2386,7 @@ class ContainerDocker(Container):
# invoke rewrites the path... Is setting it ourselves useful? # invoke rewrites the path... Is setting it ourselves useful?
args += ['-e', "PATH=%s" % "/bin:/usr/bin:/usr/bin/X11:/sbin:/usr/sbin"] args += ['-e', "PATH=%s" % "/bin:/usr/bin:/usr/bin/X11:/sbin:/usr/sbin"]
if params: if params:
args += ['-e', "TOOL_PARAMETERS=\"%s\"" % account.int_params_path(session_id)] args += ['-e', "TOOL_PARAMETERS=%s" % account.int_params_path(session_id)]
try: try:
if self.k["EXTRA_ENV_CMD"] != "": if self.k["EXTRA_ENV_CMD"] != "":
......
...@@ -555,13 +555,13 @@ class Session: ...@@ -555,13 +555,13 @@ class Session:
# add host # add host
if 'FRONT_LISTEN_HOST' in proxy_vars: if 'FRONT_LISTEN_HOST' in proxy_vars:
if proxy_vars['FRONT_LISTEN_HOST'] == '': if proxy_vars['FRONT_LISTEN_HOST'] == '':
prefix = prefix + guess_weber_proxy(hub_url) prefix = prefix + Session.guess_weber_proxy(hub_url)
else: else:
if DEBUG: if DEBUG:
log("DEBUG: front listen host is '%s'" % str(proxy_vars['FRONT_LISTEN_HOST'])) log("DEBUG: front listen host is '%s'" % str(proxy_vars['FRONT_LISTEN_HOST']))
prefix = prefix + str(proxy_vars['FRONT_LISTEN_HOST']) prefix = prefix + str(proxy_vars['FRONT_LISTEN_HOST'])
else: else:
prefix = prefix + guess_weber_proxy(hub_url) prefix = prefix + Session.guess_weber_proxy(hub_url)
# add port # add port
if 'FRONT_LISTEN_PORT' in proxy_vars: if 'FRONT_LISTEN_PORT' in proxy_vars:
if proxy_vars['FRONT_LISTEN_PORT'] == 443: if proxy_vars['FRONT_LISTEN_PORT'] == 443:
......