Added readme and improved systemd scripts

This commit is contained in:
root 2021-12-23 14:54:35 +01:00
parent 4f406a96c8
commit f9f72cbe9a
6 changed files with 45 additions and 53 deletions

View File

@ -1 +1,21 @@
# bridgehead
# bridgehead
This repository contains all information and tools to deploy a bridgehead. If you have any questions about deploying a bridgehead, please contact us.
There are some prerequisites, which need to be meet befor starting a bridgehead.
The first step is to copy the site.conf file. It contains some configuration and secrets for your bridgehead.
With cp site.dev.conf site.conf you can clone the template. You need to set the project accoriding to the which bridgehead you want to start. It's either a GBN/BBMRI-ERIC, DKTK or C4 Bridgehead.
The next step is creating a configuration for your bridghead. We can provide you a configuration git repository for bridgehead, just ask us. When you have a DKTK or C4 Bridgehead you propably need some configuration from us anyways.
git submodule add -f https://"$git_username":"$git_access_token"@code.mitro.dkfz.de/scm/bd/"$site_name_lowercase"-config.git ./site-config
If you want to manage the configuration your self you need to copy a env file from the respective project folder into a site-config folder.
Step 3 is determind your prefered start method. You can can just start the docker container with start-bridgehead and stop it. Alternatively, we advice to use the install script. This script add a systemd service to your system which starts the bridgehead, it also stops and starts the system in the event of a reboot. Also it contains a service for automatic updating your bridgehead. It will check at 3:00 am if there are any updates and will apply them.
Step 4 is checking your bridgehead.

View File

@ -21,8 +21,8 @@ secrets:
services:
connector:
container_name: c4_connector
image: samply/share-client:${PROJECT}-develop
container_name: bridgehead_c4_connector
image: "samply/share-client:c4-7"
environment:
SITE: ${SITE}
SITEID: ${SITEID}
@ -58,6 +58,7 @@ services:
- "${HOST}:${HOSTIP}"
connector_db:
container_name: bridgehead_connector_db
image: postgres:10.17
environment:
POSTGRES_DB: ${CONNECTOR_POSTGRES_DB}
@ -73,7 +74,7 @@ services:
## ID-Management
idmanager:
container_name: idmanager
container_name: bridehead_idmanager
image: docker.verbis.dkfz.de/pseudonymisierung/magicpl:release-0.2.0
environment:
TOMCAT_REVERSEPROXY_FQDN: ${HOST}/ID-Manager
@ -104,47 +105,8 @@ services:
depends_on:
- patientlist
patientlist:
container_name: patientlist
image: medicalinformatics/mainzelliste:develop
environment:
TOMCAT_REVERSEPROXY_FQDN: ${HOST}/Patientlist
TOMCAT_REVERSEPROXY_SCHEME: ${PROTOCOL}
TOMCAT_REVERSEPROXY_PORT: ${PORT}
ML_DB_DRIVER: org.postgresql.Driver
ML_DB_TYPE: postgresql
ML_DB_HOST: patientlist_db
ML_DB_PORT: 5432
ML_DB_NAME: ${ML_DB_NAME}
ML_DB_USER: ${ML_DB_USER}
ML_DB_PASS: ${LOCAL_PATIENTLIST_DBPASS}
ML_API_KEY: ${LOCAL_IDMANAGER_MAINZELLISTE_APIKEY}
ML_LOG_LEVEL: warning
ML_SITE: ${SITEID}
TZ: Europe/Berlin
env_file:
- ./site-config/patientlist.env
volumes:
- "patientlist_logs:/usr/local/tomcat/logs"
secrets:
- mainzelliste.docker.conf
- centralSearchPublicKey
depends_on:
- patientlist_db
patientlist_db:
container_name: patientlist_db
image: postgres:13.1-alpine
environment:
POSTGRES_DB: ${ML_DB_NAME}
POSTGRES_USER: ${ML_DB_USER}
POSTGRES_PASSWORD: ${C4_LOCAL_PATIENTLIST_DBPASS}
TZ: Europe/Berlin
volumes:
- "patientlist_db_data:/var/lib/postgresql/data"
networks:
- idmanagement
store:
container_name: bridgehead_store
image: docker.verbis.dkfz.de/ccp/samply.store:release-5.1.2
environment:
MDR_URL: ${CCP_MDR_URL}
@ -163,6 +125,7 @@ store:
restart: always
store_db:
container_name: bridgehead_store_db
image: postgres:10.17
command: postgres -c datestyle='iso, dmy'
environment:

