Skip to content

Commit

Permalink
Merge branch 'master' of github.com:digitalearthafrica/config into wa…
Browse files Browse the repository at this point in the history
…por-v3
  • Loading branch information
vikineema committed Jan 16, 2025
2 parents 50b02af + beeecbc commit 8797f74
Show file tree
Hide file tree
Showing 26 changed files with 1,101 additions and 275 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/apply-geoserver-config-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
GEOSERVER_DOMAIN: "https://geoserver.dev.digitalearth.africa"
GEOSERVER_CONFIG_GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GEOSERVER_ENV: "dev"
GEOSERVER_DB_DATABASE: ${{ secrets.GEOSERVER_DB_DATABASE }}
DB_HOST: ${{ secrets.DEV_DB_HOST }}
DB_USER: ${{ secrets.DEV_DB_USER }}
DB_PASSWORD: ${{ secrets.DEV_DB_PASSWORD }}
Expand All @@ -45,6 +46,7 @@ jobs:
-e GEOSERVER_COLLECTION_LIST=${{ env.GEOSERVER_COLLECTION_LIST }} \
-e GEOSERVER_CONFIG_GIT_BRANCH=${{ env.GEOSERVER_CONFIG_GIT_BRANCH }} \
-e GEOSERVER_ENV=${{ env.GEOSERVER_ENV }} \
-e GEOSERVER_DB_DATABASE=${{ env.GEOSERVER_DB_DATABASE }} \
-e DB_HOST=${{ env.DB_HOST }} \
-e DB_USER=${{ env.DB_USER }} \
-e DB_PASSWORD=${{ env.DB_PASSWORD }} \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/apply-geoserver-config-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
GEOSERVER_DOMAIN: "https://geoserver.digitalearth.africa"
GEOSERVER_CONFIG_GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GEOSERVER_ENV: "prod"
GEOSERVER_DB_DATABASE: ${{ secrets.GEOSERVER_DB_DATABASE }}
DB_HOST: ${{ secrets.PROD_DB_HOST }}
DB_USER: ${{ secrets.PROD_DB_USER }}
DB_PASSWORD: ${{ secrets.PROD_DB_PASSWORD }}
Expand All @@ -46,6 +47,7 @@ jobs:
-e GEOSERVER_COLLECTION_LIST=${{ env.GEOSERVER_COLLECTION_LIST }} \
-e GEOSERVER_CONFIG_GIT_BRANCH=${{ env.GEOSERVER_CONFIG_GIT_BRANCH }} \
-e GEOSERVER_ENV=${{ env.GEOSERVER_ENV }} \
-e GEOSERVER_DB_DATABASE=${{ env.GEOSERVER_DB_DATABASE }} \
-e DB_HOST=${{ env.DB_HOST }} \
-e DB_USER=${{ env.DB_USER }} \
-e DB_PASSWORD=${{ env.DB_PASSWORD }} \
Expand Down
60 changes: 36 additions & 24 deletions .github/workflows/ows-config-test-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python environment
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.10.12

