def __init__(self): super(TestSQLiteProfile, self).__init__() self.web.RENDER_HTML = False self.MAX_THREADS_NUMBER = self.manager.get_attribute( stored.KEY_MAX_THREAD_NR, 2, int) self.TVB_STORAGE = self.manager.get_attribute(stored.KEY_STORAGE, self.DEFAULT_STORAGE, str) # For tests we will place logs in workspace (current folder), to have them visible from Hudson. self.TVB_LOG_FOLDER = "TEST_OUTPUT" self.TVB_TEMP_FOLDER = os.path.join(self.TVB_STORAGE, "TEMP") self.db = DBSettings(self.manager, self.DEFAULT_STORAGE, self.TVB_STORAGE) self.db.DB_URL = 'sqlite:///' + os.path.join(self.TVB_STORAGE, "tvb-database.db") self.db.SELECTED_DB = 'sqlite' self.hpc.CRYPT_DATADIR = self.manager.get_attribute( stored.KEY_CRYPT_DATADIR, os.path.join(self.TVB_STORAGE, '.data')) self.hpc.CRYPT_PASSDIR = self.manager.get_attribute( stored.KEY_CRYPT_PASSDIR, os.path.join(self.TVB_STORAGE, '.pass')) self.file_storage = self.manager.get_attribute(stored.KEY_FILE_STORAGE, 'h5')
def __init__(self): self.manager = stored.SettingsManager(self.TVB_CONFIG_FILE) # Actual storage of all TVB related files self.KEYCLOAK_CONFIG = self.manager.get_attribute( stored.KEY_KC_CONFIGURATION, '') self.KEYCLOAK_LOGIN_ENABLED = self.manager.get_attribute( stored.KEY_ENABLE_KC_LOGIN, False, eval) self.KEYCLOAK_WEB_CONFIG = self.manager.get_attribute( stored.KEY_KC_WEB_CONFIGURATION, '') self.TVB_STORAGE = self.manager.get_attribute(stored.KEY_STORAGE, self.FIRST_RUN_STORAGE, str) self.UPLOAD_KEY_PATH = self.manager.get_attribute( stored.KEY_UPLOAD_PRIVATE_KEY_PATH, None, str) self.TRACE_USER_ACTIONS = self.manager.get_attribute( stored.KEY_TRACE_USER_ACTIONS, False, eval) self.TVB_LOG_FOLDER = os.path.join(self.TVB_STORAGE, "logs") self.TVB_TEMP_FOLDER = os.path.join(self.TVB_STORAGE, "TEMP") self.env = Environment() self.cluster = ClusterSettings(self.manager) self.hpc = HPCSettings(self.manager) self.web = WebSettings(self.manager) self.db = DBSettings(self.manager, self.DEFAULT_STORAGE, self.TVB_STORAGE) self.version = VersionSettings(self.manager, self.BIN_FOLDER) self.file_storage = self.manager.get_attribute(stored.KEY_FILE_STORAGE, 'h5', str) self.EXTERNALS_FOLDER_PARENT = os.path.dirname(self.BIN_FOLDER) if not self.env.is_distribution(): self.EXTERNALS_FOLDER_PARENT = os.path.dirname( self.EXTERNALS_FOLDER_PARENT) # The path to the matlab executable (if existent). Otherwise just return an empty string. value = self.manager.get_attribute(stored.KEY_MATLAB_EXECUTABLE, '', str) or '' if value == 'None': value = '' self.MATLAB_EXECUTABLE = value # Maximum number of vertices acceptable o be part of a surface at import time. self.MAX_SURFACE_VERTICES_NUMBER = self.manager.get_attribute( stored.KEY_MAX_NR_SURFACE_VERTEX, 300000, int) # Max number of ops that can be scheduled from UI in a PSE. To be correlated with the oarsub limitations self.MAX_RANGE_NUMBER = self.manager.get_attribute( stored.KEY_MAX_RANGE_NR, 2000, int) # Max number of threads in the pool of ops running in parallel. TO be correlated with CPU cores self.MAX_THREADS_NUMBER = self.manager.get_attribute( stored.KEY_MAX_THREAD_NR, 4, int) self.OPERATIONS_BACKGROUND_JOB_INTERVAL = self.manager.get_attribute( stored.KEY_OP_BACKGROUND_INTERVAL, 60, int) # The maximum disk space that can be used by one single user, in KB. self.MAX_DISK_SPACE = self.manager.get_attribute( stored.KEY_MAX_DISK_SPACE_USR, 5 * 1024 * 1024, int)
def __init__(self): super(TestSQLiteProfile, self).__init__() self.web.RENDER_HTML = False self.MAX_THREADS_NUMBER = self.manager.get_attribute(stored.KEY_MAX_THREAD_NR, 2, int) self.TVB_STORAGE = self.manager.get_attribute(stored.KEY_STORAGE, self.DEFAULT_STORAGE, unicode) # For tests we will place logs in workspace, to have them visible from Hudson. self.TVB_LOG_FOLDER = os.path.join(self.BIN_FOLDER, "TEST_OUTPUT") self.TVB_TEMP_FOLDER = os.path.join(self.TVB_STORAGE, "TEMP") self.db = DBSettings(self.manager, self.DEFAULT_STORAGE, self.TVB_STORAGE) self.db.DB_URL = 'sqlite:///' + os.path.join(self.TVB_STORAGE, "tvb-database.db") self.db.SELECTED_DB = 'sqlite'
def __init__(self, web_enabled=True): self.manager = stored.SettingsManager(self.TVB_CONFIG_FILE) ## Actual storage of all TVB related files self.TVB_STORAGE = self.manager.get_attribute(stored.KEY_STORAGE, self.FIRST_RUN_STORAGE, unicode) self.TVB_LOG_FOLDER = os.path.join(self.TVB_STORAGE, "logs") self.TVB_TEMP_FOLDER = os.path.join(self.TVB_STORAGE, "TEMP") self.TVB_PATH = self.manager.get_attribute(stored.KEY_TVB_PATH, '') self.env = Environment() self.cluster = ClusterSettings(self.manager) self.web = WebSettings(self.manager, web_enabled) self.db = DBSettings(self.manager, self.DEFAULT_STORAGE, self.TVB_STORAGE) self.version = VersionSettings(self.manager, self.BIN_FOLDER) self.EXTERNALS_FOLDER_PARENT = os.path.dirname(self.BIN_FOLDER) if not self.env.is_distribution(): self.EXTERNALS_FOLDER_PARENT = os.path.dirname( self.EXTERNALS_FOLDER_PARENT) # The path to the matlab executable (if existent). Otherwise just return an empty string. value = self.manager.get_attribute(stored.KEY_MATLAB_EXECUTABLE, '', str) or '' if value == 'None': value = '' self.MATLAB_EXECUTABLE = value # Maximum number of vertices acceptable o be part of a surface at import time. self.MAX_SURFACE_VERTICES_NUMBER = self.manager.get_attribute( stored.KEY_MAX_NR_SURFACE_VERTEX, 300000, int) # Max number of ops that can be scheduled from UI in a PSE. To be correlated with the oarsub limitations self.MAX_RANGE_NUMBER = self.manager.get_attribute( stored.KEY_MAX_RANGE_NR, 2000, int) # Max number of threads in the pool of ops running in parallel. TO be correlated with CPU cores self.MAX_THREADS_NUMBER = self.manager.get_attribute( stored.KEY_MAX_THREAD_NR, 4, int) # The maximum disk space that can be used by one single user, in KB. self.MAX_DISK_SPACE = self.manager.get_attribute( stored.KEY_MAX_DISK_SPACE_USR, 5 * 1024 * 1024, int) ## Configure Traits self.TRAITS_CONFIGURATION = EnhancedDictionary() self.TRAITS_CONFIGURATION.interface_method_name = 'interface' self.TRAITS_CONFIGURATION.use_storage = True