Esempio n. 1
0
# Config
#from config.processingParams import processingParameters
from overwatch.base import config
from overwatch.base import utilities
(processingParameters,
 filesRead) = config.readConfig(config.configurationType.processing)
print("Configuration files read: {0}".format(filesRead))
print("processingParameters: {0}".format(pprint.pformat(processingParameters)))

# By not setting a name, we get everything!
logger = logging.getLogger("")
# Alternatively, we could set processRuns to get everything derived from that
#logger = logging.getLogger("processRuns")

# Setup logging
utilities.setupLogging(logger, processingParameters["loggingLevel"],
                       processingParameters["debug"], "processRuns")
# Log settings
logger.info(processingParameters)

# Imports are below here so that they can be logged
from overwatch.processing import processRuns


def run():
    # Process all of the run data
    processRuns.processAllRuns()
    # Function calls that be used for debugging
    #processQA("Run246272", "Run246980", "EMC", "determineMedianSlope")

    ## Test processTimeSlices()
    ## TEMP
Esempio n. 2
0
# Config
from overwatch.base import config
# For configuring logger
from overwatch.base import utilities
(serverParameters, filesRead) = config.readConfig(config.configurationType.webApp)
print("Configuration files read: {0}".format(filesRead))
print("serverParameters: {0}".format(pprint.pformat(serverParameters)))

# By not setting a name, we get everything!
logger = logging.getLogger("")
# Alternatively, we could set "webApp" to get everything derived from that
#logger = logging.getLogger("webApp")

# Setup logger
utilities.setupLogging(logger, serverParameters["loggingLevel"], serverParameters["debug"], "webApp")
# Log server settings
logger.info(serverParameters)

# Imports are below here so that they can be logged
from overwatch.webApp.webApp import app

# Set the secret key here
if not serverParameters["debug"]:
    # Connect to database ourselves and grab the secret key
    (dbRoot, connection) = utilities.getDB(serverParameters["databaseLocation"])
    if dbRoot["config"].has_key("secretKey") and dbRoot["config"]["secretKey"]:
        logger.info("Setting secret key from database!")
        secretKey = dbRoot["config"]["secretKey"]
    else:
        # Set secret_key based on sensitive param value
Esempio n. 3
0
from overwatch.base import config
from overwatch.base import utilities
(processingParameters,
 filesRead) = config.readConfig(config.configurationType.processing)
print("Configuration files read: {filesRead}".format(filesRead=filesRead))
print("processingParameters: {processingParameters}".format(
    processingParameters=pprint.pformat(processingParameters)))

# By not setting a name, we get everything!
logger = logging.getLogger("")
# Alternatively, we could set processRuns to get everything derived from that
#logger = logging.getLogger("processRuns")

# Setup logging
utilities.setupLogging(logger=logger,
                       logLevel=processingParameters["loggingLevel"],
                       debug=processingParameters["debug"])
# Log settings
logger.info(processingParameters)

# Setup sentry to create alerts for warning level messages. Those will include info level breadcrumbs.
sentry_logging = LoggingIntegration(level=logging.INFO,
                                    event_level=logging.WARNING)
# Usually, we want the module specific DSN, but we will take a generic one if it's the only one available.
sentryDSN = os.getenv("SENTRY_DSN_PROCESSING") or os.getenv("SENTRY_DSN")
if sentryDSN:
    # It's helpful to know that sentry is setup, but we also don't want to put the DSN itself in the logs,
    # so we simply note that it is enabled.
    logger.info("Sentry DSN set and integrations enabled.")
sentry_sdk.init(dsn=sentryDSN, integrations=[sentry_logging])
Esempio n. 4
0
(serverParameters,
 filesRead) = config.readConfig(config.configurationType.webApp)

# Get the most useful fucntions
from overwatch.base import utilities

import logging
# By not setting a name, we get everything!
logger = logging.getLogger("")
# Alternatively, we could set processRuns to get everything derived from that
#logger = logging.getLogger("processRuns")
import pprint

# Setup logging
utilities.setupLogging(logger=logger,
                       logLevel=serverParameters["loggingLevel"],
                       debug=serverParameters["debug"])
# Log settings
logger.info("Settings: {serverParameters}".format(
    serverParameters=pprint.pformat(serverParameters)))


def updateDBUsers():
    """ Updates users in the database based on the current configuration.

    Args:
        None
    Returns:
        None
    """
    (db, connection) = utilities.getDB(serverParameters["databaseLocation"])