Commit 9dba3670 authored by Paul Rich's avatar Paul Rich
Browse files

Merge branch 'develop' into 37-ssh-interactive-mode

Conflicts:
	src/lib/Components/system/CraySystem.py
parents 7e8e9790 db7bb983
...@@ -49,14 +49,8 @@ start_component () { ...@@ -49,14 +49,8 @@ start_component () {
then then
( (
date=`/bin/date` date=`/bin/date`
if [ "$component" == "alps_script_forker" ]
then
echo "--- $date: START ${component} ---" >>/var/log/cobalt/${component}_${HOSTNAME}.out echo "--- $date: START ${component} ---" >>/var/log/cobalt/${component}_${HOSTNAME}.out
nohup "${DAEMONDIR}/${component}.py" $component_args --config-files "${CONFIGFILE}" >>/var/log/cobalt/${component}_${HOSTNAME}.out 2>&1 & nohup "${DAEMONDIR}/${component}.py" $component_args --config-files "${CONFIGFILE}" >>/var/log/cobalt/${component}_${HOSTNAME}.out 2>&1 &
else
echo "--- $date: START ${component} ---" >>/var/log/cobalt/${component}.out
nohup "${DAEMONDIR}/${component}.py" $component_args --config-files "${CONFIGFILE}" >>/var/log/cobalt/${component}.out 2>&1 &
fi
) )
echo "done" echo "done"
return 0 return 0
......
...@@ -278,6 +278,8 @@ class Component (object): ...@@ -278,6 +278,8 @@ class Component (object):
self._component_lock = threading.Lock() self._component_lock = threading.Lock()
self._component_lock_acquired_time = None self._component_lock_acquired_time = None
self.statistics = Statistics() self.statistics = Statistics()
self.logger.info("%s:%s component executing on %s", self.name,
self.implementation, socket.gethostname())
def __getstate__(self): def __getstate__(self):
state = {} state = {}
...@@ -296,6 +298,8 @@ class Component (object): ...@@ -296,6 +298,8 @@ class Component (object):
self._component_lock = threading.Lock() self._component_lock = threading.Lock()
self._component_lock_acquired_time = None self._component_lock_acquired_time = None
self.statistics = Statistics() self.statistics = Statistics()
self.logger.info("%s:%s component executing on %s", self.name,
self.implementation, socket.gethostname())
def component_lock_acquire(self): def component_lock_acquire(self):
entry_time = time.time() entry_time = time.time()
......
...@@ -55,6 +55,5 @@ class ALPSProcessGroup(ProcessGroup): ...@@ -55,6 +55,5 @@ class ALPSProcessGroup(ProcessGroup):
''' '''
if self.mode == 'interactive': if self.mode == 'interactive':
if len(USER_SESSION_HOSTS): if len(USER_SESSION_HOSTS):
pass
return super(ALPSProcessGroup, self).start() return super(ALPSProcessGroup, self).start()
...@@ -15,9 +15,16 @@ from Cobalt.Components.base import Component, exposed, automatic, query, locking ...@@ -15,9 +15,16 @@ from Cobalt.Components.base import Component, exposed, automatic, query, locking
from Cobalt.Components.system.base_system import BaseSystem from Cobalt.Components.system.base_system import BaseSystem
from Cobalt.Components.system.CrayNode import CrayNode from Cobalt.Components.system.CrayNode import CrayNode
from Cobalt.Components.system.base_pg_manager import ProcessGroupManager from Cobalt.Components.system.base_pg_manager import ProcessGroupManager
from Cobalt.Components.system.ALPSProcessGroup import ALPSProcessGroup
from Cobalt.Exceptions import ComponentLookupError from Cobalt.Exceptions import ComponentLookupError
from Cobalt.Exceptions import JobNotInteractive from Cobalt.Exceptions import JobNotInteractive
<<<<<<< Updated upstream
from Cobalt.Components.system.ALPSProcessGroup import ALPSProcessGroup from Cobalt.Components.system.ALPSProcessGroup import ALPSProcessGroup
from Cobalt.Exceptions import JobValidationError
from Cobalt.DataTypes.ProcessGroup import ProcessGroup
=======
from Cobalt.Exceptions import JobValidationError
>>>>>>> Stashed changes
from Cobalt.Util import compact_num_list, expand_num_list from Cobalt.Util import compact_num_list, expand_num_list
from Cobalt.Util import init_cobalt_config, get_config_option from Cobalt.Util import init_cobalt_config, get_config_option
...@@ -25,6 +32,7 @@ _logger = logging.getLogger(__name__) ...@@ -25,6 +32,7 @@ _logger = logging.getLogger(__name__)
init_cobalt_config() init_cobalt_config()
SYSTEM_SIZE = int(get_config_option('system', 'size'))
UPDATE_THREAD_TIMEOUT = int(get_config_option('alpssystem', UPDATE_THREAD_TIMEOUT = int(get_config_option('alpssystem',
'update_thread_timeout', 10)) 'update_thread_timeout', 10))
TEMP_RESERVATION_TIME = int(get_config_option('alpssystem', TEMP_RESERVATION_TIME = int(get_config_option('alpssystem',
...@@ -39,10 +47,13 @@ CLEANUP_DRAIN_WINDOW = get_config_option('system', 'cleanup_drain_window', 300) ...@@ -39,10 +47,13 @@ CLEANUP_DRAIN_WINDOW = get_config_option('system', 'cleanup_drain_window', 300)
#Epsilon for backfilling. This system does not do this on a per-node basis. #Epsilon for backfilling. This system does not do this on a per-node basis.
BACKFILL_EPSILON = int(get_config_option('system', 'backfill_epsilon', 120)) BACKFILL_EPSILON = int(get_config_option('system', 'backfill_epsilon', 120))
ELOGIN_HOSTS = [host for host in ":".split(get_config_option('alpssystem', 'elogin_hosts', ''))]
DRAIN_MODES = ['first-fit', 'backfill'] DRAIN_MODES = ['first-fit', 'backfill']
CLEANING_ID = -1 CLEANING_ID = -1
def chain_loc_list(loc_list): def chain_loc_list(loc_list):
'''Take a list of compact Cray locations, '''Take a list of compact Cray locations,
expand and concatenate them. expand and concatenate them.
...@@ -1228,15 +1239,36 @@ class CraySystem(BaseSystem): ...@@ -1228,15 +1239,36 @@ class CraySystem(BaseSystem):
''' '''
#Right now this does nothing. Still figuring out what a valid #Right now this does nothing. Still figuring out what a valid
#specification looks like. #specification looks like.
# mode on this system defaults to script.
mode = spec.get('mode', None)
if ((mode is None) or (mode == False)):
spec['mode'] = 'script'
if spec['mode'] not in ['script', 'interactive']:
raise JobValidationError("Mode %s is not supported on Cray systems." % mode)
# FIXME: Pull this out of the system configuration from ALPS ultimately. # FIXME: Pull this out of the system configuration from ALPS ultimately.
# For now, set this from config for the PE count per node # For now, set this from config for the PE count per node
# nodes = int(spec['nodes']) spec['nodecount'] = int(spec['nodecount'])
# proccount = spec.get('proccount', None) # proccount = spec.get('proccount', None)
# if proccount is None: # if proccount is None:
# nodes * # nodes *
spec['proccount'] = spec['nodecount'] if spec['proccount'] > SYSTEM_SIZE:
raise JobValidationError('Job requested %s nodes. Maximum permitted size is %s' %
(spec['proccount'], SYSTEM_SIZE))
spec['proccount'] = spec['nodecount'] #set multiplier for default depth
mode = spec.get('mode', 'script')
spec['mode'] = mode
if mode == 'interactive':
# Handle which script host should handle their job if they're on a
# login.
if spec.get('qsub_host', None) in ELOGIN_HOSTS:
spec['ssh_host'] = self._get_ssh_host()
return spec return spec
def _get_ssh_host(self):
return None
@exposed @exposed
def verify_locations(self, nodes): def verify_locations(self, nodes):
'''verify that a list of nodes exist on this system. Return the list '''verify that a list of nodes exist on this system. Return the list
......
...@@ -46,15 +46,15 @@ alter table "##COBALT_SCHEMA##"."RESERVATION_DATA" ...@@ -46,15 +46,15 @@ alter table "##COBALT_SCHEMA##"."RESERVATION_DATA"
add BLOCK_PASSTHROUGH INTEGER; add BLOCK_PASSTHROUGH INTEGER;
------------------------------------------------ ------------------------------------------------
-- DDL Statements for table "##COBALT_SCHEMA##"."RESERVATION_DATA" -- DDL Statements for table "##COBALT_SCHEMA##"."RESERVATION_EVENTS"
------------------------------------------------ ------------------------------------------------
update table "##COBALT_SCHEMA##"."RESERVATION_EVENTS" update "##COBALT_SCHEMA##"."RESERVATION_EVENTS"
SET NAME = "terminating" SET NAME = 'terminating'
where NAME = "ending"; where NAME = 'ending';
insert into "##COBALT_SCHEMA##"."RESERVATION_EVENTS" values insert into "##COBALT_SCHEMA##"."RESERVATION_EVENTS" values
(default, "deferred"), (default, 'deferred'),
(default, "deactivating"), (default, 'deactivating'),
(default, "released"), (default, 'released'),
(default, "instance_end"); (default, 'instance_end');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment