Example #1
0
class CleaningIntervals(object):
    ACTIVITY_LOGS = config.get_int('POLYAXON_CLEANING_INTERVALS_ACTIVITY_LOGS',
                                   is_optional=True,
                                   default=60)
    NOTIFICATIONS = config.get_int('POLYAXON_CLEANING_INTERVALS_NOTIFICATIONS',
                                   is_optional=True,
                                   default=30)
Example #2
0
class Intervals(object):
    """All intervals are in seconds"""
    OPERATIONS_DEFAULT_RETRY_DELAY = config.get_int(
        'POLYAXON_INTERVALS_OPERATIONS_DEFAULT_RETRY_DELAY',
        is_optional=True,
        default=60)
    OPERATIONS_MAX_RETRY_DELAY = config.get_int(
        'POLYAXON_INTERVALS_OPERATIONS_MAX_RETRY_DELAY',
        is_optional=True,
        default=60 * 60)
    PIPELINES_SCHEDULER = config.get_int(
        'POLYAXON_INTERVALS_PIPELINES_SCHEDULER',
        is_optional=True,
        default=30)
    EXPERIMENTS_SCHEDULER = config.get_int(
        'POLYAXON_INTERVALS_EXPERIMENTS_SCHEDULER',
        is_optional=True,
        default=30)
    EXPERIMENTS_SYNC = config.get_int(
        'POLYAXON_INTERVALS_EXPERIMENTS_SYNC',
        is_optional=True,
        default=30)
    CLUSTERS_UPDATE_SYSTEM_INFO = config.get_int(
        'POLYAXON_INTERVALS_CLUSTERS_UPDATE_SYSTEM_INFO',
        is_optional=True,
        default=150)
    CLUSTERS_UPDATE_SYSTEM_NODES = config.get_int(
        'POLYAXON_INTERVALS_CLUSTERS_UPDATE_SYSTEM_NODES',
        is_optional=True,
        default=150)
    HEARTBEAT_CHECK = config.get_int(
        'POLYAXON_INTERVALS_HEARTBEAT_CHECK',
        is_optional=True,
        default=240)
    CLUSTERS_NOTIFICATION_ALIVE = 150
    CLEAN_ACTIVITY_LOGS = config.get_int(
        'POLYAXON_INTERVALS_CLEAN_ACTIVITY_LOGS',
        is_optional=True,
        default=300)
    CLEAN_NOTIFICATIONS = config.get_int(
        'POLYAXON_INTERVALS_CLEAN_NOTIFICATIONS',
        is_optional=True,
        default=300)

    @staticmethod
    def get_schedule(interval):
        return timedelta(seconds=int(interval))

    @staticmethod
    def get_expires(interval):
        int(interval / 2)
Example #3
0
POLYAXON_ENVIRONMENT = config.env
K8S_NAMESPACE = config.namespace
K8S_NODE_NAME = config.node_name
K8S_GPU_RESOURCE_KEY = config.get_string('POLYAXON_K8S_GPU_RESOURCE_KEY')
CLUSTER_ID = config.cluster_id
REPOS_ARCHIVE_ROOT = '/tmp/archived_repos'
OUTPUTS_ARCHIVE_ROOT = '/tmp/archived_outputs'
OUTPUTS_DOWNLOAD_ROOT = '/tmp/download_outputs'
LOGS_ARCHIVE_ROOT = '/tmp/archived_logs'
FILE_UPLOAD_PERMISSIONS = 0o644
ADMIN_VIEW_ENABLED = config.get_boolean('POLYAXON_ADMIN_VIEW_ENABLED',
                                        is_optional=True,
                                        default=False)
# Heartbeat timeout (status -> failed as zombie)
HEARTBEAT_TIMEOUT = config.get_int('POLYAXON_HEARTBEAT_TIMEOUT',
                                   is_optional=True,
                                   default=60 * 30)
# Token time in days
TOKEN_TTL = config.get_int('POLYAXON_TOKEN_TTL',
                           is_optional=True,
                           default=30)
