Ejemplo n.º 1
0
		def _create_backend(wms):
			try:
				backend_cls = WMS.get_class(wms)
			except Exception:
				raise BackendError('Unable to load backend class %s' % repr(wms))
			wms_config = config.change_view(view_class='TaggedConfigView', set_classes=[backend_cls])
			return WMS.create_instance(wms, wms_config, name)
Ejemplo n.º 2
0
    def __init__(self, config, name, wmsList):
        WMS.__init__(self, config, name)
        self._defaultWMS = wmsList[0]
        defaultT = self._defaultWMS.getTimings()
        self._timing = Result(waitOnIdle=defaultT.waitOnIdle,
                              waitBetweenSteps=defaultT.waitBetweenSteps)
        self._wmsMap = {
            self._defaultWMS.getObjectName().lower(): self._defaultWMS
        }
        for wmsEntry in wmsList[1:]:
            wmsObj = wmsEntry
            self._wmsMap[wmsObj.getObjectName().lower()] = wmsObj
            wmsT = wmsObj.getTimings()
            self._timing.waitOnIdle = max(self._timing.waitOnIdle,
                                          wmsT.waitOnIdle)
            self._timing.waitBetweenSteps = max(self._timing.waitBetweenSteps,
                                                wmsT.waitBetweenSteps)

        self._brokerWMS = config.getPlugin('wms broker',
                                           'RandomBroker',
                                           cls=Broker,
                                           inherit=True,
                                           tags=[self],
                                           pargs=('wms', 'wms',
                                                  self._wmsMap.keys))
Ejemplo n.º 3
0
		def createWMS(wms):
			try:
				wmsCls = WMS.getClass(wms)
			except Exception:
				raise BackendError('Unable to load backend class %s' % repr(wms))
			wms_config = config.changeView(viewClass = 'TaggedConfigView', setClasses = [wmsCls])
			return WMS.createInstance(wms, wms_config, name)
Ejemplo n.º 4
0
		def createWMS(wms):
			try:
				wmsCls = WMS.getClass(wms)
			except Exception:
				raise BackendError('Unable to load backend class %s' % repr(wms))
			wms_config = config.changeView(viewClass = 'TaggedConfigView', setClasses = [wmsCls])
			return WMS.createInstance(wms, wms_config, name)
Ejemplo n.º 5
0
    def __init__(self, config, name, backend_list):
        WMS.__init__(self, config, name)
        self._default_backend = backend_list[0]
        default_timing = self._default_backend.get_interval_info()
        self._timing = Result(
            wait_on_idle=default_timing.wait_on_idle,
            wait_between_steps=default_timing.wait_between_steps)
        self._map_backend_name2backend = {
            self._default_backend.get_object_name().lower():
            self._default_backend
        }
        for backend_entry in backend_list[1:]:
            backend = backend_entry
            self._map_backend_name2backend[
                backend.get_object_name().lower()] = backend
            wms_timing = backend.get_interval_info()
            self._timing.wait_on_idle = max(self._timing.wait_on_idle,
                                            wms_timing.wait_on_idle)
            self._timing.wait_between_steps = max(
                self._timing.wait_between_steps, wms_timing.wait_between_steps)

        self._broker_wms = config.get_plugin(
            'wms broker',
            'RandomBroker',
            cls=Broker,
            bind_kwargs={
                'inherit': True,
                'tags': [self]
            },
            pargs=('wms', 'wms', self._map_backend_name2backend.keys))
Ejemplo n.º 6
0
	def __new__(cls, config, name):
		for cmd, wms in [('sgepasswd', 'OGE'), ('pbs-config', 'PBS'), ('qsub', 'OGE'), ('bsub', 'LSF'), ('job_slurm', 'SLURM')]:
			try:
				utils.resolveInstallPath(cmd)
				return WMS.getInstance(wms, config, name)
			except Exception:
				pass
		return WMS.getInstance('PBS', config, name)
Ejemplo n.º 7
0
 def _create_backend(wms):
     try:
         backend_cls = WMS.get_class(wms)
     except Exception:
         raise BackendError('Unable to load backend class %s' %
                            repr(wms))
     wms_config = config.change_view(view_class='TaggedConfigView',
                                     set_classes=[backend_cls])
     return WMS.create_instance(wms, wms_config, name)
Ejemplo n.º 8
0
	def __init__(self, config, wmsName, wmsList):
		WMS.__init__(self, config, wmsName)
		self._defaultWMS = wmsList[0]
		defaultT = self._defaultWMS.getTimings()
		self._timing = Result(waitOnIdle = defaultT.waitOnIdle, waitBetweenSteps = defaultT.waitBetweenSteps)
		self._wmsMap = {self._defaultWMS.getObjectName().lower(): self._defaultWMS}
		for wmsEntry in wmsList[1:]:
			wmsObj = wmsEntry
			self._wmsMap[wmsObj.getObjectName().lower()] = wmsObj
			wmsT = wmsObj.getTimings()
			self._timing.waitOnIdle = max(self._timing.waitOnIdle, wmsT.waitOnIdle)
			self._timing.waitBetweenSteps = max(self._timing.waitBetweenSteps, wmsT.waitBetweenSteps)

		self._brokerWMS = config.getPlugin('wms broker', 'RandomBroker',
			cls = Broker, tags = [self], pargs = ('wms', 'wms', self._wmsMap.keys))
Ejemplo n.º 9
0
	def __new__(cls, config, name):
		ec = ExceptionCollector()
		for cmd, wms in [('sgepasswd', 'OGE'), ('pbs-config', 'PBS'), ('qsub', 'OGE'), ('bsub', 'LSF'), ('job_slurm', 'SLURM')]:
			try:
				utils.resolveInstallPath(cmd)
			except Exception:
				ec.collect()
				continue
			try:
				wmsCls = WMS.getClass(wms)
			except Exception:
				raise BackendError('Unable to load backend class %s' % repr(wms))
			config_wms = config.changeView(viewClass = 'TaggedConfigView', setClasses = [wmsCls])
			return WMS.createInstance(wms, config_wms, name)
		ec.raise_any(BackendError('No valid local backend found!')) # at this point all backends have failed!
Ejemplo n.º 10
0
	def __init__(self, config, name, backend_list):
		WMS.__init__(self, config, name)
		self._default_backend = backend_list[0]
		default_timing = self._default_backend.get_interval_info()
		self._timing = Result(wait_on_idle=default_timing.wait_on_idle,
			wait_between_steps=default_timing.wait_between_steps)
		self._map_backend_name2backend = {
			self._default_backend.get_object_name().lower(): self._default_backend
		}
		for backend_entry in backend_list[1:]:
			backend = backend_entry
			self._map_backend_name2backend[backend.get_object_name().lower()] = backend
			wms_timing = backend.get_interval_info()
			self._timing.wait_on_idle = max(self._timing.wait_on_idle,
				wms_timing.wait_on_idle)
			self._timing.wait_between_steps = max(self._timing.wait_between_steps,
				wms_timing.wait_between_steps)

		self._broker_wms = config.get_plugin('wms broker', 'RandomBroker',
			cls=Broker, bind_kwargs={'inherit': True, 'tags': [self]},
			pargs=('wms', 'wms', self._map_backend_name2backend.keys))