View File

@ -19,7 +19,7 @@ secrets:
services:
connector:
container_name: dktk_connector
container_name: bridgehead_dktk_connector
image: samply/share-client:dktk-develop
environment:
SITE: ${SITE}
@ -57,6 +57,7 @@ services:
- "${HOST}:${HOSTIP}"
connector_db:
container_name: bridgead_connector_db
image: postgres:10.17
environment:
POSTGRES_DB: ${CONNECTOR_POSTGRES_DB}
@ -72,7 +73,7 @@ services:
## ID-Management
idmanager:
container_name: idmanager
container_name: bridgehead_idmanager
image: docker.verbis.dkfz.de/pseudonymisierung/magicpl:release-0.2.0
environment:
TOMCAT_REVERSEPROXY_FQDN: ${HOST}/ID-Manager
@ -104,7 +105,7 @@ services:
- patientlist
patientlist:
container_name: patientlist
container_name: bridgehead_patientlist
image: medicalinformatics/mainzelliste:develop
environment:
TOMCAT_REVERSEPROXY_FQDN: ${HOST}/Patientlist
@ -132,7 +133,7 @@ services:
- patientlist_db
patientlist_db:
container_name: patientlist_db
container_name: bridgehead_patientlist_db
image: postgres:13.1-alpine
environment:
POSTGRES_DB: ${ML_DB_NAME}

View File

@ -2,7 +2,7 @@ version: '3.4'
services:
store:
container_name: "store"
container_name: "bridgehead_blaze_store"
image: "samply/blaze:0.15"
environment:
BASE_URL: "http://store:8080"
@ -16,7 +16,7 @@ services:
restart: "always"
connector:
container_name: "connector"
container_name: "bridgehead_connector"
image: "samply/share-client:gbn-7"
environment:
POSTGRES_HOST: "connector-db"
@ -36,7 +36,7 @@ services:
restart: "always"
connector-db:
container_name: "connector-db"
container_name: "bridgehead_connector-db"
image: "postgres:10.17"
environment:
POSTGRES_USER: "samply"

View File

@ -14,14 +14,14 @@ echo "Installing bridgehead\@.update.service in systemd ..."
sudo cp /srv/docker/bridgehead/convenience/bridgehead-update\@.service ./
sudo cp /srv/docker/bridgehead/convenience/bridgehead-update\@.timer ./
echo "Loading the bridgehead and traefik service definitions in systemd"
echo "Loading the bridgehead definitions in systemd"
sudo systemctl daemon-reload
echo "Starting Project ${project} "
if [ ! -f "/etc/systemd/system/bridgehead@${project}.service.d/bridgehead.conf" ]; then
echo "Can't find local configuration file for bridgehead@${project} service. Please ensure that the file /etc/systemd/system/bridgehead@${project}.service.d/bridgehead.conf exists"
continue
exit
fi
sudo systemctl is-active --quiet bridgehead@"${project}"

View File

@ -4,3 +4,11 @@ source site.conf
systemctl stop bridgehead@"${project}".service
systemctl stop bridgehead-update@"${project}".timer
systemctl stop bridgehead-update@"${project}".service
cd /etc/systemd/system/
rm bridgehead\@.service
rm bridgehead-update\@.timer
rm bridgehead-update\@.service
cd -