TERN GeoNetwork Setup and Configuration
Environments
Setup
Each dataset available in the geonetwork is harvested from SHaRED when changes in SHaRED are published. These records are harvested almost instantly. These records are harvested and stored in the ISO 19115-3 format.
Key Files
In the following section is a list of key files used for translation between formats, as well as important configuration files.
Geonetwork Key Files
File | Description |
---|---|
https://bitbucket.org/terndatateam/core-geonetwork/src/tern-3.12.x/schemas/iso19115-3.2018 | This directory contains XSLT translations from ISO 19115-3 to other formats, including DCAT and RIF-CS. This directory also includes XSLT translations for outputs when accessing the CSW and OIA-PMH. |
Main DCAT translation from ISO 19115-3 for CatalogRecord and Dataset as well as any resources referenced by the translation. | |
RIF-CS translation from ISO 19115-3 | |
DCAT translation from ISO 19115-3 for Catalog and is the root of all DCAT translations. |
Ansible Key Files
File | Description |
---|---|
https://bitbucket.org/terndatateam/k8s-flux-v2/src/main/apps/prod/apps/geonetwork/kustomization.yaml | Environment configuration |
https://bitbucket.org/terndatateam/k8s-flux-v2/src/main/apps/prod/apps/geonetwork/secret.yaml | Database configurations |
https://bitbucket.org/terndatateam/k8s-flux-v2/src/main/apps/prod/apps/geonetwork/tls-secret.yaml | SSL configurations |
https://bitbucket.org/terndatateam/k8s-flux-v2/src/main/apps/base/geonetwork/deployment.yaml | Container Configurations |
Monitoring
There are also grafana dashboards available:
Dashboard | test | prod |
---|---|---|
JMX Metrics | ||
|
|
|
K8s Pod Metrics |
Deployment
Each environment is deployed to a Kubernetes cluster and is behind a load balancer.
Process
Deployment to Production and Test is done with the following process.
Checkout https://bitbucket.org/terndatateam/geonetwork-devenv/src/master/
On the command line, run
./bin/dev_up.sh
Build network by running:
./bin/mvn.sh clean install -DskipTests
Test locally by running:
docker-compose up geonetwork
and go to http://localhost:8080/geonetwork/ and ensure your changes work, and you have not introduced any bugsOnce the deployment is ready run the following script depending on the environment your deploying to:
Test
set -e
docker system prune -a
pushd src/core-geonetwork && git stash && git pull && popd
if [ -d "k8s-flux-v2" ]; then
echo "Remvong old version"
rm -fR k8s-flux-v2
fi
git clone git@bitbucket.org:terndatateam/k8s-flux-v2.git
sed -i -r 's/(.*newTag: .*)([0-9]+)/echo "\1$((\2+1))"/ge' k8s-flux-v2/apps/test/apps/geonetwork/kustomization.yaml
ID=`grep newTag k8s-flux-v2/apps/test/apps/geonetwork/kustomization.yaml | sed -r 's/.*newTag:[^0-9]+([0-9]+.*)/\1/g'`
sed -i -r "s/(.*newTag: ).*/echo '\1$ID'/ge" k8s-flux-v2/apps/test/apps/geonetwork/kustomization.yaml
./bin/mvn.sh clean install -DskipTests
pushd docker-jetty
cp ../src/core-geonetwork/web/target/geonetwork.war .
docker buildx build --platform linux/amd64 -t registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest .
docker tag registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest registry.rc.nectar.org.au/tern-data-integration/geonetwork:$ID
docker push registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest
docker push registry.rc.nectar.org.au/tern-data-integration/geonetwork:$ID
popd
pushd k8s-flux-v2
git pull
git add apps/test/apps/geonetwork/kustomization.yaml
git commit -m "Updated Geonetwork version to $ID"
git push origin HEAD
popd
Production
set -e
docker system prune -a
pushd src/core-geonetwork && git stash && git pull && popd
if [ -d "k8s-flux-v2" ]; then
echo "Remvong old version"
rm -fR k8s-flux-v2
fi
git clone git@bitbucket.org:terndatateam/k8s-flux-v2.git
sed -i -r 's/(.*newTag: .*)([0-9]+)/echo "\1$((\2+1))"/ge' k8s-flux-v2/apps/prod/apps/geonetwork/kustomization.yaml
ID=`grep newTag k8s-flux-v2/apps/prod/apps/geonetwork/kustomization.yaml | sed -r 's/.*newTag:[^0-9]+([0-9]+.*)/\1/g'`
sed -i -r "s/(.*newTag: ).*/echo '\1$ID'/ge" k8s-flux-v2/apps/test/apps/geonetwork/kustomization.yaml
cat k8s-flux-v2/apps/prod/apps/geonetwork/kustomization.yaml
cat k8s-flux-v2/apps/test/apps/geonetwork/kustomization.yaml
./bin/mvn.sh clean install -DskipTests
pushd docker-jetty
cp ../src/core-geonetwork/web/target/geonetwork.war .
docker buildx build --platform linux/amd64 -t registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest .
docker tag registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest registry.rc.nectar.org.au/tern-data-integration/geonetwork:$ID
docker push registry.rc.nectar.org.au/tern-data-integration/geonetwork:latest
docker push registry.rc.nectar.org.au/tern-data-integration/geonetwork:$ID
popd
pushd k8s-flux-v2
git pull
git add apps/prod/apps/geonetwork/kustomization.yaml
git add apps/test/apps/geonetwork/kustomization.yaml
git commit -m "Released $ID to production"
git push origin HEAD
popd
pushd /tmp
if [ -d "core-geonetwork" ]; then
echo "Remvong old version"
rm -fR core-geonetwork
fi
git clone git@bitbucket.org:terndatateam/core-geonetwork.git
cd core-geonetwork
git tag TERN-$ID
git push origin tag TERN-$ID
popd
After this script runs successfully, wait 10-15 minutes for these changes to appear in the respective environment. Once deployed, check that these changes work as intended and that no new bugs have been introduced.