Commit d597d326 authored by Andreas Mann's avatar Andreas Mann
Browse files

0430 (debian 11 rc1)

parent ac4fce23
......@@ -4,6 +4,12 @@ The provided scripts in scriptspod let the turnkey service (https://github.com/s
The web\_stats scripts and test\_performance.sh have not yet been adjusted.
The scripts have been tested on the following operating systems:
* Centos 8.3
* Fedora 33
* Debian 11 RC1 Bullseye
## Installation of the scripts
Clone branch production-v3 from https://github.com/sfu-ireceptor/turnkey-service-php to a location where you have enough storage to host the amount of data you want to support.
......
# Changes
## 210430
- adjustments for tests with debian 11 rc1 (Bullseye)
- shebang /bin/bash
- podman pull with full registry path
- run database dump process as root inside container (which is user running the container on host)
## 210427
- README changes
## 210421
- install script corrected unshare command
## 210420
- bkup_file_rotation.sh dont create empty folders
- update readme files
## 210417
- new configuration option DO_BKUP_FLAG absolute path to location of file which will trigger db backup, is checked in backup_database.sh
- created by load_ and update_scripts
210427
- README changes
210421
- install script corrected unshare command
210420
- bkup_file_rotation.sh dont create empty folders
- update readme files
210417
- new configuration option DO_BKUP_FLAG absolute path to location of file \
which will trigger db backup, is checked in backup_database.sh
- created by load_ and update_scripts
#!/bin/sh
#!/bin/bash
restore_abs_file_path=$1
parent_dir="$(dirname "$restore_abs_file_path")"
......@@ -6,7 +6,8 @@ base_name="$(basename "$restore_abs_file_path")"
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......@@ -24,7 +25,8 @@ bkup_file_name=mongodb_${host_name}_${POD_NAME_SVC}_$(date +%Y%m%dT%H%M%S).gzip.
#sudo docker-compose --file ${SCRIPT_DIR}/docker-compose.yml --project-name turnkey-service exec -T ireceptor-database \
# sh -c 'mongodump --archive'
podman exec -e MONGO_INITDB_DATABASE="ireceptor" \
podman exec -u root \
-e MONGO_INITDB_DATABASE="ireceptor" \
-e bkup_file_name=$bkup_file_name \
ireceptor-database$DATABASE_CONT_NAME_SUFFIX \
sh -c 'mongodump --archive=/mnt/bkup/incoming/$bkup_file_name --gzip'
......
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. scriptspod/$POD_CONF_FILE
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
# stop and disable turnkey service
......@@ -18,7 +20,7 @@ sudo rm -r .mongodb_data
# check where this file is coming from
rm 0
# remove log
rm $LOGFILE_NAME
rm ./scriptspod/$LOGFILE_NAME
# neede for adc-api-test dataset loading
rm -rf ${PATH_BKUP_DIR}/${POD_NAME_SVC}/restore
rm -rf ${PATH_BKUP_DIR}/${POD_NAME_SVC}/incoming
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
#sudo docker-compose --file ${SCRIPT_DIR}/docker-compose.yml --project-name turnkey-service exec -T ireceptor-database \
# sh -c 'cd /app && mongo --quiet $MONGO_INITDB_DATABASE /app/scripts/drop_indexes.js'
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
#sudo docker-compose --file ${SCRIPT_DIR}/docker-compose.yml --project-name turnkey-service exec -T ireceptor-database \
# sh -c 'cd /app && mongo --quiet $MONGO_INITDB_DATABASE /app/scripts/drop_indexes_dataloading.js'
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
set -e
# This script is meant for quick & easy install via:
......
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
#echo $SCRIPT_DIR
#echo $SCRIPT_DIR_FULL
#readlink -f ${SCRIPT_DIR}
#exit
if [ ! -f "$SCRIPT_DIR/$POD_CONF_FILE" ]; then
......@@ -23,13 +25,17 @@ log "pod external port: $POD_EX_PORT"
log "user id running mongo db container: $POD_USER_ID"
# -----------------------------------------------------------------------------
if ! [ $(command -v $PODMAN_CMD) > 0 ];then
log " $PODMAN_CMD command could not be found, install podman:$ sudo yum install poddoman"
exit
else
log " $PODMAN_CMD command available"
fi
# required commands
commands=("podman" "curl" "readlink");
for i in "${commands[@]}"
do
if ! [ $(command -v $i) > 0 ];then
log " $i command could not be found, install first. "
exit
else
log " $i command available"
fi
done
# -----------------------------------------------------------------------------
# install Docker
......@@ -98,11 +104,11 @@ if [ $? -eq 0 ]; then
exit
fi
# pull images
podman pull ireceptor/repository-mongodb:$DATABASE_TAG
podman pull ireceptor/service-php-mongodb:$API_TAG
podman pull ireceptor/dataloading-mongo:$DATALOADING_TAG
podman pull ireceptor/dataloading-mongo:$PERFORMANCE_TESTING_TAG
# pull images
podman pull registry.hub.docker.com/ireceptor/repository-mongodb:$DATABASE_TAG
podman pull registry.hub.docker.com/ireceptor/service-php-mongodb:$API_TAG
podman pull registry.hub.docker.com/ireceptor/dataloading-mongo:$DATALOADING_TAG
podman pull registry.hub.docker.com/ireceptor/dataloading-mongo:$PERFORMANCE_TESTING_TAG
log "creating the turnkey-service pod.."
podman pod create --name $POD_NAME_SVC --share net -p $POD_EX_PORT:80 -p $POD_EX_PORT_DB:27017
......
#!/bin/sh
#!/bin/bash
# check number of arguments
NB_ARGS=2
......@@ -17,7 +17,8 @@ FILE_FOLDER=`dirname "$FILE_ABSOLUTE_PATH"`
FILE_NAME=`basename "$FILE_ABSOLUTE_PATH"`
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
......@@ -17,7 +17,8 @@ mkdir -p $LOG_FOLDER
TIME1=`date +%Y-%m-%d_%H-%M-%S`
LOG_FILE=${LOG_FOLDER}/${TIME1}_${FILE_NAME}.log
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
......@@ -30,5 +30,8 @@ ${SCRIPT_DIR}/create_database_indexes.sh
echo -n "Done $0: "
date
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
# trigger db backup
touch $DO_BKUP_FLAG
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
......@@ -90,4 +90,4 @@ function log () {
echo "$dt $msg" >> $SCRIPT_DIR/$LOGFILE_NAME
}
#log "---"
log "---"
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
restore_abs_file_path=$1
parent_dir="$(dirname "$restore_abs_file_path")"
base_name="$(basename "$restore_abs_file_path")"
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
# read configuration for turnkey pod
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
#!/bin/sh
#!/bin/bash
SCRIPT_DIR=`dirname "$0"`
SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#SCRIPT_DIR_FULL="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_DIR_FULL="$( readlink -f ${SCRIPT_DIR} )";
POD_CONF_FILE="podman.conf.sh"
. $SCRIPT_DIR_FULL/$POD_CONF_FILE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment