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

Support all processing types #47

Open
ninsbl opened this issue May 15, 2023 · 4 comments
Open

Support all processing types #47

ninsbl opened this issue May 15, 2023 · 4 comments

Comments

@ninsbl
Copy link

ninsbl commented May 15, 2023

Currently, it seems the module plugin only supports persistent processing. THis is the error I get when I try to execute a module template as processing_async_export:

"accept_datetime": "2023-05-15 12:59:01.894293",
"accept_timestamp": 1684155541.8942907,
"api_info": {
"endpoint": "asyncephemeralexportresource",
"method": "POST",
"path": "/api/v3/locations/ETRS_33N/processing_async_export",
"request_url": "http://my.actinia.io/api/v3/locations/ETRS_33N/processing_async_export"
},
"datetime": "2023-05-15 12:59:02.531210",
"exception": {
"message": "GrassInitError:  GRASS module timesreies_zones_univar not found in ['/usr/local/grass/bin/timesreies_zones_univar', '/usr/local/grass/scripts/timesreies_zones_univar', '/root/.grass8/addons/bin/timesreies_zones_univar', '/root/.grass8/addons/scripts/timesreies_zones_univar']",
"traceback": [
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1944, in run\n    self._execute()\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral/ephemeral_processing_with_export.py\", line 546, in _execute\n    EphemeralProcessing._execute(self)\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1703, in _execute\n    self._execute_process_list(process_list=process_list)\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1888, in _execute_process_list\n    self._run_module(process)\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1488, in _run_module\n    return self._run_executable(process, poll_time)\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1540, in _run_executable\n    proc = self.ginit.run_module(\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/core/grass_init.py\", line 572, in run_module\n    return self.runner.run_module(\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/core/grass_init.py\", line 451, in run_module\n    grass_module_path = self._create_grass_module_path(grass_module)\n",
"  File \"/usr/lib/python3.9/site-packages/actinia_core/core/grass_init.py\", line 402, in _create_grass_module_path\n    raise GrassInitError(\n"
],
"type": "<class 'actinia_core.core.grass_init.GrassInitError'>"
},
"http_code": 400,
"message": "GrassInitError:  GRASS module timesreies_zones_univar not found in ['/usr/local/grass/bin/timesreies_zones_univar', '/usr/local/grass/scripts/timesreies_zones_univar', '/root/.grass8/addons/bin/timesreies_zones_univar', '/root/.grass8/addons/scripts/timesreies_zones_univar']",

The same call works fine with just processing.

Idally, the module-plugin should support all processing types in actinia.
Alternatively, limitations should be documented more prominently (I may just have overlooked)...

@anikaweinmann
Copy link
Member

@ninsbl Please try the endpoint /api/v3/locations/ETRS_33N/processing_async for ephemeral processing.

@metzm
Copy link

metzm commented Aug 30, 2023

Is there a simple typo somewhere? timesreies_zones_univar -> timeseries_zones_univar, see above "message"

@ninsbl
Copy link
Author

ninsbl commented Aug 31, 2023

Is there a simple typo somewhere? timesreies_zones_univar -> timeseries_zones_univar, see above "message"

Yes, well spotted. The typo should not affect the issue at hand, however...

@ninsbl
Copy link
Author

ninsbl commented Aug 31, 2023

I now tried the /api/v3/locations/ETRS_33N/processing_async endpoint, and in order to make the issue more easy to reproduce I used the example template:

{
  "id": "user_default_value",
  "description": "test default value in actinia-module-plugin",
  "template": {
    "version": "1",
    "list": [
      {
        "module": "r.mapcalc",
        "id": "r.mapcalc_test",
        "inputs": [
          {
            "param": "expression",
            "comment": "output = r.mapcalc result, string; value = raster value (default=0.428), float",
            "value": "{{ output }} = {{ value|default(0.428) }}"
          }
        ]
      },
      {
        "id": "r_info",
        "module": "r.info",
        "inputs": [
          {
            "param": "map",
            "value": "{{ output }}"
          }
        ]
      }
    ]
  }
}

And then the following JSON payload:

{
    "version": "1",
    "list": [
      {
        "module": "user_default_value",
        "id": "r.mapcalc_test",
        "inputs": [
          {
            "param": "output",
            "value": "mod_test2"
          }
        ]
      }
    ]
  }

With that /api/v3/locations/ETRS_33N/processing_async endpoint throws an error:

{
    "accept_datetime": "2023-08-31 13:03:46.721964",
    "accept_timestamp": 1693487026.7219613,
    "api_info": {
        "endpoint": "asyncephemeralresource",
        "method": "POST",
        "path": "/api/v3/locations/ETRS_33N/processing_async",
        "request_url": "http://my-actinia/api/v3/locations/ETRS_33N/processing_async"
    },
    "datetime": "2023-08-31 13:03:47.233112",
    "exception": {
        "message": "GrassInitError:  GRASS module user_default_value not found in ['/usr/local/grass/bin/user_default_value', '/usr/local/grass/scripts/user_default_value', '/root/.grass8/addons/bin/user_default_value', '/root/.grass8/addons/scripts/user_default_value']",
        "traceback": [
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1943, in run\n    self._execute()\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1702, in _execute\n    self._execute_process_list(process_list=process_list)\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1887, in _execute_process_list\n    self._run_module(process)\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1487, in _run_module\n    return self._run_executable(process, poll_time)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/processing/actinia_processing/ephemeral_processing.py\", line 1539, in _run_executable\n    proc = self.ginit.run_module(\n           ^^^^^^^^^^^^^^^^^^^^^^\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/core/grass_init.py\", line 566, in run_module\n    return self.runner.run_module(\n           ^^^^^^^^^^^^^^^^^^^^^^^\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/core/grass_init.py\", line 445, in run_module\n    grass_module_path = self._create_grass_module_path(grass_module)\n                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
            "  File \"/usr/lib/python3.11/site-packages/actinia_core/core/grass_init.py\", line 396, in _create_grass_module_path\n    raise GrassInitError(\n"
        ],
        "type": "<class 'actinia_core.core.grass_init.GrassInitError'>"
    },
    "http_code": 400,
    "message": "GrassInitError:  GRASS module user_default_value not found in ['/usr/local/grass/bin/user_default_value', '/usr/local/grass/scripts/user_default_value', '/root/.grass8/addons/bin/user_default_value', '/root/.grass8/addons/scripts/user_default_value']",

While the /api/v3/locations/ETRS_33N/mapsets/tmp_mapset/processing endpoint succeeds...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants