Skip to main content

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 found you 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 .git folder in the plugin folder, you need to set the SETUPTOOLS_SCM_PRETEND_VERSION before 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actinia_parallel_plugin-1.2.0.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

actinia_parallel_plugin-1.2.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file actinia_parallel_plugin-1.2.0.tar.gz.

File metadata

  • Download URL: actinia_parallel_plugin-1.2.0.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for actinia_parallel_plugin-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b7196a6858fa18669e22e89e1d7a4c497ab981948b44d366fc888132618a4a26
MD5 24b38cec1c6f6541d32d215693d29849
BLAKE2b-256 44b1486bc00d17e80bc4302c0c3cbc68c9b847aee0bc7edaf7b82fb32cd370fb

See more details on using hashes here.

File details

Details for the file actinia_parallel_plugin-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for actinia_parallel_plugin-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74ea5a7cd09def3d0b63283e21d40d49e27d999af6f82c6f217e52edb07b0376
MD5 4e37d00e6bd53844ae329a009fab5459
BLAKE2b-256 b08e574ce098e6c95e3b90879781ef584fde67e1f9162716358464ee79ad1ad0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page