Esempio n. 1
0
 def _update_user_data(self):
     if 'filesystems' in self.app.ud:
         old_fs_list = self.app.ud.get('filesystems') or []
         new_fs_list = []
         # clear 'services' and replace with the new format
         for fs in old_fs_list:
             svc_roles = ServiceRole.from_string_array(fs['roles'])
             if ServiceRole.GALAXY_TOOLS in svc_roles and ServiceRole.GALAXY_DATA in svc_roles:
                 # This condition should only occur in new configs, but check
                 # added so that things work properly even if run against a new config
                 # Only works for default configs though...
                 new_fs_list.append(fs)
             elif ServiceRole.GALAXY_TOOLS in svc_roles:
                 pass  # skip adding the galaxy tools file system, no longer needed.
             else:
                 if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                     fs['roles'] = ServiceRole.to_string_array([ServiceRole.GALAXY_TOOLS,
                         ServiceRole.GALAXY_DATA])
                     new_fs_list.append(fs)
                 else:
                     new_fs_list.append(fs)
         self.app.ud['filesystems'] = new_fs_list
     self.app.ud['deployment_version'] = 2
     self.app.ud.pop('galaxy_home', None)  # TODO: Galaxy home is always reset
                                           # to default. Discuss implications
     return True
Esempio n. 2
0
 def _update_user_data(self):
     if 'filesystems' in self.app.config.user_data:
         old_fs_list = self.app.config.user_data.get('filesystems') or []
         new_fs_list = []
         # clear 'services' and replace with the new format
         for fs in old_fs_list:
             svc_roles = ServiceRole.from_string_array(fs['roles'])
             if ServiceRole.GALAXY_TOOLS in svc_roles and ServiceRole.GALAXY_DATA in svc_roles:
                 # This condition should only occur in new configs, but check
                 # added so that things work properly even if run against a new config
                 # Only works for default configs though...
                 new_fs_list.append(fs)
             elif ServiceRole.GALAXY_TOOLS in svc_roles:
                 pass  # skip adding the galaxy tools file system, no longer needed.
             else:
                 if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                     fs['roles'] = ServiceRole.to_string_array([ServiceRole.GALAXY_TOOLS,
                                                                ServiceRole.GALAXY_DATA])
                     new_fs_list.append(fs)
                 else:
                     new_fs_list.append(fs)
         self.app.config.user_data['filesystems'] = new_fs_list
     self.app.config.user_data['deployment_version'] = 2
     self.app.config.user_data.pop('galaxy_home', None)  # TODO: Galaxy home is always reset to default. Discuss implications
     return True
Esempio n. 3
0
    def __init__(self, app):
        super(MigrationService, self).__init__(app)

        self.svc_roles = [ServiceRole.MIGRATION]
        self.name = ServiceRole.to_string(ServiceRole.MIGRATION)

        self.dependencies = []

        if 'filesystems' in self.app.ud:
            for fs in self.app.ud.get('filesystems') or []:
                # Wait for galaxy data, indices and tools to come up before attempting migration
                if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_DATA))
                if ServiceRole.GALAXY_TOOLS in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_TOOLS))
                if ServiceRole.GALAXY_INDICES in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_INDICES))
Esempio n. 4
0
    def __init__(self, app):
        super(MigrationService, self).__init__(app)

        self.svc_roles = [ServiceRole.MIGRATION]
        self.name = ServiceRole.to_string(ServiceRole.MIGRATION)
        self.svc_type = ServiceType.CM_SERVICE
        self.dependencies = []

        if 'filesystems' in self.app.config.user_data:
            for fs in self.app.config.user_data.get('filesystems') or []:
                # Wait for galaxy data, indices and tools to come up before attempting migration
                if ServiceRole.GALAXY_DATA in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_DATA))
                if ServiceRole.GALAXY_TOOLS in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_TOOLS))
                if ServiceRole.GALAXY_INDICES in ServiceRole.from_string_array(fs['roles']):
                    self.dependencies.append(ServiceDependency(self, ServiceRole.GALAXY_INDICES))