An actinia-core plugin which adds example endpoints to actinia-core
Project description
actinia-cloudevent-plugin
This is a plugin for actinia-core which adds cloudevent endpoints and runs as standalone app.
Installation and Setup
Use docker-compose for installation:
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml run --rm --service-ports --entrypoint sh actinia-cloudevent
# within docker
gunicorn -b 0.0.0.0:5000 -w 8 --access-logfile=- -k gthread actinia_cloudevent_plugin.main:flask_app
DEV setup
# Uncomment the volume mount of the cloud-event-plugin within docker/docker-compose.yml,
# then:
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml run --rm --service-ports --entrypoint sh actinia-cloudevent
# within docker:
# install the plugin
pip3 install .
# start flask app with actinia-cloudevent-plugin
python3 -m actinia_cloudevent_plugin.main
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-dev.yml down
# remove all custom networks not used by a container
docker network prune
docker compose -f docker/docker-compose-dev.yml up -d
Configuration
- the URL of the cloudevent receiver is defined within config/mount/sample.ini:
[EVENTRECEIVER](Default value defined within src/actinia_cloudevent_plugin/resources/config.py)
Requesting endpoint
Note: Assuming cloudevent-plugin is running as described in previous setup.
You can test the plugin and request the / endpoint, e.g. with:
# Start server for receiving of cloudevents (which are returned as response)
# NOTE: as defined within config/mount/sample.ini: [EVENTRECEIVER]
python3 tests/cloudevent_receiver_server.py
# In another terminal
JSON=tests/examples/cloudevent_example.json
curl -X POST -H 'Content-Type: application/json' --data @$JSON localhost:5000/api/v1/ | jq
Exemplary returned cloudevent: tests/examples/cloudevent_example_return.json
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-cloudevent-plugin'.. -
If you make changes in code and nothing changes you can try to uninstall the plugin:
pip3 uninstall actinia-cloudevent-plugin.wsgi -y rm -rf /usr/lib/python3.8/site-packages/actinia_cloudevent_plugin.wsgi-*.egg
Running tests
You can run the tests in the actinia test docker:
# Uncomment the volume mount of the cloud-event-plugin within docker/docker-compose.yml,
# then:
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml run --rm --service-ports --entrypoint sh actinia-cloudevent
# 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
Hint for the development of actinia plugins
skip permission check
The parameter skip_permission_check (see example in actinia-statistic plugin)
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
- the limit of the number of processes
- the limit of the processing time
Not skipped are:
- the limit of the cells
- the mapset/project limitations of the user
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
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_cloudevent_plugin-0.2.0.tar.gz.
File metadata
- Download URL: actinia_cloudevent_plugin-0.2.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d0070be810ef47da259940290442768cd8fe4d417859d1a46e870291c5fcc2e
|
|
| MD5 |
1a60165af40e6430277c0faacb41e879
|
|
| BLAKE2b-256 |
00df213f578d757913160ee308c9828b0556837c26894904c452c8dc62f0e675
|
File details
Details for the file actinia_cloudevent_plugin-0.2.0-py3-none-any.whl.
File metadata
- Download URL: actinia_cloudevent_plugin-0.2.0-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d45a13e50ca1525ecfe873a7c6203f4f36e7015e0cbfcfe7b8a6f72dca571f41
|
|
| MD5 |
86090497fb6328189284493ece96af7b
|
|
| BLAKE2b-256 |
3f0e0eb5c739c4ec1087871a4527beaaccd4ff0f620dec5e2dcdff900bdfe14a
|