コード例 #1
0
ファイル: base_pg_manager.py プロジェクト: ido/cobalt
 def _init_config_vars(self):
     '''Initialize variables from Cobalt's configuration files.'''
     init_cobalt_config()
     self.forker_re = re.compile('forker')
     self.sigkill_timeout = int(get_config_option('system', 'sigkill_timeout',
             300))
     self.remote_qsub_hosts = get_config_option('system',
             'elogin_hosts', '').split(":")
     _logger.info('REMOTE QSUB HOSTS: %s',
             ", ".join(self.remote_qsub_hosts))
コード例 #2
0
ファイル: BGQBooter.py プロジェクト: wscullin/subblock-cobalt
    def __init__(self,
                 block,
                 job_id,
                 user,
                 block_lock,
                 subblock_parent=None,
                 timeout=None):
        self.block = block
        self.block_id = self.block.name
        self.job_id = job_id
        self.user = user
        self.block_lock = block_lock
        if subblock_parent == None:
            self.subblock_parent = self.block.name
        else:
            self.subblock_parent = subblock_parent

        self.max_reboot_attempts = get_config_option("bgsystem", "max_reboots",
                                                     "unlimited")
        #config options always come back as strings.  This will be converted to an int, however.
        if str(self.max_reboot_attempts).lower() == 'unlimited':
            self.max_reboot_attempts = None
        else:
            self.max_reboot_attempts = int(self.max_reboot_attempts)
        self.reboot_attempts = 0
        self.status_string = []
        self.reap_timeout = None
        if timeout is not None:
            self.reap_timeout = timeout
コード例 #3
0
ファイル: BGQBooter.py プロジェクト: ido/cobalt
    def __init__(self, block, job_id, user, block_lock, subblock_parent=None, timeout=None):
        self.block = block
        self.block_id = self.block.name
        self.job_id = job_id
        self.user = user
        self.block_lock = block_lock
        if subblock_parent == None:
            self.subblock_parent = self.block.name
        else:
            self.subblock_parent = subblock_parent

        self.max_reboot_attempts = get_config_option("bgsystem", "max_reboots", "unlimited")
        #config options always come back as strings.  This will be converted to an int, however.
        if str(self.max_reboot_attempts).lower() == 'unlimited':
            self.max_reboot_attempts = None
        else:
            self.max_reboot_attempts = int(self.max_reboot_attempts)
        self.reboot_attempts = 0
        self.status_string = []
        self.reap_timeout = None
        if timeout is not None:
            self.reap_timeout = timeout
コード例 #4
0
ファイル: ALPSProcessGroup.py プロジェクト: ido/cobalt
XC-40 running ALPS.  This adds server-side information for interactive job
launch that is unique to the ALPS environment and is necessary on systems using
eLogin nodes (formerly known as CDL nodes).

