def setup_class(cls): """Setup Parameters""" if 'S3_ENDPOINT' in dir(settings): cls.endpoint_url = settings.S3_ENDPOINT else: cls.endpoint_url = None TileBucket.createBucket(endpoint_url=cls.endpoint_url) cls.tile_bucket = TileBucket(nd_proj.project_name, endpoint_url=cls.endpoint_url)
def setup_class(self): """Setup class parameters""" # create the tile index table. skip if it exists try: TileIndexDB.createTable(endpoint_url="http://localhost:8000") CuboidIndexDB.createTable(endpoint_url="http://localhost:8000") except Exception as e: pass self.tileindex_db = TileIndexDB(nd_proj.project_name, endpoint_url="http://localhost:8000") # create the tile bucket TileBucket.createBucket(endpoint_url="http://localhost:4567") self.tile_bucket = TileBucket(nd_proj.project_name, endpoint_url="http://localhost:4567") self.tiles = [self.x_tile, self.y_tile, self.z_tile] = [0, 0, 0] message_id = "testing" receipt_handle = "123456" # insert SUPER_CUBOID_SIZE tiles in the bucket for z_index in (self.z_tile, settings.SUPER_CUBOID_SIZE[2], 1): tile_handle = cStringIO.StringIO() self.tile_bucket.putObject( tile_handle, nd_proj.channel_name, nd_proj.resolution, self.x_tile, self.y_tile, z_index, message_id, receipt_handle, ) # creating the cuboid bucket CuboidBucket.createBucket(endpoint_url="http://localhost:4567") self.cuboid_bucket = CuboidBucket(nd_proj.project_name, endpoint_url="http://localhost:4567") # create the ingest queue IngestQueue.createQueue(nd_proj, endpoint_url="http://localhost:4568") self.ingest_queue = IngestQueue(nd_proj, endpoint_url="http://localhost:4568") # send message to the ingest queue morton_index = XYZMorton(self.tiles) supercuboid_key = self.cuboid_bucket.generateSupercuboidKey( nd_proj.channel_name, nd_proj.resolution, morton_index) response = self.ingest_queue.sendMessage(supercuboid_key) # create the cleanup queue CleanupQueue.createQueue(nd_proj, endpoint_url="http://localhost:4568")
def setUpClass(cls): # Silence warnings about open boto3 sessions. warnings.filterwarnings('ignore') cls.job_id = 123 cls.nd_proj = BossIngestProj('testCol', 'kasthuri11', 'image', 0, cls.job_id) TileBucket.createBucket() cls.tile_bucket = TileBucket(cls.nd_proj.project_name) warnings.simplefilter('ignore') #with open('/Users/manavpj1/repos/boss/django/bossingest/test/boss_tile_index.json') as fp: # schema = json.load(fp) #BossTileIndexDB.createTable(schema, endpoint_url=settings.DYNAMO_TEST_ENDPOINT) cls.tileindex_db = BossTileIndexDB( cls.nd_proj.project_name, endpoint_url=settings.DYNAMO_TEST_ENDPOINT)
def tile_bucket(s3, iam): from ndingest.ndbucket.tilebucket import TileBucket TileBucket.createBucket() yield TileBucket(nd_proj.project_name) TileBucket.deleteBucket()