From b68ba3121b9309e33f05831d8cfe956e6ccc897a Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Tue, 1 Oct 2019 00:14:58 +0200 Subject: [PATCH 1/4] Renaming of remaining GRaaS/graas to actinia --- Makefile | 14 +++++----- docs/conf.py | 2 +- scripts/actinia-bench | 8 +++--- scripts/rq_starter | 2 +- src/actinia_core/resources/common/config.py | 6 ++--- src/actinia_core/testsuite.py | 30 ++++++++++----------- tests/test_common_base.py | 24 ++++++++--------- tests/test_configuration.py | 2 +- tests/test_resource_base.py | 22 +++++++-------- 9 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index cc92cba8c..ce0fd5953 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,22 @@ # Makefile to run setup.py clean: - python setup.py clean + python3 setup.py clean docs: - python setup.py docs + python3 setup.py docs build: - python setup.py build + python3 setup.py build install: - python setup.py install + python3 setup.py install bdist: - python setup.py bdist + python3 setup.py bdist dist: - python setup.py dist + python3 setup.py dist test: - python setup.py test + python3 setup.py test diff --git a/docs/conf.py b/docs/conf.py index 1b8c269a2..06fe05455 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -150,7 +150,7 @@ # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". try: - from graas_api import __version__ as version + from actinia_api import __version__ as version except ImportError: pass else: diff --git a/scripts/actinia-bench b/scripts/actinia-bench index 5a4b1300b..4861fbcc3 100755 --- a/scripts/actinia-bench +++ b/scripts/actinia-bench @@ -238,7 +238,7 @@ SENTINEL_NDVI={ def main(): - parser = argparse.ArgumentParser(description='Run a simple benchmark on a GRaaS Service '\ + parser = argparse.ArgumentParser(description='Run a simple benchmark on a actinia Service '\ 'based on the north carolina dataset. '\ 'Example: actinia-bench -s http://127.0.0.1:80 -u soeren -p 12345678 -r 8 -t long', formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -247,7 +247,7 @@ def main(): type=str, default="http://127.0.0.1:8080/api/v1", required=False, - help="The hostname:port of the GRaaS server") + help="The hostname:port of the actinia server") parser.add_argument("-u", "--user_id", default="superadmin", @@ -339,12 +339,12 @@ def main(): def start_query_processing_async_export(base_url, auth, q, id, type, polling): - """Start an asynchronous GRaaS process and poll until its finished + """Start an asynchronous actinia process and poll until its finished This function is the argument for multiprocessing.Process Args: - base_url (str): The base URL of the GRaaS Server + base_url (str): The base URL of the actinia Server auth (tuple): Username and password as tuple q (multiprocessing.Queue): The queue to store the processing time in id (int): The id of the request diff --git a/scripts/rq_starter b/scripts/rq_starter index de15ef888..a4fa87704 100755 --- a/scripts/rq_starter +++ b/scripts/rq_starter @@ -76,7 +76,7 @@ def kill_all_workers(): def main(): parser = argparse.ArgumentParser(description='Start all Actinia Core custom worker listening to a specific queue' - 'that are specified in the GRaaS configuration file ' + 'that are specified in the actinia configuration file ' 'or in a configuration file specified as an optional path.') parser.add_argument("-c", "--config", type=str, required=False, diff --git a/src/actinia_core/resources/common/config.py b/src/actinia_core/resources/common/config.py index 47e8158b7..c8a36b7fe 100644 --- a/src/actinia_core/resources/common/config.py +++ b/src/actinia_core/resources/common/config.py @@ -84,12 +84,12 @@ def __init__(self): self.GRASS_TMP_DATABASE = "%s/actinia/workspace/temp_db" % home # The directory to store temporary GRASS databases self.GRASS_RESOURCE_DIR = "%s/actinia/resources" % home # Directory to store exported resources self.GRASS_RESOURCE_QUOTA = 100 # The size quota of the resource storage in Gigibit - self.GRASS_GIS_BASE = "/usr/local/grass-7.8.dev" # Installation directory of GRASS - self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass78" + self.GRASS_GIS_BASE = "/usr/local/grass79/" # Installation directory of GRASS + self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass79" self.GRASS_ADDON_PATH = "%s/.grass7/addons/" % home self.GRASS_MODULES_XML_PATH = os.path.join(self.GRASS_GIS_BASE, "gui", "wxpython", "xml", "module_items.xml") self.GRASS_VENV = "%s/src/actinia/grass_venv/bin/activate_this.py" % home # The path to the activation - # script of the python2 venv + # script of the python2 venv (old) # DEFAULT LIMITS when a user is created self.MAX_CELL_LIMIT = 1000 * 1000 * 1000 # Maximum number of cells that are allowed to process diff --git a/src/actinia_core/testsuite.py b/src/actinia_core/testsuite.py index a44c7eade..bfee4b9f8 100644 --- a/src/actinia_core/testsuite.py +++ b/src/actinia_core/testsuite.py @@ -4,7 +4,7 @@ # performance processing of geographical data that uses GRASS GIS for # computational tasks. For details, see https://actinia.mundialis.de/ # -# Copyright (c) 2016-2018 Sören Gebbert and mundialis GmbH & Co. KG +# Copyright (c) 2016-2019 Sören Gebbert and mundialis GmbH & Co. KG # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -55,10 +55,10 @@ class ActiniaRequests(object): by adding data and mimetype. """ # The default server is the localhost - graas_server = "http://127.0.0.1:5000" + actinia_server = "http://127.0.0.1:5000" # Check for an environmental variable to set the hostname http://IP:PORT - if "GRAAS_SERVER" in os.environ: - graas_server = str(os.environ["GRAAS_SERVER"]) + if "ACTINIA_SERVER" in os.environ: + actinia_server = str(os.environ["ACTINIA_SERVER"]) def _make_flask_response(self, resp): """Take care of the mimetype to avoid r.text to take forever to parse @@ -85,7 +85,7 @@ def _request(self, url, method, **kargs): del kargs["content_type"] if "http" not in url: - server_url = self.graas_server + url + server_url = self.actinia_server + url else: server_url = url @@ -119,7 +119,7 @@ class ActiniaTestCaseBase(unittest.TestCase): """Base class for GRASS GIS REST API tests """ server_test = False - custom_graas_cfg = False + custom_actinia_cfg = False guest = None user = None admin = None @@ -127,16 +127,16 @@ class ActiniaTestCaseBase(unittest.TestCase): auth_header = {} users_list = [] - if "GRAAS_SERVER_TEST" in os.environ: - server_test = bool(os.environ["GRAAS_SERVER_TEST"]) + if "ACTINIA_SERVER_TEST" in os.environ: + server_test = bool(os.environ["ACTINIA_SERVER_TEST"]) - if "GRAAS_CUSTOM_TEST_CFG" in os.environ: - custom_graas_cfg = str(os.environ["GRAAS_CUSTOM_TEST_CFG"]) + if "ACTINIA_CUSTOM_TEST_CFG" in os.environ: + custom_actinia_cfg = str(os.environ["ACTINIA_CUSTOM_TEST_CFG"]) @classmethod def setUpClass(cls): - if cls.server_test is False and cls.custom_graas_cfg is False: + if cls.server_test is False and cls.custom_actinia_cfg is False: global_config.REDIS_SERVER_SERVER = "localhost" global_config.REDIS_SERVER_PORT = 7000 global_config.GRASS_RESOURCE_DIR = "/tmp" @@ -150,10 +150,10 @@ def setUpClass(cls): # global_config.NUMBER_OF_WORKERS) - # If the custom_graas_cfg variable is set, then the graas config file will be read + # If the custom_actinia_cfg variable is set, then the actinia config file will be read # to configure Redis queue - if cls.server_test is False and cls.custom_graas_cfg is not False: - global_config.read(cls.custom_graas_cfg) + if cls.server_test is False and cls.custom_actinia_cfg is not False: + global_config.read(cls.custom_actinia_cfg) # Create the job queue # redis_interface.create_job_queues(global_config.REDIS_QUEUE_SERVER_URL, @@ -255,7 +255,7 @@ def waitAsyncStatusAssertHTTP(self, response, headers, http_status=200, status=" The response will be checked if the resource was accepted. Hence it must always be HTTP 200 status. The status URL from the response is then polled until status: finished, error or terminated. - The result of the poll can be checked against its HTTP status and its GRaaS status message. + The result of the poll can be checked against its HTTP status and its actinia status message. Args: response: The accept response diff --git a/tests/test_common_base.py b/tests/test_common_base.py index e4d7a1572..4c94bf344 100644 --- a/tests/test_common_base.py +++ b/tests/test_common_base.py @@ -40,18 +40,18 @@ __email__ = "soerengebbert@googlemail.com" redis_pid = None -custom_graas_cfg = False +custom_actinia_cfg = False -# Set this variable to use a graas config file in a docker container -if "GRAAS_CUSTOM_TEST_CFG" in os.environ: - custom_graas_cfg = str(os.environ["GRAAS_CUSTOM_TEST_CFG"]) +# Set this variable to use a actinia config file in a docker container +if "ACTINIA_CUSTOM_TEST_CFG" in os.environ: + custom_actinia_cfg = str(os.environ["ACTINIA_CUSTOM_TEST_CFG"]) def setup_environment(): # If docker config - if custom_graas_cfg is not False: - global_config.read(custom_graas_cfg) + if custom_actinia_cfg is not False: + global_config.read(custom_actinia_cfg) return global redis_pid @@ -64,10 +64,10 @@ def setup_environment(): # GRASS # Setup the test environment - global_config.GRASS_GIS_BASE="/usr/local/grass-7.8.dev" - global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass78" + global_config.GRASS_GIS_BASE="/usr/local/grass79/" + global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass79" # global_config.GRASS_DATABASE= "/usr/local/grass_test_db" - # global_config.GRASS_DATABASE = "%s/graas/grass_test_db" % home + # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home # Start the redis server for user and logging management redis_pid = os.spawnl(os.P_NOWAIT, "/usr/bin/redis-server", @@ -79,7 +79,7 @@ def setup_environment(): def stop_redis(): global redis_pid # Kill th redis server - if custom_graas_cfg is not False: + if custom_actinia_cfg is not False: return os.kill(redis_pid, signal.SIGTERM) @@ -96,8 +96,8 @@ class CommonTestCaseBase(unittest.TestCase): @classmethod def setUpClass(cls): - if custom_graas_cfg is not False: - global_config.read(custom_graas_cfg) + if custom_actinia_cfg is not False: + global_config.read(custom_actinia_cfg) print(global_config) else: global_config.REDIS_SERVER_URL = "localhost" diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 9a0a66ee6..dae074b83 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -39,7 +39,7 @@ class ConfigurationTestCase(unittest.TestCase): of a user entry in a Redis database """ - file_name = "/tmp/graas_test.cfg" + file_name = "/tmp/actinia_test.cfg" def test_change_loglevel(self): diff --git a/tests/test_resource_base.py b/tests/test_resource_base.py index cf1a6e0e5..76f798317 100644 --- a/tests/test_resource_base.py +++ b/tests/test_resource_base.py @@ -43,15 +43,15 @@ redis_pid = None server_test = False -custom_graas_cfg = False +custom_actinia_cfg = False # If this environmental variable is set, then a real http request will be send # instead of using the flask test_client. -if "GRAAS_SERVER_TEST" in os.environ: - server_test = bool(os.environ["GRAAS_SERVER_TEST"]) -# Set this variable to use a graas config file in a docker container -if "GRAAS_CUSTOM_TEST_CFG" in os.environ: - custom_graas_cfg = str(os.environ["GRAAS_CUSTOM_TEST_CFG"]) +if "ACTINIA_SERVER_TEST" in os.environ: + server_test = bool(os.environ["ACTINIA_SERVER_TEST"]) +# Set this variable to use a actinia config file in a docker container +if "ACTINIA_CUSTOM_TEST_CFG" in os.environ: + custom_actinia_cfg = str(os.environ["ACTINIA_CUSTOM_TEST_CFG"]) def setup_environment(): @@ -60,7 +60,7 @@ def setup_environment(): global_config.REDIS_SERVER_SERVER = "localhost" global_config.REDIS_SERVER_PORT = 7000 # Set the path to redis WORKER_LOGFILE - # global_config.WORKER_LOGFILE = "/var/log/redis/redis" + global_config.WORKER_LOGFILE = "/var/log/redis/redis" # home = os.getenv("HOME") @@ -69,18 +69,18 @@ def setup_environment(): global_config.GRASS_GIS_BASE="/usr/local/grass79/" global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass79" # global_config.GRASS_DATABASE= "/usr/local/grass_test_db" - # global_config.GRASS_DATABASE = "%s/graas/grass_test_db" % home + # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home global_config.GRASS_TMP_DATABASE = "/tmp" - if server_test is False and custom_graas_cfg is False: + if server_test is False and custom_actinia_cfg is False: # Start the redis server for user and logging management redis_pid = os.spawnl(os.P_NOWAIT, "/usr/bin/redis-server", "common/redis.conf", "--port %i" % global_config.REDIS_SERVER_PORT) time.sleep(1) - if server_test is False and custom_graas_cfg is not False: - global_config.read(custom_graas_cfg) + if server_test is False and custom_actinia_cfg is not False: + global_config.read(custom_actinia_cfg) def stop_redis(): From fde30572bf0b63cc6b49cd0bd923300e2f4a63ff Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Tue, 1 Oct 2019 00:18:40 +0200 Subject: [PATCH 2/4] Update tests/test_resource_base.py --- tests/test_resource_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_resource_base.py b/tests/test_resource_base.py index 76f798317..f8fdebec9 100644 --- a/tests/test_resource_base.py +++ b/tests/test_resource_base.py @@ -60,7 +60,7 @@ def setup_environment(): global_config.REDIS_SERVER_SERVER = "localhost" global_config.REDIS_SERVER_PORT = 7000 # Set the path to redis WORKER_LOGFILE - global_config.WORKER_LOGFILE = "/var/log/redis/redis" + # global_config.WORKER_LOGFILE = "/var/log/redis/redis" # home = os.getenv("HOME") From f62548464f3bf9a37373e998487e672b27f8d3b4 Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Sun, 6 Oct 2019 20:46:25 +0200 Subject: [PATCH 3/4] G79 -> G78 --- src/actinia_core/resources/common/config.py | 4 ++-- tests/test_common_base.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/actinia_core/resources/common/config.py b/src/actinia_core/resources/common/config.py index c8a36b7fe..554e08056 100644 --- a/src/actinia_core/resources/common/config.py +++ b/src/actinia_core/resources/common/config.py @@ -84,8 +84,8 @@ def __init__(self): self.GRASS_TMP_DATABASE = "%s/actinia/workspace/temp_db" % home # The directory to store temporary GRASS databases self.GRASS_RESOURCE_DIR = "%s/actinia/resources" % home # Directory to store exported resources self.GRASS_RESOURCE_QUOTA = 100 # The size quota of the resource storage in Gigibit - self.GRASS_GIS_BASE = "/usr/local/grass79/" # Installation directory of GRASS - self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass79" + self.GRASS_GIS_BASE = "/usr/local/grass78/" # Installation directory of GRASS + self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass78" self.GRASS_ADDON_PATH = "%s/.grass7/addons/" % home self.GRASS_MODULES_XML_PATH = os.path.join(self.GRASS_GIS_BASE, "gui", "wxpython", "xml", "module_items.xml") self.GRASS_VENV = "%s/src/actinia/grass_venv/bin/activate_this.py" % home # The path to the activation diff --git a/tests/test_common_base.py b/tests/test_common_base.py index 4c94bf344..e3b88b095 100644 --- a/tests/test_common_base.py +++ b/tests/test_common_base.py @@ -64,8 +64,8 @@ def setup_environment(): # GRASS # Setup the test environment - global_config.GRASS_GIS_BASE="/usr/local/grass79/" - global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass79" + global_config.GRASS_GIS_BASE="/usr/local/grass78/" + global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass78" # global_config.GRASS_DATABASE= "/usr/local/grass_test_db" # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home From 945856d77edc550c0bc5539ca06d69874470f004 Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Sun, 6 Oct 2019 21:00:18 +0200 Subject: [PATCH 4/4] grass79 -> grass78 --- src/actinia_core/resources/common/config.py | 4 ++-- tests/test_common_base.py | 4 ++-- tests/test_resource_base.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/actinia_core/resources/common/config.py b/src/actinia_core/resources/common/config.py index c8a36b7fe..554e08056 100644 --- a/src/actinia_core/resources/common/config.py +++ b/src/actinia_core/resources/common/config.py @@ -84,8 +84,8 @@ def __init__(self): self.GRASS_TMP_DATABASE = "%s/actinia/workspace/temp_db" % home # The directory to store temporary GRASS databases self.GRASS_RESOURCE_DIR = "%s/actinia/resources" % home # Directory to store exported resources self.GRASS_RESOURCE_QUOTA = 100 # The size quota of the resource storage in Gigibit - self.GRASS_GIS_BASE = "/usr/local/grass79/" # Installation directory of GRASS - self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass79" + self.GRASS_GIS_BASE = "/usr/local/grass78/" # Installation directory of GRASS + self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass78" self.GRASS_ADDON_PATH = "%s/.grass7/addons/" % home self.GRASS_MODULES_XML_PATH = os.path.join(self.GRASS_GIS_BASE, "gui", "wxpython", "xml", "module_items.xml") self.GRASS_VENV = "%s/src/actinia/grass_venv/bin/activate_this.py" % home # The path to the activation diff --git a/tests/test_common_base.py b/tests/test_common_base.py index 4c94bf344..e3b88b095 100644 --- a/tests/test_common_base.py +++ b/tests/test_common_base.py @@ -64,8 +64,8 @@ def setup_environment(): # GRASS # Setup the test environment - global_config.GRASS_GIS_BASE="/usr/local/grass79/" - global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass79" + global_config.GRASS_GIS_BASE="/usr/local/grass78/" + global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass78" # global_config.GRASS_DATABASE= "/usr/local/grass_test_db" # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home diff --git a/tests/test_resource_base.py b/tests/test_resource_base.py index 76f798317..e14be6859 100644 --- a/tests/test_resource_base.py +++ b/tests/test_resource_base.py @@ -66,8 +66,8 @@ def setup_environment(): # GRASS GIS # Setup the test environment - global_config.GRASS_GIS_BASE="/usr/local/grass79/" - global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass79" + global_config.GRASS_GIS_BASE="/usr/local/grass78/" + global_config.GRASS_GIS_START_SCRIPT="/usr/local/bin/grass78" # global_config.GRASS_DATABASE= "/usr/local/grass_test_db" # global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home global_config.GRASS_TMP_DATABASE = "/tmp"