- name: flake8 Lint
uses: py-actions/flake8@v1
uses: py-actions/flake8@v2
with:
ignore: E501
path: services/ows_refactored
Expand All @@ -46,48 +46,48 @@ jobs:
- name: Prepare the DB
run: |
echo "Starting up the DB"
docker-compose -f docker-compose.ows.yaml up --detach postgres
docker compose -f docker-compose.ows.yaml up --detach postgres
echo "Initialising the DB"
docker-compose -f docker-compose.ows.yaml run -T ows datacube system init
docker compose -f docker-compose.ows.yaml run -T ows datacube system init
echo "Initialising OWS"
docker-compose -f docker-compose.ows.yaml run -T ows datacube-ows-update --schema --role postgres
docker compose -f docker-compose.ows.yaml run -T ows datacube-ows-update --schema --role postgres
echo "Starting OWS"
docker-compose -f docker-compose.ows.yaml up --detach ows
docker compose -f docker-compose.ows.yaml up --detach ows
- name: Log error from previous steps
if: failure()
run: |
docker-compose -f docker-compose.ows.yaml logs ows
docker compose -f docker-compose.ows.yaml logs ows
- name: Test DEV config
run: |
docker-compose -f docker-compose.ows.yaml run \
docker compose -f docker-compose.ows.yaml run \
-e DATACUBE_OWS_CFG=ows_refactored.dev_af_ows_root_cfg.ows_cfg \
-T ows \
datacube-ows-cfg check -i /env/config/inventory/dev_af/inventory.json
- name: Test PROD config
run: |
docker-compose -f docker-compose.ows.yaml run \
docker compose -f docker-compose.ows.yaml run \
-e DATACUBE_OWS_CFG=ows_refactored.prod_af_ows_root_cfg.ows_cfg \
-T ows \
datacube-ows-cfg check -i /env/config/inventory/prod_af/inventory.json
- name: Remove the DB
run: |
docker-compose -f docker-compose.ows.yaml down
docker compose -f docker-compose.ows.yaml down
upload-translation:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python environment
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.10.12

- name: Install dependencies
run: |
Expand All @@ -97,36 +97,48 @@ jobs:
- name: Prepare the DB
run: |
docker-compose -f docker-compose.ows.yaml up -d
sleep 5
docker-compose -f docker-compose.ows.yaml exec -T ows datacube system init
docker-compose -f docker-compose.ows.yaml exec -T ows datacube-ows-update --schema --role postgres
echo "Starting up the DB"
docker compose -f docker-compose.ows.yaml up --detach postgres
echo "Initialising the DB"
docker compose -f docker-compose.ows.yaml run -T ows datacube system init
echo "Initialising OWS"
docker compose -f docker-compose.ows.yaml run -T ows datacube-ows-update --schema --role postgres
echo "Starting OWS"
docker compose -f docker-compose.ows.yaml up --detach ows
- name: Generate English Terms translation file
run: |
docker-compose -f docker-compose.ows.yaml exec \
docker compose -f docker-compose.ows.yaml exec \
-e DATACUBE_OWS_CFG=ows_refactored.prod_af_ows_root_cfg.ows_cfg \
-T ows \
datacube-ows-cfg extract -m /env/config/output/messages.po
- name: Copy messages.po from Docker container to host
run: |
docker cp $(docker compose -f docker-compose.ows.yaml ps -q ows):/env/config/output/messages.po ./output/messages.po
- name: Set file permissions for messages.po
run: |
sudo chmod 644 ./output/messages.po
- name: Upload terms to POEditor.com
if: github.ref == 'refs/heads/master' || github.event_name == 'release' || github.event_name == 'pull_request'
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: "471013"
POEDITOR_PROJECT_ID: "747296"
run: |
python .github/workflows/scripts/upload-po.py
- name: Remove the DB
run: |
docker-compose -f docker-compose.ows.yaml down
docker compose -f docker-compose.ows.yaml down
build-and-push:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand All @@ -136,7 +148,7 @@ jobs:
- name: Download translation from POEditor.com
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: "471013"
POEDITOR_PROJECT_ID: "747296"
run: |
python .github/workflows/scripts/download-mo.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/upload-po.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def upload_terms(file_path, project_id, api_token):
update_results = client.update_terms_translations(
project_id=project_id,
file_path=file_path,
language_code='en',
language_code='fr',
overwrite=True,
tags='all',
)
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.ows.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
postgres:
image: postgis/postgis:12-2.5-alpine
Expand All @@ -10,7 +8,7 @@ services:
restart: always

