-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change import from URL_PREFIX from actinia_api and add test workflow Co-authored-by: anikaweinmann <[email protected]> Co-authored-by: Markus Neteler <[email protected]>
- Loading branch information
1 parent
d0618b7
commit 44189f0
Showing
16 changed files
with
729 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: actinia plugin tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
alpine-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# with: | ||
# path: "." | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Replace run only unittest command | ||
run: | | ||
sed -i "s+# RUN make test+RUN make test+g" docker/actinia-plugin-tests/Dockerfile | ||
- name: Unittests of actinia | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: false | ||
tags: actinia-plugin-tests:alpine | ||
context: . | ||
file: docker/actinia-plugin-tests/Dockerfile | ||
no-cache: true | ||
# pull: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*.py[cod] | ||
*.so | ||
*.cfg | ||
!docker/actinia-plugin-tests/actinia-test.cfg | ||
!setup.cfg | ||
*.orig | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ dist: | |
python3 setup.py dist | ||
|
||
test: | ||
python3 setup.py test | ||
./tests_with_redis.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
======================== | ||
Actinia Statistic Plugin | ||
======================== | ||
# Actinia Statistic Plugin | ||
|
||
This actinia plugin is deigned for to compute raster map layer and raster-time-series statistics | ||
for categorical and continuous data. It provides endpoints to sample raster | ||
time series data. | ||
|
||
Note: | ||
|
||
Actinia[1] is an open source REST API for scalable, distributed, high performance | ||
> **_NOTE:_** | ||
> | ||
> [Actinia](https://github.com/mundialis/actinia_core) is an open source REST API for scalable, distributed, high performance | ||
processing of geographical data that uses GRASS GIS for computational tasks. | ||
|
||
The Actinia service consists of the *Actinia Core* that provides the basic but sophisticated processing service | ||
> | ||
> The Actinia service consists of the *Actinia Core* that provides the basic but sophisticated processing service | ||
and *Actinia plugins* that provide problem specific services like Sentinel-2 and Landsat NDVI computation, | ||
spatio-temporal statistical analysis and many more. | ||
|
||
[1] https://github.com/mundialis/actinia_core | ||
|
||
|
||
Installation | ||
============ | ||
## Installation | ||
|
||
The actinia plugin must be installed in the same environment as actinia core. | ||
Actinia core must be configured to load the installed plugin. When the plugin is | ||
loaded and all plugin endpoints are available in actinia. | ||
The interface description of actinia will be extended with the endpoints of the plugins. | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/mundialis/actinia_statistic_plugin.git | ||
```bash | ||
git clone https://github.com/mundialis/actinia_statistic_plugin.git | ||
|
||
cd actinia_statistic_plugin | ||
pip3 install -r requirements.txt | ||
python3 setup.py install | ||
.. | ||
cd actinia_statistic_plugin | ||
pip3 install -r requirements.txt | ||
python3 setup.py install | ||
``` | ||
|
||
After installation set the plugin name in the actinia core configuration | ||
and restart the actinia core server. | ||
|
||
|
||
## Testing locally | ||
|
||
``` | ||
docker build -f docker/actinia-plugin-tests/Dockerfile -t actinia-plugin-test . | ||
docker run -v /path/to/actinia_statistic_plugin/tests:/src/actinia_statistic_plugin/tests -it actinia-plugin-test:latest -i | ||
# run tests with | ||
make test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM mundialis/actinia-core:latest as actinia_test | ||
|
||
LABEL authors="Carmen Tawalika,Anika Weinmann" | ||
LABEL maintainer="[email protected],[email protected]" | ||
|
||
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 | ||
ENV ACTINIA_CUSTOM_TEST_CFG /etc/default/actinia_test | ||
# TODO do not set DEFAULT_CONFIG_PATH if this is fixed | ||
ENV DEFAULT_CONFIG_PATH /etc/default/actinia_test | ||
|
||
# install things only for tests | ||
RUN apk add redis | ||
RUN pip3 install iniconfig colorlog | ||
|
||
# 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 wget --quiet https://grass.osgeo.org/sampledata/north_carolina/nc_spm_mapset_modis2015_2016_lst.zip && \ | ||
unzip nc_spm_mapset_modis2015_2016_lst.zip && \ | ||
rm -f nc_spm_mapset_modis2015_2016_lst.zip && \ | ||
mv modis_lst /actinia_core/grassdb/nc_spm_08/modis_lst | ||
RUN chown -R 1001:1001 /actinia_core/grassdb/nc_spm_08/modis_lst && chmod -R g+w /actinia_core/grassdb/nc_spm_08/modis_lst | ||
|
||
# copy needed files and configs for test | ||
COPY docker/actinia-plugin-tests/actinia-test.cfg /etc/default/actinia | ||
COPY docker/actinia-plugin-tests/actinia-test.cfg /etc/default/actinia_test | ||
|
||
COPY requirements.txt /src/requirements.txt | ||
RUN pip3 install -r /src/requirements.txt | ||
|
||
# TODO: Postgres for tests | ||
# using tests/data/poly.gpkg | ||
|
||
COPY . /src/actinia_statistic_plugin | ||
WORKDIR /src/actinia_statistic_plugin | ||
RUN chmod a+x tests_with_redis.sh | ||
|
||
RUN make install | ||
|
||
# RUN make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[GRASS] | ||
grass_gis_start_script = /usr/local/bin/grass | ||
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_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_default_location = nc_spm_08 | ||
|
||
[API] | ||
plugins = [] | ||
force_https_urls = True | ||
|
||
[LIMITS] | ||
max_cell_limit = 22500000 | ||
process_time_limt = 60 | ||
process_num_limit = 20 | ||
number_of_workers = 3 | ||
|
||
[REDIS] | ||
redis_server_url = localhost | ||
redis_server_port = 6379 | ||
redis_queue_server_url = localhost | ||
redis_queue_server_port = 6379 | ||
worker_queue_name = actinia_job | ||
worker_logfile = /actinia_core/workspace/tmp/actinia_worker_test.log | ||
|
||
[LOGGING] | ||
log_interface = fluentd | ||
log_fluent_host = fluentd | ||
log_fluent_port = 24224 | ||
log_level = 1 | ||
|
||
[MISC] | ||
tmp_workdir = /actinia_core/workspace/tmp | ||
download_cache = /actinia_core/workspace/download_cache | ||
secret_key = token_signing_key_changeme | ||
|
||
[MANAGEMENT] | ||
default_user = user | ||
default_user_group = group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.