Esempio n. 1
0
    def __init__(self, path, fanOut=1000):
        """
        :param str path: Path to directory holding the job store
        :param int fanOut: Number of items to have in a directory before making
                           subdirectories
        """
        super(FileJobStore, self).__init__()
        self.jobStoreDir = absSymPath(path)
        logger.debug("Path to job store directory is '%s'.", self.jobStoreDir)

        # Directory where actual job files go, and their job-associated temp files
        self.jobsDir = os.path.join(self.jobStoreDir, 'jobs')
        # Directory where stats files go
        self.statsDir = os.path.join(self.jobStoreDir, 'stats')
        # Directory where non-job-associated files for the file store go
        self.filesDir = os.path.join(self.jobStoreDir, 'files/no-job')
        # Directory where job-associated files for the file store go.
        # Each per-job directory in here will have separate directories for
        # files to clean up and files to not clean up when the job is deleted.
        self.jobFilesDir = os.path.join(self.jobStoreDir, 'files/for-job')
        # Directory where shared files go
        self.sharedFilesDir = os.path.join(self.jobStoreDir, 'files/shared')

        self.fanOut = fanOut

        self.linkImports = None
        self.moveExports = None
Esempio n. 2
0
 def __init__(self, path):
     """
     :param str path: Path to directory holding the job store
     """
     super(FileJobStore, self).__init__()
     self.jobStoreDir = absSymPath(path)
     logger.debug("Path to job store directory is '%s'.", self.jobStoreDir)
     # Directory where temporary files go
     self.tempFilesDir = os.path.join(self.jobStoreDir, 'tmp')
Esempio n. 3
0
 def __init__(self, path):
     """
     :param str path: Path to directory holding the job store
     """
     super(FileJobStore, self).__init__()
     self.jobStoreDir = absSymPath(path)
     logger.debug("Path to job store directory is '%s'.", self.jobStoreDir)
     # Directory where temporary files go
     self.tempFilesDir = os.path.join(self.jobStoreDir, 'tmp')
Esempio n. 4
0
def toilPackageDirPath():
    """
    Returns the absolute path of the directory that corresponds to the top-level toil package. The return value is
    guaranteed to end in '/toil'.
    """
    import toil.jobWrapper

    result = os.path.dirname(absSymPath(toil.jobWrapper.__file__))
    assert result.endswith('/toil')
    return result
Esempio n. 5
0
def toilPackageDirPath():
    """
    Returns the absolute path of the directory that corresponds to the top-level toil package. The return value is
    guaranteed to end in '/toil'.
    """
    import toil.batchJob

    result = os.path.dirname(absSymPath(toil.batchJob.__file__))
    assert result.endswith('/toil')
    return result
Esempio n. 6
0
 def __init__(self, jobStoreDir, config=None):
     #This is root directory in which everything in the store is kept
     self.jobStoreDir = absSymPath(jobStoreDir)
     logger.info("Jobstore directory is: %s", self.jobStoreDir)
     self.tempFilesDir = os.path.join(self.jobStoreDir, "tmp")
     if not os.path.exists(self.jobStoreDir):
         os.mkdir(self.jobStoreDir)
         os.mkdir(self.tempFilesDir)
     #Parameters for creating temporary files
     self.validDirs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
     self.levels = 2
     super(FileJobStore, self).__init__(config=config)
Esempio n. 7
0
 def __init__(self, jobStoreDir, config=None):
     #This is root directory in which everything in the store is kept
     self.jobStoreDir = absSymPath(jobStoreDir)
     logger.info("Jobstore directory is: %s", self.jobStoreDir)
     self.tempFilesDir = os.path.join(self.jobStoreDir, "tmp")
     if not os.path.exists(self.jobStoreDir):
         os.mkdir(self.jobStoreDir)
         os.mkdir(self.tempFilesDir)
     #Parameters for creating temporary files
     self.validDirs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
     self.levels = 2
     super( FileJobStore, self ).__init__( config=config )
Esempio n. 8
0
    def __init__(self, path):
        """
        :param str path: Path to directory holding the job store
        """
        super(FileJobStore, self).__init__()
        self.jobStoreDir = absSymPath(path)
        logger.debug("Path to job store directory is '%s'.", self.jobStoreDir)
        # Directory where temporary files go
        self.tempFilesDir = os.path.join(self.jobStoreDir, 'tmp')
        self.linkImports = None

        # This flag is used by self._recursiveDelete to limit warning count
        self._warnedOnNfs = False
Esempio n. 9
0
 def __init__(self, jobStoreDir, config=None):
     """
     :param jobStoreDir: Place to create jobStore
     :param config: See jobStores.abstractJobStore.AbstractJobStore.__init__
     :raise RuntimeError: if config != None and the jobStore already exists or
     config == None and the jobStore does not already exists. 
     """
     #This is root directory in which everything in the store is kept
     self.jobStoreDir = absSymPath(jobStoreDir)
     logger.info("Jobstore directory is: %s", self.jobStoreDir)
     #Safety checks for existing jobStore
     self._checkJobStoreCreation(config != None, os.path.exists(self.jobStoreDir), self.jobStoreDir)
     #Directory where temporary files go
     self.tempFilesDir = os.path.join(self.jobStoreDir, "tmp")
     #Creation of jobStore, if necessary
     if config != None:
         os.mkdir(self.jobStoreDir)
         os.mkdir(self.tempFilesDir)  
     #Parameters for creating temporary files
     self.validDirs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
     self.levels = 2
     super( FileJobStore, self ).__init__( config=config )
Esempio n. 10
0
 def __init__(self, jobStoreDir, config=None):
     """
     :param jobStoreDir: Place to create jobStore
     :param config: See jobStores.abstractJobStore.AbstractJobStore.__init__
     :raise RuntimeError: if config != None and the jobStore already exists or
     config == None and the jobStore does not already exists. 
     """
     # This is root directory in which everything in the store is kept
     self.jobStoreDir = absSymPath(jobStoreDir)
     logger.info("Jobstore directory is: %s", self.jobStoreDir)
     # Safety checks for existing jobStore
     self._checkJobStoreCreation(create=config is not None,
                                 exists=os.path.exists(self.jobStoreDir),
                                 jobStoreString=self.jobStoreDir)
     # Directory where temporary files go
     self.tempFilesDir = os.path.join(self.jobStoreDir, "tmp")
     # Creation of jobStore, if necessary
     if config is not None:
         os.mkdir(self.jobStoreDir)
         os.mkdir(self.tempFilesDir)
     # Parameters for creating temporary files
     self.validDirs = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
     self.levels = 2
     super(FileJobStore, self).__init__(config=config)
Esempio n. 11
0
 def __init__(self, path):
     """
     :param str path: Path to directory holding the job store
     """
     self.jobStoreDir = absSymPath(path)
     logger.debug("Path to job store directory is '%s'.", self.jobStoreDir)