Skip to content

Commit

Permalink
remove logger; remove fill_missing flag since there is no image outsi…
Browse files Browse the repository at this point in the history
…de of the volume bounds
  • Loading branch information
xiuliren committed Jan 21, 2019
1 parent 6f147a7 commit 5127aec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 8 additions & 5 deletions igneous/task_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from taskqueue import TaskQueue

from igneous import EmptyVolumeException
from igneous import logger
#from igneous import logger

from igneous.secrets import QUEUE_NAME, QUEUE_TYPE, SQS_URL, LEASE_SECONDS

Expand Down Expand Up @@ -78,16 +78,19 @@ def execute(tag, queue, server, qurl, loop):
task.execute()
print("delete task in queue...")
tq.delete(task)
logger.log('INFO', task , "succesfully executed")
#logger.log('INFO', task , "succesfully executed")
print("successfully executed")
tries = 0
except TaskQueue.QueueEmpty:
time.sleep(random_exponential_window_backoff(tries))
continue
except EmptyVolumeException:
logger.log('WARNING', task, "raised an EmptyVolumeException")
tq.delete(task)
#logger.log('WARNING', task, "raised an EmptyVolumeException")
print('raised an EmptyVolumeException')
raise
#tq.delete(task)
except Exception as e:
logger.log('ERROR', task, "raised {}\n {}".format(e , traceback.format_exc()))
#logger.log('ERROR', task, "raised {}\n {}".format(e , traceback.format_exc()))
raise #this will restart the container in kubernetes
if (not loop) or (not LOOP):
print("not in loop mode, will break the loop and exit")
Expand Down
8 changes: 4 additions & 4 deletions igneous/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,8 @@ def _mask_output(self):
assert np.any(self.output)

def _read_image(self):
self.image_vol = CloudVolume(self.image_layer_path, bounded=False,
fill_missing=False, progress=True,
self.image_vol = CloudVolume(self.image_layer_path, bounded=True,
fill_missing=True, progress=True,
mip=self.image_mip, parallel=False)
output_slices = self.output_bounds.to_slices()
self.input_slices = tuple(slice(s.start - m, s.stop + m) for s, m in
Expand Down Expand Up @@ -1422,8 +1422,8 @@ def _validate_image(self):
content_type='application/json')
raise Exception("detected a black box by template matching!")

validate_vol = CloudVolume(self.image_layer_path, bounded=False,
fill_missing=False, progress=True,
validate_vol = CloudVolume(self.image_layer_path, bounded=True,
fill_missing=True, progress=True,
mip=self.image_validate_mip, parallel=False)
validate_image = validate_vol[validate_bbox.to_slices()]
assert validate_image.shape[3] == 1
Expand Down

0 comments on commit 5127aec

Please sign in to comment.