Exemple #1
0
from polyaxon.schemas.api.authentication import AccessTokenConfig
from polyaxon.schemas.cli.client_configuration import ClientConfig

TMP_POLYAXON_PATH = "/tmp/.polyaxon/"
USER_POLYAXON_PATH = polyaxon_user_path()

TMP_AUTH_PATH = os.path.join(TMP_POLYAXON_PATH, ".polyaxonauth")
TMP_CLIENT_CONFIG_PATH = os.path.join(TMP_POLYAXON_PATH, ".polyaxonclient")

USER_AUTH_PATH = os.path.join(USER_POLYAXON_PATH, ".polyaxonauth")
USER_CLIENT_CONFIG_PATH = os.path.join(USER_POLYAXON_PATH, ".polyaxonclient")

auth_config = rhea.Rhea.read_configs(
    [
        os.environ,
        rhea.ConfigSpec(TMP_AUTH_PATH, config_type=".json", check_if_exists=False),
        rhea.ConfigSpec(USER_AUTH_PATH, config_type=".json", check_if_exists=False),
        rhea.ConfigSpec(CONTEXT_MOUNT_AUTH, config_type=".json", check_if_exists=False),
        {"dummy": "dummy"},
    ]
)
config = rhea.Rhea.read_configs(
    [
        os.environ,
        rhea.ConfigSpec(
            TMP_CLIENT_CONFIG_PATH, config_type=".json", check_if_exists=False
        ),
        rhea.ConfigSpec(
            USER_CLIENT_CONFIG_PATH, config_type=".json", check_if_exists=False
        ),
    ]
Exemple #2
0
TMP_POLYAXON_PATH = '/tmp/.polyaxon/'

TMP_AUTH_TOKEN_PATH = os.path.join(TMP_POLYAXON_PATH, '.authtoken')
CONTEXT_AUTH_TOKEN_PATH = '/plx-context/.authtoken'

TMP_CLIENT_CONFIG_PATH = os.path.join(TMP_POLYAXON_PATH, '.polyaxonclient')
TMP_CONFIG_PATH = os.path.join(TMP_POLYAXON_PATH, '.polyaxonconfig')
TMP_AUTH_PATH = os.path.join(TMP_POLYAXON_PATH, '.polyaxonauth')
USER_CLIENT_CONFIG_PATH = os.path.join(polyaxon_user_path(), '.polyaxonclient')
USER_CONFIG_PATH = os.path.join(polyaxon_user_path(), '.polyaxonconfig')
USER_AUTH_PATH = os.path.join(polyaxon_user_path(), '.polyaxonauth')

global_config = rhea.Rhea.read_configs([
    rhea.ConfigSpec(TMP_CONFIG_PATH,
                    config_type='.json',
                    check_if_exists=False),
    rhea.ConfigSpec(USER_CONFIG_PATH,
                    config_type='.json',
                    check_if_exists=False), {
                        'dummy': 'dummy'
                    }
])
auth_config = rhea.Rhea.read_configs([
    rhea.ConfigSpec(TMP_AUTH_PATH, config_type='.json', check_if_exists=False),
    rhea.ConfigSpec(USER_AUTH_PATH, config_type='.json',
                    check_if_exists=False), {
                        'dummy': 'dummy'
                    }
])
config = rhea.Rhea.read_configs([
Exemple #3
0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

import os

import rhea

from hestia.auth import AuthenticationTypes
from hestia.user_path import polyaxon_user_path

TMP_AUTH_TOKEN_PATH = '/tmp/.polyaxon/.authtoken'
CLIENT_CONFIG_PATH = os.path.join(polyaxon_user_path(), '.polyaxonclient')

config = rhea.Rhea.read_configs([
    rhea.ConfigSpec(CLIENT_CONFIG_PATH, config_type='.json', check_if_exists=False),
    os.environ,
    rhea.ConfigSpec(TMP_AUTH_TOKEN_PATH, config_type='.json', check_if_exists=False)
])

IN_CLUSTER = config.get_boolean('POLYAXON_IN_CLUSTER',
                                is_optional=True,
                                default=False)
NO_OP = config.get_boolean('POLYAXON_NO_OP',
                           is_optional=True,
                           default=False)
API_HOST = config.get_string('POLYAXON_API_HOST',
                             is_optional=True)
HTTP_PORT = config.get_int('POLYAXON_HTTP_PORT',
                           is_optional=True)
WS_PORT = config.get_int('POLYAXON_WS_PORT',
                         is_optional=True)