wis2-gc is a Reference Implementation of a WIS2 Global Cache.
Note: architecture diagrams referenced from the WIS2 Guide
- connects to a WIS2 Global Broker, subscribed to the following:
- `origin/a/wis2/#1
- on all notifications:
- download and store data to object storage
- publish notification of cached object
- Python 3
- virtualenv
Dependencies are listed in requirements.txt. Dependencies are automatically installed during pywis-pubsub installation.
# setup virtualenv
python3 -m venv --system-site-packages wis2-gc
cd wis2-gc
source bin/activate
# clone codebase and install
git clone https://github.com/wmo-im/wis2-gc.git
cd wis2-gc
pip3 install .
# setup environment and configuration
cp wis2-gc.env local.env
vim local.env # update accordingly
source local.env
# setup pywis-pubsub - sync WIS2 notification schema
pywis-pubsub schema sync
# setup backend
wis2-gc setup
# teardown backend
wis2-gc teardown
# connect to Global Broker
# notifications will automatically trigger wis2-gc to cache data
# and send a notification to the local broker
pywis-pubsub subscribe --config pywis-pubsub.yml --download
# cleanup data older than n days (default is 2)
wis2-gc clean --days 3
Instructions to run wis2-gc via Docker can be found the docker
directory.
# install dev requirements
pip3 install -r requirements-dev.txt
# run tests like this:
python3 tests/run_tests.py
# or this:
python3 setup.py test
All bugs, enhancements and issues are managed on GitHub.