# Ephemeral token ttl
EPHEMERAL_TOKEN_TTL = config.get_int('POLYAXON_EPHEMERAL_TOKEN_TTL',
                                     is_optional=True,
                                     default=60 * 60 * 3)

# Group checks interval
GROUP_CHECKS_INTERVAL = config.get_int('POLYAXON_GROUP_CHECKS_INTERVAL',
                                       is_optional=True,
                                       default=5)
Example #4
0
from polyaxon.config_manager import config

POLYAXON_K8S_APP_NAME = config.get_string('POLYAXON_K8S_APP_NAME')
POLYAXON_K8S_API_HOST = config.get_string('POLYAXON_K8S_API_HOST')
POLYAXON_K8S_API_INTERNAL_PORT = config.get_int(
    'POLYAXON_K8S_API_INTERNAL_PORT', is_optional=True, default=80)
POLYAXON_K8S_STREAM_INTERNAL_PORT = config.get_int(
    'POLYAXON_K8S_STREAM_INTERNAL_PORT', is_optional=True, default=1337)
POLYAXON_K8S_API_HTTP_PORT = config.get_int('POLYAXON_K8S_API_HTTP_PORT')
POLYAXON_K8S_APP_CONFIG_NAME = config.get_string(
    'POLYAXON_K8S_APP_CONFIG_NAME')
POLYAXON_K8S_APP_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_APP_SECRET_NAME')
POLYAXON_K8S_RABBITMQ_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_RABBITMQ_SECRET_NAME')
POLYAXON_K8S_DB_SECRET_NAME = config.get_string('POLYAXON_K8S_DB_SECRET_NAME')
POLYAXON_K8S_REGISTRY_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_REGISTRY_SECRET_NAME', is_optional=True)

K8S_AUTHORISATION = config.get_string('POLYAXON_K8S_AUTHORISATION',
                                      is_optional=True,
                                      is_secret=True)
K8S_HOST = config.get_string('POLYAXON_K8S_HOST', is_optional=True)
SSL_CA_CERT = config.get_string('POLYAXON_K8S_SSL_CA_CERT', is_optional=True)

K8S_CONFIG = None
if K8S_AUTHORISATION and K8S_HOST:
    import urllib3

    from kubernetes import client
Example #5
0
from polyaxon.config_manager import config

email_from = config.get_string('POLYAXON_EMAIL_FROM')
email_host = config.get_string('POLYAXON_EMAIL_HOST')
email_port = config.get_int('POLYAXON_EMAIL_PORT')
email_host_user = config.get_string('POLYAXON_EMAIL_HOST_USER',
                                    is_optional=True)
email_host_password = config.get_string('POLYAXON_EMAIL_HOST_PASSWORD',
                                        is_optional=True,
                                        is_secret=True)
EMAIL_BACKEND = config.get_string(
    'POLYAXON_EMAIL_BACKEND',
    is_optional=True,
    default='django.core.mail.backends.console.EmailBackend')
Example #6
0
POLYAXON_SERVICE = config.service
POLYAXON_ENVIRONMENT = config.env
K8S_NAMESPACE = config.namespace
K8S_NODE_NAME = config.node_name
K8S_GPU_RESOURCE_KEY = config.get_string('POLYAXON_K8S_GPU_RESOURCE_KEY')
CLUSTER_ID = config.cluster_id
REPOS_ARCHIVE_ROOT = '/tmp/archived_repos'
OUTPUTS_ARCHIVE_ROOT = '/tmp/archived_outputs'
OUTPUTS_DOWNLOAD_ROOT = '/tmp/download_outputs'
FILE_UPLOAD_PERMISSIONS = 0o644
ADMIN_VIEW_ENABLED = config.get_boolean('POLYAXON_ADMIN_VIEW_ENABLED',
                                        is_optional=True,
                                        default=False)
# Heartbeat timeout (status -> failed as zombie)
HEARTBEAT_TIMEOUT = config.get_int('POLYAXON_HEARTBEAT_TIMEOUT',
                                   is_optional=True,
                                   default=60 * 30)
# Token experiment time in days
TOKEN_EXPIRATION = config.get_int('POLYAXON_TOKEN_EXPIRATION',
                                  is_optional=True,
                                  default=30)

