Ejemplo n.º 1
0
def setup_environment():

    # If docker config
    if custom_graas_cfg is not False:
        global_config.read(custom_graas_cfg)
        return

    global redis_pid
    # Set the port to the test redis server
    global_config.REDIS_SERVER_SERVER = "localhost"
    global_config.REDIS_SERVER_PORT = 7000

    # home = os.getenv("HOME")

    # GRASS

    # Setup the test environment
    global_config.GRASS_GIS_BASE="/usr/local/grass-7.5.svn"
    global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass75"
    # global_config.GRASS_DATABASE= "/usr/local/grass_test_db"
    # global_config.GRASS_DATABASE = "%s/graas/grass_test_db" % home

    # Start the redis server for user and logging management
    redis_pid = os.spawnl(os.P_NOWAIT, "/usr/bin/redis-server",
                          "common/redis.conf",
                          "--port %i" % global_config.REDIS_SERVER_PORT)
    time.sleep(1)
Ejemplo n.º 2
0
def setup_environment():
    global redis_pid
    # Set the port to the test redis server
    global_config.REDIS_SERVER_SERVER = "localhost"
    global_config.REDIS_SERVER_PORT = 7000

    # home = os.getenv("HOME")

    # GRASS

    # Setup the test environment
    global_config.GRASS_GIS_BASE = "/usr/local/grass79/"
    global_config.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass79"
    # global_config.GRASS_DATABASE= "/usr/local/grass_test_db"
    # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home
    global_config.GRASS_TMP_DATABASE = "/tmp"

    if server_test is False and custom_actinia_cfg is False:
        # Start the redis server for user and logging management
        redis_pid = os.spawnl(os.P_NOWAIT, "/usr/bin/redis-server",
                              "common/redis.conf",
                              "--port %i" % global_config.REDIS_SERVER_PORT)
        time.sleep(1)

    if server_test is False and custom_actinia_cfg is not False:
        global_config.read(custom_actinia_cfg)
Ejemplo n.º 3
0
    def setUpClass(cls):

        if custom_graas_cfg is not False:
            global_config.read(custom_graas_cfg)
            print(global_config)
        else:
            global_config.REDIS_SERVER_URL = "localhost"
            global_config.REDIS_SERVER_PORT = 7000

        redis_interface.connect(global_config.REDIS_SERVER_URL,
                                global_config.REDIS_SERVER_PORT)
Ejemplo n.º 4
0
    def setUpClass(cls):

        if custom_graas_cfg is not False:
            global_config.read(custom_graas_cfg)
            print(global_config)
        else:
            global_config.REDIS_SERVER_URL = "localhost"
            global_config.REDIS_SERVER_PORT = 7000

        args = (global_config.REDIS_SERVER_URL, global_config.REDIS_SERVER_PORT)
        if global_config.REDIS_SERVER_PW and global_config.REDIS_SERVER_PW is not None:
            args = (*args, global_config.REDIS_SERVER_PW)

        redis_interface.connect(*args)
Ejemplo n.º 5
0
from src.actinia_satellite_plugin.endpoints import create_endpoints
from actinia_core.health_check import health_check
from actinia_core.version import version
from actinia_core.resources.common.app import flask_app
from actinia_core.resources.common.config import global_config, DEFAULT_CONFIG_PATH
from actinia_core.resources.common.redis_interface import connect, create_job_queues
from actinia_core.resources.common.process_queue import create_process_queue

__license__ = "GPLv3"
__author__     = "Sören Gebbert"
__copyright__  = "Copyright 2016, Sören Gebbert"
__maintainer__ = "Sören Gebbert"
__email__      = "*****@*****.**"

if os.path.exists(DEFAULT_CONFIG_PATH) is True and os.path.isfile(DEFAULT_CONFIG_PATH):
    global_config.read(DEFAULT_CONFIG_PATH)

# Create the endpoints based on the global config
create_endpoints()

# Connect the redis interfaces
connect(global_config.REDIS_SERVER_URL,
        global_config.REDIS_SERVER_PORT)

# Create the process queue
create_process_queue(global_config)


########################################################################################################################
if __name__ == '__main__':
    # Connect to the database