Skip to content

Commit 712a0b0

Browse files
committed
redis to kvdb/valkey
1 parent 6c07a3a commit 712a0b0

19 files changed

+146
-146
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ in any module, import `from actinia_module_plugin.resources.logging import log`
2929

3030

3131
### Running tests
32-
You can run the tests in the actinia-modules-plugin-test docker. For that you can comment the execution of the test in the docker/actinia-modules-plugin-test/Dockerfile `RUN ./tests_with_redis.sh` and run the following commands:
32+
You can run the tests in the actinia-modules-plugin-test docker. For that you can comment the execution of the test in the docker/actinia-modules-plugin-test/Dockerfile `RUN ./tests_with_kvdb.sh` and run the following commands:
3333
```bash
3434
docker build -f docker/actinia-module-plugin-test/Dockerfile -t actinia-module-plugin-test .
3535

@@ -39,5 +39,5 @@ docker run -it actinia-module-plugin-test -i
3939
cd /src/actinia-module-plugin/
4040

4141
# run all tests
42-
./tests_with_redis.sh
42+
./tests_with_kvdb.sh
4343
```

docker/actinia-module-plugin-test/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ENV TEMPLATE_VALUE_ENV_RASTER=elevation
1212
ENV TEMPLATE_VALUE_ENV_TYPE=raster
1313

1414
# install things only for tests
15-
RUN apk add --no-cache redis
15+
RUN apk add --no-cache valkey valkey-cli
1616
RUN pip install --upgrade setuptools && pip install pytest pytest-cov pwgen
1717

1818
ENTRYPOINT ["/bin/sh"]
@@ -35,7 +35,7 @@ COPY docker/actinia-module-plugin-test/actinia-module-plugin-test.cfg /etc/defau
3535
COPY docker/actinia-module-plugin-test/actinia-module-plugin-test.cfg /etc/default/actinia-module-plugin-test
3636
COPY . /src/actinia-module-plugin/
3737

38-
RUN chmod a+x tests_with_redis.sh
38+
RUN chmod a+x tests_with_kvdb.sh
3939
RUN pip install .
4040

41-
RUN ./tests_with_redis.sh
41+
RUN ./tests_with_kvdb.sh

docker/actinia-module-plugin-test/actinia-module-plugin-test.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ force_https_urls = True
1414
[QUEUE]
1515
queue_type = local
1616

17-
[REDIS]
18-
redis_server_url = localhost
19-
redis_server_port = 6379
17+
[KVDB]
18+
kvdb_server_url = localhost
19+
kvdb_server_port = 6379
2020
worker_queue_name = actinia_job
2121
worker_logfile = /actinia_core/workspace/tmp/actinia_worker_test.log
2222

