diff --git a/.env.unix.example b/.env.unix.example index eec8b3c7bde116df329651c2e18f6b1cd7ac1290..0c0ec3bc05b29074c26887f5306074c31e1beb6b 100644 --- a/.env.unix.example +++ b/.env.unix.example @@ -15,7 +15,7 @@ KEYCLOAK_ADMIN=fda KEYCLOAK_ADMIN_PASSWORD=fda BROKER_CONSUMERS=2 WEBSITE=http://localhost -GATEWAY_ENDPOINT=http://gateway-service:9095 +GATEWAY_ENDPOINT=http://gateway-service TOKEN_MAX=5 LOG_LEVEL=trace # error, warning, info, debug, trace DOI_URL="https://doi.org" diff --git a/dbrepo-analyse-service/Dockerfile b/dbrepo-analyse-service/Dockerfile index 8f78283686e036255ebfb91f388dfcb298a2b590..d442cb5f68d657019daaee79a77b1fc7cd6f433c 100644 --- a/dbrepo-analyse-service/Dockerfile +++ b/dbrepo-analyse-service/Dockerfile @@ -4,7 +4,7 @@ MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> RUN apk update && apk --no-cache add build-base gcc python3-dev libpq-dev libffi-dev py3-pandas \ py3-sqlalchemy py3-requests py3-gevent py3-psycopg2 -COPY ./requirements.docker.txt ./requirements.txt +COPY ./requirements.txt ./requirements.txt RUN pip install -r ./requirements.txt WORKDIR /app @@ -14,7 +14,6 @@ ENV FLASK_RUN_HOST=0.0.0.0 ENV PORT_APP=5000 ENV FLASK_ENV=production ENV HOSTNAME=analyse-service -ENV EUREKA_SERVER=http://discovery-service:9090/eureka/ HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD ./service_ready diff --git a/dbrepo-analyse-service/app.py b/dbrepo-analyse-service/app.py index 38ea705005fc8985ed6d69d2fd7aa5d5a12b298d..2f4601669a25dff818eb0d4f1bbed1504c69784d 100644 --- a/dbrepo-analyse-service/app.py +++ b/dbrepo-analyse-service/app.py @@ -1,11 +1,9 @@ -import os from _csv import Error from flask import Flask, request, Response from determine_dt import determine_datatypes from determine_pk import determine_pk import logging -import py_eureka_client.eureka_client as eureka_client from flasgger import Swagger from flasgger.utils import swag_from from flasgger import LazyJSONEncoder @@ -148,11 +146,6 @@ def determinepk(): rest_server_port = 5000 -eureka_client.init(eureka_server=os.getenv('EUREKA_SERVER', 'http://localhost:9090/eureka/'), - app_name=os.getenv('HOSTNAME', 'analyse-service'), - instance_ip=os.getenv('HOSTNAME', 'analyse-service'), - instance_host=os.getenv('HOSTNAME', 'analyse-service'), - instance_port=rest_server_port) if __name__ == '__main__': http_server = WSGIServer(('', 5000), app) diff --git a/dbrepo-analyse-service/requirements.docker.txt b/dbrepo-analyse-service/requirements.docker.txt deleted file mode 100644 index bf69c5bd687e3fbc7cc2ae78015a14c131951db0..0000000000000000000000000000000000000000 --- a/dbrepo-analyse-service/requirements.docker.txt +++ /dev/null @@ -1,8 +0,0 @@ -messytables==0.15.2 -flask==2.3.2 -flasgger==0.9.5 -py-eureka-client==0.9.1 -docker==5.0.0 -prometheus_flask_exporter==0.21.0 -pytest==7.2.1 -coverage==7.1.0 \ No newline at end of file diff --git a/dbrepo-analyse-service/requirements.txt b/dbrepo-analyse-service/requirements.txt index 61e4283c6d9bed4a372d04172f7b8866b52aeaad..81e3eb123300e29ce57b2861b4f95636e1687e8b 100644 --- a/dbrepo-analyse-service/requirements.txt +++ b/dbrepo-analyse-service/requirements.txt @@ -1,13 +1,49 @@ +attrs==23.1.0 +certifi==2023.5.7 +chardet==5.1.0 +charset-normalizer==2.0.12 +click==8.1.3 +coverage==7.1.0 +docker==5.0.0 +exceptiongroup==1.1.1 +flasgger==0.9.5 +Flask==2.2.2 +gevent==21.8.0 +greenlet==1.1.3.post0 +html5lib==1.1 +idna==3.4 +importlib-metadata==6.6.0 +iniconfig==2.0.0 +itsdangerous==2.1.2 +Jinja2==3.1.2 +json-table-schema==0.2.1 +jsonschema==4.17.3 +lxml==4.9.2 +MarkupSafe==2.1.2 messytables==0.15.2 +mistune==2.0.5 +numpy==1.24.3 +packaging==23.1 pandas==1.2.3 -flask==2.3.2 -flasgger==0.9.5 +pluggy==1.0.0 +prometheus-client==0.16.0 +prometheus-flask-exporter==0.21.0 psycopg2-binary==2.8.6 -py-eureka-client==0.9.1 -docker==5.0.0 -sqlalchemy==1.4.15 -requests==2.26.0 -gevent==21.8.0 -prometheus_flask_exporter==0.21.0 +pyrsistent==0.19.3 pytest==7.2.1 -coverage==7.1.0 \ No newline at end of file +python-dateutil==2.8.2 +python-magic==0.4.27 +pytz==2023.3 +PyYAML==6.0 +requests==2.26.0 +six==1.16.0 +SQLAlchemy==1.4.15 +tomli==2.0.1 +urllib3==1.26.15 +webencodings==0.5.1 +websocket-client==1.5.1 +Werkzeug==2.3.3 +xlrd==2.0.1 +zipp==3.15.0 +zope.event==4.6 +zope.interface==6.0 diff --git a/dbrepo-authentication-service/Dockerfile b/dbrepo-authentication-service/Dockerfile index 33442559125c008fae59e2a795aa1084c9280d34..579d599274724c62789bcbaf5f1deb3cb436bdd8 100644 --- a/dbrepo-authentication-service/Dockerfile +++ b/dbrepo-authentication-service/Dockerfile @@ -35,8 +35,6 @@ COPY ./dbrepo-realm.json /opt/keycloak/data/import/dbrepo-realm.json WORKDIR /app -COPY ./service-register.sh ./service-register.sh -COPY ./docker-entrypoint.sh ./docker-entrypoint.sh COPY ./healthcheck.sh ./healthcheck.sh ENV METADATA_USERNAME=root @@ -54,4 +52,4 @@ ENV KEYCLOAK_ADMIN_PASSWORD=fda HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD ["bash", "/app/healthcheck.sh"] -ENTRYPOINT ["bash", "/app/docker-entrypoint.sh"] +ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm"] diff --git a/dbrepo-authentication-service/docker-entrypoint.sh b/dbrepo-authentication-service/docker-entrypoint.sh deleted file mode 100644 index d8e0fdcd850f1e8f867b99c22926aef8c341589e..0000000000000000000000000000000000000000 --- a/dbrepo-authentication-service/docker-entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -/app/service-register.sh authentication-service 8443 8080 -(while sleep 60; do bash /app/service-register.sh authentication-service 8443 8080; done) & - -/opt/keycloak/bin/kc.sh start-dev --import-realm diff --git a/dbrepo-authentication-service/service-register.sh b/dbrepo-authentication-service/service-register.sh deleted file mode 100755 index 2d7f64be971f7e14fad690f3e6a9b708f092ab26..0000000000000000000000000000000000000000 --- a/dbrepo-authentication-service/service-register.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# $1 is used as the host name. - -EUREKA_HOST="discovery-service" -EUREKA_PORT="9090" -EUREKA_URI="http://$EUREKA_HOST:$EUREKA_PORT" - -SERVICE_NAME="$1" -SERVICE_PROTOCOL="http" -SERVICE_HOST="$1" -SECURE_PORT="${2:-9000}" -SERVICE_PORT="${3:-9000}" - -SERVICE_URI="$SERVICE_PROTOCOL://$SERVICE_HOST:$SERVICE_PORT" -HOME_URI="$SERVICE_URI/realms/dbrepo" -HEALTH_URI="$SERVICE_URI/health" - -# This is the URL shown in the "status" field in the -# instances section of the eureka dashboard. -# -# It's up to you to decide what the URL points to. Some -# information or status endpoint might be good. -STATUS_URI="$SERVICE_URI/health" - -# This is the name displayed to the right of the status -# on the eureka dashbard. If the app (FAKE_SERVICE) is -# registered with more than one hostname, they will be -# displayed as a comma-separated list. This hostname -# is part of the heartbeat message. -# -# If you'll have more than one host per service, -# make sure they have different host names. -HOST_NAME="${1:-fake01}" - -# Everyone of these parameters seem to be required. I don't know -# anything about secureVipAddress and vipAddress. -# -# dataCenterInfo must have a name of "MyOwn" or "Amazon". -# -# status can be UP, DOWN, STARTING, OUT_OF_SERVICE, UNKNOWN. -# if the registration status is STARTING, then the service -# will never be evicted. Also, simply sending a Heartbeat -# does not change the status. -# -# The metadata fields can be any information you want associated -# with a service. I recommend keeping it short. -# - -cat <<EOF > /tmp/json.json -{ - "instance": { - "instanceId": "$SERVICE_NAME:$SERVICE_NAME:$SERVICE_PORT", - "hostName": "$HOST_NAME", - "app": "$SERVICE_NAME", - "ipAddr": "$SERVICE_HOST", - "status": "UP", - "dataCenterInfo": { - "@class": "com.netflix.appinfo.MyDataCenterInfo", - "name": "MyOwn" - }, - "healthCheckUrl": "$HEALTH_URI", - "homePageUrl": "$HOME_URI", - "leaseInfo": { - "evictionDurationInSecs": 90 - }, - "metadata": { - "zone": "default", - "management.port": "8443" - }, - "port": { - "\$": "$SERVICE_PORT", - "@enabled": "true" - }, - "securePort": { - "\$": "$SECURE_PORT", - "@enabled": "true" - }, - "vipAddress": "$SERVICE_HOST", - "secureVipAddress": "$SERVICE_HOST", - "statusPageUrl": "$STATUS_URI" - } -} -EOF - -curl --header "content-type: application/json" --data-binary @/tmp/json.json --silent $EUREKA_URI/eureka/apps/$SERVICE_NAME diff --git a/dbrepo-broker-service/Dockerfile b/dbrepo-broker-service/Dockerfile index 1b46c7899b8e9ab615e4e8d8f4e3876f09887106..c6824832c3158bce1c85c905112dac6cab261ae4 100644 --- a/dbrepo-broker-service/Dockerfile +++ b/dbrepo-broker-service/Dockerfile @@ -16,12 +16,9 @@ COPY ./rabbitmq.conf /etc/rabbitmq/rabbitmq.conf WORKDIR /app COPY ./init.sh ./init.sh -COPY ./service-register.sh ./service-register.sh COPY ./service_ready /usr/bin/service_ready COPY ./docker-entrypoint.sh ./docker-entrypoint.sh -RUN chmod +x ./service-register.sh - HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD service_ready ENTRYPOINT [ "bash", "/app/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/dbrepo-broker-service/docker-entrypoint.sh b/dbrepo-broker-service/docker-entrypoint.sh index 788bd0723fcc9d632b1c7713dcfeb14f490d2806..b062814baf3ea77ece53a565e36f9abf0b20e1eb 100755 --- a/dbrepo-broker-service/docker-entrypoint.sh +++ b/dbrepo-broker-service/docker-entrypoint.sh @@ -6,8 +6,4 @@ bash ./init.sh # enable prometheus plugin (sleep 10; rabbitmq-plugins enable rabbitmq_prometheus rabbitmq_mqtt rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl; touch /ready) & -# register with discovery service -/app/service-register.sh broker-service 15672 15672 -(while sleep 60; do /app/service-register.sh broker-service 15672 15672; done) & - rabbitmq-server \ No newline at end of file diff --git a/dbrepo-broker-service/service-register.sh b/dbrepo-broker-service/service-register.sh deleted file mode 100755 index 6cda6f4300050619f8edd2ce09a7c224e5bf5512..0000000000000000000000000000000000000000 --- a/dbrepo-broker-service/service-register.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -# $1 is used as the host name. - -EUREKA_HOST="discovery-service" -EUREKA_PORT="9090" -EUREKA_URI="http://$EUREKA_HOST:$EUREKA_PORT" - -SERVICE_NAME="$1" -SERVICE_PROTOCOL="http" -SERVICE_HOST="$1" -SECURE_PORT="${2:-9000}" -SERVICE_PORT="${3:-9000}" - -SERVICE_URI="$SERVICE_PROTOCOL://$SERVICE_HOST:$SERVICE_PORT" -HOME_URI="$SERVICE_URI/realms/dbrepo" -HEALTH_URI="$SERVICE_URI/health" - -# This is the URL shown in the "status" field in the -# instances section of the eureka dashboard. -# -# It's up to you to decide what the URL points to. Some -# information or status endpoint might be good. -STATUS_URI="$SERVICE_URI/health" - -# This is the name displayed to the right of the status -# on the eureka dashbard. If the app (FAKE_SERVICE) is -# registered with more than one hostname, they will be -# displayed as a comma-separated list. This hostname -# is part of the heartbeat message. -# -# If you'll have more than one host per service, -# make sure they have different host names. -HOST_NAME="${1:-fake01}" - -# Everyone of these parameters seem to be required. I don't know -# anything about secureVipAddress and vipAddress. -# -# dataCenterInfo must have a name of "MyOwn" or "Amazon". -# -# status can be UP, DOWN, STARTING, OUT_OF_SERVICE, UNKNOWN. -# if the registration status is STARTING, then the service -# will never be evicted. Also, simply sending a Heartbeat -# does not change the status. -# -# The metadata fields can be any information you want associated -# with a service. I recommend keeping it short. -# - -cat <<EOF > /tmp/json.json -{ - "instance": { - "instanceId": "$SERVICE_NAME:$SERVICE_NAME:$SERVICE_PORT", - "hostName": "$HOST_NAME", - "app": "$SERVICE_NAME", - "ipAddr": "$SERVICE_HOST", - "status": "UP", - "dataCenterInfo": { - "@class": "com.netflix.appinfo.MyDataCenterInfo", - "name": "MyOwn" - }, - "healthCheckUrl": "$HEALTH_URI", - "homePageUrl": "$HOME_URI", - "leaseInfo": { - "evictionDurationInSecs": 90 - }, - "metadata": { - "zone": "default", - "management.port": "15672" - }, - "port": { - "\$": "$SERVICE_PORT", - "@enabled": "true" - }, - "securePort": { - "\$": "$SECURE_PORT", - "@enabled": "false" - }, - "vipAddress": "$SERVICE_HOST", - "secureVipAddress": "$SERVICE_HOST", - "statusPageUrl": "$STATUS_URI" - } -} -EOF - -curl --header "content-type: application/json" --data-binary @/tmp/json.json --silent $EUREKA_URI/eureka/apps/$SERVICE_NAME diff --git a/dbrepo-container-service/rest-service/src/main/resources/application-local.yml b/dbrepo-container-service/rest-service/src/main/resources/application-local.yml index ca57158d4d162611602df256c838fdb3c2bb4b08..5ffa215283c5f634120d51fbd8343efedf2df4b9 100644 --- a/dbrepo-container-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-container-service/rest-service/src/main/resources/application-local.yml @@ -36,11 +36,6 @@ logging: root: warn at.tuwien.: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: container-service - non-secure-port: 9091 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: network: userdb mount.path: /tmp @@ -50,4 +45,4 @@ fda: public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB client_secret: client-secret client_id: dbrepo-client - gateway.endpoint: http://localhost:9095 \ No newline at end of file + gateway.endpoint: http://localhost \ No newline at end of file diff --git a/dbrepo-container-service/rest-service/src/main/resources/application.yml b/dbrepo-container-service/rest-service/src/main/resources/application.yml index 4d1061d16429fb302b5ac943666a22dcf3fe4e7a..d0b2927e65751b5a64329b653979692ed0b9f809 100644 --- a/dbrepo-container-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-container-service/rest-service/src/main/resources/application.yml @@ -36,11 +36,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: container-service - non-secure-port: 9091 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: network: "${USER_NETWORK}" mount.path: "${SHARED_FILESYSTEM}" @@ -50,4 +45,4 @@ fda: public_key: "${JWT_PUBKEY}" client_secret: "${DBREPO_CLIENT_SECRET}" client_id: "${CLIENT_ID}" - gateway.endpoint: http://gateway-service:9095 \ No newline at end of file + gateway.endpoint: http://gateway-service \ No newline at end of file diff --git a/dbrepo-database-service/Dockerfile b/dbrepo-database-service/Dockerfile index b181da3570e0e9461a27a3b91be26e2d85ae151b..a2d4257a25edc04a812290520972f9343f6e60f0 100644 --- a/dbrepo-database-service/Dockerfile +++ b/dbrepo-database-service/Dockerfile @@ -29,7 +29,7 @@ ENV BROKER_PASSWORD=fda ENV SEARCH_ENDPOINT=search-service ENV SEARCH_USERNAME=elastic ENV SEARCH_PASSWORD=elastic -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 +ENV GATEWAY_ENDPOINT=http://gateway-service ENV LOG_LEVEL=debug ENV DBREPO_CLIENT_SECRET=client-secret ENV CLIENT_ID=dbrepo-client diff --git a/dbrepo-database-service/rest-service/src/main/resources/application-local.yml b/dbrepo-database-service/rest-service/src/main/resources/application-local.yml index c6bb7a1caaa6caf9aa606d0a8764a2cfb03b1e03..0fdd60eace0b1f9e072433b38e93eb20f459a8c7 100644 --- a/dbrepo-database-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-database-service/rest-service/src/main/resources/application-local.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: info org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: database-service - non-secure-port: 9092 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: elastic: endpoint: localhost:9200 @@ -51,4 +46,4 @@ fda: public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB client_secret: client-secret client_id: dbrepo-client - gateway.endpoint: http://localhost:9095 \ No newline at end of file + gateway.endpoint: http://localhost \ No newline at end of file diff --git a/dbrepo-database-service/rest-service/src/main/resources/application.yml b/dbrepo-database-service/rest-service/src/main/resources/application.yml index 434d09b0be7696113f76f5b2b35f589f46a30b1d..88ffaa9d7f75f5d7ff1c00721524b1fe2a8d9939 100644 --- a/dbrepo-database-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-database-service/rest-service/src/main/resources/application.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: database-service - non-secure-port: 9092 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: elastic: endpoint: search-service:9200 diff --git a/dbrepo-discovery-service/.gitignore b/dbrepo-discovery-service/.gitignore deleted file mode 100644 index b60573d098237e09a5c4eabeae2ccda891966c09..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -## Generated -rest-service/ready - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ diff --git a/dbrepo-discovery-service/.mvn/wrapper/MavenWrapperDownloader.java b/dbrepo-discovery-service/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100644 index a45eb6ba269cd38f8965cef786729790945d9537..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2007-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.net.*; -import java.io.*; -import java.nio.channels.*; -import java.util.Properties; - -public class MavenWrapperDownloader { - - private static final String WRAPPER_VERSION = "0.5.6"; - /** - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. - */ - private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" - + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; - - /** - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to - * use instead of the default one. - */ - private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; - - /** - * Path where the maven-wrapper.jar will be saved to. - */ - private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; - - /** - * Name of the property which should be used to override the default download url for the wrapper. - */ - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; - - public static void main(String args[]) { - System.out.println("- Downloader started"); - File baseDirectory = new File(args[0]); - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); - - // If the maven-wrapper.properties exists, read it and check if it contains a custom - // wrapperUrl parameter. - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - String url = DEFAULT_DOWNLOAD_URL; - if (mavenWrapperPropertyFile.exists()) { - FileInputStream mavenWrapperPropertyFileInputStream = null; - try { - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); - Properties mavenWrapperProperties = new Properties(); - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } catch (IOException e) { - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); - } finally { - try { - if (mavenWrapperPropertyFileInputStream != null) { - mavenWrapperPropertyFileInputStream.close(); - } - } catch (IOException e) { - // Ignore ... - } - } - } - System.out.println("- Downloading from: " + url); - - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if (!outputFile.getParentFile().exists()) { - if (!outputFile.getParentFile().mkdirs()) { - System.out.println( - "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); - } - } - System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); - try { - downloadFileFromURL(url, outputFile); - System.out.println("Done"); - System.exit(0); - } catch (Throwable e) { - System.out.println("- Error downloading"); - e.printStackTrace(); - System.exit(1); - } - } - - private static void downloadFileFromURL(String urlString, File destination) throws Exception { - if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { - String username = System.getenv("MVNW_USERNAME"); - char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); - Authenticator.setDefault(new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(username, password); - } - }); - } - URL website = new URL(urlString); - ReadableByteChannel rbc; - rbc = Channels.newChannel(website.openStream()); - FileOutputStream fos = new FileOutputStream(destination); - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); - fos.close(); - rbc.close(); - } - -} diff --git a/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.jar b/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054..0000000000000000000000000000000000000000 Binary files a/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.properties b/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 642d572ce90e5085986bdd9c9204b9404f028084..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/dbrepo-discovery-service/Dockerfile b/dbrepo-discovery-service/Dockerfile deleted file mode 100644 index b216c09e0936a2af0b4f12f097a99723ab65bc7f..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -###### FIRST STAGE ###### -FROM dbrepo-metadata-db:latest as dependency -MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> - -###### SECOND STAGE ###### -FROM maven:slim as build - -COPY ./pom.xml ./ - -RUN mvn -fn -B dependency:go-offline > /dev/null - -COPY --from=dependency /root/.m2/repository/at/tuwien /root/.m2/repository/at/tuwien - -COPY ./rest-service ./rest-service -COPY ./services ./services -COPY ./report ./report - -# Make sure it compiles -RUN mvn -q clean package -DskipTests - -###### THIRD STAGE ###### -FROM openjdk:11-jre-slim as runtime - -ENV METADATA_DB=fda -ENV METADATA_USERNAME=postgres -ENV METADATA_PASSWORD=postgres -ENV LOG_LEVEL=debug - -COPY ./service_ready /usr/bin -RUN chmod +x /usr/bin/service_ready - -HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD service_ready - -COPY --from=build ./rest-service/target/rest-service-*.jar ./rest-service.jar - -EXPOSE 9090 - -ENTRYPOINT ["java", "-Dlog4j2.formatMsgNoLookups=true", "-jar", "./rest-service.jar"] diff --git a/dbrepo-discovery-service/mvnw b/dbrepo-discovery-service/mvnw deleted file mode 100755 index dea2123dccdfdb51caebcfe8e5964494fdeb2a89..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-at.tuwien.gateway.config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/dbrepo-discovery-service/mvnw.cmd b/dbrepo-discovery-service/mvnw.cmd deleted file mode 100644 index 4a6729c8ab8f9413d3e6956fdef16f3621367758..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.at.tuwien.gateway.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.at.tuwien.gateway.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/dbrepo-discovery-service/pom.xml b/dbrepo-discovery-service/pom.xml deleted file mode 100644 index c7b10ef2f4cda0937bdd5737f8d38d6ab477267d..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>2.3.10.RELEASE</version> - </parent> - - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-discovery-service</artifactId> - <version>1.2.0</version> - <name>dbrepo-discovery-service</name> - <description>Demo project for Spring Boot</description> - - <packaging>pom</packaging> - <modules> - <module>report</module> - <module>rest-service</module> - <module>services</module> - </modules> - - <properties> - <java.version>11</java.version> - <spring-cloud.version>3.0.1</spring-cloud.version> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-bootstrap</artifactId> - <version>${spring-cloud.version}</version> - </dependency> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> - <version>${spring-cloud.version}</version> - </dependency> - <!-- Data Source --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> - <dependency> - <groupId>org.mariadb.jdbc</groupId> - <artifactId>mariadb-java-client</artifactId> - <version>${mariadb.version}</version> - </dependency> - <!-- Monitoring --> - <dependency> - <groupId>io.micrometer</groupId> - <artifactId>micrometer-registry-prometheus</artifactId> - <scope>runtime</scope> - </dependency> - <!-- IDE --> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </dependency> - <!-- Testing --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-vintage-engine</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - </dependency> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-metadata-db-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <excludes> - <exclude>at/tuwien/utils/**/*</exclude> - <exclude>at/tuwien/seeder/**/*</exclude> - <exclude>at/tuwien/mapper/**/*</exclude> - <exclude>at/tuwien/exception/**/*</exclude> - <exclude>at/tuwien/config/**/*</exclude> - <exclude>**/DbrepoDiscoveryServiceApplication.class</exclude> - </excludes> - </configuration> - <executions> - <execution> - <id>default-prepare-agent</id> - <goals> - <goal>prepare-agent</goal> - </goals> - </execution> - <execution> - <id>report</id> - <phase>verify</phase> - <goals> - <goal>report</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/dbrepo-discovery-service/report/pom.xml b/dbrepo-discovery-service/report/pom.xml deleted file mode 100644 index e5f5fcaad75a161a5c72d3df824ad95fa797e0fd..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/report/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-discovery-service</artifactId> - <version>1.2.0</version> - </parent> - - <artifactId>report</artifactId> - <version>1.2.0</version> - <name>dbrepo-discovery-service-report</name> - - <properties> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <dependencies> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>rest-service</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>services</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <executions> - <execution> - <id>report-aggregate</id> - <phase>verify</phase> - <goals> - <goal>report-aggregate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/pom.xml b/dbrepo-discovery-service/rest-service/pom.xml deleted file mode 100644 index 453330597b6bee2a57cbd803fadf4f5f58a99557..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-discovery-service</artifactId> - <version>1.2.0</version> - </parent> - - <artifactId>rest-service</artifactId> - <version>1.2.0</version> - <name>dbrepo-discovery-service-discovery</name> - - <properties> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>repackage</goal><!-- to make it exuteable with $ java -jar ./app.jar --> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>services</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - -</project> \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/DbrepoDiscoveryServiceApplication.java b/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/DbrepoDiscoveryServiceApplication.java deleted file mode 100644 index 6561edd18f7cefbf79d75824a8a16a887f147ca4..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/DbrepoDiscoveryServiceApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.tuwien; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; - -@SpringBootApplication -@EnableEurekaServer -public class DbrepoDiscoveryServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(DbrepoDiscoveryServiceApplication.class, args); - } - -} diff --git a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java b/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java deleted file mode 100644 index cb0c9ffc9ee477fe22ec4a9ceb75d804285efe6f..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.tuwien.config; - -import lombok.Getter; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.client.support.BasicAuthenticationInterceptor; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.util.DefaultUriBuilderFactory; - -@Getter -@Configuration -public class GatewayConfig { - - @Value("${fda.gateway.endpoint}") - private String gatewayEndpoint; - - @Value("${spring.rabbitmq.username}") - private String brokerUsername; - - @Value("${spring.rabbitmq.password}") - private String brokerPassword; - - @Bean("brokerRestTemplate") - public RestTemplate brokerRestTemplate() { - final RestTemplate restTemplate = new RestTemplate(); - restTemplate.setUriTemplateHandler(new DefaultUriBuilderFactory(gatewayEndpoint)); - restTemplate.getInterceptors() - .add(new BasicAuthenticationInterceptor(brokerUsername, brokerPassword)); - return restTemplate; - } -} diff --git a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java b/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java deleted file mode 100644 index fba7f99cf2bf1cbb12ac51cd6fd5b80751ff43c1..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package at.tuwien.config; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.Date; -import java.util.TimeZone; - -@Slf4j -@Configuration -public class JacksonConfig { - - @Bean - public ObjectMapper objectMapper() throws JsonProcessingException { - final ObjectMapper objectMapper = new ObjectMapper(); - objectMapper.findAndRegisterModules(); - objectMapper.registerModule(new Jdk8Module()); - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - objectMapper.setTimeZone(TimeZone.getTimeZone("UTC")); - log.debug("current time is {}", objectMapper.writeValueAsString(new Date())); - return objectMapper; - } - -} diff --git a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java b/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java deleted file mode 100644 index 0bee3b961edd4ca456f0243c8eede630a4a54716..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java +++ /dev/null @@ -1,23 +0,0 @@ -package at.tuwien.config; - -import com.google.common.io.Files; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.event.EventListener; - -import java.io.File; -import java.io.IOException; - -@Configuration -public class ReadyConfig { - - @Value("${fda.ready.path}") - private String readyPath; - - @EventListener(ApplicationReadyEvent.class) - public void init() throws IOException { - Files.touch(new File(readyPath)); - } - -} diff --git a/dbrepo-discovery-service/rest-service/src/main/resources/application-local.yml b/dbrepo-discovery-service/rest-service/src/main/resources/application-local.yml deleted file mode 100644 index 1ab259ae3fe70e9b2b3e44c9f46c7dea341cc81a..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/resources/application-local.yml +++ /dev/null @@ -1,54 +0,0 @@ -app.version: '@project.version@' -spring: - main.banner-mode: off - datasource: - url: jdbc:mariadb://localhost:3306/fda - driver-class-name: org.mariadb.jdbc.Driver - username: root - password: dbrepo - jpa: - show-sql: false - database-platform: org.hibernate.dialect.MariaDBDialect - hibernate: - ddl-auto: validate - use-new-id-generator-mappings: false - open-in-view: false - properties: - hibernate: - default_schema: fda - jdbc: - time_zone: UTC - application: - name: discovery-service - rabbitmq: - host: localhost - username: fda - password: fda - cloud: - loadbalancer.ribbon.enabled: false - gateway: - httpclient: - ssl: - useInsecureTrustManager: true -management.endpoints.web.exposure.include: health,info,prometheus -server: - port: 9090 -logging: - pattern.console: "%d %highlight(%-5level) %msg%n" - level: - root: warn - at.tuwien.: info - org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - client: - register-with-eureka: false - fetch-registry: false - serviceUrl.defaultZone: http://localhost:9090/eureka/ - instance: - hostname: discovery-service - non-secure-port-enabled: false - secure-port-enabled: true - secure-port: 9090 -fda: - ready.path: ./ready - gateway.endpoint: http://localhost:9095 \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/src/main/resources/application.yml b/dbrepo-discovery-service/rest-service/src/main/resources/application.yml deleted file mode 100644 index 3d691f1015f4b01cb4335c8835f0ae07dc112785..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/main/resources/application.yml +++ /dev/null @@ -1,48 +0,0 @@ -app.version: '@project.version@' -spring: - main.banner-mode: off - datasource: - url: jdbc:mariadb://metadata-db:3306/fda - driver-class-name: org.mariadb.jdbc.Driver - username: "${METADATA_USERNAME}" - password: "${METADATA_PASSWORD}" - jpa: - show-sql: false - database-platform: org.hibernate.dialect.MariaDBDialect - hibernate: - ddl-auto: validate - open-in-view: false - properties: - hibernate: - jdbc: - time_zone: UTC - application: - name: discovery-service - rabbitmq: - host: broker-service - username: "${BROKER_USERNAME}" - password: "${BROKER_PASSWORD}" - cloud: - loadbalancer.ribbon.enabled: false -management.endpoints.web.exposure.include: health,info,prometheus -server: - port: 9090 -logging: - pattern.console: "%d %highlight(%-5level) %msg%n" - level: - root: warn - at.tuwien.: "${LOG_LEVEL}" - org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - client: - register-with-eureka: false - fetch-registry: false - serviceUrl.defaultZone: http://discovery-service:9090/eureka/ - instance: - hostname: discovery-service - non-secure-port-enabled: false - secure-port-enabled: true - secure-port: 9090 -fda: - ready.path: /ready - gateway.endpoint: "${GATEWAY_ENDPOINT}" \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/src/main/resources/config.properties b/dbrepo-discovery-service/rest-service/src/main/resources/config.properties deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java b/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java deleted file mode 100644 index c5adb93d3dddc50757d88380ed50857a1e034610..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/BaseUnitTest.java +++ /dev/null @@ -1,9 +0,0 @@ -package at.tuwien; - -import at.tuwien.test.BaseTest; -import org.springframework.test.context.TestPropertySource; - -@TestPropertySource(locations = "classpath:application.properties") -public abstract class BaseUnitTest extends BaseTest { - -} \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/MockServiceIntegrationTest.java b/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/MockServiceIntegrationTest.java deleted file mode 100644 index 329ae7be2373a0eeb6eca51d5b16183d91ab3ed1..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/test/java/at/tuwien/MockServiceIntegrationTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package at.tuwien; - -import at.tuwien.config.H2Utils; -import at.tuwien.service.MockService; -import lombok.extern.log4j.Log4j2; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; - -import static org.junit.jupiter.api.Assertions.assertTrue; - - -@Log4j2 -@SpringBootTest -public class MockServiceIntegrationTest extends BaseUnitTest { - - @Autowired - private H2Utils h2Utils; - - @Autowired - private MockService mockService; - - @BeforeEach - public void beforeEach() { - h2Utils.runScript("schema.sql"); - } - - @Test - public void mock_succeeds() { - - /* test */ - final Boolean response = mockService.mock(); - assertTrue(response); - } - -} diff --git a/dbrepo-discovery-service/rest-service/src/test/resources/application.properties b/dbrepo-discovery-service/rest-service/src/test/resources/application.properties deleted file mode 100644 index 1caa6874366e985b357c2d5b32bd12316edf0de3..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/test/resources/application.properties +++ /dev/null @@ -1,11 +0,0 @@ -# enable local spring profile -spring.profiles.active=local - -# disable datasource -spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password=password -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.show-sql=false \ No newline at end of file diff --git a/dbrepo-discovery-service/rest-service/src/test/resources/schema.sql b/dbrepo-discovery-service/rest-service/src/test/resources/schema.sql deleted file mode 100644 index 906d8df808fa8f79c1f7c1c26088c55da6c9ee9b..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/rest-service/src/test/resources/schema.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE SCHEMA IF NOT EXISTS `fda`; -SET SCHEMA `fda`; -DROP TABLE IF EXISTS fda.mdb_concepts; -CREATE TABLE IF NOT EXISTS fda.mdb_concepts -( - uri VARCHAR(500) not null, - name VARCHAR(255), - created timestamp NOT NULL DEFAULT NOW(), - created_by bigint, - PRIMARY KEY (uri) -); -DROP TABLE IF EXISTS fda.mdb_units; -CREATE TABLE IF NOT EXISTS fda.mdb_units -( - uri VARCHAR(500) not null, - name VARCHAR(255), - created timestamp NOT NULL DEFAULT NOW(), - created_by bigint, - PRIMARY KEY (uri) -); --- Modified for H2 --- Assume id=1 is invalid --- Assume id=2 is still valid token --- CREATE VIEW IF NOT EXISTS fda.mdb_invalid_tokens AS --- (SELECT `id`, `token_hash`, `creator`, `created`, `expires`, `last_used` FROM fda.`mdb_tokens` WHERE `id` = 1); \ No newline at end of file diff --git a/dbrepo-discovery-service/service_ready b/dbrepo-discovery-service/service_ready deleted file mode 100644 index b2e4f9df6804f249ba8aadd72f742929072badaa..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/service_ready +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -if [ -f /ready ]; then - echo "service is ready and accepting connections" - exit 0 -fi -exit 1 \ No newline at end of file diff --git a/dbrepo-discovery-service/services/pom.xml b/dbrepo-discovery-service/services/pom.xml deleted file mode 100644 index 8ac4f5a15d79b5e1d2663e37c38120e5e7065963..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/services/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>dbrepo-discovery-service</artifactId> - <groupId>at.tuwien</groupId> - <version>1.2.0</version> - </parent> - - <artifactId>services</artifactId> - <version>1.2.0</version> - <name>dbrepo-discovery-service-services</name> - -</project> \ No newline at end of file diff --git a/dbrepo-discovery-service/services/src/main/java/at/tuwien/service/MockService.java b/dbrepo-discovery-service/services/src/main/java/at/tuwien/service/MockService.java deleted file mode 100644 index 521e25785d998c394a5a774b9299da0c93206ffa..0000000000000000000000000000000000000000 --- a/dbrepo-discovery-service/services/src/main/java/at/tuwien/service/MockService.java +++ /dev/null @@ -1,12 +0,0 @@ -package at.tuwien.service; - -import org.springframework.stereotype.Service; - -@Service -public class MockService { - - public Boolean mock() { - return true; - } - -} diff --git a/dbrepo-gateway-service/.gitignore b/dbrepo-gateway-service/.gitignore deleted file mode 100644 index 549e00a2a96fa9d7c5dbc9859664a78d980158c2..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -HELP.md -target/ -!.mvn/wrapper/maven-wrapper.jar -!**/src/main/**/target/ -!**/src/test/**/target/ - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ -build/ -!**/src/main/**/build/ -!**/src/test/**/build/ - -### VS Code ### -.vscode/ diff --git a/dbrepo-gateway-service/.mvn/wrapper/MavenWrapperDownloader.java b/dbrepo-gateway-service/.mvn/wrapper/MavenWrapperDownloader.java deleted file mode 100644 index a45eb6ba269cd38f8965cef786729790945d9537..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/.mvn/wrapper/MavenWrapperDownloader.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2007-present the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.net.*; -import java.io.*; -import java.nio.channels.*; -import java.util.Properties; - -public class MavenWrapperDownloader { - - private static final String WRAPPER_VERSION = "0.5.6"; - /** - * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. - */ - private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" - + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; - - /** - * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to - * use instead of the default one. - */ - private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; - - /** - * Path where the maven-wrapper.jar will be saved to. - */ - private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; - - /** - * Name of the property which should be used to override the default download url for the wrapper. - */ - private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; - - public static void main(String args[]) { - System.out.println("- Downloader started"); - File baseDirectory = new File(args[0]); - System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); - - // If the maven-wrapper.properties exists, read it and check if it contains a custom - // wrapperUrl parameter. - File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); - String url = DEFAULT_DOWNLOAD_URL; - if (mavenWrapperPropertyFile.exists()) { - FileInputStream mavenWrapperPropertyFileInputStream = null; - try { - mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); - Properties mavenWrapperProperties = new Properties(); - mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); - url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); - } catch (IOException e) { - System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); - } finally { - try { - if (mavenWrapperPropertyFileInputStream != null) { - mavenWrapperPropertyFileInputStream.close(); - } - } catch (IOException e) { - // Ignore ... - } - } - } - System.out.println("- Downloading from: " + url); - - File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if (!outputFile.getParentFile().exists()) { - if (!outputFile.getParentFile().mkdirs()) { - System.out.println( - "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); - } - } - System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); - try { - downloadFileFromURL(url, outputFile); - System.out.println("Done"); - System.exit(0); - } catch (Throwable e) { - System.out.println("- Error downloading"); - e.printStackTrace(); - System.exit(1); - } - } - - private static void downloadFileFromURL(String urlString, File destination) throws Exception { - if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { - String username = System.getenv("MVNW_USERNAME"); - char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); - Authenticator.setDefault(new Authenticator() { - @Override - protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication(username, password); - } - }); - } - URL website = new URL(urlString); - ReadableByteChannel rbc; - rbc = Channels.newChannel(website.openStream()); - FileOutputStream fos = new FileOutputStream(destination); - fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); - fos.close(); - rbc.close(); - } - -} diff --git a/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.jar b/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 2cc7d4a55c0cd0092912bf49ae38b3a9e3fd0054..0000000000000000000000000000000000000000 Binary files a/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.properties b/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 642d572ce90e5085986bdd9c9204b9404f028084..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/dbrepo-gateway-service/Dockerfile b/dbrepo-gateway-service/Dockerfile index 7fd33750f721c204635b9c51e91365ae439a3bc7..6086e614d19011a1df5854c3af5881fa7350a237 100644 --- a/dbrepo-gateway-service/Dockerfile +++ b/dbrepo-gateway-service/Dockerfile @@ -1,45 +1,4 @@ -###### FIRST STAGE ###### -FROM dbrepo-metadata-db:latest as dependency -MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> +FROM nginx:alpine AS runtime +MAINTAINER Martin Weise <martin.weise@tuwien.ac.at -###### FIRST STAGE ###### -FROM maven:slim as build - -COPY ./pom.xml ./ - -RUN mvn -fn -B dependency:go-offline > /dev/null - -COPY --from=dependency /root/.m2/repository/at/tuwien /root/.m2/repository/at/tuwien - -COPY ./report ./report -COPY ./rest-service ./rest-service - -# Make sure it compiles -RUN mvn -q clean package -DskipTests - -###### SECOND STAGE ###### -FROM openjdk:11-jre-slim as runtime - -ENV METADATA_DB=fda -ENV METADATA_USERNAME=postgres -ENV METADATA_PASSWORD=postgres -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 -ENV LOG_LEVEL=debug - -WORKDIR /app - -COPY ./server.keystore ./server.keystore -COPY ./root.crt /etc/ssl/certs/DBRepo_Root_CA.crt - -RUN cat /etc/ssl/certs/DBRepo_Root_CA.crt >> /etc/ssl/certs/ca-certificates.crt - -COPY ./service_ready /usr/bin -RUN chmod +x /usr/bin/service_ready - -HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD service_ready - -COPY --from=build ./rest-service/target/rest-service-*.jar ./rest-service.jar - -EXPOSE 9095 - -ENTRYPOINT ["java", "-Dlog4j2.formatMsgNoLookups=true", "-Djavax.net.ssl.trustStore=/app/server.keystore", "-Djavax.net.ssl.trustStorePassword=password", "-jar", "./rest-service.jar"] \ No newline at end of file +COPY ./dbrepo.conf /etc/nginx/conf.d/default.conf diff --git a/dbrepo-gateway-service/README.md b/dbrepo-gateway-service/README.md deleted file mode 100644 index 75fed4cae459ea1b6c37d40d48de6573a856ddb2..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Gateway Service - -## Actuator - -* Overview: [https://localhost:9095/actuator/](https://localhost:9095/actuator/) -* Info: [https://localhost:9095/actuator/info](https://localhost:9095/actuator/info) - -## Prometheus - -* Overview: [https://localhost:9095/actuator/prometheus](https://localhost:9095/actuator/prometheus) - -## Health - -* Overview: [https://localhost:9095/actuator/health/](https://localhost:9095/actuator/health/) - -# Routes - -* Overview: [https://localhost:9095/actuator/gateway/routes](https://localhost:9095/actuator/gateway/routes) \ No newline at end of file diff --git a/dbrepo-gateway-service/dbrepo.conf b/dbrepo-gateway-service/dbrepo.conf new file mode 100644 index 0000000000000000000000000000000000000000..08a12c17477ec885bdeec28a42d4c36ed0b33e7f --- /dev/null +++ b/dbrepo-gateway-service/dbrepo.conf @@ -0,0 +1,271 @@ +client_max_body_size 2G; + +resolver 127.0.0.11 valid=30s; # docker dns + +upstream authentication { + server authentication-service:8444; +} + +upstream user { + server user-service:9098; +} + +upstream broker { + server broker-service:15672; +} + +upstream analyse { + server analyse-service:5000; +} + +upstream metadata { + server metadata-service:9099; +} + +upstream identifier { + server identifier-service:9096; +} + +upstream query { + server query-service:9093; +} + +upstream table { + server table-service:9094; +} + +upstream database { + server database-service:9094; +} + +upstream container { + server container-service:9092; +} + +upstream semantics { + server semantics-service:5010; +} + +upstream search { + server search-service:9200; +} + +upstream ui { + server ui:3000; +} + +server { + listen 80 default_server; + server_name _; + + location /api/auth { + rewrite /api/auth/(.*) /api/$1 break; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://authentication; + proxy_read_timeout 90; + } + + location /api/user { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://user; + proxy_read_timeout 90; + } + + location /api/broker { + rewrite /api/broker/(.*) /api/$1 break; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://broker; + proxy_read_timeout 90; + } + + location /api/analyse { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://analyse; + proxy_read_timeout 90; + } + + location /api/oai { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://metadata; + proxy_read_timeout 90; + } + + location /api/identifier { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://identifier; + proxy_read_timeout 90; + } + + location /pid { + rewrite /pid/(.*) /api/pid/$1 break; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://identifier; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/query { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/view { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table/[0-9]+/history { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table/[0-9]+/data { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table/[0-9]+/query { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table/[0-9]+/export { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table/[0-9]+/consumer { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/version { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://query; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/table { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://table; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://database; + proxy_read_timeout 90; + } + + location /api/container/[0-9]+/database/[0-9]+/access { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://database; + proxy_read_timeout 90; + } + + location /api/container { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://container; + proxy_read_timeout 90; + } + + location /api/image { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://container; + proxy_read_timeout 90; + } + + location /api/semantics { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://semantics; + proxy_read_timeout 90; + } + + location /retrieve { + rewrite /retrieve/(.*) /$1 break; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://search; + proxy_read_timeout 90; + } + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://ui; + proxy_read_timeout 90; + } +} diff --git a/dbrepo-gateway-service/mvnw b/dbrepo-gateway-service/mvnw deleted file mode 100755 index a16b5431b4c3cab50323a3f558003fd0abd87dad..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/dbrepo-gateway-service/mvnw.cmd b/dbrepo-gateway-service/mvnw.cmd deleted file mode 100644 index c8d43372c986d97911cdc21bd87e0cbe3d83bdda..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM https://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/dbrepo-gateway-service/pom.xml b/dbrepo-gateway-service/pom.xml deleted file mode 100644 index addee3cef67e6f4a64c220ac55aed5b92c7739e3..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/pom.xml +++ /dev/null @@ -1,149 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>2.3.4.RELEASE</version> - </parent> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-gateway-service</artifactId> - <version>1.2.0</version> - <name>dbrepo-gateway-service</name> - <description>Service that proxies the API to the microservices</description> - <url>https://dbrepo-docs.ossdip.at</url> - <developers> - <developer> - <name>Martin Weise</name> - <email>martin.weise@tuwien.ac.at</email> - <organization>TU Wien</organization> - </developer> - </developers> - - <packaging>pom</packaging> - <modules> - <module>rest-service</module> - <module>report</module> - </modules> - - <properties> - <java.version>11</java.version> - <spring-cloud.version>Hoxton.SR10</spring-cloud.version><!-- SR11 not working yet --> - <swagger.version>2.1.7</swagger.version> - <springfox.version>3.0.0</springfox.version> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <dependencies> - <!-- Gate --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-actuator</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-webflux</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-gateway</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> - </dependency> - <!-- Embedded DataSource --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - <scope>runtime</scope> - </dependency> - <!-- Monitoring --> - <dependency> - <groupId>io.micrometer</groupId> - <artifactId>micrometer-registry-prometheus</artifactId> - <scope>runtime</scope> - </dependency> - <!-- IDE --> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </dependency> - <!-- Testing --> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-vintage-engine</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - </dependency> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-metadata-db-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-dependencies</artifactId> - <version>${spring-cloud.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <build> - <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <configuration> - <excludes> - <exclude>at/tuwien/utils/**/*</exclude> - <exclude>at/tuwien/seeder/**/*</exclude> - <exclude>at/tuwien/mapper/**/*</exclude> - <exclude>at/tuwien/exception/**/*</exclude> - <exclude>at/tuwien/config/**/*</exclude> - <exclude>**/DbrepoGatewayServiceApplication.class</exclude> - </excludes> - </configuration> - <executions> - <execution> - <id>default-prepare-agent</id> - <goals> - <goal>prepare-agent</goal> - </goals> - </execution> - <execution> - <id>report</id> - <phase>verify</phase> - <goals> - <goal>report</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> diff --git a/dbrepo-gateway-service/report/pom.xml b/dbrepo-gateway-service/report/pom.xml deleted file mode 100644 index 7c2e3a729c3794be87390b6235722a6bfae9bbc2..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/report/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-gateway-service</artifactId> - <version>1.2.0</version> - </parent> - - <artifactId>report</artifactId> - <version>1.2.0</version> - <name>dbrepo-gateway-service-report</name> - <description> - This module is only intended for the pipeline coverage report. See the detailed report in the - respective modules - </description> - - <properties> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <dependencies> - <dependency> - <groupId>at.tuwien</groupId> - <artifactId>rest-service</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - <executions> - <execution> - <id>report-aggregate</id> - <phase>verify</phase> - <goals> - <goal>report-aggregate</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - -</project> \ No newline at end of file diff --git a/dbrepo-gateway-service/rest-service/pom.xml b/dbrepo-gateway-service/rest-service/pom.xml deleted file mode 100644 index 6a543cd5edc51564b1141c4e67f72fb169502c80..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>at.tuwien</groupId> - <artifactId>dbrepo-gateway-service</artifactId> - <version>1.2.0</version> - </parent> - - <artifactId>rest-service</artifactId> - <version>1.2.0</version> - <name>dbrepo-gateway-service-rest-service</name> - - <properties> - <jacoco.version>0.8.7</jacoco.version> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>repackage</goal><!-- to make it exuteable with $ java -jar ./app.jar --> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies /> - -</project> \ No newline at end of file diff --git a/dbrepo-gateway-service/rest-service/ready b/dbrepo-gateway-service/rest-service/ready deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/DbrepoGatewayServiceApplication.java b/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/DbrepoGatewayServiceApplication.java deleted file mode 100644 index 821368936f057582faa2e9e9afaa0bb8dc37102f..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/DbrepoGatewayServiceApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package at.tuwien; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class DbrepoGatewayServiceApplication { - - public static void main(String[] args) { - SpringApplication.run(DbrepoGatewayServiceApplication.class, args); - } - -} diff --git a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java b/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java deleted file mode 100644 index bb1450fde72230d2707facca8592f17f5a18c331..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/GatewayConfig.java +++ /dev/null @@ -1,83 +0,0 @@ -package at.tuwien.config; - -import org.springframework.cloud.gateway.route.RouteLocator; -import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class GatewayConfig { - - @Bean - public RouteLocator routes(RouteLocatorBuilder builder) { - return builder.routes() - .route("authentication-service", r -> r.path("/api/auth/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .filters(f -> f.rewritePath("/api/auth/(?<segment>.*)", "/${segment}")) - .uri("lb://authentication-service")) - .route("user-service", r -> r.path("/api/user/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://user-service")) - .route("broker-service", r -> r.path("/api/broker/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .filters(f -> f.rewritePath("/api/broker/(?<segment>.*)", "/api/${segment}")) - .uri("lb://broker-service")) - .route("analyse-service", r -> r.path("/api/analyse/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://analyse-service")) - .route("metadata-service", r -> r.path("/api/oai/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://metadata-service")) - .route("identifier-service", r -> r.path("/api/pid/**", - "/api/identifier/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://identifier-service")) - .route("query-service", r -> r.path("/api/container/**/database/**/query/**", - "/api/container/**/database/**/view/**", - "/api/container/**/database/**/table/**/history/**", - "/api/container/**/database/**/table/**/data/**", - "/api/container/**/database/**/table/**/query/**", - "/api/container/**/database/**/table/**/export/**", - "/api/container/**/database/**/table/**/consumer", - "/api/container/**/database/**/version/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://query-service")) - .route("table-service", r -> r.path("/api/container/**/database/**/table/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://table-service")) - .route("database-service", r -> r.path("/api/container/**/database/**", - "/api/container/**/database/**/access/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://database-service")) - .route("container-service", r -> r.path("/api/container/**", - "/api/image/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://container-service")) - .route("semantics-service", r -> r.path("/api/semantics/**") - .and() - .method("POST", "GET", "PUT", "DELETE") - .and() - .uri("lb://semantics-service")) - .build(); - - } - -} diff --git a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java b/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java deleted file mode 100644 index fba7f99cf2bf1cbb12ac51cd6fd5b80751ff43c1..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/JacksonConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package at.tuwien.config; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.Date; -import java.util.TimeZone; - -@Slf4j -@Configuration -public class JacksonConfig { - - @Bean - public ObjectMapper objectMapper() throws JsonProcessingException { - final ObjectMapper objectMapper = new ObjectMapper(); - objectMapper.findAndRegisterModules(); - objectMapper.registerModule(new Jdk8Module()); - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - objectMapper.setTimeZone(TimeZone.getTimeZone("UTC")); - log.debug("current time is {}", objectMapper.writeValueAsString(new Date())); - return objectMapper; - } - -} diff --git a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java b/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java deleted file mode 100644 index 2250fa50884df3f47b0b063975aea74f06203f80..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/ReadyConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package at.tuwien.config; - -import com.google.common.io.Files; -import lombok.extern.log4j.Log4j2; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.event.EventListener; - -import java.io.File; -import java.io.IOException; - -@Log4j2 -@Configuration -public class ReadyConfig { - - @Value("${fda.ready.path}") - private String readyPath; - - @EventListener(ApplicationReadyEvent.class) - public void init() throws IOException { - Files.touch(new File(readyPath)); - } - -} diff --git a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/WebConfig.java b/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/WebConfig.java deleted file mode 100644 index e5aece5a2404d6a67ff6060f27dacd87b5481ca8..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/java/at/tuwien/config/WebConfig.java +++ /dev/null @@ -1,26 +0,0 @@ -package at.tuwien.config; - -import org.springframework.cloud.client.loadbalancer.LoadBalanced; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.reactive.config.CorsRegistry; -import org.springframework.web.reactive.config.WebFluxConfigurer; -import org.springframework.web.reactive.function.client.WebClient; - -@Configuration -public class WebConfig implements WebFluxConfigurer { - - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**") - .allowedMethods("POST", "GET", "PUT", "DELETE") - .allowedOrigins("*"); - } - - @Bean - @LoadBalanced - public WebClient.Builder loadBalancedWebClientBuilder() { - return WebClient.builder(); - } - -} diff --git a/dbrepo-gateway-service/rest-service/src/main/resources/application-local.yml b/dbrepo-gateway-service/rest-service/src/main/resources/application-local.yml deleted file mode 100644 index 320e14ae2ff24ced3b20791aeb12d31c93d46524..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/resources/application-local.yml +++ /dev/null @@ -1,42 +0,0 @@ -app.version: '@project.version@' -spring: - main.banner-mode: off - datasource: - url: jdbc:h2:mem:mydb - username: sa - password: password - driverClassName: org.h2.Driver - jpa: - show-sql: false - database-platform: org.hibernate.dialect.H2Dialect - hibernate: - ddl-auto: validate - use-new-id-generator-mappings: false - open-in-view: false - properties: - hibernate: - default_schema: fda - jdbc: - time_zone: UTC - application: - name: gateway-service - cloud: - loadbalancer.ribbon.enabled: false -management.endpoints.web.exposure.include: health,info,prometheus,gateway -server: - port: 9095 -logging: - pattern.console: "%d %highlight(%-5level) %msg%n" - level: - root: warn - at.tuwien.: info - org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: gateway-service - non-secure-port-enabled: false - secure-port-enabled: true - secure-port: 9095 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ -fda: - ready.path: ./ready \ No newline at end of file diff --git a/dbrepo-gateway-service/rest-service/src/main/resources/application.yml b/dbrepo-gateway-service/rest-service/src/main/resources/application.yml deleted file mode 100644 index 3c021d74d60d42c47898642d9f03dc2421b62881..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/main/resources/application.yml +++ /dev/null @@ -1,40 +0,0 @@ -app.version: '@project.version@' -spring: - main.banner-mode: off - datasource: - url: jdbc:h2:mem:mydb - username: sa - password: password - driverClassName: org.h2.Driver - jpa: - show-sql: false - database-platform: org.hibernate.dialect.H2Dialect - hibernate: - ddl-auto: validate - open-in-view: false - properties: - hibernate: - jdbc: - time_zone: UTC - application: - name: gateway-service - cloud: - loadbalancer.ribbon.enabled: false -management.endpoints.web.exposure.include: health,info,prometheus,gateway -server: - port: 9095 -logging: - pattern.console: "%d %highlight(%-5level) %msg%n" - level: - root: warn - at.tuwien.: "${LOG_LEVEL}" - org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: gateway-service - non-secure-port-enabled: false - secure-port-enabled: true - secure-port: 9095 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ -fda: - ready.path: /ready \ No newline at end of file diff --git a/dbrepo-gateway-service/rest-service/src/main/resources/config.properties b/dbrepo-gateway-service/rest-service/src/main/resources/config.properties deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/dbrepo-gateway-service/rest-service/src/test/resources/application.properties b/dbrepo-gateway-service/rest-service/src/test/resources/application.properties deleted file mode 100644 index 1caa6874366e985b357c2d5b32bd12316edf0de3..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/rest-service/src/test/resources/application.properties +++ /dev/null @@ -1,11 +0,0 @@ -# enable local spring profile -spring.profiles.active=local - -# disable datasource -spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS FDA -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password=password -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -spring.jpa.hibernate.ddl-auto=create-drop -spring.jpa.show-sql=false \ No newline at end of file diff --git a/dbrepo-gateway-service/root.crt b/dbrepo-gateway-service/root.crt deleted file mode 100644 index 798a1f673479c075782eeed6458beb2d7d693e07..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/root.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDPzCCAiegAwIBAgIEHaMDRDANBgkqhkiG9w0BAQsFADBBMQswCQYDVQQGEwJB -VDEQMA4GA1UEChMHVFUgV2llbjEPMA0GA1UECxMGRFMtSUZTMQ8wDQYDVQQDEwZS -b290Q0EwHhcNMjMwNDAzMTczOTU5WhcNMzMwMjA5MTczOTU5WjBBMQswCQYDVQQG -EwJBVDEQMA4GA1UEChMHVFUgV2llbjEPMA0GA1UECxMGRFMtSUZTMQ8wDQYDVQQD -EwZSb290Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCK8FuP0bGt -QAvhZEjRWTQuCdE6vXpDWjvSoevZaSclgJ9SncDHtRzkH0x0ArVfIRZFtjSUEcHb -2r8mnOvqQ+9vs2azjTlacdPvezbhfgFFGIdrnHSm3RTB7smeOFceFkIvwiXT49+y -ZGkB/p0QCDoVYhgRxFNtZKBTYa0uJLQ7cM8LK2g66/yugJsB4zOlre1zPiWGY/5k -sWu780XVKpl9j6CR/xp3012bKlT/t7j7fKRamJYVYtW2guRQnl5J5AKRzlRGh84G -onNI5qiwS0gAZUajpL00lb2XxSkv11DY0743EOSsqOvUDr+5h4v7pXEt+O5aFvFN -ewRTHON1624fAgMBAAGjPzA9MB0GA1UdDgQWBBSdLp+I30uB4jAMP1PnZLolxbF/ -AzALBgNVHQ8EBAMCAgQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC -AQEAIqrbs8mXC07a8VURnu3EFxO3dliDgxY1yQfB0VqMFL1yxGKXrVAJFLP/1MVr -HVx53vZd/KBNGUjhLfnj3vF+TpqnOoJ/QEDSJPuEnpfFPtx0tE3e3lQQlebIA8aM -m1iP2SJuKAYQUYOg1N9XXa+UPs9tWWrllY5dcYdHOK168eUwo1h6v0OOnaP7RvSn -457jewK6fJ3tUhox2Hu1JEowupYE5QhMiLwG30MGkf2pWkTNfz005LTzmgvfMSz7 -k1rfO9oKdVbxNYxZPdzKZRsnCfOka/MmYcXstjp5KKXLo4Z3LLs8N0GDWlKRvX9p -z2CJQ6CG+Aws4+J3mFOm2G9rIw== ------END CERTIFICATE----- diff --git a/dbrepo-gateway-service/server.keystore b/dbrepo-gateway-service/server.keystore deleted file mode 100644 index 1acf1f68ca7c367468fe2a81179d5fc9f295cfc9..0000000000000000000000000000000000000000 Binary files a/dbrepo-gateway-service/server.keystore and /dev/null differ diff --git a/dbrepo-gateway-service/service_ready b/dbrepo-gateway-service/service_ready deleted file mode 100644 index b2e4f9df6804f249ba8aadd72f742929072badaa..0000000000000000000000000000000000000000 --- a/dbrepo-gateway-service/service_ready +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -if [ -f /ready ]; then - echo "service is ready and accepting connections" - exit 0 -fi -exit 1 \ No newline at end of file diff --git a/dbrepo-identifier-service/Dockerfile b/dbrepo-identifier-service/Dockerfile index b8343cc968c5fa7475a99e40a7c4d079fae37266..a8f39e3d7fd063b67e883e9bd673c23dcefd6897 100644 --- a/dbrepo-identifier-service/Dockerfile +++ b/dbrepo-identifier-service/Dockerfile @@ -25,7 +25,7 @@ FROM openjdk:11-jre-slim as runtime ENV METADATA_DB=fda ENV METADATA_USERNAME=root ENV METADATA_PASSWORD=dbrepo -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 +ENV GATEWAY_ENDPOINT=http://gateway-service ENV WEBSITE=http://localhost ENV LOG_LEVEL=debug ENV DBREPO_CLIENT_SECRET=client-secret diff --git a/dbrepo-identifier-service/rest-service/src/main/resources/application-local.yml b/dbrepo-identifier-service/rest-service/src/main/resources/application-local.yml index bb5c0681e33a5e73cb1287d73e2385dbf54a5675..20b898bb03590e5bb0840effd8e6db995f8f92bd 100644 --- a/dbrepo-identifier-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-identifier-service/rest-service/src/main/resources/application-local.yml @@ -36,11 +36,6 @@ logging: at.tuwien.: trace at.tuwien.auth.UserPermissionEvaluator: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: identifier-service - non-secure-port: 9096 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: ready.path: ./ready jwt: @@ -48,7 +43,7 @@ fda: public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB client_secret: client-secret client_id: dbrepo-client - gateway.endpoint: http://localhost:9095 + gateway.endpoint: http://localhost website: http://localhost:3000 elastic: endpoint: localhost:9200 diff --git a/dbrepo-identifier-service/rest-service/src/main/resources/application.yml b/dbrepo-identifier-service/rest-service/src/main/resources/application.yml index 9d2031bd7e895dd711f292066fbf1e4a44bac5ab..f2531d64202e878f9f52108a7ab6a953701a2bfc 100644 --- a/dbrepo-identifier-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-identifier-service/rest-service/src/main/resources/application.yml @@ -36,11 +36,6 @@ logging: at.tuwien.: "${LOG_LEVEL}" at.tuwien.auth.UserPermissionEvaluator: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: identifier-service - non-secure-port: 9096 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: ready.path: /ready jwt: diff --git a/dbrepo-metadata-db/pom.xml b/dbrepo-metadata-db/pom.xml index 5a0d2c25ae82a6bbf84780706dbb49be7611d5ce..c7f3b2990d618df0124b1b7030ee2bcdf53db6f5 100644 --- a/dbrepo-metadata-db/pom.xml +++ b/dbrepo-metadata-db/pom.xml @@ -29,7 +29,7 @@ <maven.compiler.target>${java.version}</maven.compiler.target> <spring-cloud.version>Hoxton.SR8</spring-cloud.version> <mapstruct.version>1.4.2.Final</mapstruct.version> - <docker.version>3.2.7</docker.version> + <docker.version>3.3.0</docker.version> <testcontainers.version>1.15.2</testcontainers.version> <swagger.version>2.1.7</swagger.version> <springfox.version>3.0.0</springfox.version> @@ -47,17 +47,6 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> - <dependency> - <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> - <version>3.0.1</version> - <exclusions> - <exclusion> - <groupId>javax.ws.rs</groupId> - <artifactId>jsr311-api</artifactId> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> @@ -83,6 +72,12 @@ <artifactId>commons-io</artifactId> <version>${commons.version}</version> </dependency> + <!-- Utils --> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>31.1-jre</version> + </dependency> <!-- SQL Parser --> <dependency> <groupId>com.github.jsqlparser</groupId> diff --git a/dbrepo-metadata-service/Dockerfile b/dbrepo-metadata-service/Dockerfile index af0e2b6da4bf0e2b13253487554afbd3e87bd0ef..ed2428b33a6d14de007a412265f72a0c6cdbb9a7 100644 --- a/dbrepo-metadata-service/Dockerfile +++ b/dbrepo-metadata-service/Dockerfile @@ -24,7 +24,7 @@ FROM openjdk:11-jre-slim as runtime ENV METADATA_DB=fda ENV METADATA_USERNAME=root ENV METADATA_PASSWORD=dbrepo -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 +ENV GATEWAY_ENDPOINT=http://gateway-service ENV PID_BASE="http://example.com/pid/" ENV REPOSITORY_NAME="Example Repository" ENV BASE_URL="http://example.com" diff --git a/dbrepo-metadata-service/rest-service/src/main/resources/application-local.yml b/dbrepo-metadata-service/rest-service/src/main/resources/application-local.yml index b5529e2975fa93116d76ac5200cf2011f71d74b7..eef6f76815fba864d5b66e9527425d0fc7bda3a6 100644 --- a/dbrepo-metadata-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-metadata-service/rest-service/src/main/resources/application-local.yml @@ -35,17 +35,10 @@ logging: root: warn at.tuwien.: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: metadata-service - non-secure-port-enabled: false - secure-port-enabled: true - secure-port: 9099 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: ready.path: ./ready pid.base: http://example.com/pid/ - gateway.endpoint: http://localhost:9095 + gateway.endpoint: http://localhost dbrepo: repository-name: TU Wien Database Repository base-url: http://dbrepo.ossdip.at/api/oai diff --git a/dbrepo-metadata-service/rest-service/src/main/resources/application.yml b/dbrepo-metadata-service/rest-service/src/main/resources/application.yml index 1a81f97ef818aeeba391f917d907038ff8f1e556..74ee7061931c59b69a9d5329e9e103ad119ff39b 100644 --- a/dbrepo-metadata-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-metadata-service/rest-service/src/main/resources/application.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: metadata-service - non-secure-port: 9099 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: ready.path: ./ready pid.base: "${PID_BASE}" diff --git a/dbrepo-proxy/Dockerfile b/dbrepo-proxy/Dockerfile deleted file mode 100644 index 6086e614d19011a1df5854c3af5881fa7350a237..0000000000000000000000000000000000000000 --- a/dbrepo-proxy/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM nginx:alpine AS runtime -MAINTAINER Martin Weise <martin.weise@tuwien.ac.at - -COPY ./dbrepo.conf /etc/nginx/conf.d/default.conf diff --git a/dbrepo-proxy/dbrepo.conf b/dbrepo-proxy/dbrepo.conf deleted file mode 100644 index ac955002347f24a0c292ecc1eb4efe7f363db680..0000000000000000000000000000000000000000 --- a/dbrepo-proxy/dbrepo.conf +++ /dev/null @@ -1,44 +0,0 @@ -client_max_body_size 2G; - -server { - listen 80 default_server; - server_name _; - - location /api { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://gateway-service:9095; - proxy_read_timeout 90; - } - - location /pid { - rewrite /pid/(.*) /api/pid/$1 break; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://gateway-service:9095; - proxy_read_timeout 90; - } - - location /retrieve { - rewrite /retrieve/(.*) /$1 break; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://search-service:9200; - proxy_read_timeout 90; - } - - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://ui:3000/; - proxy_read_timeout 90; - } -} diff --git a/dbrepo-query-service/Dockerfile b/dbrepo-query-service/Dockerfile index a8114f56c674d26ea73bc769f91b69c561a8a479..7b32d8c70bdd561512a907839c6813b8b396760e 100644 --- a/dbrepo-query-service/Dockerfile +++ b/dbrepo-query-service/Dockerfile @@ -27,7 +27,7 @@ ENV METADATA_USERNAME=root ENV METADATA_PASSWORD=dbrepo ENV BROKER_USERNAME=fda ENV BROKER_PASSWORD=fda -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 +ENV GATEWAY_ENDPOINT=http://gateway-service ENV SHARED_FILESYSTEM=/tmp ENV BROKER_CONSUMERS=2 ENV LOG_LEVEL=debug diff --git a/dbrepo-query-service/rest-service/src/main/resources/application-docker.yml b/dbrepo-query-service/rest-service/src/main/resources/application-docker.yml deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/dbrepo-query-service/rest-service/src/main/resources/application-local.yml b/dbrepo-query-service/rest-service/src/main/resources/application-local.yml index ac9c7fb360aa866be92d4530f0ff7550640d47a2..59ec68cf1aa181044a0b615edf2666fcf025af06 100644 --- a/dbrepo-query-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-query-service/rest-service/src/main/resources/application-local.yml @@ -39,13 +39,8 @@ logging: root: warn at.tuwien.: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: query-service - non-secure-port: 9093 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: - gateway.endpoint: http://localhost:9095 + gateway.endpoint: http://localhost ready.path: ./ready jwt: issuer: https://localhost:8443/realms/dbrepo diff --git a/dbrepo-query-service/rest-service/src/main/resources/application.yml b/dbrepo-query-service/rest-service/src/main/resources/application.yml index df6ca210fb0604969f43b73973b6c913cdf66f9e..c7860e13a47712afa2cabe2a44530d99af573ff4 100644 --- a/dbrepo-query-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-query-service/rest-service/src/main/resources/application.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: query-service - non-secure-port: 9093 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: gateway.endpoint: "${GATEWAY_ENDPOINT}" ready.path: /ready diff --git a/dbrepo-semantics-service/Dockerfile b/dbrepo-semantics-service/Dockerfile index bb9426c7b036a80e64590e0392b63016efa005df..07f4c1abb1cd90e2bc34da67d8f80ca5a33d5eb4 100644 --- a/dbrepo-semantics-service/Dockerfile +++ b/dbrepo-semantics-service/Dockerfile @@ -1,14 +1,19 @@ -FROM python:3.9-slim -MAINTAINER Cornelia Michlits <cornelia.michlits@tuwien.ac.at> +FROM python:3.9-alpine +MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> -RUN apt-get update && apt-get install -y python3-dev libmariadb3 libmariadb-dev gcc +RUN apk update && apk --no-cache add build-base gcc python3-dev libpq-dev libffi-dev mariadb-dev mariadb-connector-c \ + mariadb-connector-c-dev py3-pandas py3-sqlalchemy py3-requests py3-gevent py3-psycopg2 + +COPY ./requirements.txt ./requirements.txt +RUN pip install -r ./requirements.txt + +WORKDIR /app ENV FLASK_APP=app.py ENV FLASK_RUN_HOST=0.0.0.0 ENV PORT_APP=5010 ENV FLASK_DEBUG=0 ENV HOSTNAME=semantics-service -ENV EUREKA_SERVER=http://discovery-service:9090/eureka/ ENV READY_FILE=/ready ENV LOG_LEVEL=debug ENV METADATA_DB=fda @@ -17,8 +22,6 @@ ENV METADATA_PASSWORD=dbrepo ENV JWT_ISSUER=http://localhost:8080/realms/dbrepo ENV JWT_PUBKEY=public-key -WORKDIR /app - COPY requirements.txt requirements.txt RUN pip install -r requirements.txt > /dev/null diff --git a/dbrepo-semantics-service/app.py b/dbrepo-semantics-service/app.py index 4e9c167c75b3d52fc609208edc7dfea94df178bc..a2a2604caa8d36185dea0f82faf781ba3bdc6212 100644 --- a/dbrepo-semantics-service/app.py +++ b/dbrepo-semantics-service/app.py @@ -3,7 +3,6 @@ import logging import re from flask import Flask, request, jsonify from logging.config import dictConfig -import py_eureka_client.eureka_client as eureka_client from flasgger import Swagger from flasgger.utils import swag_from from flasgger import LazyJSONEncoder @@ -263,11 +262,6 @@ def get_ontologies(name): rest_server_port = int(os.getenv('PORT_APP', 5010)) rest_server_host = os.getenv('FLASK_RUN_HOST', '0.0.0.0') -eureka_client.init(eureka_server=os.getenv('EUREKA_SERVER', 'http://localhost:9090/eureka/'), - app_name=os.getenv('HOSTNAME', 'fda-units-service'), - instance_ip=os.getenv('HOSTNAME', 'fda-units-service'), - instance_host=os.getenv('HOSTNAME', 'fda-units-service'), - instance_port=rest_server_port) if __name__ == '__main__': http_server = WSGIServer((rest_server_host, rest_server_port), app) diff --git a/dbrepo-semantics-service/requirements.txt b/dbrepo-semantics-service/requirements.txt index bf2f5a864c50536632b0af24dad167b4b3c8783a..b3a686a9cd73b4c53cb266f28844b05572471b7d 100644 --- a/dbrepo-semantics-service/requirements.txt +++ b/dbrepo-semantics-service/requirements.txt @@ -1,40 +1,55 @@ -attrs==22.2.0 -certifi==2022.12.7 -charset-normalizer==2.1.1 +attrs==23.1.0 +certifi==2023.5.7 +chardet==5.1.0 +charset-normalizer==2.0.12 click==8.1.3 -dnspython==2.2.1 -docker==6.0.1 +coverage==7.1.0 +docker==5.0.0 +exceptiongroup==1.1.1 flasgger==0.9.5 Flask==2.2.2 -gevent==22.10.2 -greenlet==2.0.1 +Flask-JWT-Extended==4.4.4 +gevent==21.8.0 +greenlet==1.1.3.post0 +html5lib==1.1 idna==3.4 -ifaddr==0.2.0 -importlib-metadata==5.2.0 +importlib-metadata==6.6.0 +iniconfig==2.0.0 isodate==0.6.1 itsdangerous==2.1.2 Jinja2==3.1.2 +json-table-schema==0.2.1 jsonschema==4.17.3 +lxml==4.9.2 mariadb==1.0.10 -MarkupSafe==2.1.1 -mistune==2.0.4 -packaging==22.0 -prometheus-client==0.15.0 +MarkupSafe==2.1.2 +messytables==0.15.2 +mistune==2.0.5 +numpy==1.24.3 +packaging==23.1 +pandas==1.2.3 +pluggy==1.0.0 +prometheus-client==0.16.0 prometheus-flask-exporter==0.21.0 -py-eureka-client==0.11.7 +psycopg2-binary==2.8.6 +PyJWT==2.6.0 pyparsing==3.0.9 pyrsistent==0.19.3 +pytest==7.2.1 +python-dateutil==2.8.2 +python-magic==0.4.27 +pytz==2023.3 PyYAML==6.0 rdflib==6.2.0 -requests==2.28.1 +requests==2.26.0 six==1.16.0 -urllib3==1.26.13 -websocket-client==1.4.2 -Werkzeug==2.2.2 -zipp==3.11.0 +SQLAlchemy==1.4.15 +tomli==2.0.1 +urllib3==1.26.15 +webencodings==0.5.1 +websocket-client==1.5.1 +Werkzeug==2.3.3 +xlrd==2.0.1 +zipp==3.15.0 zope.event==4.6 -zope.interface==5.5.2 -html5lib==1.1 -pytest==7.2.1 -coverage==7.1.0 -Flask-JWT-Extended==4.4.4 \ No newline at end of file +zope.interface==6.0 diff --git a/dbrepo-table-service/rest-service/src/main/resources/application-local.yml b/dbrepo-table-service/rest-service/src/main/resources/application-local.yml index ea99819af32bc89472368d14f1b2659054f042d9..325e6444db47bc38804d8004a9b0b8d0d96ae573 100644 --- a/dbrepo-table-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-table-service/rest-service/src/main/resources/application-local.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: table-service - non-secure-port: 9094 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: ready.path: ./ready jwt: @@ -47,7 +42,7 @@ fda: public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB client_secret: client-secret client_id: dbrepo-client - gateway.endpoint: http://localhost:9095 + gateway.endpoint: http://localhost elastic: endpoint: localhost:9200 username: elastic diff --git a/dbrepo-table-service/rest-service/src/main/resources/application.yml b/dbrepo-table-service/rest-service/src/main/resources/application.yml index 24e4a6534817db7d06711591e7ba03782bebdd8b..fbe68f32422001cfdbc47cc7cfc3526ad59e03be 100644 --- a/dbrepo-table-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-table-service/rest-service/src/main/resources/application.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: table-service - non-secure-port: 9094 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: ready.path: /ready jwt: @@ -47,7 +42,7 @@ fda: public_key: "${JWT_PUBKEY}" client_secret: "${DBREPO_CLIENT_SECRET}" client_id: "${CLIENT_ID}" - gateway.endpoint: http://gateway-service:9095 + gateway.endpoint: http://gateway-service elastic: endpoint: search-service:9200 username: elastic diff --git a/dbrepo-ui/README.md b/dbrepo-ui/README.md index 50b0454feff6ccb71ec382367fbd49de9cc863b1..c4f407ba90f72ae0af0398394613b55c6cea031f 100644 --- a/dbrepo-ui/README.md +++ b/dbrepo-ui/README.md @@ -44,7 +44,7 @@ See https://nuxtjs.org/ Configure the `.env` file for the IP and port running or run through terminal: ```bash -API=http://fda-gateway-service:9095 npm --prefix ./fda-ui run dev +API=http://fda-gateway-service npm --prefix ./fda-ui run dev ``` Of course you need to add `fda-gateway-service` to your `/etc/hosts` file for Docker "DNS" to your containers: diff --git a/dbrepo-user-service/Dockerfile b/dbrepo-user-service/Dockerfile index 58faa272f64d684f94956b9493202599fb36a547..8473a7fc59f5e63302554b16d9ab9e0d22b47d24 100644 --- a/dbrepo-user-service/Dockerfile +++ b/dbrepo-user-service/Dockerfile @@ -24,7 +24,7 @@ FROM openjdk:11-jre-slim as runtime ENV METADATA_DB=fda ENV METADATA_USERNAME=root ENV METADATA_PASSWORD=dbrepo -ENV GATEWAY_ENDPOINT=http://gateway-service:9095 +ENV GATEWAY_ENDPOINT=http://gateway-service ENV JWT_ISSUER=http://localhost:8080/realms/dbrepo ENV JWT_PUBKEY=public-key ENV LOG_LEVEL=debug diff --git a/dbrepo-user-service/rest-service/src/main/resources/application-local.yml b/dbrepo-user-service/rest-service/src/main/resources/application-local.yml index 6a5a1c57f83af9ee6edf53f90bc9f2e64e31fc39..c93c21664f50d1f9ceaebc8bf33f0ae26d29e89d 100644 --- a/dbrepo-user-service/rest-service/src/main/resources/application-local.yml +++ b/dbrepo-user-service/rest-service/src/main/resources/application-local.yml @@ -35,18 +35,13 @@ logging: root: warn at.tuwien.: trace org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: user-service - non-secure-port: 9098 - client.serviceUrl.defaultZone: http://localhost:9090/eureka/ fda: elastic: endpoint: localhost:9200 username: elastic password: elastic ready.path: ./ready - gateway.endpoint: http://localhost:9095 + gateway.endpoint: http://localhost default_role: default-researcher-roles jwt: issuer: https://localhost:8443/realms/dbrepo diff --git a/dbrepo-user-service/rest-service/src/main/resources/application.yml b/dbrepo-user-service/rest-service/src/main/resources/application.yml index f0606a3bf70aa251c5870c345172c7dee2d2d721..8c87174566c483eba6a87cd364c8178ef81ed648 100644 --- a/dbrepo-user-service/rest-service/src/main/resources/application.yml +++ b/dbrepo-user-service/rest-service/src/main/resources/application.yml @@ -35,11 +35,6 @@ logging: root: warn at.tuwien.: "${LOG_LEVEL}" org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver: debug -eureka: - instance: - hostname: user-service - non-secure-port: 9098 - client.serviceUrl.defaultZone: http://discovery-service:9090/eureka/ fda: elastic: endpoint: search-service:9200 diff --git a/docker-compose.dbrepo1.yml b/docker-compose.dbrepo1.yml index b85af3cd4fdd74be65d4e20685fcba9d642ef986..626ed083c1a9e666dec5e229d2c1d6e2ff7c79c1 100644 --- a/docker-compose.dbrepo1.yml +++ b/docker-compose.dbrepo1.yml @@ -68,7 +68,7 @@ services: networks: core: ports: - - "9095:9095" + - "80:80" env_file: - .env depends_on: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 8984baecab55922994fb89672234edc276ec221e..32ec047479cdc2578c9c9f6a8624b3db24f53a59 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -68,7 +68,7 @@ services: networks: core: ports: - - "9095:9095" + - "80:80" env_file: - .env depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index 5a3cd4022d0dd2c4d0796d11e04c8009a4c5f3b7..00b55f085c52d77ccf150ae09da0e40d391eda67 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,40 +49,6 @@ services: logging: driver: json-file - dbrepo-discovery-service: - restart: "no" - container_name: dbrepo-discovery-service - hostname: discovery-service - build: ./dbrepo-discovery-service - image: dbrepo-discovery-service - networks: - core: - ports: - - "9090:9090" - env_file: - - .env - logging: - driver: json-file - - dbrepo-gateway-service: - restart: "no" - container_name: dbrepo-gateway-service - hostname: gateway-service - build: ./dbrepo-gateway-service - image: dbrepo-gateway-service - networks: - core: - public: - ports: - - "9095:9095" - env_file: - - .env - depends_on: - dbrepo-discovery-service: - condition: service_healthy - logging: - driver: json-file - dbrepo-database-service: restart: "no" container_name: dbrepo-database-service @@ -144,8 +110,6 @@ services: volumes: - authentication-service-data:/opt/keycloak/data/ depends_on: - dbrepo-discovery-service: - condition: service_healthy dbrepo-metadata-db: condition: service_healthy logging: @@ -260,9 +224,6 @@ services: volumes: - "/tmp:/tmp" - /var/run/docker.sock:/var/run/docker.sock - depends_on: - dbrepo-discovery-service: - condition: service_healthy logging: driver: json-file @@ -302,8 +263,6 @@ services: - "/tmp:/tmp" - /var/run/docker.sock:/var/run/docker.sock depends_on: - dbrepo-discovery-service: - condition: service_healthy dbrepo-metadata-db: condition: service_healthy dbrepo-authentication-service: @@ -325,8 +284,6 @@ services: env_file: - .env depends_on: - dbrepo-discovery-service: - condition: service_healthy dbrepo-authentication-service: condition: service_healthy volumes: @@ -342,9 +299,6 @@ services: image: dbrepo-search-service networks: core: - depends_on: - dbrepo-discovery-service: - condition: service_healthy ports: - 9200:9200 - 9600:9600 @@ -376,12 +330,12 @@ services: logging: driver: json-file - dbrepo-proxy: + dbrepo-gateway-service: restart: "no" - container_name: dbrepo-proxy - hostname: proxy - build: ./dbrepo-proxy - image: dbrepo-proxy + container_name: dbrepo-gateway-service + hostname: gateway-service + build: ./dbrepo-gateway-service + image: dbrepo-gateway-service networks: core: public: @@ -393,11 +347,31 @@ services: env_file: - .env depends_on: + dbrepo-analyse-service: + condition: service_healthy + dbrepo-authentication-service: + condition: service_healthy + dbrepo-broker-service: + condition: service_healthy + dbrepo-container-service: + condition: service_healthy + dbrepo-database-service: + condition: service_healthy + dbrepo-identifier-service: + condition: service_healthy + dbrepo-metadata-service: + condition: service_healthy + dbrepo-query-service: + condition: service_healthy dbrepo-search-service: condition: service_started - dbrepo-gateway-service: + dbrepo-semantics-service: + condition: service_healthy + dbrepo-table-service: condition: service_healthy dbrepo-ui: condition: service_started + dbrepo-user-service: + condition: service_healthy logging: driver: json-file