Skip to content

fix for issue-559 #3049

fix for issue-559

fix for issue-559 #3049

Workflow file for this run

name: test docker deployment ⚙️
on: [ push, pull_request ]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: setup Python
with:
python-version: 3.8
- name: install testing requirements 📦
working-directory: tests
run: |
pip3 install -r requirements.txt
pip3 install check-jsonschema
- name: cache schemas 📦
run: |
pywis-pubsub schema sync
curl -s https://raw.githubusercontent.com/wmo-im/wcmp2/main/schemas/wcmp2-bundled.json --output /tmp/wcmp2-bundled.json
- name: display Docker and Python versions 📦
run: |
docker version
docker compose version
python3 -V
- name: setup wis2box configuration
run: |
cp tests/test.env wis2box.env
cat wis2box.env
python3 wis2box-ctl.py config
- name: build wis2box
run: |
python3 wis2box-ctl.py build
python3 wis2box-ctl.py update
- name: start containers ⚙️
run: |
python3 wis2box-ctl.py start
python3 wis2box-ctl.py status -a
docker logs wis2box-management
- name: setup wis2box-management ⚙️
run: |
sleep 30
python3 wis2box-ctl.py execute wis2box environment show
- name: populate stations from CSV 📡
run: |
python3 wis2box-ctl.py execute wis2box metadata station publish-collection
- name: add Malawi data 🇲🇼
env:
TOPIC_HIERARCHY: mwi.mwi_met_centre.data.core.weather.surface-based-observations.synop
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/mwi-surface-weather-observations.yml
DISCOVERY_METADATA_ID: urn:x-wmo:md:mwi:mwi_met_centre:surface-weather-observations
TEST_DATA: /data/wis2box/observations/malawi
run: |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA
curl -s http://localhost/oapi/collections/discovery-metadata/items/$DISCOVERY_METADATA_ID --output /tmp/$DISCOVERY_METADATA_ID
check-jsonschema --schemafile /tmp/wcmp2-bundled.json /tmp/$DISCOVERY_METADATA_ID
- name: add Italy data 🇮🇹
env:
TOPIC_HIERARCHY: ita.roma_met_centre.data.core.weather.surface-based-observations.synop
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/ita-surface-weather-observations.yml
DISCOVERY_METADATA_ID: urn:x-wmo:md:ita:roma_met_centre:surface-weather-observations
TEST_DATA: /data/wis2box/observations/italy
run: |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA
curl -s http://localhost/oapi/collections/discovery-metadata/items/$DISCOVERY_METADATA_ID --output /tmp/$DISCOVERY_METADATA_ID
check-jsonschema --schemafile /tmp/wcmp2-bundled.json /tmp/$DISCOVERY_METADATA_ID
- name: add Algeria data 🇩🇿
env:
TOPIC_HIERARCHY: dza.alger_met_centre.data.core.weather.surface-based-observations.synop
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/dza-surface-weather-observations.yml
DISCOVERY_METADATA_ID: urn:x-wmo:md:dza:dza_met_centre:surface-weather-observations
TEST_DATA: /data/wis2box/observations/algeria
run: |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA
curl -s http://localhost/oapi/collections/discovery-metadata/items/$DISCOVERY_METADATA_ID --output /tmp/$DISCOVERY_METADATA_ID
check-jsonschema --schemafile /tmp/wcmp2-bundled.json /tmp/$DISCOVERY_METADATA_ID
- name: add Romania data 🇷🇴
env:
TOPIC_HIERARCHY: rou.rnimh.data.core.weather.surface-based-observations.synop
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/rou-synoptic-weather-observations.yml
DISCOVERY_METADATA_ID: urn:x-wmo:md:rou:rnimh:synoptic-weather-observations
TEST_DATA: /data/wis2box/observations/romania
run: |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA
curl -s http://localhost/oapi/collections/discovery-metadata/items/$DISCOVERY_METADATA_ID --output /tmp/$DISCOVERY_METADATA_ID
check-jsonschema --schemafile /tmp/wcmp2-bundled.json /tmp/$DISCOVERY_METADATA_ID
- name: add Congo data 🇨🇩
env:
TOPIC_HIERARCHY: cog.brazza_met_centre.data.core.weather.surface-based-observations.synop
DISCOVERY_METADATA: /data/wis2box/metadata/discovery/cog-surface-weather-observations.yml
DISCOVERY_METADATA_ID: urn:x-wmo:md:cog:brazza_met_centre:surface-weather-observations
TEST_DATA: /data/wis2box/observations/congo
run: |
python3 wis2box-ctl.py execute wis2box metadata discovery publish $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data add-collection $DISCOVERY_METADATA
python3 wis2box-ctl.py execute wis2box data ingest -th $TOPIC_HIERARCHY -p $TEST_DATA
curl -s http://localhost/oapi/collections/discovery-metadata/items/$DISCOVERY_METADATA_ID --output /tmp/$DISCOVERY_METADATA_ID
check-jsonschema --schemafile /tmp/wcmp2-bundled.json /tmp/$DISCOVERY_METADATA_ID
- name: sync stations 🔄
run: |
sleep 30
python3 wis2box-ctl.py execute wis2box metadata station publish-collection
- name: run integration tests ⚙️
run: |
sleep 30
pytest -s tests/integration
- name: run flake8 ⚙️
run: |
find . -type f -name "*.py" | xargs flake8
- name: failed tests 🚩
if: ${{ failure() }}
run: |
docker logs -n1000 wis2box-management
docker logs -n1000 wis2box-api