src/actinia_module_plugin/api/modules/actinia.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
1919
actinia-module viewer
20-
Templates can be stored file based and in redis
20+
Templates can be stored file based and in kvdb
2121
2222
* List all actinia-modules
2323
* Describe single actinia-module
@@ -40,7 +40,7 @@
4040
createProcessChainTemplateListFromFileSystem,
4141
)
4242
from actinia_module_plugin.core.modules.actinia_user_templates import (
43-
createProcessChainTemplateListFromRedis,
43+
createProcessChainTemplateListFromKvdb,
4444
)
4545
from actinia_module_plugin.core.modules.actinia_common import (
4646
createActiniaModule,
@@ -59,8 +59,8 @@ def get(self):
5959
"""Get a list of all actinia modules (process chain templates)."""
6060

6161
pc_list_fs = createProcessChainTemplateListFromFileSystem()
62-
pc_list_redis = createProcessChainTemplateListFromRedis()
63-
pc_list = pc_list_fs + pc_list_redis
62+
pc_list_kvdb = createProcessChainTemplateListFromKvdb()
63+
pc_list = pc_list_fs + pc_list_kvdb
6464

6565
pc_list = filter(pc_list)
6666

src/actinia_module_plugin/api/modules/combined.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
1919
actinia-module + grass-module viewer
20-
Templates can be stored file based and in redis
20+
Templates can be stored file based and in kvdb
2121
2222
* List all GRASS GIS modules and actinia-modules
2323
* Describe single module
@@ -39,7 +39,7 @@
3939
createProcessChainTemplateListFromFileSystem,
4040
)
4141
from actinia_module_plugin.core.modules.actinia_user_templates import (
42-
createProcessChainTemplateListFromRedis,
42+
createProcessChainTemplateListFromKvdb,
4343
)
4444
from actinia_module_plugin.core.modules.actinia_common import (
4545
createActiniaModule,
@@ -75,8 +75,8 @@ def get(self):
7575
final_grass_list = createFullModuleList(self, final_grass_list)
7676

7777
pc_list_fs = createProcessChainTemplateListFromFileSystem()
78-
pc_list_redis = createProcessChainTemplateListFromRedis()
79-
module_list = final_grass_list + pc_list_fs + pc_list_redis
78+
pc_list_kvdb = createProcessChainTemplateListFromKvdb()
79+
module_list = final_grass_list + pc_list_fs + pc_list_kvdb
8080

8181
module_list = filter(module_list)
8282

src/actinia_module_plugin/api/modules/grass.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
from actinia_module_plugin.core.modules.grass import createGrassModule
4040
from actinia_module_plugin.core.modules.grass import createFullModuleList
4141
from actinia_module_plugin.core.modules.grass import installGrassAddon
42-
from actinia_module_plugin.core.modules.accessible_modules_redis_interface import (
43-
addGrassAddonToModuleListRedis,
42+
from actinia_module_plugin.core.modules.accessible_modules_kvdb_interface import (
43+
addGrassAddonToModuleListKvdb,
4444
)
4545
from actinia_module_plugin.model.modules import ModuleList
4646
from actinia_module_plugin.model.responseModels import (
@@ -104,7 +104,7 @@ def post(self, grassmodule):
104104
response = installGrassAddon(self, grassmodule)
105105

106106
if response["status"] == "finished":
107-
addGrassAddonToModuleListRedis(self, grassmodule)
107+
addGrassAddonToModuleListKvdb(self, grassmodule)
108108
msg = "Successfully installed GRASS addon " + grassmodule + "."
109109
status_code = 201
110110
else:

src/actinia_module_plugin/api/processing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
from flask import jsonify, make_response
5555
from flask_restful_swagger_2 import swagger
56-
from actinia_core.core.common.redis_interface import enqueue_job
56+
from actinia_core.core.common.kvdb_interface import enqueue_job
5757
from actinia_core.models.response_models import create_response_from_model
5858
from actinia_core.processing.common.ephemeral_processing_with_export import (
5959
start_job as start_job_ephemeral_processing_with_export,
@@ -73,7 +73,7 @@
7373
createProcessChainTemplateListFromFileSystem,
7474
)
7575
from actinia_module_plugin.core.modules.actinia_user_templates import (
76-
createProcessChainTemplateListFromRedis,
76+
createProcessChainTemplateListFromKvdb,
7777
)
7878
from actinia_module_plugin.core.modules.grass import createModuleList
7979
from actinia_module_plugin.core.processing import fillTemplateFromProcessChain
@@ -105,7 +105,7 @@ def log_error_to_resource_logger(self, msg, rdc):
105105
resource_id=self.resource_id,
106106
iteration=1,
107107
document=data,
108-
expiration=rdc.config.REDIS_RESOURCE_EXPIRE_TIME,
108+
expiration=rdc.config.KVDB_RESOURCE_EXPIRE_TIME,
109109
)
110110

111111

@@ -167,7 +167,7 @@ def preprocess_build_pc_and_enqueue(self, preprocess_kwargs, start_job):
167167
# get grass and actinia module lists
168168
module_list = createModuleList(self)
169169
pc_global_list = createProcessChainTemplateListFromFileSystem()
170-
pc_user_list = createProcessChainTemplateListFromRedis()
170+
pc_user_list = createProcessChainTemplateListFromKvdb()
171171
grass_module_list = []
172172
actinia_module_list = []
173173

src/actinia_module_plugin/core/modules/accessible_modules_redis_interface.py renamed to src/actinia_module_plugin/core/modules/accessible_modules_kvdb_interface.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,45 @@
1616
limitations under the License.
1717
1818
19-
Accessible Modules Redis Interface
19+
Accessible Modules Kvdb Interface
2020
"""
2121

2222
__license__ = "Apache-2.0"
2323
__author__ = "Anika Weinmann, Carmen Tawalika, Guido Riembauer, Julia Haas"
2424
__copyright__ = "Copyright 2021 - 2022, mundialis GmbH & Co. KG"
2525
__maintainer__ = "mundialis GmbH & Co. KG"
2626

27-
from actinia_core.core.redis_user import RedisUserInterface
27+
from actinia_core.core.kvdb_user import KvdbUserInterface
2828
from actinia_core.core.common.config import Configuration
2929

3030

31-
def getAccessibleModuleListRedis(self):
32-
redis_interface = RedisUserInterface()
31+
def getAccessibleModuleListKvdb(self):
32+
kvdb_interface = KvdbUserInterface()
3333
conf = Configuration()
3434
try:
3535
conf.read()
3636
except Exception:
3737
pass
3838

39-
server = conf.REDIS_SERVER_URL
40-
port = conf.REDIS_SERVER_PORT
41-
if conf.REDIS_SERVER_PW:
42-
redis_password = conf.REDIS_SERVER_PW
39+
server = conf.KVDB_SERVER_URL
40+
port = conf.KVDB_SERVER_PORT
41+
if conf.KVDB_SERVER_PW:
42+
kvdb_password = conf.KVDB_SERVER_PW
4343
else:
44-
redis_password = None
45-
redis_interface.connect(host=server, port=port, password=redis_password)
44+
kvdb_password = None
45+
kvdb_interface.connect(host=server, port=port, password=kvdb_password)
4646
user = self.user.get_id()
47-
access_modules = redis_interface.get_credentials(user)["permissions"][
47+
access_modules = kvdb_interface.get_credentials(user)["permissions"][
4848
"accessible_modules"
4949
]
50-
redis_interface.disconnect()
50+
kvdb_interface.disconnect()
5151
return access_modules
5252

5353

54-
def addGrassAddonToModuleListRedis(self, grassmodule):
54+
def addGrassAddonToModuleListKvdb(self, grassmodule):
5555
"""
5656
This function adds installed GRASS addon to the user's module list
57-
in redis.
57+
in kvdb.
5858
"""
5959
self.user.add_accessible_modules(
6060
[

src/actinia_module_plugin/core/modules/actinia_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
1919
actinia-module viewer
20-
Common module for file based and redis templates
20+
Common module for file based and kvdb templates
2121
"""
2222

2323
__license__ = "Apache-2.0"
@@ -207,7 +207,7 @@ def execute_interface_descr(self, vp):
207207
pc_item = {
208208
item_key: {"module": vp.module, "interface-description": True}
209209
}
210-
# TODO make use of module in redis cache if exists
210+
# TODO make use of module in kvdb cache if exists
211211
response = run_process_chain(self.resourceBaseSelf, pc_item)
212212
xml_strings = response["process_log"]
213213
self.count = self.count + 1

src/actinia_module_plugin/core/modules/actinia_user_templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
1919
actinia-module viewer
20-
Module for templates stored in redis which are user defined
20+
Module for templates stored in kvdb which are user defined
2121
"""
2222

2323
__license__ = "Apache-2.0"
@@ -31,7 +31,7 @@
3131
from actinia_module_plugin.model.modules import Module
3232

3333

34-
def createProcessChainTemplateListFromRedis():
34+
def createProcessChainTemplateListFromKvdb():
3535
"""
3636
list all stored templates and return as actinia-module list
3737
"""

0 commit comments

Comments
 (0)