예제 #1
0
    def getJobInfo(self):
        import os

        try:
            URL = os.environ['GANGA_OUTPUTSERVERMS_URL']
        except KeyError:
            from Ganga.Utility.util import hostname
            import ganga_output_server
            URL = 'http://%s:%d'%(hostname(),ganga_output_server.DEFAULT_PORT)
        
        return {'jobid':self.job_info.getFQID('.'),'server_url': URL}
예제 #2
0
   def _submit( self, scriptpath):
      job = self.getJobObject()
      self.actualCE = util.hostname()
      logger.info('Starting job %d', job.id)

      try:
         job.updateStatus( "submitted" )
         self.status = "submitted"
         os.spawnv( os.P_WAIT, scriptpath, ( scriptpath, ) )
         self.status = "completed"
      except KeyboardInterrupt:
         self.status = "killed"
         pass

      return True
예제 #3
0
    def _submit(self, scriptpath, env=None):
        if env is None:
            env = expand_vars(os.environ)
        job = self.getJobObject()
        self.actualCE = util.hostname()
        logger.info('Starting job %s', job.getFQID('.'))

        try:
            job.updateStatus("submitted")
            self.status = "submitted"
            import subprocess
            subprocess.call(scriptpath)
            self.status = "completed"
        except KeyboardInterrupt:
            self.status = "killed"

        return True
예제 #4
0
    def _submit(self, scriptpath, env=None):
        if env is None:
            env = expand_vars(os.environ)
        job = self.getJobObject()
        self.actualCE = util.hostname()
        logger.info('Starting job %s', job.getFQID('.'))

        try:
            job.updateStatus("submitted")
            self.status = "submitted"
            import subprocess
            subprocess.call(scriptpath)
            self.status = "completed"
        except KeyboardInterrupt:
            self.status = "killed"

        return True
예제 #5
0
파일: OctopusMS.py 프로젝트: kreczko/ganga
    def getJobInfo(self):
        import os
        try:
            s = os.environ['GANGA_OCTOPUS_SERVER']
        except KeyError:
            from Ganga.Utility.util import hostname
            s = hostname()

        try:
            p = os.environ['GANGA_OCTOPUS_PORT']
        except KeyError:
            p = 8882

        h = long(hash(self.job_info.getFQID('.')))
        h = h + sys.maxsize * (long(hash(s)) + sys.maxsize)

        return {'jobid': self.job_info.getFQID('.'), 'channel': h,
                'octopus_server': s, 'octopus_port': p}
예제 #6
0
# [N] in the pattern is important because it prevents CVS from expanding the pattern itself!
r = re.compile(r'\$[N]ame: (?P<version>\S+) \$').match(_gangaVersion)
if r:
    _gangaVersion = r.group('version')
else:
    _gangaVersion = "SVN_TRUNK"

# store a path to Ganga libraries
_gangaPythonPath = os.path.dirname(os.path.dirname(__file__))


# grab the hostname
try:
    from Ganga.Utility.util import hostname
    hostname = hostname()
except Exception as x:  # fixme: use OSError instead?
    hostname = 'localhost'


# ------------------------------------------------
# Setup all configs for this module
from Ganga.Utility.Config import makeConfig, getConfig, expandvars


# ------------------------------------------------
# Logging
log_config = makeConfig("Logging", """control the messages printed by Ganga
The settings are applied hierarchically to the loggers. Ganga is the name of the top-level logger which
applies by default to all Ganga.* packages unless overriden in sub-packages.
You may define new loggers in this section.
예제 #7
0
파일: __init__.py 프로젝트: datty/ganga
# [N] in the pattern is important because it prevents CVS from expanding the pattern itself!
r = re.compile(r'\$[N]ame: (?P<version>\S+) \$').match(_gangaVersion)
if r:
    _gangaVersion = r.group('version')
else:
    _gangaVersion = "SVN_TRUNK"

# store a path to Ganga libraries
_gangaPythonPath = os.path.dirname(os.path.dirname(__file__))


# grab the hostname
try:
    from Ganga.Utility.util import hostname
    hostname = hostname()
except Exception as x:  # fixme: use OSError instead?
    hostname = 'localhost'


# ------------------------------------------------
# Setup all configs for this module
from Ganga.Utility.Config import makeConfig, getConfig, expandvars


# ------------------------------------------------
# Logging
log_config = makeConfig("Logging", """control the messages printed by Ganga
The settings are applied hierarchically to the loggers. Ganga is the name of the top-level logger which
applies by default to all Ganga.* packages unless overriden in sub-packages.
You may define new loggers in this section.