An actinia-core plugin which adds parallel processing endpoints to actinia-core
Project description
actinia-parallel-plugin
This is the actinia-parallel-plugin for actinia-core which adds parallel processing endpoints to actinia.
You can run actinia-parallel-plugin as an actinia-core plugin.
Installation
Use docker compose for installation:
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 foundyou can try the following:
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
DEV setup
For a DEV setup you can use the docker/docker-compose.yml:
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-parallel-plugin && pip3 install .)
# start actinia-core with your plugin
gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app
# or for debugging in one line with reset
reset && (cd /src/actinia-parallel-plugin && pip3 install .) && gunicorn -b 0.0.0.0:8088 -w 3 --access-logfile=- -k gthread actinia_core.main:flask_app
PostGIS
Connect to PostGIS DB from actinia-core docker container:
psql -U actinia -h postgis -d gis
Hints
- If you have no
.gitfolder in the plugin folder, you need to set theSETUPTOOLS_SCM_PRETEND_VERSIONbefore installing the plugin:
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-parallel-plugin'..
- If you make changes in code and nothing changes you can try to uninstall the plugin:
pip3 uninstall actinia-parallel-plugin.wsgi -y
rm -rf /usr/lib/python3.8/site-packages/actinia_parallel_plugin.wsgi-*.egg
Running tests
You can run the tests in the actinia test docker:
docker compose -f docker/docker-compose-test.yml build
docker compose -f docker/docker-compose-test.yml up -d
# exec docker and run tests manually
docker exec -it docker_actinia-test_1 sh
# run all tests
make test
# run only unittests
make unittest
# run only integrationtests
make integrationtest
# or run tests outside of docker container
docker exec -it docker_actinia-test_1 sh /usr/bin/run_integration_tests.sh
docker exec -it docker_actinia-test_1 sh /usr/bin/run_unittests.sh
docker compose -f docker/docker-compose-test.yml down
You can also run the tests in the GHA workflows locally via act. To run docker compose inside a workflow act_base can be used. With these you can run the following to run the tests:
# list all workflows
act -l
# run workflow
act -j integration-tests -P ubuntu-latest=lucasalt/act_base:latest
act -j unittests -P ubuntu-latest=lucasalt/act_base:latest
Examples
Requesting batch job and job endpoints
# request batch job
curl -u actinia-gdi:actinia-gdi -X GET http://localhost:8088/api/v3/resources/actinia-gdi/batches/1 | jq
# request job
curl -u actinia-gdi:actinia-gdi -X GET http://localhost:8088/api/v3/resources/actinia-gdi/batches/1/jobs/1 | jq
Start parallel batch job
Ephemeral processing
You can start a parallel ephemeral batch job via:
# parallel ephemeral processing
curl -u actinia-gdi:actinia-gdi -X POST -H 'Content-Type: application/json' -d @test_postbodies/parallel_ephemeral_processing.json http://localhost:8088/api/v3/projects/nc_spm_08_grass7_root/processing_parallel | jq
Attention:
- The individual process chains must be "independent" of each other, since createBatch is designed as an ephemeral process.
TODOs:
- exporter in PC
- using stdout/export in PC of next block
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file actinia_parallel_plugin-1.1.2.tar.gz.
File metadata
- Download URL: actinia_parallel_plugin-1.1.2.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9efe9366f263f90d47fab9a10b276485585276de6095acea13649ebe17f1c80
|
|
| MD5 |
3b64c020ee36dbf5d118e5748a9d78ce
|
|
| BLAKE2b-256 |
fc0610f4ba099cc9d4ef8b35fbe23e6977d516eb14ea9d6107028cc9264f91b4
|
File details
Details for the file actinia_parallel_plugin-1.1.2-py3-none-any.whl.
File metadata
- Download URL: actinia_parallel_plugin-1.1.2-py3-none-any.whl
- Upload date:
- Size: 51.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74b73db48a91371ce3caa607d1c501a0ea7e9c4b5064a90b9607efcbfc32befa
|
|
| MD5 |
1883ce4ac610aa853b4d8ec2466b7307
|
|
| BLAKE2b-256 |
97030028ac749fd4dad89d3d69fdece81ee90b5c1089bd19b09641cb937d3f64
|