"""
import time
import logging

from Cobalt.Util import init_cobalt_config, get_config_option
from Cobalt.DataTypes.ProcessGroup import ProcessGroup

_logger = logging.getLogger(__name__)

init_cobalt_config()

PGROUP_STARTUP_TIMEOUT = float(get_config_option('alpssystem', 'pgroup_startup_timeout', 120.0))
USER_SESSION_HOSTS = [host.strip() for host in
        get_config_option('alpssystem', 'user_session_hosts', '').split(':')]

class ALPSProcessGroup(ProcessGroup):
    '''ALPS-specific PocessGroup modifications.'''

    def __init__(self, spec):
        super(ALPSProcessGroup, self).__init__(spec)
        self.alps_res_id = spec.get('alps_res_id', None)
        self.interactive_complete = False
        now = int(time.time())
        self.startup_timeout = int(spec.get("pgroup_startup_timeout",
            now + PGROUP_STARTUP_TIMEOUT))

    def start(self):
コード例 #5
0
ファイル: base_forker.py プロジェクト: ido/cobalt
from Cobalt.Util import init_cobalt_config, get_config_option

__all__ = [
    "BaseForker",
    "BaseChild"
]

_logger = logging.getLogger(__name__.split('.')[-1])

config = ConfigParser.ConfigParser()
config.read(Cobalt.CONFIG_FILES)
init_cobalt_config()

# Number of bytes to attempt to read at once from stdout.  Excpect some large
# values due to large Cray system states/statuses.
PIPE_BUFSIZE = int(get_config_option('forker', ' pipe_buffsize', 16777216))

def get_forker_config(option, default):
    try:
        value = config.get('forker', option)
    except Exception, e:
        if isinstance(e, ConfigParser.NoSectionError):
            _logger.info("[forker] section missing from cobalt.conf")
            value = default
        elif isinstance(e, ConfigParser.NoOptionError):
            value = default
        else:
            raise e
    return value

コード例 #6
0
ファイル: qsub.py プロジェクト: ido/cobalt
    cb_debug, cb_env, cb_nodes, cb_time, cb_umask, cb_path, cb_dep, \
    cb_attrs, cb_user_list, cb_geometry, cb_gtzero, cb_mode, cb_interactive
from Cobalt.arg_parser import ArgParse
from Cobalt.Util import get_config_option, init_cobalt_config, sleep
from Cobalt.Proxy import ComponentProxy
import xmlrpclib
import subprocess

__revision__ = '$Revision: 559 $'
__version__  = '$Version$'

#init cobalt config file for setting default kernels.
init_cobalt_config()
SYSMGR           = client_utils.SYSMGR
QUEMGR           = client_utils.QUEMGR
CN_DEFAULT_KERNEL  = get_config_option('bgsystem', 'cn_default_kernel', 'default')
ION_DEFAULT_KERNEL = get_config_option('bgsystem', 'ion_default_kernel', 'default')
CRAY_MOM_QSUB      = get_config_option('alps', 'cray_mom_qsub', '/usr/bin/qsub')

def on_interrupt(sig, func=None):
    """
    Interrupt Handler to cleanup the interactive job if the user interrupts
    Will contain two static variables: count and exit.
    'count' will keep track how many interruptions happened and
    'exit' flags whether we completely exit once the interrupt occurs.
    """
    on_interrupt.count += 1
    if on_interrupt.exit:
        sys.exit(1)

# Initializing on_interrupt static variables
コード例 #7
0
ファイル: qsub.py プロジェクト: samnickolay/cobalt-master
from Cobalt.client_utils import \
    cb_debug, cb_env, cb_nodes, cb_time, cb_umask, cb_path, cb_dep, \
    cb_attrs, cb_user_list, cb_geometry, cb_gtzero, cb_mode, cb_interactive
from Cobalt.arg_parser import ArgParse
from Cobalt.Util import get_config_option, init_cobalt_config, sleep
from Cobalt.Proxy import ComponentProxy
import xmlrpclib

__revision__ = '$Revision: 559 $'
__version__ = '$Version$'

#init cobalt config file for setting default kernels.
init_cobalt_config()
SYSMGR = client_utils.SYSMGR
QUEMGR = client_utils.QUEMGR
CN_DEFAULT_KERNEL = get_config_option('bgsystem', 'cn_default_kernel',
                                      'default')
ION_DEFAULT_KERNEL = get_config_option('bgsystem', 'ion_default_kernel',
                                       'default')


def on_interrupt(sig, func=None):
    """
    Interrupt Handler to cleanup the interactive job if the user interrupts
    Will contain two static variables: count and exit.
    'count' will keep track how many interruptions happened and 
    'exit' flags whether we completely exit once the interrupt occurs.
    """
    on_interrupt.count += 1
    if on_interrupt.exit:
        sys.exit(1)
コード例 #8
0
ファイル: qsub.py プロジェクト: benmcclelland/cobalt
from Cobalt.client_utils import \
    cb_debug, cb_env, cb_nodes, cb_time, cb_umask, cb_path, cb_dep, \
    cb_attrs, cb_user_list, cb_geometry, cb_gtzero, cb_mode, cb_interactive
from Cobalt.arg_parser import ArgParse
from Cobalt.Util import get_config_option, init_cobalt_config, sleep
from Cobalt.Proxy import ComponentProxy
import xmlrpclib

__revision__ = '$Revision: 559 $'
__version__  = '$Version$'

#init cobalt config file for setting default kernels.
init_cobalt_config()
SYSMGR           = client_utils.SYSMGR
QUEMGR           = client_utils.QUEMGR
CN_DEFAULT_KERNEL  = get_config_option('bgsystem', 'cn_default_kernel', 'default')
ION_DEFAULT_KERNEL = get_config_option('bgsystem', 'ion_default_kernel', 'default')

def on_interrupt(sig, func=None):
    """
    Interrupt Handler to cleanup the interactive job if the user interrupts
    Will contain two static variables: count and exit.
    'count' will keep track how many interruptions happened and 
    'exit' flags whether we completely exit once the interrupt occurs.
    """
    on_interrupt.count += 1
    if on_interrupt.exit:
        sys.exit(1)

# Initializing on_interrupt static variables
on_interrupt.count = 0
コード例 #9
0
ファイル: alps_script_forker.py プロジェクト: ido/cobalt
import Cobalt.Util
from Cobalt.Util import init_cobalt_config, get_config_option, expand_num_list

from cray_messaging import BasilRequest
from cray_messaging import parse_response, ALPSError

exposed = Cobalt.Components.base.exposed
convert_argv_to_quoted_command_string = Cobalt.Util.convert_argv_to_quoted_command_string


_logger = logging.getLogger(__name__.split('.')[-1])

#CONFIG POINT TO ALPS

init_cobalt_config()
BASIL_PATH = get_config_option('alps', 'basil', '/opt/cray/alps/default/bin/apbasil')
DEFAULT_DEPTH = int(get_config_option('alps', 'default_depth', 72))

class ALPSScriptChild (PGChild):
    def __init__(self, id = None, **kwargs):
        PGChild.__init__(self, id=id, **kwargs)
        self.pagg_id = None
        self.alps_res_id = None
        try:
            self.bg_partition = self.pg.location[0]
        except IndexError:
            _logger.error("%s: no partition was specified", self.label)
            raise

        data = kwargs['data']
        if data.has_key('nodect'):