def on_create(node):
    cfg = common.Config().get_user_config()
    environment = cfg.get('environment', {})
    for key in environment:
        for value in environment[key].split(":"):
            _addEnvEntry(node, **{key: value})

    upload_paths = cfg.get('upload_paths', [])
    for path in upload_paths:
        _addPathEntry(node, path)

    detect(node)
示例#2
0
def on_create(node):
    """Set up preemptible and retries from config."""
    cfg = common.Config().get_user_config()
    retries = cfg.get(
        'autoretry_policy',
        {}).get(
        "preempted",
        {}).get("max_retries")
    if retries:
        node.parm('preemptible').set(1)
        node.parm('retries').set(retries)
    else:
        node.parm('preemptible').set(0)
示例#3
0
import os
import sys
import imp
import logging
import tempfile
import warnings

from conductor.lib import common, loggeria, version_check, wizard

#The version string is updated by the build system.
#Do not modify the following line.
#__version__="0.0.0"

# Read the config yaml file upon module import
try:
    CONFIG = common.Config().config
except ValueError:
    # wizard.run()
    CONFIG = common.Config().config

# IF there is log level specified in config (which by default there should be), then set it for conductor's logger
log_level = CONFIG.get("log_level")
if log_level:
    loggeria.set_conductor_log_level(log_level)

#Try to ensure that we have the latest version of Conductor
try:
    vc = version_check.VersionCheck()
    if not vc.is_latest:
        warnings.warn("Conductor is out of date.  Please go to {} for update information.".format(vc.update_url))
except:
def on_create(node):
    node.parm('local_upload').set(
        int(common.Config().get_user_config().get('local_upload', True)))