mirror of
https://github.com/samply/bridgehead.git
synced 2025-06-16 21:50:14 +02:00
Compare commits
15 Commits
fix/kr-dea
...
feature/op
Author | SHA1 | Date | |
---|---|---|---|
d9208c4be2 | |||
967e45624e | |||
8cd5b93b95 | |||
52c24ee6fa | |||
26712d3567 | |||
eea17c3478 | |||
cf5230963c | |||
7aaee5e7d5 | |||
3312ca8a64 | |||
23981062bb | |||
8e7fe6851e | |||
760d599b7c | |||
072ee348fc | |||
f328e40963 | |||
eb2955872f |
39
.github/scripts/rename_inactive_branches.py
vendored
Normal file
39
.github/scripts/rename_inactive_branches.py
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
import os
|
||||
import requests
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# Configuration
|
||||
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
|
||||
REPO = 'samply/bridgehead'
|
||||
HEADERS = {'Authorization': f'token {GITHUB_TOKEN}', 'Accept': 'application/vnd.github.v3+json'}
|
||||
API_URL = f'https://api.github.com/repos/{REPO}/branches'
|
||||
INACTIVE_DAYS = 365
|
||||
CUTOFF_DATE = datetime.now() - timedelta(days=INACTIVE_DAYS)
|
||||
|
||||
# Fetch all branches
|
||||
def get_branches():
|
||||
response = requests.get(API_URL, headers=HEADERS)
|
||||
response.raise_for_status()
|
||||
return response.json() if response.status_code == 200 else []
|
||||
|
||||
# Rename inactive branches
|
||||
def rename_branch(old_name, new_name):
|
||||
rename_url = f'https://api.github.com/repos/{REPO}/branches/{old_name}/rename'
|
||||
response = requests.post(rename_url, json={'new_name': new_name}, headers=HEADERS)
|
||||
response.raise_for_status()
|
||||
print(f"Renamed branch {old_name} to {new_name}" if response.status_code == 201 else f"Failed to rename {old_name}: {response.status_code}")
|
||||
|
||||
# Check if the branch is inactive
|
||||
def is_inactive(commit_url):
|
||||
last_commit_date = requests.get(commit_url, headers=HEADERS).json()['commit']['committer']['date']
|
||||
return datetime.strptime(last_commit_date, '%Y-%m-%dT%H:%M:%SZ') < CUTOFF_DATE
|
||||
|
||||
# Rename inactive branches
|
||||
def main():
|
||||
for branch in get_branches():
|
||||
if is_inactive(branch['commit']['url']):
|
||||
#rename_branch(branch['name'], f"archived/{branch['name']}")
|
||||
print(f"[LOG] Branch '{branch['name']}' is inactive and would be renamed to 'archived/{branch['name']}'")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
27
.github/workflows/rename-inactive-branches.yml
vendored
Normal file
27
.github/workflows/rename-inactive-branches.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: Cleanup - Rename Inactive Branches
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0' # Runs every Sunday at midnight
|
||||
|
||||
jobs:
|
||||
archive-stale-branches:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Libraries
|
||||
run: pip install requests
|
||||
|
||||
- name: Run Script to Rename Inactive Branches
|
||||
run: |
|
||||
python .github/scripts/rename_inactive_branches.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -10,7 +10,8 @@ services:
|
||||
BASE_URL: "http://bridgehead-bbmri-blaze:8080"
|
||||
JAVA_TOOL_OPTIONS: "-Xmx${BLAZE_MEMORY_CAP:-4096}m"
|
||||
DB_RESOURCE_CACHE_SIZE: ${BLAZE_RESOURCE_CACHE_CAP:-2500000}
|
||||
DB_BLOCK_CACHE_SIZE: $BLAZE_MEMORY_CAP
|
||||
DB_BLOCK_CACHE_SIZE: ${BLAZE_MEMORY_CAP}
|
||||
CQL_EXPR_CACHE_SIZE: ${BLAZE_CQL_CACHE_CAP:-32}
|
||||
ENFORCE_REFERENTIAL_INTEGRITY: "false"
|
||||
volumes:
|
||||
- "blaze-data:/app/data"
|
||||
|
@ -2,7 +2,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
focus-eric:
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}-bbmri
|
||||
container_name: bridgehead-focus-eric
|
||||
environment:
|
||||
API_KEY: ${ERIC_FOCUS_BEAM_SECRET_SHORT}
|
||||
|
@ -2,7 +2,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
focus-gbn:
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}-bbmri
|
||||
container_name: bridgehead-focus-gbn
|
||||
environment:
|
||||
API_KEY: ${GBN_FOCUS_BEAM_SECRET_SHORT}
|
||||
|
@ -8,7 +8,8 @@ services:
|
||||
BASE_URL: "http://bridgehead-ccp-blaze:8080"
|
||||
JAVA_TOOL_OPTIONS: "-Xmx${BLAZE_MEMORY_CAP:-4096}m"
|
||||
DB_RESOURCE_CACHE_SIZE: ${BLAZE_RESOURCE_CACHE_CAP:-2500000}
|
||||
DB_BLOCK_CACHE_SIZE: $BLAZE_MEMORY_CAP
|
||||
DB_BLOCK_CACHE_SIZE: ${BLAZE_MEMORY_CAP}
|
||||
CQL_EXPR_CACHE_SIZE: ${BLAZE_CQL_CACHE_CAP:-32}
|
||||
ENFORCE_REFERENTIAL_INTEGRITY: "false"
|
||||
volumes:
|
||||
- "blaze-data:/app/data"
|
||||
@ -21,7 +22,7 @@ services:
|
||||
- "traefik.http.routers.blaze_ccp.tls=true"
|
||||
|
||||
focus:
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}
|
||||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG}-dktk
|
||||
container_name: bridgehead-focus
|
||||
environment:
|
||||
API_KEY: ${FOCUS_BEAM_SECRET_SHORT}
|
||||
@ -32,6 +33,7 @@ services:
|
||||
RETRY_COUNT: ${FOCUS_RETRY_COUNT}
|
||||
EPSILON: 0.28
|
||||
QUERIES_TO_CACHE: '/queries_to_cache.conf'
|
||||
ENDPOINT_TYPE: ${FOCUS_ENDPOINT_TYPE:-blaze}
|
||||
volumes:
|
||||
- /srv/docker/bridgehead/ccp/queries_to_cache.conf:/queries_to_cache.conf
|
||||
depends_on:
|
||||
@ -57,7 +59,6 @@ services:
|
||||
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
||||
- /srv/docker/bridgehead/ccp/root.crt.pem:/conf/root.crt.pem:ro
|
||||
|
||||
|
||||
volumes:
|
||||
blaze-data:
|
||||
|
||||
|
@ -22,7 +22,7 @@ services:
|
||||
|
||||
opal:
|
||||
container_name: bridgehead-opal
|
||||
image: docker.verbis.dkfz.de/ccp/dktk-opal:latest
|
||||
image: docker.verbis.dkfz.de/ccp/dktk-opal:test
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.opal_ccp.rule=PathPrefix(`/opal`)"
|
||||
@ -151,7 +151,7 @@ services:
|
||||
--pass-access-token=false
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.oauth2_proxy.rule=Host(`${HOST}`) && PathPrefix(`/oauth2`)"
|
||||
- "traefik.http.routers.oauth2_proxy.rule=PathPrefix(`/oauth2`)"
|
||||
- "traefik.http.services.oauth2_proxy.loadbalancer.server.port=4180"
|
||||
- "traefik.http.routers.oauth2_proxy.tls=true"
|
||||
environment:
|
||||
|
@ -65,3 +65,8 @@ services:
|
||||
- "traefik.http.routers.reporter_ccp.tls=true"
|
||||
- "traefik.http.middlewares.reporter_ccp_strip.stripprefix.prefixes=/ccp-reporter"
|
||||
- "traefik.http.routers.reporter_ccp.middlewares=reporter_ccp_strip"
|
||||
|
||||
focus:
|
||||
environment:
|
||||
EXPORTER_URL: "http://exporter:8092"
|
||||
AUTH_HEADER: "${EXPORTER_API_KEY}"
|
||||
|
@ -23,3 +23,7 @@ services:
|
||||
POSTGRES_DB: "dashboard"
|
||||
volumes:
|
||||
- "/var/cache/bridgehead/ccp/dashboard-db:/var/lib/postgresql/data"
|
||||
|
||||
focus:
|
||||
environment:
|
||||
POSTGRES_CONNECTION_STRING: "postgresql://dashboard:${DASHBOARD_DB_PASSWORD}@dashboard-db/dashboard"
|
@ -4,4 +4,5 @@ if [ "$ENABLE_FHIR2SQL" == true ]; then
|
||||
log INFO "Dashboard setup detected -- will start Dashboard backend and FHIR2SQL service."
|
||||
OVERRIDE+=" -f ./$PROJECT/modules/fhir2sql-compose.yml"
|
||||
DASHBOARD_DB_PASSWORD="$(generate_simple_password 'fhir2sql')"
|
||||
FOCUS_ENDPOINT_TYPE="blaze-and-sql"
|
||||
fi
|
||||
|
@ -19,10 +19,18 @@ services:
|
||||
- traefik-forward-auth
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Router with Authentication
|
||||
- "traefik.http.routers.id-manager.rule=PathPrefix(`/id-manager`)"
|
||||
- "traefik.http.services.id-manager.loadbalancer.server.port=8080"
|
||||
- "traefik.http.routers.id-manager.tls=true"
|
||||
- "traefik.http.routers.id-manager.middlewares=traefik-forward-auth-idm"
|
||||
- "traefik.http.routers.id-manager.service=id-manager-service"
|
||||
# Router without Authentication
|
||||
- "traefik.http.routers.id-manager-compatibility.rule=PathPrefix(`/id-manager/paths/translator/getIds`)"
|
||||
- "traefik.http.routers.id-manager-compatibility.tls=true"
|
||||
- "traefik.http.routers.id-manager-compatibility.service=id-manager-service"
|
||||
# Definition of Service
|
||||
- "traefik.http.services.id-manager-service.loadbalancer.server.port=8080"
|
||||
- "traefik.http.services.id-manager-service.loadbalancer.server.scheme=http"
|
||||
|
||||
patientlist:
|
||||
image: docker.verbis.dkfz.de/bridgehead/mainzelliste
|
||||
@ -57,7 +65,7 @@ services:
|
||||
- "/tmp/bridgehead/patientlist/:/docker-entrypoint-initdb.d/"
|
||||
|
||||
traefik-forward-auth:
|
||||
image: docker.verbis.dkfz.de/cache/oauth2-proxy/oauth2-proxy:v7.6.0
|
||||
image: docker.verbis.dkfz.de/cache/oauth2-proxy/oauth2-proxy:latest
|
||||
environment:
|
||||
- http_proxy=http://forward_proxy:3128
|
||||
- https_proxy=http://forward_proxy:3128
|
||||
@ -67,6 +75,7 @@ services:
|
||||
- OAUTH2_PROXY_CLIENT_ID=bridgehead-${SITE_ID}
|
||||
- OAUTH2_PROXY_CLIENT_SECRET=${IDMANAGER_AUTH_CLIENT_SECRET}
|
||||
- OAUTH2_PROXY_COOKIE_SECRET=${IDMANAGER_AUTH_COOKIE_SECRET}
|
||||
- OAUTH2_PROXY_COOKIE_NAME=_BRIDGEHEAD_oauth2_idm
|
||||
- OAUTH2_PROXY_COOKIE_DOMAINS=.${HOST}
|
||||
- OAUTH2_PROXY_HTTP_ADDRESS=:4180
|
||||
- OAUTH2_PROXY_REVERSE_PROXY=true
|
||||
@ -92,5 +101,12 @@ services:
|
||||
forward_proxy:
|
||||
condition: service_healthy
|
||||
|
||||
ccp-patient-project-identificator:
|
||||
image: samply/ccp-patient-project-identificator
|
||||
container_name: bridgehead-ccp-patient-project-identificator
|
||||
environment:
|
||||
MAINZELLISTE_APIKEY: ${IDMANAGER_LOCAL_PATIENTLIST_APIKEY}
|
||||
SITE_NAME: ${SITE_NAME}
|
||||
|
||||
volumes:
|
||||
patientlist-db-data:
|
||||
|
@ -171,8 +171,10 @@ optimizeBlazeMemoryUsage() {
|
||||
if [ $available_system_memory_chunks -eq 0 ]; then
|
||||
log WARN "Only ${BLAZE_MEMORY_CAP} system memory available for Blaze. If your Blaze stores more than 128000 fhir ressources it will run significally slower."
|
||||
export BLAZE_RESOURCE_CACHE_CAP=128000;
|
||||
export BLAZE_CQL_CACHE_CAP=32;
|
||||
else
|
||||
export BLAZE_RESOURCE_CACHE_CAP=$((available_system_memory_chunks * 312500))
|
||||
export BLAZE_CQL_CACHE_CAP=$((($system_memory_in_mb/4)/16));
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user