# Auditor backend
AUDITOR_BACKEND = config.get_string('POLYAXON_AUDITOR_BACKEND',
                                    is_optional=True)


def get_allowed_hosts():
    allowed_hosts = config.get_string('POLYAXON_ALLOWED_HOSTS',
                                      is_optional=True,
                                      is_list=True,
Example #7
0
POLYAXON_SERVICE = config.service
POLYAXON_ENVIRONMENT = config.env
K8S_NAMESPACE = config.namespace
K8S_NODE_NAME = config.node_name
K8S_GPU_RESOURCE_KEY = config.get_string('POLYAXON_K8S_GPU_RESOURCE_KEY')
CLUSTER_ID = config.cluster_id
REPOS_ARCHIVE_ROOT = '/tmp/archived_repos'
OUTPUTS_ARCHIVE_ROOT = '/tmp/archived_outputs'
OUTPUTS_DOWNLOAD_ROOT = '/tmp/download_outputs'
FILE_UPLOAD_PERMISSIONS = 0o644
ADMIN_VIEW_ENABLED = config.get_boolean('POLYAXON_ADMIN_VIEW_ENABLED',
                                        is_optional=True,
                                        default=False)
# Heartbeat timeout (status -> failed as zombie)
HEARTBEAT_TIMEOUT = config.get_int('POLYAXON_HEARTBEAT_TIMEOUT',
                                   is_optional=True,
                                   default=60 * 4)


def get_allowed_hosts():
    allowed_hosts = config.get_string('POLYAXON_ALLOWED_HOSTS',
                                      is_optional=True,
                                      is_list=True,
                                      default=['*'])
    allowed_hosts.append('.polyaxon.com')
    k8s_api_host = config.get_string('POLYAXON_K8S_API_HOST', is_optional=True)
    if k8s_api_host:
        allowed_hosts.append(k8s_api_host)

    return allowed_hosts
Example #8
0
BROKER_POOL_LIMIT = None

if RABBITMQ_USER and RABBITMQ_PASSWORD:
    CELERY_BROKER_URL = 'amqp://{user}:{password}@{url}'.format(
        user=RABBITMQ_USER, password=RABBITMQ_PASSWORD, url=AMQP_URL)

# todo: fix me at some point
CELERY_BROKER_URL = 'amqp://{url}'.format(url=AMQP_URL)

INTERNAL_EXCHANGE = config.get_string('POLYAXON_INTERNAL_EXCHANGE',
                                      is_optional=True,
                                      default='internal')

CELERY_RESULT_BACKEND = config.get_string(
    'POLYAXON_REDIS_CELERY_RESULT_BACKEND_URL')
CELERYD_PREFETCH_MULTIPLIER = config.get_int(
    'POLYAXON_CELERYD_PREFETCH_MULTIPLIER')

CELERY_TASK_ALWAYS_EAGER = config.get_boolean('POLYAXON_CELERY_ALWAYS_EAGER')
if CELERY_TASK_ALWAYS_EAGER:
    BROKER_TRANSPORT = 'memory'

CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_IGNORE_RESULT = True
CELERY_IGNORE_RESULT = True
CELERY_HARD_TIME_LIMIT_DELAY = config.get_int(
    'POLYAXON_CELERY_HARD_TIME_LIMIT_DELAY', is_optional=True, default=180)
HEALTH_CHECK_WORKER_TIMEOUT = config.get_int(
    'POLYAXON_HEALTH_CHECK_WORKER_TIMEOUT', is_optional=True, default=4)
GROUP_CHUNKS = config.get_int('POLYAXON_GROUP_CHUNKS',
Example #9
0
    default=True)

# Tensorboard
TENSORBOARD_DOCKER_IMAGE = config.get_string('POLYAXON_TENSORBOARD_DOCKER_IMAGE',
                                             is_optional=True,
                                             default='tensorflow/tensorflow:1.11.0-py3')

# Notebook config
MOUNT_CODE_IN_NOTEBOOKS = config.get_boolean('POLYAXON_MOUNT_CODE_IN_NOTEBOOKS',
                                             is_optional=True,
                                             default=False)
NOTEBOOK_DOCKER_IMAGE = config.get_string('POLYAXON_NOTEBOOK_DOCKER_IMAGE',
                                          is_optional=True)
NOTEBOOK_BACKEND = config.get_string('POLYAXON_NOTEBOOK_BACKEND',
                                     is_optional=True,
                                     default='notebook')
# Sidecar config
JOB_SIDECAR_LOG_SLEEP_INTERVAL = config.get_int('POLYAXON_JOB_SIDECAR_LOG_SLEEP_INTERVAL',
                                                is_optional=True)

# TPU
K8S_TPU_TF_VERSION = config.get_string('POLYAXON_K8S_TPU_TF_VERSION',
                                       is_optional=True,
                                       default='1.12')

# SECURITY CONTEXT
SECURITY_CONTEXT_USER = config.get_int('POLYAXON_SECURITY_CONTEXT_USER',
                                       is_optional=True)
SECURITY_CONTEXT_GROUP = config.get_int('POLYAXON_SECURITY_CONTEXT_GROUP',
                                        is_optional=True)
Example #10
0
from polyaxon.config_manager import config

REGISTRATION_SUPERUSER_VALIDATION_WORKFLOW = '0'
EMAIL_VALIDATION_WORKFLOW = '1'

REGISTRATION_WORKFLOW = REGISTRATION_SUPERUSER_VALIDATION_WORKFLOW

USERS_MINIMUM_PASSWORD_LENGTH = config.get_int('POLYAXON_PASSWORD_LENGTH')

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS': {
            'min_length': USERS_MINIMUM_PASSWORD_LENGTH,
        }
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
Example #11
0
# DNS Cluster
DNS_USE_RESOLVER = config.get_boolean('POLYAXON_DNS_USE_RESOLVER',
                                      is_optional=True,
                                      default=False)
