From bb45a8c7bc4afe28d7cce350acf7556a330fefe7 Mon Sep 17 00:00:00 2001 From: juarez Date: Mon, 13 Feb 2023 15:29:45 +0100 Subject: [PATCH] Rename teiler to exporter --- ccp/modules/exporter-compose.yml | 42 ++++++++++++++++++++++++++++++++ ccp/modules/exporter-setup.sh | 10 ++++++++ ccp/modules/teiler-compose.yml | 42 -------------------------------- ccp/modules/teiler-setup.sh | 10 -------- 4 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 ccp/modules/exporter-compose.yml create mode 100644 ccp/modules/exporter-setup.sh delete mode 100644 ccp/modules/teiler-compose.yml delete mode 100644 ccp/modules/teiler-setup.sh diff --git a/ccp/modules/exporter-compose.yml b/ccp/modules/exporter-compose.yml new file mode 100644 index 0000000..dc2e340 --- /dev/null +++ b/ccp/modules/exporter-compose.yml @@ -0,0 +1,42 @@ +version: "3.7" + +services: + exporter: + image: docker.verbis.dkfz.de/ccp/dktk-exporter:latest + container_name: bridgehead-ccp-exporter + environment: + LOG_LEVEL: "INFO" + EXPORTER_API_KEY: "${EXPORTER_API_KEY}" + CROSS_ORIGINS: "https://${HOST}/ccp-teiler-root-config" + EXPORTER_DB_USER: "exporter" + EXPORTER_DB_PASSWORD: "${EXPORTER_DB_PASSWORD}" # Set in exporter-setup.sh + EXPORTER_DB_URL: "jdbc:postgresql://exporter-db:5432/exporter" + CLEAN_TEMP_FILES_CRON_EXPRESSION: "0 0 1 * * *" + TEMP_FILES_LIFETIME_IN_DAYS: "1" + CLEAN_WRITE_FILES_CRON_EXPRESSION: "0 0 2 * * *" + WRITE_FILES_LIFETIME_IN_DAYS: "30" + labels: + - "traefik.enable=true" + - "traefik.http.routers.exporter_ccp.rule=PathPrefix(`/ccp-exporter`)" + - "traefik.http.services.exporter_ccp.loadbalancer.server.port=8092" + - "traefik.http.routers.exporter_ccp.tls=true" + - "traefik.http.routers.exporter_ccp.middlewares=auth" + volumes: + - "exporter:/app/exporter-files" + + exporter-db: + image: postgres:15.1-alpine + container_name: bridgehead-ccp-exporter-db + environment: + POSTGRES_USER: "exporter" + POSTGRES_PASSWORD: "${EXPORTER_DB_PASSWORD}" # Set in exporter-setup.sh + POSTGRES_DB: "exporter" + volumes: + - "exporter-db:/var/lib/postgresql/data" + + +volumes: + exporter-db: + name: "exporter-db" + exporter: + name: "exporter" diff --git a/ccp/modules/exporter-setup.sh b/ccp/modules/exporter-setup.sh new file mode 100644 index 0000000..090d23c --- /dev/null +++ b/ccp/modules/exporter-setup.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +function exporterSetup() { + if [ -n "$ENABLE_EXPORTER" ];then + log INFO "Exporter setup detected -- will start Exporter service." + OVERRIDE+=" -f ./$PROJECT/modules/exporter-compose.yml" + fi + # TODO: Generate password in another way so that not all passwords are the same? + EXPORTER_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)" +} diff --git a/ccp/modules/teiler-compose.yml b/ccp/modules/teiler-compose.yml deleted file mode 100644 index 904e2ec..0000000 --- a/ccp/modules/teiler-compose.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: "3.7" - -services: - teiler: - image: docker.verbis.dkfz.de/ccp/dktk-teiler:latest - container_name: bridgehead-ccp-teiler - environment: - LOG_LEVEL: "INFO" - TEILER_API_KEY: "${TEILER_API_KEY}" - CROSS_ORIGINS: "https://${HOST}/ccp-teiler-root-config" - TEILER_DB_USER: "teiler" - TEILER_DB_PASSWORD: "${TEILER_DB_PASSWORD}" # Set in teiler-setup.sh - TEILER_DB_URL: "jdbc:postgresql://teiler-db:5432/teiler" - CLEAN_TEMP_FILES_CRON_EXPRESSION: "0 0 1 * * *" - TEMP_FILES_LIFETIME_IN_DAYS: "1" - CLEAN_WRITE_FILES_CRON_EXPRESSION: "0 0 2 * * *" - WRITE_FILES_LIFETIME_IN_DAYS: "30" - labels: - - "traefik.enable=true" - - "traefik.http.routers.teiler_ccp.rule=PathPrefix(`/ccp-teiler`)" - - "traefik.http.services.teiler_ccp.loadbalancer.server.port=8092" - - "traefik.http.routers.teiler_ccp.tls=true" - - "traefik.http.routers.teiler_ccp.middlewares=auth" - volumes: - - "teiler:/app/teiler-files" - - teiler-db: - image: postgres:15.1-alpine - container_name: bridgehead-ccp-teiler-db - environment: - POSTGRES_USER: "teiler" - POSTGRES_PASSWORD: "${TEILER_DB_PASSWORD}" # Set in teiler-setup.sh - POSTGRES_DB: "teiler" - volumes: - - "teiler-db:/var/lib/postgresql/data" - - -volumes: - teiler-db: - name: "teiler-db" - teiler: - name: "teiler" diff --git a/ccp/modules/teiler-setup.sh b/ccp/modules/teiler-setup.sh deleted file mode 100644 index e4c4945..0000000 --- a/ccp/modules/teiler-setup.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -function teilerSetup() { - if [ -n "$ENABLE_TEILER" ];then - log INFO "Teiler setup detected -- will start Teiler service." - OVERRIDE+=" -f ./$PROJECT/modules/teiler-compose.yml" - fi - # TODO: Generate password in another way so that not all passwords are the same? - TEILER_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)" -}