Commit fe333fa2 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added 'is_test' attribute to config.Job; revised requirements.txt


Former-commit-id: ceef5c7b
parent c2aa97d0
......@@ -62,8 +62,9 @@ GMS_config = GMS_configuration()
class Job:
def __init__(self, call_type, ID, exec_mode='Python', db_host='localhost', exec_L1AP=None, exec_L1BP=None,
exec_L1CP=None, exec_L2AP=None, exec_L2BP=None, exec_L2CP=None, CPUs=None, sub_multiProc=True,
exc_handler=True, log_level='INFO', blocksize=(2048,2048), profiling=False, bench_all=False,
bench_cloudMask=False, path_procdata_scenes=None, path_procdata_MGRS=None, path_archive=None):
exc_handler=True, log_level='INFO', blocksize=(2048,2048), is_test=False, profiling=False,
bench_all=False, bench_cloudMask=False, path_procdata_scenes=None, path_procdata_MGRS=None,
path_archive=None):
"""Create a job configuration
......@@ -84,6 +85,7 @@ class Job:
:param log_level: the logging level to be used (choices: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL';
default: 'INFO')
:param blocksize: X/Y block size to be used for any tiling process (default: (2048,2048)
:param is_test: whether the curent job represents a test job (run by a test runner) or not (default=False)
:param profiling: enable/disable code profiling (default: False)
:param bench_all: enable/disable benchmark of the whole processing pipeline
:param bench_cloudMask: enable/disable benchmark of the of the cloud mask generator module
......@@ -115,6 +117,7 @@ class Job:
self.disable_exception_handler = exc_handler is False
self.log_level = log_level
self.tiling_block_size_XY = blocksize
self.is_test = is_test
self.profiling = profiling
self.benchmark_global = bench_all
self.bench_CLD_class = bench_cloudMask
......
......@@ -22,13 +22,14 @@ def check_dependencies(logger=None):
javaLibs = []
# check if spatial index mediator is running
SpatIdxSrv = SpatialIndexMediatorServer(CFG.job.path_spatIdxSrv)
if not SpatIdxSrv.is_running:
SpatIdxSrv.start()
_log_or_print('Spatial Index Mediator Server started successfully.', logger.info)
if not SpatIdxSrv.is_running:
_log_or_print('Attempt to start Spatial Index Mediator Server failed.', logger.info)
if not CFG.job.is_test:
SpatIdxSrv = SpatialIndexMediatorServer(CFG.job.path_spatIdxSrv)
if not SpatIdxSrv.is_running:
SpatIdxSrv.start()
_log_or_print('Spatial Index Mediator Server started successfully.', logger.info)
if not SpatIdxSrv.is_running:
_log_or_print('Attempt to start Spatial Index Mediator Server failed.', logger.info)
def check_paths():
# check existance of database paths, etc.
......
......@@ -81,7 +81,8 @@ class Test_Landsat8_PreCollectionDataNew(BaseTestCases.TestAll):
job_config_kwargs = dict(
path_archive = os.path.join(gmsRepo_rootpath, 'tests', 'data', 'archive_data'),
path_procdata_scenes = os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_scenes'),
path_procdata_MGRS = os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'))
path_procdata_MGRS = os.path.join(gmsRepo_rootpath, 'tests', 'data', 'output_mgrs_tiles'),
is_test = True)
cls.PC = process_controller(26186196, parallelization_level='scenes', db_host='geoms', delete_old_output=True,
job_config_kwargs=job_config_kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment