Пример #1
0
JS_DEBUG = config.get_boolean('POLYAXON_JS_DEBUG')

if JS_DEBUG:

    def js_debug_processor(request):
        return {'js_debug': True}

    LIST_TEMPLATE_CONTEXT_PROCESSORS += (
        'polyaxon.settings.js_debug_processor', )

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            ROOT_DIR.child('polyaxon').child('polyaxon').child('templates'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'debug':
            config.get_boolean('DJANGO_TEMPLATE_DEBUG', is_optional=True)
            or DEBUG,
            'context_processors':
            LIST_TEMPLATE_CONTEXT_PROCESSORS,
        },
    },
]

POLYAXON_NOTIFICATION_CLUSTER_ALIVE_URL = (
    "{url}&cid={cluster_uuid}&t=pageview&"
    "dp=%2Fplatform%2F{cluster_uuid}"
Пример #2
0
import os

from polyaxon.utils import ROOT_DIR

LOG_DIRECTORY = ROOT_DIR.child('logs')
if not os.path.exists(LOG_DIRECTORY):
    os.makedirs(LOG_DIRECTORY)

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'standard': {
            'format':
            '[%(asctime)s] %(levelname)s %(message)s [%(name)s:%(lineno)s]',
            'datefmt': '%d/%b/%Y %H:%M:%S'
        },
        'simple': {
            'format': '%(levelname)8s  %(message)s [%(name)s]'
        },
        'verbose': {
            'format':
            '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
    },
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse',
        },
    },
    'handlers': {
Пример #3
0
# TODO: integrate subpaths
UPLOAD_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_UPLOAD',
                                     is_optional=True)
DATA_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_DATA', is_optional=True)
LOGS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_LOGS', is_optional=True)
OUTPUTS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_OUTPUTS',
                                      is_optional=True)
REPOS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_REPOS',
                                    is_optional=True)

# Extra persistence volumes
EXTRA_PERSISTENCES = config.get_string('POLYAXON_EXTRA_PERSISTENCES',
                                       is_optional=True)
if EXTRA_PERSISTENCES:
    EXTRA_PERSISTENCES = json.loads(EXTRA_PERSISTENCES)

# Additional locations of static files
STATICFILES_DIRS = (ROOT_DIR.child('client').child('public'), )

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

LOCALE_PATHS = (
    ROOT_DIR.child('locale'),
    ROOT_DIR.child('client').child('js').child('libs').child('locale'))

STATICI18N_ROOT = 'static'
STATICI18N_OUTPUT_DIR = 'jsi18n'
Пример #4
0
    JS_DEBUG = config.get_boolean('POLYAXON_JS_DEBUG')

    if JS_DEBUG:
        def js_debug_processor(request):
            return {'js_debug': True}

        LIST_TEMPLATE_CONTEXT_PROCESSORS += ('polyaxon.settings.js_debug_processor',)

    TEMPLATES_DEBUG = (config.get_boolean('DJANGO_TEMPLATE_DEBUG', is_optional=True) or
                       config.is_debug_mode)
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [
                ROOT_DIR.child('polyaxon').child('polyaxon').child('templates'),
            ],
            'APP_DIRS': True,
            'OPTIONS': {
                'debug': TEMPLATES_DEBUG,
                'context_processors': LIST_TEMPLATE_CONTEXT_PROCESSORS,
            },
        },
    ]

else:
    LIST_TEMPLATE_CONTEXT_PROCESSORS = [
        'django.contrib.auth.context_processors.auth',
        'polyaxon.context_processors.versions',
        'polyaxon.context_processors.cluster',
    ]
Пример #5
0
UPLOAD_CLAIM_NAME = config.get_string('POLYAXON_CLAIM_NAMES_UPLOAD')
DATA_CLAIM_NAME = config.get_string('POLYAXON_CLAIM_NAMES_DATA')
LOGS_CLAIM_NAME = config.get_string('POLYAXON_CLAIM_NAMES_LOGS')
OUTPUTS_CLAIM_NAME = config.get_string('POLYAXON_CLAIM_NAMES_OUTPUTS')
REPOS_CLAIM_NAME = config.get_string('POLYAXON_CLAIM_NAMES_REPOS')

# TODO: integrate subpaths
UPLOAD_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_UPLOAD', is_optional=True)
DATA_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_DATA', is_optional=True)
LOGS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_LOGS', is_optional=True)
OUTPUTS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_OUTPUTS', is_optional=True)
REPOS_SUB_PATHS = config.get_string('POLYAXON_SUB_PATHS_REPOS', is_optional=True)

# Additional locations of static files
STATICFILES_DIRS = (
    ROOT_DIR.child('client').child('public'),
)


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

LOCALE_PATHS = (
    ROOT_DIR.child('locale'),
    ROOT_DIR.child('client').child('js').child('libs').child('locale')
)

STATICI18N_ROOT = 'static'
STATICI18N_OUTPUT_DIR = 'jsi18n'
Пример #6
0
import os

from polyaxon.utils import ROOT_DIR, config

LOG_DIRECTORY = ROOT_DIR.child('logs')
if not os.path.exists(LOG_DIRECTORY):
    os.makedirs(LOG_DIRECTORY)

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,

    'formatters': {
        'standard': {
            'format': '[%(asctime)s] %(levelname)s %(message)s [%(name)s:%(lineno)s]',
            'datefmt': '%d/%b/%Y %H:%M:%S'
        },
        'simple': {
            'format': '%(levelname)8s  %(message)s [%(name)s]'
        },
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
    },

    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse',
        },
    },
    'handlers': {