DNS_CUSTOM_CLUSTER = config.get_string('POLYAXON_DNS_CUSTOM_CLUSTER',
                                       is_optional=True,
                                       default='cluster.local')

# Roles
ROLE_LABELS_WORKER = config.get_string('POLYAXON_ROLE_LABELS_WORKER')
ROLE_LABELS_DASHBOARD = config.get_string('POLYAXON_ROLE_LABELS_DASHBOARD')
ROLE_LABELS_LOG = config.get_string('POLYAXON_ROLE_LABELS_LOG')
ROLE_LABELS_API = config.get_string('POLYAXON_ROLE_LABELS_API')
ROLE_LABELS_CONFIG = config.get_string('POLYAXON_ROLE_LABELS_CONFIG')
ROLE_LABELS_HOOKS = config.get_string('POLYAXON_ROLE_LABELS_HOOKS')

# Types
TYPE_LABELS_CORE = config.get_string('POLYAXON_TYPE_LABELS_CORE')
TYPE_LABELS_RUNNER = config.get_string('POLYAXON_TYPE_LABELS_RUNNER')

# SECURITY CONTEXT
SECURITY_CONTEXT_USER = config.get_int('POLYAXON_SECURITY_CONTEXT_USER',
                                       is_optional=True)
SECURITY_CONTEXT_GROUP = config.get_int('POLYAXON_SECURITY_CONTEXT_GROUP',
                                        is_optional=True)
# Plugins
PLUGINS = config.get_dict_of_dicts('POLYAXON_PLUGINS',
                                   is_optional=True,
                                   default={})
Example #12
0
from datetime import timedelta

from kombu import Exchange, Queue

from polyaxon.config_manager import config

CELERY_TASK_TRACK_STARTED = config.get_boolean(
    'POLYAXON_CELERY_TASK_TRACK_STARTED', is_optional=True, default=True)

CELERY_BROKER_POOL_LIMIT = config.get_int('POLYAXON_CELERY_BROKER_POOL_LIMIT',
                                          is_optional=True,
                                          default=100)

CELERY_BROKER_BACKEND = config.broker_backend
CELERY_CONFIRM_PUBLISH = config.get_boolean('POLYAXON_CELERY_CONFIRM_PUBLISH',
                                            is_optional=True,
                                            default=True)
