actinia-org / actinia-module-plugin

Contains actinia module self-description and process-chain-template management and processing
Apache License 2.0
2 stars 3 forks source link

Are users allowed to install GRASS addons in actinia? #13

Closed veroandreo closed 1 year ago

veroandreo commented 3 years ago

Among other addons, I'd like to install v.strds.stats to be able to easily query a STRDS with a vector of polygons. However, using ace (I didn't find an actinia endpoint), I get:

ace location="latlong_wgs84" grass_command="g.extension -l"
https://actinia.mundialis.de//api/v1/locations/latlong_wgs84/processing_async_export
{'version': '1', 'list': [{'module': 'g.extension', 'id': 'g.extension_1804289383', 'flags': 'l', 'inputs': [{'param': 'operation', 'value': 'add'}, {'param': 'prefix', 'value': '$GRASS_ADDON_BASE'}]}]}
veroandreo
Resource status accepted
Polling: https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-4d5944b4-2258-4c51-9f0e-c6c6504774ce
Resource poll status: error
AsyncProcessError:  Module or executable <g.extension> is not supported
--------------------------------------------------------------------------
{"accept_datetime":"2021-10-18 12:48:15.280245","accept_timestamp":1634561295.2802432,"api_info":{"endpoint":"asyncephemeralexportresource","method":"POST","path":"/api/v1/locations/latlong_wgs84/processing_async_export","request_url":"http://actinia.mundialis.de/api/v1/locations/latlong_wgs84/processing_async_export"},"datetime":"2021-10-18 12:48:15.487385","exception":{"message":"AsyncProcessError:  Module or executable <g.extension> is not supported","traceback":["  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1747, in run\n    self._execute()\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing_with_export.py\", line 604, in _execute\n    EphemeralProcessing._execute(self)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1541, in _execute\n    process_list = self._create_temporary_grass_environment_and_process_list(\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1627, in _create_temporary_grass_environment_and_process_list\n    process_list = self._validate_process_chain(\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 693, in _validate_process_chain\n    raise AsyncProcessError(\n"],"type":"<class 'actinia_core.core.common.exceptions.AsyncProcessError'>"},"http_code":400,"message":"AsyncProcessError:  Module or executable <g.extension> is not supported","process_chain_list":[{"list":[{"flags":"l","id":"g.extension_1804289383","inputs":[{"param":"operation","value":"add"},{"param":"prefix","value":"$GRASS_ADDON_BASE"}],"module":"g.extension"}],"version":"1"}],"process_log":[],"progress":{"num_of_steps":0,"step":0},"resource_id":"resource_id-4d5944b4-2258-4c51-9f0e-c6c6504774ce","status":"error","time_delta":0.20717811584472656,"timestamp":1634561295.4873397,"urls":{"resources":[],"status":"https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-4d5944b4-2258-4c51-9f0e-c6c6504774ce"},"user_id":"veroandreo"}

Is this a user permission problem?

If g.extension was allowed it might make it possible to send addon-like python scripts to actinia which IMHO is easier and more flexible than creating the json processing chains (I have no knowledge about security though).

anikaweinmann commented 3 years ago

User are not allowed to install own addons. This will not be changed for security reasons.

In the module plugin we want to add an endpoint to install official GRASS GIS addons for a user.

juleshaas commented 2 years ago

The endpoint is created in #26. Tests still need to be done in separate PR.

anikaweinmann commented 1 year ago

Tests will be created in https://github.com/actinia-org/actinia-module-plugin/issues/27.