Closed mmacata closed 9 months ago
Is it possible to set something by the importer
so that extent=region
is used? So that only parts of large data sets will be imported.
I guess it would be easy to add it here. But then it would be a breaking change for actinia, no? If the importer behaves differently. Either way we decide I think it would be good to have the same behaviour for imports via wget and for those with vsicurl.
As a heads-up: /vsicurl/ uses (or at least may use) userfaultfd syscalls that will fail in a docker container, unless that capability is added to the container /service with seccomp / capadd. Ran into that recently myself and have not properly solved that yet, but currently looking for a good solution for our stack deployment...
As a heads-up: /vsicurl/ uses (or at least may use) userfaultfd syscalls that will fail in a docker container, unless that capability is added to the container /service with seccomp / capadd. Ran into that recently myself and have not properly solved that yet, but currently looking for a good solution for our stack deployment...
Interesting. When I tested it locally with vscode / docker dev setup, all went fine! Used mundialis/actinia:latest and started actinia as root user there.
I guess it would be easy to add it here. But then it would be a breaking change for actinia, no? If the importer behaves differently. Either way we decide I think it would be good to have the same behaviour for imports via wget and for those with vsicurl.
If we add a parameter which can be set but have not be added then it would not be a breaking change, or?
Interesting. When I tested it locally with vscode / docker dev setup, all went fine! Used mundialis/actinia:latest and started actinia as root user there.
The issue I encountered seems to be format dependent. I tested your Geotiff and that works fine for me too. NetCDF however, does not seem to work...
So, in a docker container, this will fail: gdalinfo /vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2A/2023/09/26/S2A_MSIL1C_20230926T134931_N0509_R110_T31XEG_20230926T154938.nc
Issue confirmed also with podman
:
podman run -it --rm osgeo/grass-gis:releasebranch_8_3-debian bash
root@94aa9494148b:/grassdb# gdalinfo /vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2A/2023/09/26/S2A_MSIL1C_20230926T134931_N0509_R110_T31XEG_20230926T154938.nc
ERROR 1: CPLCreateUserFaultMapping(): syscall(__NR_userfaultfd) failed: insufficient permission. add CAP_SYS_PTRACE capability, or set /proc/sys/vm/unprivileged_userfaultfd to 1
gdalinfo failed - unable to open '/vsicurl/https://nbstds.met.no/thredds/fileServer/NBS/S2A/2023/09/26/S2A_MSIL1C_20230926T134931_N0509_R110_T31XEG_20230926T154938.nc'.
OK, how I plan to tackle the issue in our swarm deployment (actinia-swarm.yml) is to add permissions / capabilities like this:
cap_add:
- SYS_PTRACE
And here with context...
---
version: "3.1"
services:
actinia:
cap_add:
- SYS_PTRACE
environment:
With that addition /vsicurl/ works in docker also with netcdf...
My knowledge of Unix system admin stuff does not go deep enough to know if there is an option to allow only userfaultfd. A web search produced this: https://lore.kernel.org/lkml/CAJHvVcgbCL7+4bBZ_5biLKfjmz_DKNBV8H6NxcLcFrw9Fbu7mw@mail.gmail.com/ But I have no idea if that patch was merged.
Map pixel limit check needed:
"message": "AsyncProcessError: Region too large, set a coarser resolution to minimum nsres: 343448.918425 ewres: 343448.918425 [num_cells: 11781980]"
r.import
and Importer up to now also doesn't check pixel limit in early stage.
This PR enables the user to import online raster resources via vsicurl via importer. In comparison to the current raster import it skips the
wget
step and passes the URL directly tor.import
. The vsicurl URL can directly be specified in the process chain:Output before without vsicurl URL:
This is still possible. But now with vsicurl:
These changes were tested with superadmin and normal user. The users limits were decreased to show the effect. For only 1 allowed pixel, v.import runs through but then the next step fails with
"message": "AsyncProcessError: Region too large, set a coarser resolution to minimum nsres: 343448.918425 ewres: 343448.918425 [num_cells: 11781980]",
. This might be critical as a large image could do harm to a running actinia installation? What do you think @anikaweinmann @neteler ? With only one second allowed for calculation, actinia behaves as it should:"message": "AsyncProcessTimeLimit: Time (1 seconds) exceeded to run executable r.import",
.