if config.is_rabbitmq_broker and CELERY_CONFIRM_PUBLISH:
    # see https://github.com/celery/celery/issues/5410 for details
    CELERY_BROKER_TRANSPORT_OPTIONS = {'confirm_publish': True}

CELERY_BROKER_URL = config.get_broker_url()

INTERNAL_EXCHANGE = config.get_string('POLYAXON_INTERNAL_EXCHANGE',
                                      is_optional=True,
                                      default='internal')

CELERY_RESULT_BACKEND = config.get_redis_url(
    'POLYAXON_REDIS_CELERY_RESULT_BACKEND_URL')

CELERY_WORKER_PREFETCH_MULTIPLIER = config.get_int(
Example #13
0
LOGIN_REDIRECT_URL = '/'
ACCOUNT_ACTIVATION_DAYS = 7
INVITATION_TIMEOUT_DAYS = 30

SESSION_COOKIE_AGE = 24 * 60 * 60  # 24 hours
SESSION_COOKIE_HTTPONLY = True

DEFAULT_DB_ENGINE = 'django.db.backends.postgresql'
DATABASES = {
    'default': {
        'ENGINE':
        config.get_string('POLYAXON_DB_ENGINE', is_optional=True)
        or DEFAULT_DB_ENGINE,
        'NAME':
        config.get_string('POLYAXON_DB_NAME'),
        'USER':
        config.get_string('POLYAXON_DB_USER'),
        'PASSWORD':
        config.get_string('POLYAXON_DB_PASSWORD', is_secret=True),
        'HOST':
        config.get_string('POLYAXON_DB_HOST'),
        'PORT':
        config.get_string('POLYAXON_DB_PORT'),
        'ATOMIC_REQUESTS':
        True,
        'CONN_MAX_AGE':
        config.get_int('POLYAXON_DB_CONN_MAX_AGE', is_optional=True,
                       default=0),
    }
}
Example #14
0
from polyaxon.config_manager import config

THROTTLE_RATES_HIGH = config.get_int('POLYAXON_THROTTLE_RATES_HIGH',
                                     is_optional=True,
                                     default=120)
THROTTLE_RATES_INTERNAL = config.get_int('POLYAXON_THROTTLE_RATES_INTERNAL',
                                         is_optional=True,
                                         default=120)
THROTTLE_RATES_IMPERSONATE = config.get_int(
    'POLYAXON_THROTTLE_RATES_IMPERSONATE', is_optional=True, default=120)
THROTTLE_RATES_USER = config.get_int('POLYAXON_THROTTLE_RATES_USER',
                                     is_optional=True,
                                     default=120)
THROTTLE_RATES_ADMIN = config.get_int('POLYAXON_THROTTLE_RATES_ADMIN',
                                      is_optional=True,
                                      default=100)
THROTTLE_RATES_ANON = config.get_int('POLYAXON_THROTTLE_RATES_ANON',
                                     is_optional=True,
                                     default=30)
THROTTLE_RATES_CHECKS = config.get_int('POLYAXON_THROTTLE_RATES_CHECKS',
                                       is_optional=True,
                                       default=10)

REST_FRAMEWORK = {
    'DEFAULT_SCHEMA_CLASS':
    'api.openapi.PolyaxonOpenAPISchema',
    'DEFAULT_RENDERER_CLASSES': (
        # 'djangorestframework_camel_case.render.CamelCaseJSONRenderer',  # Any other renders,
        'rest_framework.renderers.JSONRenderer', ),

    # 'DEFAULT_PARSER_CLASSES': (
Example #15
0
from polyaxon.config_manager import config

POLYAXON_K8S_APP_NAME = config.get_string('POLYAXON_K8S_APP_NAME')
POLYAXON_K8S_API_HOST = config.get_string('POLYAXON_K8S_API_HOST')
POLYAXON_K8S_API_HTTP_PORT = config.get_int('POLYAXON_K8S_API_HTTP_PORT')
POLYAXON_K8S_API_WS_PORT = config.get_int('POLYAXON_K8S_API_WS_PORT')
POLYAXON_K8S_APP_CONFIG_NAME = config.get_string(
    'POLYAXON_K8S_APP_CONFIG_NAME')
POLYAXON_K8S_APP_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_APP_SECRET_NAME')
POLYAXON_K8S_RABBITMQ_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_RABBITMQ_SECRET_NAME')
POLYAXON_K8S_DB_SECRET_NAME = config.get_string('POLYAXON_K8S_DB_SECRET_NAME')
POLYAXON_K8S_REGISTRY_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_REGISTRY_SECRET_NAME', is_optional=True)

K8S_AUTHORISATION = config.get_string('POLYAXON_K8S_AUTHORISATION',
                                      is_optional=True,
                                      is_secret=True)
K8S_HOST = config.get_string('POLYAXON_K8S_HOST', is_optional=True)
SSL_CA_CERT = config.get_string('POLYAXON_K8S_SSL_CA_CERT', is_optional=True)

K8S_CONFIG = None
if K8S_AUTHORISATION and K8S_HOST:
    import urllib3

    from kubernetes import client

    K8S_CONFIG = client.Configuration()
    K8S_CONFIG.api_key['authorization'] = K8S_AUTHORISATION
    K8S_CONFIG.api_key_prefix['authorization'] = 'Bearer'
Example #16
0
from polyaxon.config_manager import config

OAUTH_GITHUB_VERIFICATION_SCHEDULE = config.get_int(
    'POLYAXON_AUTH_GITHUB_VERIFICATION_SCHEDULE', is_optional=True, default=0)
OAUTH_GITHUB_CLIENT_ID = config.get_string('POLYAXON_AUTH_GITHUB_CLIENT_ID',
                                           is_optional=True,
                                           is_secret=True)
OAUTH_GITHUB_CLIENT_SECRET = config.get_string(
    'POLYAXON_AUTH_GITHUB_CLIENT_SECRET', is_optional=True, is_secret=True)
OAUTH_GITHUB_ENABLED = config.get_boolean('POLYAXON_AUTH_GITHUB',
                                          is_optional=True,
                                          default=False)

OAUTH_BITBUCKET_VERIFICATION_SCHEDULE = config.get_int(
    'POLYAXON_AUTH_BITBUCKET_VERIFICATION_SCHEDULE',
    is_optional=True,
    default=0)
OAUTH_BITBUCKET_CLIENT_ID = config.get_string(
    'POLYAXON_AUTH_BITBUCKET_CLIENT_ID', is_optional=True, is_secret=True)
OAUTH_BITBUCKET_CLIENT_SECRET = config.get_string(
    'POLYAXON_AUTH_BITBUCKET_CLIENT_SECRET', is_optional=True, is_secret=True)
OAUTH_BITBUCKET_ENABLED = config.get_boolean('POLYAXON_AUTH_BITBUCKET',
                                             is_optional=True,
                                             default=False)

OAUTH_GITLAB_VERIFICATION_SCHEDULE = config.get_int(
    'POLYAXON_AUTH_GITLAB_VERIFICATION_SCHEDULE', is_optional=True, default=0)
OAUTH_GITLAB_URL = config.get_string('POLYAXON_AUTH_GITLAB_URL',
                                     is_optional=True,
                                     is_secret=True)
OAUTH_GITLAB_CLIENT_ID = config.get_string('POLYAXON_AUTH_GITLAB_CLIENT_ID',
Example #17
0
                                         is_optional=True,
                                         default='cloud-tpus.google.com/v2')
CONF_BACKEND = config.get_string('POLYAXON_CONF_BACKEND', is_optional=True)
CLUSTER_ID = config.cluster_id
REPOS_ARCHIVE_ROOT = '/tmp/archived_repos'
OUTPUTS_ARCHIVE_ROOT = '/tmp/archived_outputs'
OUTPUTS_DOWNLOAD_ROOT = '/tmp/download_outputs'
LOGS_DOWNLOAD_ROOT = '/tmp/download_logs'
LOGS_ARCHIVE_ROOT = '/tmp/archived_logs'
FILE_UPLOAD_PERMISSIONS = 0o644
ADMIN_VIEW_ENABLED = config.get_boolean('POLYAXON_ADMIN_VIEW_ENABLED',
                                        is_optional=True,
                                        default=False)
# Global Async Countdown
GLOBAL_COUNTDOWN = config.get_int('POLYAXON_GLOBAL_COUNTDOWN',
                                  is_optional=True,
                                  default=1)
# Heartbeat timeout (status -> failed as zombie)
TTL_HEARTBEAT = config.get_int('POLYAXON_TTL_HEARTBEAT',
                               is_optional=True,
                               default=60 * 30)
# Token time in days
TTL_TOKEN = config.get_int('POLYAXON_TTL_TOKEN',
                           is_optional=True,
                           default=30)
# Ephemeral token ttl
TTL_EPHEMERAL_TOKEN = config.get_int('POLYAXON_TTL_EPHEMERAL_TOKEN',
                                     is_optional=True,
                                     default=60 * 60 * 3)

# Group checks interval
Example #18
0
from polyaxon.config_manager import config

POLYAXON_K8S_APP_NAME = config.get_string('POLYAXON_K8S_APP_NAME')
POLYAXON_K8S_API_HOST = config.get_string('POLYAXON_K8S_API_HOST')
POLYAXON_K8S_API_PORT = config.get_int('POLYAXON_K8S_API_PORT')
POLYAXON_K8S_APP_CONFIG_NAME = config.get_string(
    'POLYAXON_K8S_APP_CONFIG_NAME')
POLYAXON_K8S_APP_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_APP_SECRET_NAME')
POLYAXON_K8S_RABBITMQ_SECRET_NAME = config.get_string(
    'POLYAXON_K8S_RABBITMQ_SECRET_NAME')
POLYAXON_K8S_DB_SECRET_NAME = config.get_string('POLYAXON_K8S_DB_SECRET_NAME')

K8S_AUTHORISATION = config.get_string('POLYAXON_K8S_AUTHORISATION',
                                      is_optional=True,
                                      is_secret=True)
K8S_HOST = config.get_string('POLYAXON_K8S_HOST', is_optional=True)
SSL_CA_CERT = config.get_string('POLYAXON_K8S_SSL_CA_CERT', is_optional=True)

K8S_CONFIG = None
if K8S_AUTHORISATION and K8S_HOST:
    import urllib3

    from kubernetes import client

    K8S_CONFIG = client.Configuration()
    K8S_CONFIG.api_key['authorization'] = K8S_AUTHORISATION
    K8S_CONFIG.api_key_prefix['authorization'] = 'Bearer'
    K8S_CONFIG.host = K8S_HOST

    if SSL_CA_CERT:
Example #19
0
                                           default='polyaxon-job-sidecar')
CONTAINER_NAME_INIT = config.get_string('POLYAXON_CONTAINER_NAME_INIT',
                                        is_optional=True,
                                        default='polyaxon-job-init')
CONTAINER_NAME_PLUGIN_JOB = config.get_string('POLYAXON_CONTAINER_NAME_PLUGIN_JOB',
                                              is_optional=True,
                                              default='polyaxon-plugin-job')
CONTAINER_NAME_DOCKERIZER_JOB = config.get_string('POLYAXON_CONTAINER_NAME_DOCKERIZER_JOB',
                                                  is_optional=True,
                                                  default='polyaxon-dockerizer-job')
JOB_DOCKER_NAME = config.get_string('POLYAXON_JOB_DOCKER_NAME',
                                    is_optional=True,
                                    default='polyaxon/polyaxon-lib')
JOB_SIDECAR_DOCKER_IMAGE = config.get_string('POLYAXON_JOB_SIDECAR_DOCKER_IMAGE')
JOB_SIDECAR_DOCKER_IMAGE_PULL_POLICY = config.get_string(
    'POLYAXON_JOB_SIDECAR_DOCKER_IMAGE_PULL_POLICY',
    is_optional=True)
JOB_INIT_DOCKER_IMAGE = config.get_string('POLYAXON_JOB_INIT_DOCKER_IMAGE')
JOB_INIT_DOCKER_IMAGE_PULL_POLICY = config.get_string(
    'POLYAXON_JOB_INIT_DOCKER_IMAGE_PULL_POLICY',
    is_optional=True)
JOB_DOCKERIZER_IMAGE = config.get_string('POLYAXON_JOB_DOCKERIZER_IMAGE')
JOB_DOCKERIZER_IMAGE_PULL_POLICY = config.get_string(
    'POLYAXON_JOB_DOCKERIZER_IMAGE_PULL_POLICY',
    is_optional=True,)
TENSORBOARD_DOCKER_IMAGE = config.get_string('POLYAXON_TENSORBOARD_DOCKER_IMAGE',
                                             is_optional=True,
                                             default='tensorflow/tensorflow:1.4.1-py3')
JOB_SIDECAR_LOG_SLEEP_INTERVAL = config.get_int('POLYAXON_JOB_SIDECAR_LOG_SLEEP_INTERVAL',
                                                is_optional=True)
Example #20
0
from polyaxon.config_manager import config

TTL_WATCH_STATUSES = config.get_int('POLYAXON_TTL_WATCH_STATUSES',
                                    is_optional=True,
                                    default=60 * 20)
Example #21
0
    'POLYAXON_RABBITMQ_USER', is_optional=True)
