diff --git a/deploy/conf.py b/deploy/conf.py index 729de371..56f8e7f6 100644 --- a/deploy/conf.py +++ b/deploy/conf.py @@ -74,7 +74,7 @@ # # Database connection # -database_host = '127.0.0.1' +database_host = 'mongo' database_port = 27017 database_user = 'root' database_password = 'example' @@ -126,4 +126,4 @@ # # Ontologies # -ontologies_folder = "ontologies" \ No newline at end of file +ontologies_folder = "ontologies" diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 4fa2aba6..83d6916f 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -7,6 +7,29 @@ networks: services: + ########################################### + # beacon-ri-tools + ########################################### + + beacon-ri-tools: + image: beacon2ri/beacon_reference_implementation:v2.0.0 + hostname: beacon-ri-tools + networks: + - beacon-priv + tty: true + + ########################################### + # training-ui + ########################################### + + training-ui: + image: beacon2ri/training_ui:v0.1 + hostname: beacon_training_ui + ports: + - 8080:8080 + networks: + - beacon-priv + ########################################### # MongoDB Database ########################################### @@ -22,8 +45,8 @@ services: MONGO_INITDB_DATABASE: beacon volumes: - ./mongo-init/:/docker-entrypoint-initdb.d/:ro - # networks: - # - beacon-priv + networks: + - beacon-priv mongo-express: image: mongo-express @@ -34,8 +57,8 @@ services: ME_CONFIG_MONGODB_ADMINUSERNAME: root ME_CONFIG_MONGODB_ADMINPASSWORD: example ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/ - # networks: - # - beacon-priv + networks: + - beacon-priv ########################################### # Beacon @@ -55,9 +78,9 @@ services: - ./ontologies:/beacon/ontologies ports: - "5050:5050" - # networks: - # - beacon-priv - # - pub + networks: + - beacon-priv + - pub working_dir: '/beacon' entrypoint: ['python','-m','beacon'] # entrypoint: ['/bin/sleep','100000000'] @@ -75,9 +98,9 @@ services: - ./logger.yml:/beacon/logger.yml ports: - "5051:5051" - # networks: - # - beacon-priv - # - pub + networks: + - beacon-priv + - pub #entrypoint: ['/bin/sleep','100000000'] working_dir: '/beacon' entrypoint: ['python','-m', 'permissions'] @@ -110,9 +133,9 @@ services: - ./beacon-realm.json:/tmp/beacon-realm.json ports: - "8080:8080" - # networks: - # - pub - # - idp-priv + networks: + - pub + - idp-priv depends_on: - idp-db @@ -124,5 +147,5 @@ services: - POSTGRES_DB=keycloak - POSTGRES_USER=admin - POSTGRES_PASSWORD=secret - # networks: - # - idp-priv \ No newline at end of file + networks: + - idp-priv diff --git a/deploy/extract_filtering_terms.py b/deploy/extract_filtering_terms.py index 4dd296cf..7b8d5800 100644 --- a/deploy/extract_filtering_terms.py +++ b/deploy/extract_filtering_terms.py @@ -1,7 +1,8 @@ +import re +import sys import os.path import urllib.request from typing import List, Dict, Optional -import re from urllib.error import HTTPError import requests @@ -165,6 +166,8 @@ def get_properties_of_document(document, prefix="") -> List[str]: properties.append(prefix + '.' + key if prefix else key) elif isinstance(value, int): properties.append(prefix + '.' + key if prefix else key) + elif isinstance(value, float): + properties.append(prefix + '.' + key if prefix else key) elif isinstance(value, str): properties.append(prefix + '.' + key if prefix else key) elif isinstance(value, list): @@ -173,10 +176,10 @@ def get_properties_of_document(document, prefix="") -> List[str]: properties += get_properties_of_document(value, prefix + '.' + key if prefix else key) else: print('Unknown type:', value, ' (', type(value), ')') - exit(0) + sys.exit(0) else: print('Unknown type2:', document, ' (', type(document), ')') - exit(0) + sys.exit(0) return properties @@ -210,6 +213,6 @@ def insert_all_alphanumeric_terms_used(): if len(terms) > 0: client.beacon.filtering_terms.insert_many(terms) - -insert_all_ontology_terms_used() -insert_all_alphanumeric_terms_used() +if __name__=='__main__': + insert_all_ontology_terms_used() + insert_all_alphanumeric_terms_used()