From e7693e53821747d294452c9bff7e8b0f38a0eb8e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 24 Sep 2016 07:41:39 +0000 Subject: tools: export GENENETWORK_FILES and move cache into TMPDIR/gn2 --- etc/default_settings.py | 13 ++++++++----- wqflask/base/webqtlConfig.py | 5 +++-- wqflask/utility/tools.py | 7 +++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/etc/default_settings.py b/etc/default_settings.py index df734f7c..9dddd0ad 100644 --- a/etc/default_settings.py +++ b/etc/default_settings.py @@ -22,7 +22,7 @@ SQLALCHEMY_DATABASE_URI = 'mysql://gn2:mysql_password@localhost/db_webqtl_s' SQLALCHEMY_POOL_RECYCLE = 3600 GN_SERVER_URL = "http://localhost:8880/" -# Flask configuration (see website) +# ---- Flask configuration (see website) TRAP_BAD_REQUEST_ERRORS = True SECURITY_CONFIRMABLE = True SECURITY_TRACKABLE = True @@ -34,8 +34,8 @@ SECURITY_POST_LOGIN_VIEW = "/thank_you" SERVER_PORT = 5003 SECRET_HMAC_CODE = '\x08\xdf\xfa\x93N\x80\xd9\\H@\\\x9f`\x98d^\xb4a;\xc6OM\x946a\xbc\xfc\x80:*\xebc' -# Behavioural settings (defaults) note that logger and log levels can -# be overridden at the module level and with enviroment settings +# ---- Behavioural settings (defaults) note that logger and log levels can +# be overridden at the module level and with enviroment settings WEBSERVER_MODE = 'DEV' # Python webserver mode (DEBUG|DEV|PROD) WEBSERVER_BRANDING = None # Set the branding (nyi) WEBSERVER_DEPLOY = None # Deployment specifics (nyi) @@ -49,10 +49,13 @@ LOG_BENCH = True # Log bench marks USE_REDIS = True # REDIS caching (note that redis will be phased out) USE_GN_SERVER = 'False' # Use GN_SERVER SQL calls -# Path overrides for Genenetwork +# ---- Path overrides for Genenetwork +# TMPDIR is normally picked up from the environment HOME=os.environ['HOME'] LOGFILE = HOME+"/genenetwork2.log" -GENENETWORK_FILES = HOME+"/gn2_data" +GENENETWORK_FILES = HOME+"/gn2_data" # base dir for all static data files + +# ---- GN2 Executables PYLMM_COMMAND = str.strip(os.popen("which pylmm_redis").read()) PLINK_COMMAND = str.strip(os.popen("which plink2").read()) GEMMA_COMMAND = str.strip(os.popen("which gemma").read()) diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 8c67a6fd..6bbabdec 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -60,9 +60,10 @@ ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?sp # HTMLPATH is replaced by GENODIR # IMGDIR is replaced by GENERATED_IMAGE_DIR -# Temporary storage: +# Temporary storage (note that this TMPDIR is not the same directory +# as the UNIX TMPDIR) TMPDIR = mk_dir(TEMPDIR+'/gn2/') -CACHEDIR = mk_dir(TEMPDIR+'/cache/') +CACHEDIR = mk_dir(TMPDIR+'/cache/') # We can no longer write into the git tree: GENERATED_IMAGE_DIR = mk_dir(TMPDIR+'/generated/') GENERATED_TEXT_DIR = mk_dir(TMPDIR+'/generated_text/') diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 2c8cc5c5..907b0d6a 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -147,7 +147,10 @@ def locate_ignore_error(name, subdir=None): return None def tempdir(): - return valid_path(get_setting("TEMPDIR","/tmp")) + """ + Get UNIX TMPDIR by default + """ + return valid_path(get_setting("TMPDIR","/tmp")) BLUE = '\033[94m' GREEN = '\033[92m' @@ -184,9 +187,9 @@ LOG_BENCH = get_setting_bool('LOG_BENCH') LOG_FORMAT = "%(message)s" # not yet in use USE_REDIS = get_setting_bool('USE_REDIS') USE_GN_SERVER = get_setting_bool('USE_GN_SERVER') +GENENETWORK_FILES = get_setting_bool('GENENETWORK_FILES') PYLMM_COMMAND = pylmm_command() GEMMA_COMMAND = gemma_command() PLINK_COMMAND = plink_command() -FLAT_FILES = flat_files() TEMPDIR = tempdir() -- cgit v1.2.3