-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from samply/develop
Keep develop in sync with main
- Loading branch information
Showing
45 changed files
with
904 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: "3.7" | ||
|
||
services: | ||
blaze: | ||
image: docker.verbis.dkfz.de/cache/samply/blaze:0.28 | ||
container_name: bridgehead-cce-blaze | ||
environment: | ||
BASE_URL: "http://bridgehead-cce-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 | ||
ENFORCE_REFERENTIAL_INTEGRITY: "false" | ||
volumes: | ||
- "blaze-data:/app/data" | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.blaze_cce.rule=PathPrefix(`/cce-localdatamanagement`)" | ||
- "traefik.http.middlewares.cce_b_strip.stripprefix.prefixes=/cce-localdatamanagement" | ||
- "traefik.http.services.blaze_cce.loadbalancer.server.port=8080" | ||
- "traefik.http.routers.blaze_cce.middlewares=cce_b_strip,auth" | ||
- "traefik.http.routers.blaze_cce.tls=true" | ||
|
||
focus: | ||
image: docker.verbis.dkfz.de/cache/samply/focus:${FOCUS_TAG} | ||
container_name: bridgehead-focus | ||
environment: | ||
API_KEY: ${FOCUS_BEAM_SECRET_SHORT} | ||
BEAM_APP_ID_LONG: focus.${PROXY_ID} | ||
PROXY_ID: ${PROXY_ID} | ||
BLAZE_URL: "http://bridgehead-cce-blaze:8080/fhir/" | ||
BEAM_PROXY_URL: http://beam-proxy:8081 | ||
RETRY_COUNT: ${FOCUS_RETRY_COUNT} | ||
EPSILON: 0.28 | ||
depends_on: | ||
- "beam-proxy" | ||
- "blaze" | ||
|
||
beam-proxy: | ||
image: docker.verbis.dkfz.de/cache/samply/beam-proxy:${BEAM_TAG} | ||
container_name: bridgehead-beam-proxy | ||
environment: | ||
BROKER_URL: ${BROKER_URL} | ||
PROXY_ID: ${PROXY_ID} | ||
APP_focus_KEY: ${FOCUS_BEAM_SECRET_SHORT} | ||
PRIVKEY_FILE: /run/secrets/proxy.pem | ||
ALL_PROXY: http://forward_proxy:3128 | ||
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs | ||
ROOTCERT_FILE: /conf/root.crt.pem | ||
secrets: | ||
- proxy.pem | ||
depends_on: | ||
- "forward_proxy" | ||
volumes: | ||
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro | ||
- /srv/docker/bridgehead/cce/root.crt.pem:/conf/root.crt.pem:ro | ||
|
||
|
||
volumes: | ||
blaze-data: | ||
|
||
secrets: | ||
proxy.pem: | ||
file: /etc/bridgehead/pki/${SITE_ID}.priv.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: "3.7" | ||
services: | ||
landing: | ||
container_name: lens_federated-search | ||
image: docker.verbis.dkfz.de/ccp/lens:${SITE_ID} | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.landing.rule=PathPrefix(`/`)" | ||
- "traefik.http.services.landing.loadbalancer.server.port=80" | ||
- "traefik.http.routers.landing.tls=true" | ||
|
||
spot: | ||
image: docker.verbis.dkfz.de/ccp-private/central-spot | ||
environment: | ||
BEAM_SECRET: "${FOCUS_BEAM_SECRET_SHORT}" | ||
BEAM_URL: http://beam-proxy:8081 | ||
BEAM_PROXY_ID: ${SITE_ID} | ||
BEAM_BROKER_ID: ${BROKER_ID} | ||
BEAM_APP_ID: "focus" | ||
PROJECT_METADATA: "cce_supervisors" | ||
depends_on: | ||
- "beam-proxy" | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.services.spot.loadbalancer.server.port=8080" | ||
- "traefik.http.middlewares.corsheaders2.headers.accesscontrolallowmethods=GET,OPTIONS,POST" | ||
- "traefik.http.middlewares.corsheaders2.headers.accesscontrolalloworiginlist=https://${HOST}" | ||
- "traefik.http.middlewares.corsheaders2.headers.accesscontrolallowcredentials=true" | ||
- "traefik.http.middlewares.corsheaders2.headers.accesscontrolmaxage=-1" | ||
- "traefik.http.routers.spot.rule=Host(`${HOST}`) && PathPrefix(`/backend`)" | ||
- "traefik.http.middlewares.stripprefix_spot.stripprefix.prefixes=/backend" | ||
- "traefik.http.routers.spot.tls=true" | ||
- "traefik.http.routers.spot.middlewares=corsheaders2,stripprefix_spot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
if [ -n "$ENABLE_LENS" ];then | ||
OVERRIDE+=" -f ./$PROJECT/modules/lens-compose.yml" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDNTCCAh2gAwIBAgIUW34NEb7bl0+Ywx+I1VKtY5vpAOowDQYJKoZIhvcNAQEL | ||
BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjQwMTIyMTMzNzEzWhcNMzQw | ||
MTE5MTMzNzQzWjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN | ||
AQEBBQADggEPADCCAQoCggEBAL5UegLXTlq3XRRj8LyFs3aF0tpRPVoW9RXp5kFI | ||
TnBvyO6qjNbMDT/xK+4iDtEX4QQUvsxAKxfXbe9i1jpdwjgH7JHaSGm2IjAiKLqO | ||
OXQQtguWwfNmmp96Ql13ArLj458YH08xMO/w2NFWGwB/hfARa4z/T0afFuc/tKJf | ||
XbGCG9xzJ9tmcG45QN8NChGhVvaTweNdVxGWlpHxmi0Mn8OM9CEuB7nPtTTiBuiu | ||
pRC2zVVmNjVp4ktkAqL7IHOz+/F5nhiz6tOika9oD3376Xj055lPznLcTQn2+4d7 | ||
K7ZrBopCFxIQPjkgmYRLfPejbpdUjK1UVJw7hbWkqWqH7JMCAwEAAaN7MHkwDgYD | ||
VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFGjvRcaIP4HM | ||
poIguUAK9YL2n7fbMB8GA1UdIwQYMBaAFGjvRcaIP4HMpoIguUAK9YL2n7fbMBYG | ||
A1UdEQQPMA2CC0Jyb2tlci1Sb290MA0GCSqGSIb3DQEBCwUAA4IBAQCbzycJSaDm | ||
AXXNJqQ88djrKs5MDXS8RIjS/cu2ayuLaYDe+BzVmUXNA0Vt9nZGdaz63SLLcjpU | ||
fNSxBfKbwmf7s30AK8Cnfj9q4W/BlBeVizUHQsg1+RQpDIdMrRQrwkXv8mfLw+w5 | ||
3oaXNW6W/8KpBp/H8TBZ6myl6jCbeR3T8EMXBwipMGop/1zkbF01i98Xpqmhx2+l | ||
n+80ofPsSspOo5XmgCZym8CD/m/oFHmjcvOfpOCvDh4PZ+i37pmbSlCYoMpla3u/ | ||
7MJMP5lugfLBYNDN2p+V4KbHP/cApCDT5UWLOeAWjgiZQtHH5ilDeYqEc1oPjyJt | ||
Rtup0MTxSJtN | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BROKER_ID=test-no-real-data.broker.samply.de | ||
BROKER_URL=https://${BROKER_ID} | ||
PROXY_ID=${SITE_ID}.${BROKER_ID} | ||
FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)" | ||
FOCUS_RETRY_COUNT=${FOCUS_RETRY_COUNT:-64} | ||
SUPPORT_EMAIL=manoj.waikar@dkfz-heidelberg.de | ||
PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem | ||
BROKER_URL_FOR_PREREQ=$BROKER_URL | ||
|
||
for module in $PROJECT/modules/*.sh | ||
do | ||
log DEBUG "sourcing $module" | ||
source $module | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.