Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exit() errors and and __main__ section #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deploy/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#
# Database connection
#
database_host = '127.0.0.1'
database_host = 'mongo'
database_port = 27017
database_user = 'root'
database_password = 'example'
Expand Down Expand Up @@ -126,4 +126,4 @@
#
# Ontologies
#
ontologies_folder = "ontologies"
ontologies_folder = "ontologies"
53 changes: 38 additions & 15 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
###########################################
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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']
Expand All @@ -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']
Expand Down Expand Up @@ -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

Expand All @@ -124,5 +147,5 @@ services:
- POSTGRES_DB=keycloak
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=secret
# networks:
# - idp-priv
networks:
- idp-priv
15 changes: 9 additions & 6 deletions deploy/extract_filtering_terms.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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


Expand Down Expand Up @@ -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()