Пример #1
0
 def get_volumes(self):
     volumes = []
     for v in self.volumes:
         mv = MarathonContainerVolume.from_json(v)
         mv.container_path = self.format_volume_name(mv.container_path, self)
         mv.host_path = self.format_volume_name(mv.host_path, self)
         if mv.external and 'name' in mv.external:
             mv.external['name'] = self.format_volume_name(mv.external['name'], self)
         volumes.append(mv)
     return volumes
Пример #2
0
 def get_volumes(self):
     volumes = []
     container_paths = getattr(self, 'container_paths', [])
     for p in container_paths:
         if p.host_path:
             host_path = p.host_path
         else:
             host_path = os.path.join("/mnt/container-volumes/",
                                      self.get_marathon_app_id(),
                                      p.container_path.strip('/'))
         volumes.append(
             MarathonContainerVolume(container_path=p.container_path,
                                     host_path=host_path,
                                     mode=p.mode))
     return volumes
    def get_volumes(self):
        volumes = []
        for v in self.volumes:
            mv = MarathonContainerVolume.from_json(v)
            mv.container_path = self.format_volume_name(mv.container_path, self)
            mv.host_path = self.format_volume_name(mv.host_path, self)
            if mv.external and 'name' in mv.external:
                mv.external['name'] = self.format_volume_name(mv.external['name'], self)
            volumes.append(mv)
        out_vols = []
        dups = {}
        #Remove Duplicates there should be only one container path point for container
        for x in volumes:
            if x.container_path in dups:
                pass
            else:
                out_vols.append(x)
                dups[x.container_path] = 1

        return out_vols
Пример #4
0
        marathon_app.env['GEOSERVER_WEB_XML_URI'] = GEOSERVER_WEB_XML_URI
    marathon_app.env['ENABLE_CORS'] = ENABLE_CORS
    marathon_app.env['GOSU_USER'] = GOSU_USER

    geoserver_hostname = HAPROXY_VHOST
    # If multiple VHOSTs are specified, only apply the first as the GeoServer global value.
    if ',' in geoserver_hostname:
        geoserver_hostname = geoserver_hostname.split(',')[0]

    marathon_app.env['GEOSERVER_HOSTNAME'] = geoserver_hostname
    marathon_app.env['INSTANCE_MEMORY'] = str(GEOSERVER_MEMORY)
    marathon_app.container.volumes[0].host_path = HOST_GEOSERVER_DATA_DIR
    # If HOST_SUPPLEMENTAL_DATA_DIRS set, add read-only volume mounts as needed
    if HOST_SUPPLEMENTAL_DATA_DIRS and len(HOST_SUPPLEMENTAL_DATA_DIRS.split(',')):
        for sup_dir in HOST_SUPPLEMENTAL_DATA_DIRS.split(','):
            marathon_app.container.volumes.append(MarathonContainerVolume(sup_dir, sup_dir, 'RO'))
    marathon_app.container.docker.image = GEOSERVER_IMAGE
    marathon_app.labels['HAPROXY_0_VHOST'] = HAPROXY_VHOST
    marathon_app.labels['DCOS_PACKAGE_FRAMEWORK_NAME'] = FRAMEWORK_NAME
    if AUTH_URI:
        marathon_app.fetch = [{ 'uri': AUTH_URI }]

create_app_validate(MARATHON_CLIENT, marathon_app)

# Block until GeoServer is healthy
block_for_healthy_app(MARATHON_CLIENT, GEOSERVER_APP, 1)

# Verify completely configured GeoServer. Health check seems to pass before data directory is fully initialized...
while True:
    logging.info('Checking for a fully initialized data directory...')
    if exists('%s/global.xml' % GEOSERVER_DATA_DIR) and exists('%s/security/usergroup/default/users.xml' % GEOSERVER_DATA_DIR) and exists('%s/logging.xml' % GEOSERVER_DATA_DIR):