Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming of remaining GRaaS/graas to actinia #43

Merged
merged 6 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
try:
from graas_api import __version__ as version
from actinia_api import __version__ as version
except ImportError:
pass
else:
Expand Down
8 changes: 4 additions & 4 deletions scripts/actinia-bench
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/rq_starter
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 15 additions & 15 deletions src/actinia_core/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -119,24 +119,24 @@ 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
root = None
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"
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions tests/test_common_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
__email__ = "[email protected]"

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
Expand All @@ -67,7 +67,7 @@ def setup_environment():
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/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",
Expand All @@ -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)

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
20 changes: 10 additions & 10 deletions tests/test_resource_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -69,18 +69,18 @@ def setup_environment():
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/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():
Expand Down