RABBITMQ_PASSWORD = config.get_string(
    'POLYAXON_RABBITMQ_PASSWORD', is_secret=True, is_optional=True)
if RABBITMQ_USER and RABBITMQ_PASSWORD:
    CELERY_BROKER_URL = 'amqp://{user}:{password}@{url}'.format(
        user=RABBITMQ_USER,
        password=RABBITMQ_PASSWORD,
        url=AMQP_URL
    )

CELERY_BROKER_URL = 'amqp://{url}'.format(url=AMQP_URL)

INTERNAL_EXCHANGE = config.get_string('POLYAXON_INTERNAL_EXCHANGE')

# CELERY_RESULT_BACKEND = config.get_string('POLYAXON_REDIS_CELERY_RESULT_BACKEND_URL')
CELERYD_PREFETCH_MULTIPLIER = config.get_int('POLYAXON_CELERYD_PREFETCH_MULTIPLIER')

CELERY_TASK_ALWAYS_EAGER = config.get_boolean('POLYAXON_CELERY_ALWAYS_EAGER')
if CELERY_TASK_ALWAYS_EAGER:
    BROKER_TRANSPORT = 'memory'

CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'

CELERY_IGNORE_RESULT = True
CELERY_HARD_TIME_LIMIT_DELAY = config.get_int('POLYAXON_CELERY_HARD_TIME_LIMIT_DELAY',
                                              is_optional=True,
                                              default=180)

