Compare commits

...

27 Commits

Author SHA1 Message Date
4f9b662223 Pin the landing page to a version known to work 2024-08-29 15:04:28 +02:00
e323c2765f Added ECDC Beam Broker site to list of Firewall exceptions 2024-07-26 09:51:46 +02:00
8c1c0de927 Made scripts executable 2024-07-18 12:52:48 +02:00
56cdd0dcc4 Got automatic Bridgehead restart to work
Cherry picked from ehds2_develop branch
2024-07-18 12:47:47 +02:00
1b9af45991 Replaced tabs with spaces 2024-07-17 09:35:50 +02:00
353fc010cb Cherry picked the stop/start files from ehds2_develop branch 2024-07-17 09:28:40 +02:00
c15c3962a7 Switched to bridgehead user for git to avoid auth problems 2024-07-17 09:24:37 +02:00
e0fe39ab83 Perform git actions with the bridgehead user, to prevent authentication issues 2024-07-16 16:58:13 +02:00
cce76bab84 Updated README for the new run/stop scripts 2024-07-16 16:55:08 +02:00
013d6d219b Provided more detailed instructions on uploading data to a Bridgehead 2024-07-15 10:28:21 +02:00
cc228e20d9 Reordered the Bridgehead restart instructions
Ordered them so that first a stop is performed, then a start. This
reflects what administrators will be doing in real life. Also included a
git pull for the Bridgehead, since this will normally also be part of
the regular administrative tasks.

Also removed a bunch of instructions for the installation, since these
steps are now performed automatically by the bridgehead script.
2024-07-15 09:20:18 +02:00
153f654397 Deal with multiple data files, update repos
The check for the presence of data in the TransFAIR updating function
only worked for single CSV files. Tis commit corrects that.

Now also do a git pull on the various repos, to keep things up to date.
2024-07-12 11:07:06 +02:00
70aca8e99c Wait longer for Blaze to start 2024-07-10 14:34:14 +02:00
f925c27791 Suggested more robust Bridgehead start 2024-07-10 14:26:46 +02:00
350a4c84af Added extra detail relating to EHDS2 2024-07-10 14:20:40 +02:00
b52931e46c Pinned Blaze version 2024-07-02 14:11:34 +02:00
eb0f392e3c Croatia is having problems with a slow starting Blaze, increase Focus retry count 2024-06-13 09:25:57 +02:00
a738f1468f Fixed bug in CVS test logic
The -f test with a wildcard works OK if there is 0 or 1 CSV files but
breaks if there are 2 or more. The replacement uses ls to check if
there are any CSV files.
2024-06-07 16:08:16 +02:00
aa122d0bff Shortened national node names in config
For ECDC, the Beam broker URL is very long, so the resulting Beam ID
can be longer than 64 characters, which is too much for the CSR
generation algorithm.
2024-05-17 11:44:37 +02:00
ec4e91fade Corrected data target directory 2024-05-17 09:59:33 +02:00
c5f82bf93c Removed outdated steps relating to transFAIR 2024-05-17 09:57:31 +02:00
eb563113e0 Merge branch 'ehds2' of https://github.com/samply/bridgehead into ehds2 2024-05-17 09:50:59 +02:00
a10d0f9605 Added instructions for starting/stopping ECDC Bridgeheads 2024-05-17 09:49:39 +02:00
994b0a4124 remove time 2024-04-25 14:03:39 +02:00
593f93fffc Turned off obfuscation, because ECDC does not want this feature 2024-03-28 11:06:10 +01:00
b2b9865e8c Improved documentation for EHDS2/ECDC 2024-03-28 09:22:41 +01:00
4588960e19 Removed DKFZ URLs and certificates from EHDS2 branch 2024-03-27 16:08:32 +01:00
17 changed files with 306 additions and 127 deletions

View File

