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

Added auto-deletion of previously created test job output.

Former-commit-id: f8e508e5
Former-commit-id: fc301120
parent 8843472e
......@@ -32,7 +32,9 @@ from ..misc.definition_dicts import proc_chain, db_jobs_statistics_def
class process_controller(object):
def __init__(self, job_ID, call_type='webapp', exec_mode='Python', db_host='localhost',
parallelization_level='scenes'):
parallelization_level='scenes', delete_old_output=False):
# type: (int, str, str, str, str, bool) -> None
"""GeoMultiSens Process Controller
:param job_ID: <int> a job ID belonging to a valid database record within table 'jobs'
......@@ -42,6 +44,8 @@ class process_controller(object):
:param db_host: <str> hostname of the host where database is hosted
:param parallelization_level: <str> choices: 'scenes' - parallelization on scene-level
'tiles' - parallelisation on tile-level
:param delete_old_output: <bool> whether to delete previously created output of the given job ID
before running the job (default = False)
"""
# assertions
......@@ -86,8 +90,9 @@ class process_controller(object):
self.logger.info('Process Controller initialized for job ID %s (comment: %s).'
% (self.job.ID, self.DB_job_record.comment))
#self.logger.info('Deleting previously processed data...')
#self.DB_job_record.delete_procdata_of_entire_job(force=True) # TODO make this optional
if delete_old_output:
self.logger.info('Deleting previously processed data...')
self.DB_job_record.delete_procdata_of_entire_job(force=True)
@property
......
......@@ -33,7 +33,7 @@ RUN /bin/bash -i -c "source /root/anaconda3/bin/activate ; \
#COPY *.pkl /root/ # EXAMPLE
#COPY *.h5 /root/ # EXAMPLE
# copy py_tools_ds, geoarray, arosics ans sicor code to /tmp
# copy py_tools_ds, geoarray, arosics and sicor code to /tmp
COPY py_tools_ds /tmp/py_tools_ds
COPY geoarray /tmp/geoarray
COPY arosics /tmp/arosics
......
......@@ -76,7 +76,7 @@ class BaseTestCases:
class Test_Landsat8_PreCollectionData(BaseTestCases.TestAll):
@classmethod
def setUpClass(cls):
cls.PC = process_controller(26186196, parallelization_level='scenes', db_host='geoms')
cls.PC = process_controller(26186196, parallelization_level='scenes', db_host='geoms', delete_old_output=True)
[cls.PC.add_local_availability(ds) for ds in cls.PC.usecase.data_list]
[cls.validate_db_entry(ds['filename']) for ds in cls.PC.usecase.data_list]
......@@ -85,7 +85,7 @@ class Test_Landsat8_PreCollectionData(BaseTestCases.TestAll):
class Test_Sentinel2A(BaseTestCases.TestAll):
@classmethod
def setUpClass(cls):
cls.PC = process_controller(26185761, parallelization_level='scenes', db_host='geoms') # FIXME This job ID does not belong to a test dataset!
cls.PC = process_controller(26185761, parallelization_level='scenes', db_host='geoms', delete_old_output=True) # FIXME This job ID does not belong to a test dataset!
[cls.PC.add_local_availability(ds) for ds in cls.PC.usecase.data_list]
[cls.validate_db_entry(ds['filename']) for ds in cls.PC.usecase.data_list]
......
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