ows:
image: opendatacube/ows:latest
image: opendatacube/ows:1.8.0-rc1
environment:
DB_HOSTNAME: postgres
DB_USERNAME: postgres
Expand All @@ -24,7 +22,7 @@ services:
depends_on:
- postgres
volumes:
- ./products:/env/products
- ./products:/products
- ./services/ows_refactored:/env/config/ows_refactored/
- ./services/inventory:/env/config/inventory/
- ./output:/env/config/output/
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"dataStore": {
"name": "africapolis_2015",
"type": "PostGIS",
"enabled": true,
"workspace": {
"name": "africapolis"
},
"connectionParameters": {
"entry": [
{ "@key": "schema", "$": "public" },
{ "@key": "Evictor run periodicity", "$": "300" },
{ "@key": "Max open prepared statements", "$": "50" },
{ "@key": "encode functions", "$": "true" },
{ "@key": "Batch insert size", "$": "1" },
{ "@key": "preparedStatements", "$": "false" },
{ "@key": "database", "$": "${GEOSERVER_DB_DATABASE}" },
{ "@key": "reWriteBatchedInserts", "$": "false" },
{ "@key": "host", "$": "${DB_HOST}" },
{ "@key": "Loose bbox", "$": "true" },
{ "@key": "SSL mode", "$": "DISABLE" },
{ "@key": "Estimated extends", "$": "true" },
{ "@key": "fetch size", "$": "1000" },
{ "@key": "Expose primary keys", "$": "true" },
{ "@key": "validate connections", "$": "true" },
{ "@key": "Support on the fly geometry simplification", "$": "true" },
{ "@key": "Connection timeout", "$": "20" },
{ "@key": "create database", "$": "false" },
{ "@key": "Method used to simplify geometries", "$": "FAST" },
{ "@key": "port", "$": "5432" },
{
"@key": "passwd",
"$": "${DB_PASSWORD}"
},
{ "@key": "min connections", "$": "1" },
{ "@key": "dbtype", "$": "postgis" },
{ "@key": "namespace", "$": "https://africapolis" },
{ "@key": "max connections", "$": "10" },
{ "@key": "Evictor tests per run", "$": "3" },
{ "@key": "Test while idle", "$": "true" },
{ "@key": "user", "$": "${DB_USER}" },
{ "@key": "Max connection idle time", "$": "300" }
]
},
"_default": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"dataStore": {
"name": "africapolis_2020",
"type": "PostGIS",
"enabled": true,
"workspace": {
"name": "africapolis"
},
"connectionParameters": {
"entry": [
{ "@key": "schema", "$": "public" },
{ "@key": "Evictor run periodicity", "$": "300" },
{ "@key": "Max open prepared statements", "$": "50" },
{ "@key": "encode functions", "$": "true" },
{ "@key": "Batch insert size", "$": "1" },
{ "@key": "preparedStatements", "$": "false" },
{ "@key": "database", "$": "${GEOSERVER_DB_DATABASE}" },
{ "@key": "reWriteBatchedInserts", "$": "false" },
{ "@key": "host", "$": "${DB_HOST}" },
{ "@key": "Loose bbox", "$": "true" },
{ "@key": "SSL mode", "$": "DISABLE" },
{ "@key": "Estimated extends", "$": "true" },
{ "@key": "fetch size", "$": "1000" },
{ "@key": "Expose primary keys", "$": "true" },
{ "@key": "validate connections", "$": "true" },
{ "@key": "Support on the fly geometry simplification", "$": "true" },
{ "@key": "Connection timeout", "$": "20" },
{ "@key": "create database", "$": "false" },
{ "@key": "Method used to simplify geometries", "$": "FAST" },
{ "@key": "port", "$": "5432" },
{
"@key": "passwd",
"$": "${DB_PASSWORD}"
},
{ "@key": "min connections", "$": "1" },
{ "@key": "dbtype", "$": "postgis" },
{ "@key": "namespace", "$": "https://africapolis" },
{ "@key": "max connections", "$": "10" },
{ "@key": "Evictor tests per run", "$": "3" },
{ "@key": "Test while idle", "$": "true" },
{ "@key": "user", "$": "${DB_USER}" },
{ "@key": "Max connection idle time", "$": "300" }
]
},
"_default": false
}
}

Loading

0 comments on commit 8797f74

Please sign in to comment.