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

Use versionless GRASS GIS (8) instead of hardcoded grass7x #347

Merged
merged 2 commits into from
May 3, 2022
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 docker/actinia-core-alpine/actinia.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ grass_database = /actinia_core/grassdb
grass_user_database = /actinia_core/userdata
grass_tmp_database = /actinia_core/workspace/temp_db
grass_resource_dir = /actinia_core/resources
grass_gis_base = /usr/local/grass80
grass_gis_base = /usr/local/grass
grass_gis_start_script = /usr/local/bin/grass
grass_addon_path = /root/.grass8/addons/

Expand Down
2 changes: 1 addition & 1 deletion docker/actinia-core-dev/actinia.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ grass_database = /actinia_core/grassdb
grass_user_database = /actinia_core/userdata
grass_tmp_database = /actinia_core/workspace/temp_db
grass_resource_dir = /actinia_core/resources
grass_gis_base = /usr/local/grass80
grass_gis_base = /usr/local/grass
grass_gis_start_script = /usr/local/bin/grass
grass_addon_path = /root/.grass8/addons/
additional_allowed_modules=i.albedo
Expand Down
4 changes: 2 additions & 2 deletions docker/actinia-core-tests/actinia-test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ grass_user_database = /actinia_core/userdata
grass_tmp_database = /actinia_core/workspace/temp_db
grass_resource_dir = /actinia_core/resources
grass_addon_path = /root/.grass8/addons/
grass_gis_base = /usr/local/grass80
grass_modules_xml_path = /usr/local/grass80/gui/wxpython/xml/module_items.xml
grass_gis_base = /usr/local/grass
grass_modules_xml_path = /usr/local/grass/gui/wxpython/xml/module_items.xml
grass_default_location = nc_spm_08

[API]
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
cd /tmp

# fetch weekly generated latest snapshot of GRASS GIS stable
wget https://grass.osgeo.org/grass78/source/snapshot/grass-7.8.git_src_snapshot_latest.tar.gz
tar xzvf grass-7.8.git_src_snapshot_latest.tar.gz
mv grass-7.8.git_src_snapshot_????_??_?? grass78
rm -f grass-7.8.git_src_snapshot_latest.tar.gz
wget https://grass.osgeo.org/grass80/source/snapshot/grass-8.0.git_src_snapshot_latest.tar.gz
tar xzvf grass-8.0.git_src_snapshot_latest.tar.gz
mv grass-8.0.git_src_snapshot_????_??_?? grass
rm -f grass-8.0.git_src_snapshot_latest.tar.gz

cd grass78
cd grass

# production related compilation flags (no debugging enabled)
export CFLAGS="-O2 -std=gnu99 -fexceptions -fstack-protector -m64"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial_landsat_ndvi.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ as well as univariate statistics of the computed NDVI scene.
{
"executable": "python3",
"parameter": [
"/usr/local/bin/grass78",
"/usr/local/bin/grass",
"-e",
"-c",
"/actinia/workspace/download_cache/demouser/LC80440342016259LGN00_B1.TIF",
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial_sentinel2_ndvi.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ as well as univariate statistics of the computed NDVI scene.
{
"executable": "python3",
"parameter": [
"/usr/local/bin/grass78",
"/usr/local/bin/grass",
"-e",
"-c",
"/actinia/workspace/download_cache/demouser/S2A_MSIL1C_20161206T030112_N0204_R032_T50RKR_20161206T030749_B08",
Expand Down
6 changes: 3 additions & 3 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ slope. Additional information about the raster layer are requested with
Store the following script as text file `ace_dtm_statistics.sh`:

```bash
# grass78 ~/grassdata/nc_spm_08/user1/
# grass ~/grassdata/nc_spm_08/user1/
# Import the web resource `elev_ned_30m.tif` and set the region to the imported map
g.region raster=elev@https://storage.googleapis.com/graas-geodata/elev_ned_30m.tif -ap
# Compute univariate statistics
Expand Down Expand Up @@ -503,7 +503,7 @@ The resulting data are provided as REST resources for download.
Store the following script as text file `/tmp/ace_segmentation.sh`:

```bash
# grass78 ~/grassdata/nc_spm_08/user1/
# grass ~/grassdata/nc_spm_08/user1/
# Import the web resource and set the region to the imported map
# we apply a trick for the import of multi-band GeoTIFFs:
# install with: g.extension importer
Expand Down Expand Up @@ -609,7 +609,7 @@ ace location="mylatlon" create_mapset="user1"

```bash
# list existing addons, see also
# https://grass.osgeo.org/grass7/manuals/addons/
# https://grass.osgeo.org/grass-stable/manuals/addons/
ace location="latlong_wgs84" grass_command="g.extension -l"

# install machine learning addon r.learn.ml2
Expand Down
6 changes: 3 additions & 3 deletions src/actinia_core/core/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def __init__(self):
# The size quota of the resource storage in Gigibit
self.GRASS_RESOURCE_QUOTA = 100
# Installation directory of GRASS
self.GRASS_GIS_BASE = "/usr/local/grass78/"
self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass78"
self.GRASS_ADDON_PATH = "%s/.grass7/addons/" % home
self.GRASS_GIS_BASE = "/usr/local/grass/"
self.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass"
self.GRASS_ADDON_PATH = "%s/.grass8/addons/" % home
self.GRASS_MODULES_XML_PATH = os.path.join(
self.GRASS_GIS_BASE, "gui", "wxpython", "xml", "module_items.xml")
# The path to the activation script of the python2 venv (old)
Expand Down
4 changes: 2 additions & 2 deletions src/actinia_core/core/request_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ def extract_start_script_parameters(args):
that were created with the start_script_parser.

Args:
args (dict): The argument dictionary with grass78 options
args (dict): The argument dictionary with grass start script options

Returns:
list:
A List of grass78 parameter
A list of grass start script parameters
"""
options = []
if "epsg" in args:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_common_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def setup_environment():
# GRASS

# Setup the test environment
global_config.GRASS_GIS_BASE = "/usr/local/grass80/"
global_config.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass80"
global_config.GRASS_GIS_BASE = "/usr/local/grass/"
global_config.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass"
# global_config.GRASS_DATABASE= "/usr/local/grass_test_db"
# global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home

Expand Down
4 changes: 2 additions & 2 deletions tests/test_resource_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def setup_environment():

# GRASS GIS
# Setup the test environment
global_config.GRASS_GIS_BASE = "/usr/local/grass80/"
global_config.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass80"
global_config.GRASS_GIS_BASE = "/usr/local/grass/"
global_config.GRASS_GIS_START_SCRIPT = "/usr/local/bin/grass"
# global_config.GRASS_DATABASE= "/usr/local/grass_test_db"
# global_config.GRASS_DATABASE = "%s/actinia/grass_test_db" % home
global_config.GRASS_TMP_DATABASE = "/tmp"
Expand Down