@ -8,8 +8,8 @@ This repository is the starting point for any information and tools you will nee
- [Hardware](#hardware) - [Hardware](#hardware)
- [Software](#software) - [Software](#software)
- [Network](#network) - [Network](#network)
- [EHDS2/ECDC](#ehds2-ecdc)
2. [Deployment](#deployment) 2. [Deployment](#deployment)
- [EHDS2/ECDC](#ehds2-ecdc)
- [Site name](#site-name) - [Site name](#site-name)
- [Projects](#projects) - [Projects](#projects)
- [GitLab repository](#gitlab-repository) - [GitLab repository](#gitlab-repository)
@ -88,37 +88,43 @@ The following URLs need to be accessible (prefix with `https://`):
* gitlab.bbmri-eric.eu * gitlab.bbmri-eric.eu
* only for German Biobank Node * only for German Biobank Node
* broker.bbmri.de * broker.bbmri.de
* only for EHDS2/ECDC
* ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
> 📝 This URL list is subject to change. Instead of the individual names, we highly recommend whitelisting wildcard domains: *.dkfz.de, github.com, *.docker.com, *.docker.io, *.samply.de, *.bbmri.de. > 📝 This URL list is subject to change. Instead of the individual names, we highly recommend whitelisting wildcard domains: *.dkfz.de, github.com, *.docker.com, *.docker.io, *.samply.de, *.bbmri.de.
> 📝 Ubuntu's pre-installed uncomplicated firewall (ufw) is known to conflict with Docker, more info [here](https://github.com/chaifeng/ufw-docker). > 📝 Ubuntu's pre-installed uncomplicated firewall (ufw) is known to conflict with Docker, more info [here](https://github.com/chaifeng/ufw-docker).
## Deployment
### EHDS2/ECDC ### EHDS2/ECDC
ECDC data should be provided as a CSV file and placed in the directory /srv/docker/ecdc/data. The Bridgehead can be started without data, but obviously, any searches run from a Locator will return zero results for this site if you do that. Note that an empty data directory will automatically be inserted on the first start of the Bridgehead if you don't set one up yourself. The ECDC Bridgehead allows you to connect your site/node to the [AMR Explorer](http://ehds2-lens.swedencentral.cloudapp.azure.com/), a non-public central web site that allow certified researchers to search for information relating to antiobiotic resistance, Europe-wide. You can supply the Bridgehead with data from your site in the form of CSV files, which will then be made available to the Explorer for searching purposes.
To get the right Beam certificate for your setup, you will need to edit the following files and comment/uncomment as appropriate: You will need to set up some configuration before you can start a Bridgehead. This can be done as follows:
- bbmri/modules/ehds2.root.crt.pem ```shell
- bbmri/modules/ehds2.test.root.crt.pem sudo mkdir -p /etc/bridgehead
sudo cp /srv/docker/bridgehead/bbmri/modules/bbmri.conf /etc/bridgehead
```
You will also need to edit: Now edit ```/etc/bridgehead/bbmri.conf``` and customize the following variables for your site:
./bbmri/modules/ehds2-setup.sh - SITE_NAME
- SITE_ID
- OPERATOR_FIRST_NAME
- OPERATOR_LAST_NAME
- OPERATOR_EMAIL
and set the broker address correctly for your site. If you run a proxy at your site, you will also need to give values to the ```HTTP*_PROXY*``` variables.
When you first start the Bridgehead, it will clone two extra repositories into /srv/docker, namely, focus and transfair. It will automatically build local images of these repositories for you. These components have the following functionality that has been customized for ECDC: When you first start the Bridgehead, it will clone two extra repositories into /srv/docker, namely, ```focus``` and ```transfair```. It will automatically build local images of these repositories for you. These components have the following functionality that has been customized for ECDC:
- *focus.* This component is responsible for completing the CQL that is used for running queries against the Blaze FHIR store. It uses a set of templates for doing this. Extra templates have been written for the ECDC use case. - *focus.* This component is responsible for completing the CQL that is used for running queries against the Blaze FHIR store. It uses a set of templates for doing this. Extra templates have been written for the ECDC use case. They can be found in /srv/docker/focus/resources/cql/EHDS2*.
- *transfair.* This is an ETL component. It takes the CSV data that you provide, converts it to FHIR, and loads it to Blaze. - *transfair.* This is an ETL component. It takes the CSV data that you provide, converts it to FHIR, and loads it to Blaze. This will be run once, if there is data in /srv/docker/ecdc/data. A lock file in the data directory ensures that it does not get run again. Remove this lock file and restart the Bridgehead if you want to load new data.
These images will normally be rebuilt every time you restart the Bridgehead. This is a workaround to fix a bug: if you don't rebuild these images for every start, then legacy versions will be used and you will lose the new ECDC functionality. The reason for this is still under investigation. These images will normally be rebuilt every time you restart the Bridgehead. This is a workaround to fix a bug: if you don't rebuild these images for every start, then legacy versions will be used and you will lose the new ECDC functionality. The reason for this is still under investigation.
Note that the /srv/docker/ecdc/data directory is also used as the home for a "lock" file, which will be created if your data has been successfully converted to FHIR by transfair. As long as this file exists, transfair will not be run again when you restart the Bridgehead. Hence, if you add or modify data, you will need to delete this file by hand before restarting the Bridgehead.
## Deployment
### Site name ### Site name
You will need to choose a short name for your site. This is not a URL, just a simple identifying string. For the examples below, we will use "your-site-name", but you should obviously choose something that is meaningful to you and which is unique. You will need to choose a short name for your site. This is not a URL, just a simple identifying string. For the examples below, we will use "your-site-name", but you should obviously choose something that is meaningful to you and which is unique.
@ -165,19 +171,14 @@ sudo git clone https://github.com/samply/bridgehead.git /srv/docker/bridgehead
If this is an ECDC/EHDS2 installation, switch to the ```ehds2``` branch and copy the configuration file to the required location: If this is an ECDC/EHDS2 installation, switch to the ```ehds2``` branch and copy the configuration file to the required location:
```shell ```shell
cd
git clone https://github.com/samply/transFAIR.git
cd transFAIR
docker build -t samply/transfair --no-cache .
cd /srv/docker/bridgehead cd /srv/docker/bridgehead
sudo git checkout ehds2 sudo git checkout ehds2
sudo mkdir test data
sudo mkdir -p /etc/bridgehead/ sudo mkdir -p /etc/bridgehead/
sudo cp bbmri/modules/bbmri.conf /etc/bridgehead/ sudo cp bbmri/modules/bbmri.conf /etc/bridgehead/
sudo vi /etc/bridgehead/bbmri.conf # Modify to include national node name and admin contact details sudo vi /etc/bridgehead/bbmri.conf # Modify to include national node name and admin contact details
``` ```
For an ECDC/EHDS2 installation, you will also need to copy your data in a comma-separated value (CSV) formatted file to ```/srv/docker/bridgehead/data```. Make sure it is readable by all. Only files with the ending ```.csv``` will be read in, all other files will be ignored. For an ECDC/EHDS2 installation, you will also need to copy your data in a comma-separated value (CSV) formatted file to ```/srv/docker/ecdc/data```. Make sure it is readable by all. Only files with the ending ```.csv``` will be read in, all other files will be ignored.
If this is not an ECDC/EHDS2 installation, then download your site specific configuration repository: If this is not an ECDC/EHDS2 installation, then download your site specific configuration repository:
```shell ```shell
@ -232,6 +233,22 @@ pki-scripts/managepki list
### Starting and stopping your Bridgehead ### Starting and stopping your Bridgehead
For an ECDC/EHDS2 installation, this is done with the help of specialized scripts:
To start:
```shell
sudo /srv/docker/bridgehead/run.sh
```
To stop (you generally won't need to do this):
```shell
sudo /srv/docker/bridgehead/stop.sh
```
For regular installations, read on.
If you followed the above steps, your Bridgehead should already be configured to autostart (via systemd). If you would like to start/stop manually: If you followed the above steps, your Bridgehead should already be configured to autostart (via systemd). If you would like to start/stop manually:
To start, run To start, run
@ -377,6 +394,19 @@ There will be a delay before the effects of Directory sync become visible. First
The data accessed by the federated search is held in the Bridgehead in a FHIR store (we use Blaze). The data accessed by the federated search is held in the Bridgehead in a FHIR store (we use Blaze).
For an ECDC/EHDS2 installation, you need to provide your data as a table in a CSV (comma-separated value) files and place it in the directory /srv/docker/ecdc/data. You can provide as many data files as you like, and you can add new files incrementally over time.
In order for this new data to be loaded, you will need to execute the ```run.sh``` script with the appropriate arguments:
- To read just the most recently added data files: ```/srv/docker/bridgehead run.sh --upload```.
- To read in all data from scratch: ```/srv/docker/bridgehead run.sh --upload-all```.
These two variants give you the choice between uploading data in an incremental way that preserves the date used for statistics or as a single upload that date stamps everything with the current date.
The Bridgehead can be started without data, but obviously, any searches run from the Explorer will return zero results for your site if you do that. Note that an empty data directory will automatically be inserted on the first start of the Bridgehead if you don't set one up yourself.
For non-ECDC setups, read on.
You can load data into this store by using its FHIR API: You can load data into this store by using its FHIR API:
``` ```

View File

@ -4,7 +4,10 @@ version: "3.7"
services: services:
blaze: blaze:
image: docker.verbis.dkfz.de/cache/samply/blaze:latest #image: docker.verbis.dkfz.de/cache/samply/blaze:latest
# Blaze versions 0.26 and 0.27 do not return anything when you run a
# CQL query, so I am pinning the version at 0.25.
image: samply/blaze:0.25
container_name: bridgehead-bbmri-blaze container_name: bridgehead-bbmri-blaze
environment: environment:
BASE_URL: "http://bridgehead-bbmri-blaze:8080" BASE_URL: "http://bridgehead-bbmri-blaze:8080"

View File

@ -19,18 +19,19 @@
### Common Configuration of all Components ### Common Configuration of all Components
## This is the descriptive humanreadable name of your site (e.g. München LMU) ## This is a descriptive human readable name of your site (e.g. Belgium)
SITE_NAME=ECDC-Bridgehead-<National node> SITE_NAME=<National node>
## This is the id for your site used in machine to machine communication (e.g. muenchen-lmu) ## This is the id for your site used in machine to machine communication (should be
SITE_ID=ecdc-bridgehead-<National node> ## lower-case, e.g. belgium)
SITE_ID=<National node>
## This server's hostname, for access from other computers within your institution ## This server's hostname, for access from other computers within your institution
## (e.g. mybridgehead.intern.myinstitution.org) ## (e.g. mybridgehead.intern.myinstitution.org)
## Optional. If left empty, this is auto-generated via the `hostname` command. ## Optional. If left empty, this is auto-generated via the `hostname` command.
HOST= HOST=
## Proxy Configuration ## Proxy Configuration
# leave empty if not applyable # leave empty if not applicable
# ex.: http://my-proxy-host:my-proxy-port # eg.: http://my-proxy-host:my-proxy-port
HTTP_PROXY_URL= HTTP_PROXY_URL=
HTTP_PROXY_USERNAME= HTTP_PROXY_USERNAME=
HTTP_PROXY_PASSWORD= HTTP_PROXY_PASSWORD=

View File

@ -12,6 +12,7 @@ services:
BLAZE_URL: "http://blaze:8080/fhir/" BLAZE_URL: "http://blaze:8080/fhir/"
BEAM_PROXY_URL: http://beam-proxy-ehds2:8081 BEAM_PROXY_URL: http://beam-proxy-ehds2:8081
RETRY_COUNT: ${FOCUS_RETRY_COUNT} RETRY_COUNT: ${FOCUS_RETRY_COUNT}
OBFUSCATE: "no"
depends_on: depends_on:
- "beam-proxy-ehds2" - "beam-proxy-ehds2"
- "blaze" - "blaze"
@ -55,11 +56,11 @@ services:
command: bash -c " \ command: bash -c " \
echo listing /app/data && \ echo listing /app/data && \
ls -la /app/data && \ ls -la /app/data && \
[ -f /app/data/*.[cC][sS][vV] ] && \ ls /app/data/*.[cC][sS][vV] 1> /dev/null 2>&1 && \
[ ! -f /app/data/lock ] && \ [ ! -f /app/data/lock ] && \
( \ ( \
echo 'Wait for Blaze to finish initializing' ; \ echo 'Wait for Blaze to finish initializing' ; \
sleep 60 ; \ sleep 360 ; \
echo 'Remove old output files' ; \ echo 'Remove old output files' ; \
rm -rf /app/test/* ; \ rm -rf /app/test/* ; \
cd /app ; \ cd /app ; \
@ -77,5 +78,5 @@ services:
test-data-loader: test-data-loader:
container_name: test-data-loader container_name: test-data-loader
image: samply/test-data-loader image: samply/test-data-loader
command: sh -c "sleep 300 && echo Listing all resources in FHIR store && blazectl --server http://bridgehead-bbmri-blaze:8080/fhir count-resources && tail -f /dev/null" command: sh -c "sleep 420 && echo Listing all resources in FHIR store && blazectl --server http://bridgehead-bbmri-blaze:8080/fhir count-resources && tail -f /dev/null"

View File

@ -7,19 +7,16 @@ if [ "${ENABLE_EHDS2}" == "true" ]; then
# The environment needs to be defined in /etc/bridgehead # The environment needs to be defined in /etc/bridgehead
case "$ENVIRONMENT" in case "$ENVIRONMENT" in
"production") "production")
export EHDS2_BROKER_ID=broker.bbmri.samply.de export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
#export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
export EHDS2_ROOT_CERT=ehds2 export EHDS2_ROOT_CERT=ehds2
;; ;;
"test") "test")
export EHDS2_BROKER_ID=broker.test.bbmri.samply.de export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
#export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
export EHDS2_ROOT_CERT=ehds2.test export EHDS2_ROOT_CERT=ehds2.test
;; ;;
*) *)
report_error 6 "Environment \"$ENVIRONMENT\" is unknown. Assuming production. FIX THIS!" report_error 6 "Environment \"$ENVIRONMENT\" is unknown. Assuming production. FIX THIS!"
export EHDS2_BROKER_ID=broker.bbmri.samply.de export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
#export EHDS2_BROKER_ID=ecdc-vm-ehds-test1.swedencentral.cloudapp.azure.com
export EHDS2_ROOT_CERT=ehds2 export EHDS2_ROOT_CERT=ehds2
;; ;;
esac esac

View File

@ -1,44 +1,22 @@
# DKFZ certificate # EHDS2/ECDC certificate
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDNTCCAh2gAwIBAgIUMy/n0zFRihhVR3aAD54LumzeYdwwDQYJKoZIhvcNAQEL MIIDNTCCAh2gAwIBAgIUamQJB/Uevzf3+qrDQOqA8mwkwX8wDQYJKoZIhvcNAQEL
BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjIxMDI1MDczNTA4WhcNMzIx BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjQwMjA3MTQ1MTQxWhcNMzQw
MDIyMDczNTM3WjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN MjA0MTQ1MjExWjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAL3qWliHIlIT1Qlsyq/NKJ1uj6/AF0STNg5NTNpb AQEBBQADggEPADCCAQoC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AhhE0ht7Sp
h8JStJC+KpvXmDrGkwx9bHlEZMgQQejIrwPLEbA32KBvNxdoUxF9q1Y773MKdqbc inKLJSVZrdFHbAbRXnYcUz/3oyy/uw0YvF0dJAHz2sgbtCLMHzKU7NwotaEqZedA
cCJwzQXE/NPZ13hCGrEIXs8DgH52GhEB5592k5/bRNcAvUwbZSXPPiT0rgq/eUOt I7688nI42aHggIkwa1CzmFo9ybQ2afgrYNeF+TcTQI6G+fFpeRT5I+FvA9hUI3r4
BYhgN0ov7h1MC5L6CYB/rQwqck7JPlmrXTkh2gix4/dEdBRzsHsn/xlo8ay5QYHG Kp63Si7cpQS5uiHs90sv2SNMedo2Gf9VyJKB7NOReQJWsrw32ITi4QLNKHcHciKm
rx2Adit76eZu/MJoJNzl1r8MPxLqyAie3KcIU54A+UMozLrWEQP/TyOyWZdjUjJt cpi/OqbR1YTJRoUrcC655G7bSKENzccdTWo8kBJgYLVbe+FohqgheqPqWpdH2zoR
cBYgkKJTjwdRhc+ehI3kFo7b/a/Z/jl9szKsAPHozMixSi8lGnsYwN80oqeRvT7h OxOwviutfJTNvDyhXu8FrDc5tr9f5VjXv1hK2szYuvggwbybUBB9bLsx+fV79oZe
wcMUK+igv3/K 3zR0j5YwB28G
-----END CERTIFICATE----- -----END CERTIFICATE-----
# EHDS2/ECDC certificate
#-----BEGIN CERTIFICATE-----
#MIIDNTCCAh2gAwIBAgIUamQJB/Uevzf3+qrDQOqA8mwkwX8wDQYJKoZIhvcNAQEL
#BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjQwMjA3MTQ1MTQxWhcNMzQw
#MjA0MTQ1MjExWjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN
#AQEBBQADggEPADCCAQoCggEBAKvI2XT0os20vG7d8FjRuMq9mALcQgLZvjAbQZbm
#JyeVxRQP5HsSrBlBwaZWgmXWFfIPlwsEsTAUsCneAl4ZL3gQ6831nbmmpgThOEVy
#rGBsbL6qlEWWplD/AGpcdEbAuDmuMSO9tKR6iRm+acTHJcXqsDm2HUUS7U+ManWY
#S0dG10beJE2eVtEv5/fnFlVSn72VgAVgXVl7UA5E77zXK9GUAyQ6Oo7MET9zifZ/
#EifeSoEvLk+U7HRLgQbKz2ti6ABh0wnK7Ec2DjekMBXyeQz0tR+8dS53s5pqti7c
#SUQMHmL4jKxvfQr7fr5wbJpFDu37Vif9GdND9WSDRcufuM8CAwEAAaN7MHkwDgYD
#VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKMF6QgDV4cV
#WyQZn3EHKLUumXzuMB8GA1UdIwQYMBaAFKMF6QgDV4cVWyQZn3EHKLUumXzuMBYG
#A1UdEQQPMA2CC0Jyb2tlci1Sb290MA0GCSqGSIb3DQEBCwUAA4IBAQAhhE0ht7Sp
#inKLJSVZrdFHbAbRXnYcUz/3oyy/uw0YvF0dJAHz2sgbtCLMHzKU7NwotaEqZedA
#I7688nI42aHggIkwa1CzmFo9ybQ2afgrYNeF+TcTQI6G+fFpeRT5I+FvA9hUI3r4
#Kp63Si7cpQS5uiHs90sv2SNMedo2Gf9VyJKB7NOReQJWsrw32ITi4QLNKHcHciKm
#cpi/OqbR1YTJRoUrcC655G7bSKENzccdTWo8kBJgYLVbe+FohqgheqPqWpdH2zoR
#OxOwviutfJTNvDyhXu8FrDc5tr9f5VjXv1hK2szYuvggwbybUBB9bLsx+fV79oZe
#3zR0j5YwB28G
#-----END CERTIFICATE-----

View File

@ -1,44 +1,22 @@
# DKFZ certificate # EHDS2/ECDC certificate
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIDNTCCAh2gAwIBAgIUJ0g7k2vrdAwNTU38S1/mU8NO26MwDQYJKoZIhvcNAQEL MIIDNTCCAh2gAwIBAgIUamQJB/Uevzf3+qrDQOqA8mwkwX8wDQYJKoZIhvcNAQEL
BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMj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e
#3zR0j5YwB28G
#-----END CERTIFICATE-----

View File

@ -7,7 +7,7 @@
# Makes only sense for EHDS2 project # Makes only sense for EHDS2 project
: ${ENABLE_EHDS2:=false} : ${ENABLE_EHDS2:=false}
FOCUS_RETRY_COUNT=32 FOCUS_RETRY_COUNT=128
PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem
for module in $PROJECT/modules/*.sh for module in $PROJECT/modules/*.sh

View File

@ -88,7 +88,11 @@ case "$ACTION" in
start) start)
loadVars loadVars
hc_send log "Bridgehead $PROJECT startup: Checking requirements ..." hc_send log "Bridgehead $PROJECT startup: Checking requirements ..."
chown -R bridgehead ${BASE}
checkRequirements checkRequirements
# Note: changes to "bridgehead" script will only take effect after next start.
su bridgehead -c "git pull"
chown -R bridgehead ${BASE}
# Local versions of focus and transfair are needed by EHDS2 # Local versions of focus and transfair are needed by EHDS2
clone_focus_if_nonexistent ${BASE}/.. clone_focus_if_nonexistent ${BASE}/..
build_focus ${BASE}/.. build_focus ${BASE}/..

14
ecdc.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Start ECDC Bridgehead
[Service]
Type=simple
ExecStart=/srv/docker/bridgehead/restart_service.sh
ExecStop=/srv/docker/bridgehead/shutdown_service.sh
Restart=always
RestartSec=36000
KillMode=mixed
[Install]
WantedBy=default.target

View File

@ -258,8 +258,8 @@ function clone_repo_if_nonexistent() {
cd "$target_dir" cd "$target_dir"
# Checkout the specified branch # Checkout the specified branch
git checkout "$branch_name" chown -R bridgehead .
echo "Checked out branch '$branch_name'." su bridgehead -c "git checkout $branch_name"
cd - cd -
} }
@ -282,11 +282,13 @@ function build_transfair() {
# We only take the touble to build transfair if: # We only take the touble to build transfair if:
# #
# 1. There is no data lock file (which means that no ETL has yet been run) and # 1. There is data available (any CSV files) and
# 2. There is data available. # 2. There is no data lock file (which means that no ETL has yet been run).
if [ -f ../ecdc/data/*.[cC][sS][vV] ] && [ ! -f ../ecdc/data/lock ]; then if ls ../ecdc/data/*.[cC][sS][vV] 1> /dev/null 2>&1 && [ ! -f ../ecdc/data/lock ]; then
cd $base_dir/transfair cd $base_dir/transfair
su bridgehead -c "git pull"
docker build --progress=plain -t samply/transfair --no-cache . docker build --progress=plain -t samply/transfair --no-cache .
chown -R bridgehead .
cd - cd -
fi fi
} }
@ -295,7 +297,9 @@ function build_focus() {
local base_dir="$1" local base_dir="$1"
cd $base_dir/focus cd $base_dir/focus
su bridgehead -c "git pull"
docker build --progress=plain -f DockerfileWithBuild -t samply/focus --no-cache . docker build --progress=plain -f DockerfileWithBuild -t samply/focus --no-cache .
chown -R bridgehead .
cd - cd -
} }

View File

@ -84,7 +84,7 @@ else
SYNCTEXT="For example, consider entering a correct NTP server (e.g. your institution's Active Directory Domain Controller in /etc/systemd/timesyncd.conf (option NTP=) and restart systemd-timesyncd." SYNCTEXT="For example, consider entering a correct NTP server (e.g. your institution's Active Directory Domain Controller in /etc/systemd/timesyncd.conf (option NTP=) and restart systemd-timesyncd."
if [ $SKEW -ge 300 ]; then if [ $SKEW -ge 300 ]; then
report_error 5 "Your clock is not synchronized (${SKEW}s off). This will cause Samply.Beam's certificate will fail. Please setup time synchronization. $SYNCTEXT" report_error 5 "Your clock is not synchronized (${SKEW}s off). This will cause Samply.Beam's certificate will fail. Please setup time synchronization. $SYNCTEXT"
exit 1 log WARN "Server Time Error"
elif [ $SKEW -ge 60 ]; then elif [ $SKEW -ge 60 ]; then
log WARN "Your clock is more than a minute off (${SKEW}s). Consider syncing to a time server. $SYNCTEXT" log WARN "Your clock is more than a minute off (${SKEW}s). Consider syncing to a time server. $SYNCTEXT"
fi fi

View File

@ -45,7 +45,7 @@ services:
landing: landing:
container_name: bridgehead-landingpage container_name: bridgehead-landingpage
image: docker.verbis.dkfz.de/cache/samply/bridgehead-landingpage:main image: docker.verbis.dkfz.de/cache/samply/bridgehead-landingpage:master
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.landing.rule=PathPrefix(`/`)" - "traefik.http.routers.landing.rule=PathPrefix(`/`)"

30
restart_service.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
# Start a running Bridgehead. If there is already a Bridgehead running,
# stop it first.
# This is intended to be used by systemctl.
cd /srv/docker/bridgehead
echo "git status before stop"
git status
echo "Stopping running Bridgehead, if present"
./bridgehead stop bbmri
# If "flush_blaze" is present, delete the Blaze volume before starting
# the Bridgehead again. This allows a user to upload all data, if
# requested.
if [ -f "/srv/docker/ecdc/data/flush_blaze" ]; then
docker volume rm bbmri_blaze-data
rm -f /srv/docker/ecdc/data/flush_blaze
fi
echo "git status before start"
git status | systemd-cat -p info
echo "Start the Bridgehead anew"
./bridgehead start bbmri
echo "Bridgehead has unexpectedly terminated"

83
run.sh Executable file
View File

@ -0,0 +1,83 @@
#!/usr/bin/env bash
# Start a Bridgehead from the command line. Upload data if requested.
# Behind the scenes we use systemctl to do the work.
# Function to print usage
print_usage() {
echo "Start a Bridghead, optionally upload data"
echo "Usage: $0 [--upload | --upload-all | --help | -h]"
echo "Options:"
echo " --upload Run Bridgehead and upload just the new CSV data files."
echo " --upload-all Run Bridgehead and upload all CSV data files."
echo " --help, -h Display this help message."
echo " No options Run Bridgehead only."
}
# Initialize variables
UPLOAD=false
UPLOAD_ALL=false
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--upload)
UPLOAD=true
;;
--upload-all)
UPLOAD_ALL=true
;;
--help|-h)
print_usage
exit 0
;;
*)
echo "Error: Unknown argument '$1'"
print_usage
exit 1
;;
esac
shift
done
# Check for conflicting options
if [ "$UPLOAD" = true ] && [ "$UPLOAD_ALL" = true ]; then
echo "Error: you must specify either --upload or --upload-all, specifying both is not permitted."
print_usage
exit 1
fi
# Disable/stop standard Bridgehead systemctl services, if present
sudo systemctl disable bridgehead@bbmri.service >& /dev/null
sudo systemctl disable system-bridgehead.slice >& /dev/null
sudo systemctl disable bridgehead-update@bbmri.timer >& /dev/null
sudo systemctl stop bridgehead@bbmri.service >& /dev/null
sudo systemctl stop system-bridgehead.slice >& /dev/null
sudo systemctl stop bridgehead-update@bbmri.timer >& /dev/null
# Set up systemctl for EHDS2/ECDC if necessary
cp /srv/docker/bridgehead/ecdc.service /etc/systemd/system
systemctl daemon-reload
systemctl enable ecdc.service
# Use systemctl to stop the Bridgehead if it is running
sudo systemctl stop ecdc.service
# Use files to tell the Bridgehead what to do with any data present
if [ "$UPLOAD" = true ] || [ "$UPLOAD_ALL" = true ]; then
if [ -f /srv/docker/ecdc/data/lock ]; then
rm /srv/docker/ecdc/data/lock
fi
fi
if [ "$UPLOAD_ALL" = true ]; then
echo "All CSV files in /srv/docker/ecdc/data will be uploaded"
touch /srv/docker/ecdc/data/flush_blaze
fi
# Start up the Bridgehead
sudo systemctl start ecdc.service
# Show status of Bridgehead service
sleep 10
systemctl status ecdc.service

13
shutdown_service.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# Shut down a running Bridgehead.
# This is intended to be used by systemctl.
cd /srv/docker/bridgehead
echo "git status before stop"
git status
echo "Stopping running Bridgehead, if present"
./bridgehead stop bbmri

43
stop.sh Executable file
View File

@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Shut down a running Bridgehead.
# Behind the scenes we use systemctl to do the work.
# Function to print usage
print_usage() {
echo "Stop the running Bridgehead"
echo "Usage: $0 [--help | -h]"
echo "Options:"
echo " --help, -h Display this help message."
echo " No options Stop Bridgehead only."
}
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--help|-h)
print_usage
exit 0
;;
*)
echo "Error: Unknown argument '$1'"
print_usage
exit 1
;;
esac
shift
done
# Set up systemctl for EHDS2/ECDC if necessary
cp /srv/docker/bridgehead/ecdc.service /etc/systemd/system
systemctl daemon-reload
systemctl enable ecdc.service
# Use systemctl to stop the Bridgehead if it is running
sudo systemctl stop ecdc.service
# Show status of Bridgehead service
sleep 20
systemctl status ecdc.service
docker ps