Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c033490
try to fix uncontrolled data used in path (#280)
anikaweinmann Nov 26, 2021
90b5c10
Refactor rest - part 2 (#322)
mmacata Apr 1, 2022
a5ea4c9
actinia tests: fix test descriptions (#371)
neteler Aug 1, 2022
2a7c354
Black (#378)
anikaweinmann Sep 22, 2022
c0f0f1b
Black (#378)
anikaweinmann Sep 22, 2022
85a0600
Black (#378)
anikaweinmann Sep 22, 2022
3870c9f
Black (#378)
anikaweinmann Sep 22, 2022
4b9741f
Black (#378)
anikaweinmann Sep 22, 2022
da38d53
Add job queue name to response (#380)
mmacata Sep 22, 2022
8c606bf
Change pc style for module description for importer and exporter in m…
juleshaas Oct 21, 2022
e17aa1e
Start with the adjustment of the interim results (#390)
anikaweinmann Nov 22, 2022
e999c9a
Improve interim results by include additional mapsets (#399)
anikaweinmann Dec 14, 2022
960ce05
Add raster VRT support and support for mapset names by interim result…
anikaweinmann Jan 20, 2023
089ce41
Add raster VRT support and support for mapset names by interim result…
anikaweinmann Jan 20, 2023
b942acd
Black (#458)
anikaweinmann Jun 29, 2023
d62628b
Black (#458)
anikaweinmann Jun 29, 2023
fff8601
Black (#458)
anikaweinmann Jun 29, 2023
5d6d167
Allow separate config for worker Part 1 (#376)
mmacata Nov 2, 2023
06431d0
Checking pixellimit for r.import commands (#491)
linakrisztian Nov 21, 2023
98d6a47
Add stdin for parameters (#501)
anikaweinmann Feb 23, 2024
7366ec5
Merge branch 'main' of github.com:actinia-org/actinia-core into main
mmacata Feb 23, 2024
9431eb1
Lint (#535)
mmacata Jun 21, 2024
56e8b23
Renamed GRASS GIS locations to projects (#565)
anikaweinmann Dec 4, 2024
ae09f70
Renamed GRASS GIS locations to projects (#565)
anikaweinmann Dec 4, 2024
d92bf03
Renamed GRASS GIS locations to projects (#565)
anikaweinmann Dec 4, 2024
30f827c
Renamed GRASS GIS locations to projects (#565)
anikaweinmann Dec 4, 2024
47a30db
Renamed GRASS GIS locations to projects (#565)
anikaweinmann Dec 4, 2024
8a5bdff
Introduce ruff (#574)
mmacata Dec 5, 2024
c072d39
Introduce ruff (#574)
mmacata Dec 5, 2024
0920232
Remaining changes for switch of redis to valkey (#601)
linakrisztian Apr 15, 2025
e559132
Refactor rest - part 2 (#322)
mmacata Apr 1, 2022
03f22e9
Remaining changes for switch of redis to valkey (#601)
linakrisztian Apr 15, 2025
00dd79e
Refactor rest - part 2 (#322)
mmacata Apr 1, 2022
1fa1086
Remaining changes for switch of redis to valkey (#601)
linakrisztian Apr 15, 2025
6cd94d5
Move modules used by plugins (#221)
mmacata Jun 2, 2021
9162db6
split up module from actinia-core
mmacata Jun 2, 2025
0c024c6
cleanup
mmacata Jun 2, 2025
ce9c1de
lint
mmacata Jun 2, 2025
777fae9
Refactor rest - part 2 (#322)
mmacata Apr 1, 2022
f42f3f6
simplify folder structure
mmacata Jun 4, 2025
fec4f43
lint
mmacata Jun 5, 2025
bef809e
fix tests
mmacata Jun 6, 2025
5511cb7
lint
mmacata Jun 6, 2025
358c298
fix test call
mmacata Jun 6, 2025
a1094bb
lint
mmacata Jun 6, 2025
13cc529
update README
mmacata Jun 12, 2025
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
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
# E501 line too long (83 > 79 characters)

exclude = .git,.pycache,build,.eggs

per-file-ignores =
./src/actinia_processing_lib/ephemeral_processing.py: E501
./src/actinia_processing_lib/persistent_processing.py: E501
86 changes: 43 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ on:

jobs:

unittests-G84:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Replace run only unittest command
run: |
sed -i "s+# RUN make test+RUN make unittest+g" docker/actinia-processing-lib-test/Dockerfile
- name: Unittests of actinia-processing-lib
id: docker_build
uses: docker/build-push-action@v6
with:
push: false
tags: actinia-processing-lib-tests:alpine
context: .
file: docker/actinia-processing-lib-test/Dockerfile
no-cache: true
# pull: true
# unittests-G84:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Replace run only unittest command
# run: |
# sed -i "s+# RUN make test+RUN make unittest+g" docker/actinia-processing-lib-test/Dockerfile
# - name: Unittests of actinia-processing-lib
# id: docker_build
# uses: docker/build-push-action@v6
# with:
# push: false
# tags: actinia-processing-lib-tests:alpine
# context: .
# file: docker/actinia-processing-lib-test/Dockerfile
# no-cache: true
# # pull: true

integration-tests-G84:
runs-on: ubuntu-latest
Expand All @@ -55,29 +55,29 @@ jobs:
no-cache: true
# pull: true

unittests-G83:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Replace actinia version (including GRASS version)
run: |
sed -i "s+mundialis/actinia:latest+mundialis/actinia:grass8.3+g" docker/actinia-processing-lib-test/Dockerfile
- name: Replace run only unittest command
run: |
sed -i "s+# RUN make test+RUN make unittest+g" docker/actinia-processing-lib-test/Dockerfile
- name: Unittests of actinia-processing-lib
id: docker_build
uses: docker/build-push-action@v6
with:
push: false
tags: actinia-processing-lib-tests:alpine
context: .
file: docker/actinia-processing-lib-test/Dockerfile
no-cache: true
# pull: true
# unittests-G83:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Replace actinia version (including GRASS version)
# run: |
# sed -i "s+mundialis/actinia:latest+mundialis/actinia:grass8.3+g" docker/actinia-processing-lib-test/Dockerfile
# - name: Replace run only unittest command
# run: |
# sed -i "s+# RUN make test+RUN make unittest+g" docker/actinia-processing-lib-test/Dockerfile
# - name: Unittests of actinia-processing-lib
# id: docker_build
# uses: docker/build-push-action@v6
# with:
# push: false
# tags: actinia-processing-lib-tests:alpine
# context: .
# file: docker/actinia-processing-lib-test/Dockerfile
# no-cache: true
# # pull: true

integration-tests-G83:
runs-on: ubuntu-latest
Expand Down
50 changes: 50 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# For documentation about this config, see
# https://pylint.readthedocs.io/en/stable/user_guide/configuration/all-options.html (as of writing, version 2.17.4)

[MAIN]

jobs=0 # Default: 1

load-plugins=
pylint.extensions.broad_try_clause

recursive=yes # Default: False

# reports=yes # Default: False

# score=no # Default: True

# To disable more rules, see output of pylint. E.g.
# [...] C0301: Line too long (89/80) (line-too-long)
# can be suppressed with either disable=line-too-long or disable=C
# It is also possible to ignore a specific line by adding
# # pylint: disable=broad-exception-caught
# above the line causing the lint error
disable=
W, ; all Warnings are allowed to fail
import-error, ; To suppress e.g "Unable to import 'grass.script"
missing-module-docstring, ; we use the GRASS GIS header
R, ; refactoring + design recommendations

[BASIC]
# for global variable setting
good-names=keep_data,download_dir,gisdbase,tgtgisrc,tmploc,srcgisrc

[BROAD_TRY_CLAUSE]
max-try-statements=4 # Default: 1

[FORMAT]
max-line-length=80 # Default: 100
max-module-lines=800 # Default: 1000
ignore-long-lines=.*COPYRIGHT:.* |# . description:.*|\s*(# )?.*http.:\/\/\S+?|# %%*

[MESSAGES CONTROL]
# C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
# C0301: Line too long (already captured by other linters)
# C0302: Too many lines in module (2241/800) (too-many-lines)
# E0606 (possibly-used-before-assignment): to set options and flags at the bottom of the file without pre-initialization
disable=C0209,C0301,C0302,E0606


[VARIABLES]
additional-builtins=_ # Default: ()
90 changes: 3 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,13 @@
# actinia-processing-lib

This is an example plugin for [actinia-core](https://github.com/mundialis/actinia_core) which adds a "Hello World" endpoint to actinia-core.
This is the processing library for [actinia-core](https://github.com/mundialis/actinia_core).

You can run actinia-processing-lib as an actinia-core plugin.
It is a requirement of actinia-core and some actinia plugins and not meant to be used standalone.

## Installation
Use docker-compose for installation:
```bash
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml up -d
```

### Installation hints
* If you get an error like: `ERROR: for docker_kvdb_1 Cannot start service valkey: network xxx not found` you can try the following:
```bash
docker compose -f docker/docker-compose.yml down
# remove all custom networks not used by a container
docker network prune
docker compose -f docker/docker-compose.yml up -d
```

### Requesting helloworld endpoint
You can test the plugin and request the `/helloworld` endpoint, e.g. with:
```bash
curl -u actinia-gdi:actinia-gdi -X GET http://localhost:8088/api/v3/helloworld | jq

curl -u actinia-gdi:actinia-gdi -H 'accept: application/json' -H 'Content-Type: application/json' -X POST http://localhost:8088/api/v3/helloworld -d '{"name": "test"}' | jq
```

## DEV setup
For a DEV setup you can use the docker/docker-compose.yml:
```bash
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml run --rm --service-ports --entrypoint sh actinia

# install the plugin
(cd /src/actinia-processing-lib && python3 setup.py install)
# start actinia-core with your plugin
sh /src/start.sh
# gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app
```
For a DEV setup integrated with other actinia components, see [here](https://github.com/actinia-org/actinia-docker#local-dev-setup-for-actinia-core-plugins-with-vscode).

### Hints

* If you have no `.git` folder in the plugin folder, you need to set the
`SETUPTOOLS_SCM_PRETEND_VERSION` before installing the plugin:
```bash
export SETUPTOOLS_SCM_PRETEND_VERSION=0.0
```
Otherwise you will get an error like this
`LookupError: setuptools-scm was unable to detect version for '/src/actinia-processing-lib'.`.

* If you make changes in code and nothing changes you can try to uninstall the plugin:
```bash
pip3 uninstall actinia-processing-lib.wsgi -y
rm -rf /usr/lib/python3.8/site-packages/actinia_processing_lib.wsgi-*.egg
```

### Running tests
You can run the tests in the actinia test docker:
Expand All @@ -69,45 +21,9 @@ cd /src/actinia-processing-lib/
# run all tests
make test

# run only unittests
make unittest
# run only integrationtests
make integrationtest

# run only tests which are marked for development with the decorator '@pytest.mark.dev'
make devtest
```

## Starting steps for own plugin
If you want to have your own plugin you can use this repo to create it by
executing the `scripts/create_own_plugin.sh`.

If you want the repo in git then you first have to create an empty git repository
and then run the script. Then follow the last instructions from the script
to upload the initial code to your git repository.

```bash
bash create_own_plugin.sh actinia-ex2-plugin git
```

If you only want your own plugin in a folder and not in git you can execute the
script like this:

```bash
bash create_own_plugin.sh actinia-ex2-plugin
```

## Hint for the development of actinia plugins

### skip permission check
The parameter [`skip_permission_check`](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L1420-L1422) (see [example in actinia-statistic plugin](https://github.com/mundialis/actinia_statistic_plugin/blob/master/src/actinia_statistic_plugin/vector_sampling.py#L207))
should only be set to `True` if you are sure that you really don't want to check the permissions.

The skip of the permission check leads to a skipping of:
* [the module check](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L579-L589)
* [the limit of the number of processes](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L566-L570)
* the limit of the processing time

Not skipped are:
* the limit of the cells
* the mapset/project limitations of the user
24 changes: 0 additions & 24 deletions docker/Dockerfile

This file was deleted.

27 changes: 5 additions & 22 deletions docker/actinia-processing-lib-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
# Exception for hadolint-docker-linter:
# DL3007: using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag
# hadolint ignore=DL3007
FROM mundialis/actinia:latest AS actinia_test

LABEL authors="Carmen Tawalika,Anika Weinmann"
LABEL maintainer="[email protected],[email protected]"
FROM mundialis/actinia:latest

ENV ACTINIA_CUSTOM_TEST_CFG=/etc/default/actinia-processing-lib-test

# TODO do not set DEFAULT_CONFIG_PATH if this is fixed
ENV DEFAULT_CONFIG_PATH=/etc/default/actinia-processing-lib-test

# install things only for tests
# DL3018: Pin versions in apk add
# hadolint ignore=DL3018
RUN apk add --no-cache valkey && \
pip3 install --no-cache-dir iniconfig==2.0.0 colorlog==6.8.2 pwgen==0.8.2.post0 pytest==8.3.5 pytest-cov==6.0.0

# COPY docker/actinia-processing-lib-test/start.sh /src/start.sh
RUN apk add valkey
RUN pip3 install --no-cache-dir \
iniconfig==2.0.0 pytest==8.3.5 pytest-cov==6.0.0

ENTRYPOINT ["/bin/sh"]
CMD ["/src/start.sh"]

# # add data for tests
# RUN wget --quiet https://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_micro.zip && \
# unzip nc_spm_08_micro.zip && \
# rm -f nc_spm_08_micro.zip && \
# mv nc_spm_08_micro /actinia_core/grassdb/nc_spm_08
# RUN grass -e -c 'EPSG:4326' /actinia_core/grassdb/latlong_wgs84
RUN grass -c EPSG:3358 /actinia_core/userdata/user/nc_spm_08 --text

# copy needed files and configs for test
COPY docker/actinia-processing-lib-test/actinia-processing-lib-test.cfg /etc/default/actinia
Expand All @@ -37,6 +22,4 @@ COPY . /src/actinia-processing-lib/
WORKDIR /src/actinia-processing-lib/
RUN pip3 install --no-cache-dir -e .

RUN chmod a+x tests_with_kvdb.sh && make install

# RUN make test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grass_gis_start_script = /usr/local/bin/grass
grass_addon_path = /root/.grass8/addons/

[API]
plugins = ["actinia_processing_lib"]
plugins = []
force_https_urls = True

[KVDB]
Expand Down
28 changes: 0 additions & 28 deletions docker/actinia.cfg

This file was deleted.

Loading