def __init__(self, buildRepo, project, email=None, emailOpts='n', jointLog=False, pythonExec=None): self.buildRepo = buildRepo self.project = project self.email = email self.emailOpts = emailOpts self.jointLog = jointLog self.pythonExec = pythonExec if self.pythonExec is None: self.pythonExec = sys.executable assert self.pythonExec # attempt to find name of cell as a way of identifying this grid self.cell = os.environ.get('GE_CELL', os.environ.get('SGE_CELL', 'default')) self.secHashUid = persist.secHashObject( (self.buildRepo, self.cell, self.project)) # check there is a grid available for us to use try: subprocess.check_output(['qstat']) except OSError: raise RuntimeError('grid not found (running qstat failed)')
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashFunc = codedep.getHash(self.func) secHashInputs = [art.secHash() for art in self.inputs] return persist.secHashObject( (secHashSource, secHashFunc, secHashInputs, self.indexOut, self.shouldCache))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashFunc = codedep.getHash(self.func) secHashInputs = [ art.secHash() for art in self.inputs ] return persist.secHashObject((secHashSource, secHashFunc, secHashInputs, self.indexOut, self.shouldCache))
def test_secHash_consistent(self): """Tests that secHashFile of a pickled object is the same as secHashObject of the object.""" l = [1, 2, 3] d = dict() d['a'] = l d['b'] = l with TempDir() as tempDir: def loc(suffix): return os.path.join(tempDir.location, suffix) persist.savePickle(loc('d.pickle'), d) assert (persist.secHashFile(loc('d.pickle')) == persist.secHashObject(d))
def test_secHashObject_characterization(self): """Simple characterization test for secHashObject so we will know if it ever changes.""" l = [1, 2, 3] d = dict() d['a'] = l d['b'] = l assert persist.secHashObject(0) == '27b9b44c6234ee94be9ee6f1af3aca8f77c42194' assert persist.secHashObject(1) == 'aaabe6ddf3884ad6332f7ba21ebde77cfa56020f' assert persist.secHashObject(2) == 'f90d0d7dda12125e6e903c7fe294ef5a18b5c38d' assert persist.secHashObject([]) == 'a766f8f1a671877187d2e4cc90987785f7323bde' assert persist.secHashObject(None) == '6ae75066bc250a2c28d6871cbb2e5e6089800440' assert persist.secHashObject(dict()) == '10c1a6c4ca5103c9310a788b6ac71b1eb03026f3' assert persist.secHashObject(l) == '4af396d95ed2d87f7330f8418f1d7619623e5f42' assert persist.secHashObject(d) == 'bebad045b5f2d023efed1d4fc1840a28c532789e'
def __init__(self, buildRepo, project, email = None, emailOpts = 'n', jointLog = False, pythonExec = None): self.buildRepo = buildRepo self.project = project self.email = email self.emailOpts = emailOpts self.jointLog = jointLog self.pythonExec = pythonExec if self.pythonExec is None: self.pythonExec = sys.executable assert self.pythonExec # attempt to find name of cell as a way of identifying this grid self.cell = os.environ.get('GE_CELL', os.environ.get('SGE_CELL', 'default')) self.secHashUid = persist.secHashObject((self.buildRepo, self.cell, self.project)) # check there is a grid available for us to use try: subprocess.check_output(['qstat']) except OSError: raise RuntimeError('grid not found (running qstat failed)')
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) return persist.secHashObject((secHashSource, self.litValue))
def __enter__(self): self.submitServer, self.runServerProcess = mock_sge.getMockSge() self.secHashUid = persist.secHashObject( (self.buildRepo, self.runServerProcess.pid)) return self
def getJobQueuerDir(self, job, queuer): jobQueuerId = persist.secHashObject((job.secHash(), queuer.secHash())) return os.path.join(self.base, 'liveJobs', jobQueuerId)
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashInputs = [art.secHash() for art in self.inputs] return persist.secHashObject((secHashSource, secHashInputs))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashThunk = codedep.getHash(self.thunk) return persist.secHashObject((secHashSource, secHashThunk, self.shouldCache))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashInputs = [ art.secHash() for art in self.inputs ] return persist.secHashObject((secHashSource, secHashInputs))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) return persist.secHashObject((secHashSource, self.parentJob.secHash(), self.indexOut))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashFile = persist.secHashFile(self.location) return persist.secHashObject((secHashSource, secHashFile))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) return persist.secHashObject( (secHashSource, self.parentJob.secHash(), self.indexOut))
def __init__(self, buildRepo): self.buildRepo = buildRepo self.secHashUid = persist.secHashObject(id(self))
def computeSecHash(self): secHashSource = codedep.getHash(self.__class__) secHashThunk = codedep.getHash(self.thunk) return persist.secHashObject( (secHashSource, secHashThunk, self.shouldCache))
def __enter__(self): self.submitServer, self.runServerProcess = mock_sge.getMockSge() self.secHashUid = persist.secHashObject(( self.buildRepo, self.runServerProcess.pid )) return self