コード例 #1
0
 def _hashTestFile(self, url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     contents = uri.get_contents_as_string(headers=self.headers)
     return hashlib.md5(contents).hexdigest()
コード例 #2
0
ファイル: jobStoreTest.py プロジェクト: broadinstitute/toil
 def _cleanUpExternalStore(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     uri = boto.storage_uri(uri)
     headers = {"x-goog-project-id": projectID}
     bucket = uri.get_bucket(headers=headers, validate=True)
     if bucket is not None:
         while True:
             for key in bucket.list():
                 try:
                     key.delete()
                 except boto.exception.GSResponseError as e:
                     if e.status == 404:
                         pass
                     else:
                         raise e
             try:
                 uri.delete_bucket()
             except boto.exception.GSResponseError as e:
                     if e.status == 404:
                         break
                     else:
                         continue
コード例 #3
0
 def _createExternalStore(self):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     uriString = "gs://import-export-test-%s" % str(uuid.uuid4())
     uri = boto.storage_uri(uriString)
     return GoogleJobStore._retryCreateBucket(uri=uri, headers=self.headers)
コード例 #4
0
 def _createJobStore(self):
     from toil.jobStores.googleJobStore import GoogleJobStore
     return GoogleJobStore.initialize(GoogleJobStoreTest.projectID + ":" + self.namePrefix)
コード例 #5
0
ファイル: jobStoreTest.py プロジェクト: anukat2015/toil
 def _createJobStore(self, config=None):
     from toil.jobStores.googleJobStore import GoogleJobStore
     return GoogleJobStore.createJobStore(self.namePrefix + ":" + GoogleJobStoreTest.projectID,
                                          config=config)
コード例 #6
0
ファイル: jobStoreTest.py プロジェクト: broadinstitute/toil
 def _hashUrl(url):
     import boto
     from toil.jobStores.googleJobStore import GoogleJobStore
     projectID, uri = GoogleJobStore._getResources(urlparse.urlparse(url))
     return hashlib.md5(boto.storage_uri(uri).get_contents_as_string(headers=GoogleJobStoreTest.headers)).hexdigest()