Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

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.

https://bitbucket.org/terndatateam/core-geonetwork/src/tern-3.12.x/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/layout/tpl-rdf.xsl

Main DCAT translation from ISO 19115-3 for CatalogRecord and Dataset as well as any resources referenced by the translation.

https://bitbucket.org/terndatateam/core-geonetwork/src/tern-3.12.x/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/convert/rif.xsl

RIF-CS translation from ISO 19115-3

https://bitbucket.org/terndatateam/core-geonetwork/src/tern-3.12.x/web/src/main/webapp/xslt/services/dcat/rdf.xsl

DCAT translation from ISO 19115-3 for Catalog and is the root of all DCAT translations.

Ansible Key Files

Monitoring

Monitoring is done through Prometheus.

https://prometheus-test.tern.org.au/graph?g0.expr=irate(container_cpu_system_seconds_total%7Bcontainer%3D%22geonetwork%22%7D%5B5m%5D)%20*%20100&g0.tab=0&g0.stacked=0&g0.show_exemplars=0&g0.range_input=1h&g1.expr=(avg%20by%20(instance)%20(irate(container_cpu_system_seconds_total%7Bcontainer%3D%22geonetwork%22%7D%5B5m%5D))%20*%20100)%0A&g1.tab=0&g1.stacked=0&g1.show_exemplars=0&g1.range_input=1h

https://prometheus.tern.org.au/graph?g0.expr=irate(container_cpu_system_seconds_total%7Bcontainer%3D%22geonetwork%22%7D%5B5m%5D)%20*%20100&g0.tab=0&g0.stacked=0&g0.show_exemplars=0&g0.range_input=1h&g1.expr=(avg%20by%20(instance)%20(irate(container_cpu_system_seconds_total%7Bcontainer%3D%22geonetwork%22%7D%5B5m%5D))%20*%20100)%0A&g1.tab=0&g1.stacked=0&g1.show_exemplars=0&g1.range_input=1h

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.

  1. Checkout https://bitbucket.org/terndatateam/geonetwork-devenv/src/master/

  2. On the command line, run ./bin/dev_up.sh

  3. Build network by running: ./bin/mvn.sh clean install -DskipTests

  4. 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 bugs

  5. Once 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.

  • No labels