Skip to content

Commit

Permalink
Merge pull request #348 from appuio/disable_backup_restore_testing
Browse files Browse the repository at this point in the history
[stardog] Disable backup restore testing
  • Loading branch information
zugao authored Sep 6, 2021
2 parents cd15392 + d35e9e6 commit ee834f5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion appuio/stardog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: stardog
version: 0.7.7
version: 0.7.8
appVersion: 7.7.2
description: Stardog is the world’s leading knowledge graph platform for the enterprise. Stardog makes it fast and easy to turn enterprise data into knowledge.
home: "https://www.stardog.com/"
Expand Down
2 changes: 1 addition & 1 deletion appuio/stardog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# stardog

![Version: 0.7.7](https://img.shields.io/badge/Version-0.7.7-informational?style=flat-square) ![AppVersion: 7.7.2](https://img.shields.io/badge/AppVersion-7.7.2-informational?style=flat-square)
![Version: 0.7.8](https://img.shields.io/badge/Version-0.7.8-informational?style=flat-square) ![AppVersion: 7.7.2](https://img.shields.io/badge/AppVersion-7.7.2-informational?style=flat-square)

Stardog is the world’s leading knowledge graph platform for the enterprise. Stardog makes it fast and easy to turn enterprise data into knowledge.

Expand Down
12 changes: 0 additions & 12 deletions appuio/stardog/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,9 @@ spec:
set -e
BACKUP_DATE=$(date --utc +%Y-%m-%d_%H%M)
DATABASE_NAME={{ $db.name | quote }}
CURRENT_TRIPLE_COUNT=$(/opt/stardog/bin/stardog data size --exact "${DATABASE_NAME}" --passwd "${STARDOG_ADMIN_PW}" | cut -d " " -f 2 | tr -d ",")
echo "${DATABASE_NAME} has ${CURRENT_TRIPLE_COUNT} triples."
BACKUP_TARGET="s3://${S3_ENDPOINT}/${S3_BUCKET_NAME}/${S3_PATH_PREFIX}/${BACKUP_DATE}?AWS_ACCESS_KEY_ID=${S3_ACCESS_KEY}&AWS_SECRET_ACCESS_KEY=${S3_SECRET_KEY}&region=${S3_REGION}"
/opt/stardog/bin/stardog-admin db status --passwd "${STARDOG_ADMIN_PW}" "${DATABASE_NAME}"
/opt/stardog/bin/stardog-admin db backup --passwd "${STARDOG_ADMIN_PW}" --to "${BACKUP_TARGET}" "${DATABASE_NAME}"
PERCENT_USE=$(df --output=pcent -h /var/opt/stardog | tail -n 1 | tr -d "%")
if [ "${PERCENT_USE}" -gt "60" ]; then echo "not enough space to test restore: ${PERCENT_USE}% used" ; exit 1; fi
RESTORE_TARGET="s3://${S3_ENDPOINT}/${S3_BUCKET_NAME}/${S3_PATH_PREFIX}/${BACKUP_DATE}/${DATABASE_NAME}?AWS_ACCESS_KEY_ID=${S3_ACCESS_KEY}&AWS_SECRET_ACCESS_KEY=${S3_SECRET_KEY}&region=${S3_REGION}"
RESTORE_NAME="${DATABASE_NAME}_restore_test_${BACKUP_DATE}"
/opt/stardog/bin/stardog-admin db restore --passwd "${STARDOG_ADMIN_PW}" --name "${RESTORE_NAME}" "${RESTORE_TARGET}"
RESTORED_TRIPLE_COUNT=$(/opt/stardog/bin/stardog data size --exact "${RESTORE_NAME}" --passwd "${STARDOG_ADMIN_PW}" | cut -d " " -f 2 | tr -d ",")
echo "After backup-and-restore: ${RESTORED_TRIPLE_COUNT} triples."
/opt/stardog/bin/stardog-admin db drop --passwd "${STARDOG_ADMIN_PW}" "${RESTORE_NAME}"
SAME_COUNT=$((${CURRENT_TRIPLE_COUNT} == ${RESTORED_TRIPLE_COUNT} ? 0 : 1 ))
exit ${SAME_COUNT}
volumeMounts:
- name: data
mountPath: /var/opt/stardog
Expand Down

0 comments on commit ee834f5

Please sign in to comment.