Example #22
0
from polyaxon.config_manager import config

DEFAULT_FROM_EMAIL = config.get_string('POLYAXON_EMAIL_FROM',
                                       is_optional=True,
                                       default='<Polyaxon>')
EMAIL_HOST = config.get_string('POLYAXON_EMAIL_HOST',
                               is_optional=True,
                               default='localhost')
EMAIL_PORT = config.get_int('POLYAXON_EMAIL_PORT',
                            is_optional=True,
                            default=25)
EMAIL_HOST_USER = config.get_string('POLYAXON_EMAIL_HOST_USER',
                                    is_optional=True,
                                    default='')
EMAIL_HOST_PASSWORD = config.get_string('POLYAXON_EMAIL_HOST_PASSWORD',
                                        is_optional=True,
                                        is_secret=True,
                                        default='')
EMAIL_SUBJECT_PREFIX = config.get_string('POLYAXON_EMAIL_SUBJECT_PREFIX',
                                         is_optional=True,
                                         default='[Polyaxon]')
EMAIL_USE_TLS = config.get_boolean('POLYAXON_EMAIL_USE_TLS',
                                   is_optional=True,
                                   default=False)

if config.is_debug_mode or config.is_testing_env:
    EMAIL_BACKEND = config.get_string(
        'POLYAXON_EMAIL_BACKEND',
        is_optional=True,
        default='django.core.mail.backends.console.EmailBackend')