diff --git a/cache/run-seeder.sh b/cache/run-seeder.sh index d7855841ee5d8508887b011ccd00add5813e2538..53f789d7902beb5e31c6dcb30ab639130f8bf494 100644 --- a/cache/run-seeder.sh +++ b/cache/run-seeder.sh @@ -4,4 +4,4 @@ echo "Running seeder" -python3 /seeder.py ${COLLECTION} --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-queue-key ${REDIS_QUEUE_KEY} +python3 /seeder.py --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-queue-key ${REDIS_QUEUE_KEY} diff --git a/cache/seeder.py b/cache/seeder.py index dd7371431a0763440f171d0a29ef7008f4c1ed08..d023dba3d0da8908842eee1814056be4db1f5da3 100644 --- a/cache/seeder.py +++ b/cache/seeder.py @@ -44,12 +44,6 @@ import sqlite3 import boto3 -# collection: -COLLECTION_MAP = { - # TODO -} - - logger = logging.getLogger(__name__) @@ -224,12 +218,6 @@ if __name__ == "__main__": Pre-seeds cache of PRISM View Server (pvs). """) - parser.add_argument( - "collection", default=None, - help=( - "Collection the seeder is run for." - ) - ) parser.add_argument( "--mode", default="standard", choices=["standard", "redis"], help=( @@ -278,9 +266,9 @@ if __name__ == "__main__": setup_logging(arg_values.verbosity) - collection = arg_values.collection - if collection not in COLLECTION_MAP: - logger.critical("Provided collection '%s' is not valid." % collection) + collection = os.environ.get('Collection') + if collection is None: + logger.critical("Collection environment variable not set.") sys.exit(1) if arg_values.mode == "standard": diff --git a/core/registrar.py b/core/registrar.py index a774a1d501fe24cbb537c0ff4e7701e5a952bc42..776e0311d745bdfb0d79d5c95625e147d60ee89a 100644 --- a/core/registrar.py +++ b/core/registrar.py @@ -60,13 +60,6 @@ from eoxserver.resources.coverages.registration.registrators.gdal import ( GDALRegistrator ) - -# collection: [name] -COLLECTION_MAP = { - "VHR_IMAGE_2018": ["VHR IMAGE 2018", ], - "Emergency": ["Emergency", ], -} - logger = logging.getLogger(__name__) @@ -275,13 +268,6 @@ if __name__ == "__main__": Register products. """) - parser.add_argument( - "collection", default=None, - help=( - "Collection the registrar is run for." - ) - ) - parser.add_argument( "--mode", default="standard", choices=["standard", "redis"], help=( @@ -326,10 +312,9 @@ if __name__ == "__main__": setup_logging(arg_values.verbosity) - collection = arg_values.collection - - if collection not in COLLECTION_MAP: - logger.critical("Provided collection '%s' is not valid." % collection) + collection = os.environ.get('Collection') + if collection is None: + logger.critical("Collection environment variable not set.") sys.exit(1) upload_container = os.environ.get('UPLOAD_CONTAINER') diff --git a/core/run-registrar.sh b/core/run-registrar.sh index c00cb49c4bfc329eeb0c987dda3e2970e174417b..ba8d1e9ed748f47db2b7772f4edb3f60cdf81314 100644 --- a/core/run-registrar.sh +++ b/core/run-registrar.sh @@ -2,4 +2,4 @@ echo "Running registrar" - python3 /registrar.py ${COLLECTION} --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-register-queue-key ${REDIS_REGISTER_QUEUE_KEY} --redis-registered-set-key ${REDIS_REGISTERED_SET_KEY} + python3 /registrar.py --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-register-queue-key ${REDIS_REGISTER_QUEUE_KEY} --redis-registered-set-key ${REDIS_REGISTERED_SET_KEY} diff --git a/preprocessor/get_min_max.py b/preprocessor/get_min_max.py index 01936532f43c3966fcdd7ed09928e747a3a38477..a9ef3aa181b53eaf753f27cb6da99104d4722e67 100644 --- a/preprocessor/get_min_max.py +++ b/preprocessor/get_min_max.py @@ -41,11 +41,6 @@ import re from swiftclient.service import SwiftError, SwiftService -# collection: [name] -COLLECTION_MAP = { - "VHR_IMAGE_2018": ["VHR IMAGE 2018", ], -} - logger = logging.getLogger(__name__) @@ -146,13 +141,6 @@ if __name__ == "__main__": Get min/max of products. """) - parser.add_argument( - "collection", default=None, - help=( - "Collection the registrar is run for." - ) - ) - parser.add_argument( "-v", "--verbosity", type=int, default=3, choices=[0, 1, 2, 3, 4], help=( @@ -165,9 +153,9 @@ if __name__ == "__main__": setup_logging(arg_values.verbosity) - collection = arg_values.collection - if collection not in COLLECTION_MAP: - logger.critical("Provided collection '%s' is not valid." % collection) + collection = os.environ.get('Collection') + if collection is None: + logger.critical("Collection environment variable not set.") sys.exit(1) get_min_max( diff --git a/preprocessor/preprocessor.py b/preprocessor/preprocessor.py index 62d964dbb827404b728a81391227fb85fe45897a..9894bbad077b66162a1648fd62f5818ac664f08f 100644 --- a/preprocessor/preprocessor.py +++ b/preprocessor/preprocessor.py @@ -46,11 +46,6 @@ from swiftclient.service import SwiftError, SwiftService, SwiftUploadObject import transform_chain -# collection: [name] -COLLECTION_MAP = { - "VHR_IMAGE_2018": ["VHR IMAGE 2018", ], - "Emergency": ["Emergency", ], -} SPLIT_PARTS_CHECK = os.environ.get('SPLIT_PARTS_CHECK') ENFORCE_FOUR_BANDS = os.environ.get('ENFORCE_FOUR_BANDS') @@ -341,12 +336,6 @@ if __name__ == "__main__": Preprocess product data. """) - parser.add_argument( - "collection", default=None, - help=( - "Collection the preprocessor is run for." - ) - ) parser.add_argument( "--mode", default="standard", choices=["standard", "redis"], help=( @@ -391,9 +380,9 @@ if __name__ == "__main__": setup_logging(arg_values.verbosity) - collection = arg_values.collection - if collection not in COLLECTION_MAP: - logger.critical("Provided collection '%s' is not valid." % collection) + collection = os.environ.get('Collection') + if collection is None: + logger.critical("Collection environment variable not set.") sys.exit(1) upload_container = os.environ.get('UPLOAD_CONTAINER') diff --git a/preprocessor/run-preprocessor.sh b/preprocessor/run-preprocessor.sh index c80fe467b83be80e46545787f4d89606da46787f..7ae857f3b9a6beb9a8c5197115df75da76380ab3 100644 --- a/preprocessor/run-preprocessor.sh +++ b/preprocessor/run-preprocessor.sh @@ -2,4 +2,4 @@ echo "Running preprocessor" -python3 /preprocessor.py ${COLLECTION} --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-preprocess-queue-key ${REDIS_PREPROCESS_QUEUE_KEY} --redis-register-queue-key ${REDIS_REGISTER_QUEUE_KEY} +python3 /preprocessor.py --mode redis --redis-host ${REDIS_HOST} --redis-port ${REDIS_PORT} --redis-preprocess-queue-key ${REDIS_PREPROCESS_QUEUE_KEY} --redis-register-queue-key ${REDIS_REGISTER_QUEUE_KEY}