From fae36124deb5f6ef2ebc3d2f9ec092ea7c58772a Mon Sep 17 00:00:00 2001 From: Dmitry Repchevsky Date: Thu, 7 Dec 2023 12:21:56 +0100 Subject: [PATCH 1/6] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6f6d8ba..d7fdca2 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ In addition to the provided docker images, artifacts are stored on the Barcelona https://inb.bsc.es/maven/es/bsc/inb/ga4gh/beacon-network-v2/0.0.9/beacon-network-v2-0.0.9.war ###### Configuration -There are three configuration files in the `/BEACON-INF` directory: +There are three default configuration files in the `/BEACON-INF` directory: * `configuration.json` - standard beacon configuration file: [beaconConfigurationResponse.json](https://github.com/ga4gh-beacon/beacon-v2/blob/main/framework/json/responses/beaconConfigurationResponse.json) * `beacon-info.json` - standard beacon information file: [beaconInfoResponse.json](https://github.com/ga4gh-beacon/beacon-v2/blob/main/framework/json/responses/beaconInfoResponse.json) * `beacon-network.json` - Json Array of backed Beacons' endpoints @@ -47,9 +47,18 @@ The example of the `beacon-network.json`: ``` Note that the **W**eb application **AR**chive (WAR) is just a usual ZIP file so one can edit these configurations manually without the need to rebuild the application. -It is also possible to define external directory for the `beacon-network.json` configuration. +It is also possible to define external directory for the configuration. ```bash export BEACON_NETWORK_CONFIG_DIR=/wildfly/BEACON-INF ``` -When the `BEACON_NETWORK_CONFIG_DIR` is set, the aggregator monitors the `$BEACON_NETWORK_CONFIG_DIR/beacon-network.json` to dynamically update the configuration. +When the `BEACON_NETWORK_CONFIG_DIR` is set, the aggregator monitors the `$BEACON_NETWORK_CONFIG_DIR/beacon-network.json` to dynamically update the configuration. +It also looks (but not actively monitoring) the `$BEACON_NETWORK_CONFIG_DIR/beacon-info.json` so deployers may change the beacon identifier and other metatada. + +The application provides simple SQL logging which level may be confirured via `BEACON_NETWORK_LOG_LEVEL` environment variable. +The possible values are "**NONE**", "**METADATA**", "**REQUESTS**", "**RESPONSES**", "**ALL**" +- "**NONE**" : No logging at all. +- "**METADATA**" : Only backed beacons' metadata is logged (good for debugging). +- "**REQUESTS**" : Beacon Network Request quieries are logged. It also logs response codes (but not the data). +- "**RESPONSES**" : Logs all Requests with Responses as well as possible error messages. +- "**ALL**" : Maximum logging level. Currently same as "**RESPONSES**" From 01fd0419bccba813523197dd270ded1b99f5e366 Mon Sep 17 00:00:00 2001 From: Dmitry Repchevsky Date: Thu, 7 Dec 2023 13:17:48 +0100 Subject: [PATCH 2/6] missed checkout step --- .github/workflows/build-docker-image.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 49ac138..99b7f00 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,11 +18,8 @@ jobs: packages: write steps: - - name: Deploy to BSC GitLab Maven Repository - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml - env: - MAVEN_USERNAME: gitlab-bsc-maven - MAVEN_PASSWORD: ${{ secrets.BSC_GITLAB_MAVEN_REPO }} + - name: Checkout + uses: actions/checkout@v3 - name: Log into the Container registry uses: docker/login-action@v3 From 01a9f76d23e6faf2c5d8874cd0693e027af76e11 Mon Sep 17 00:00:00 2001 From: dmitry Date: Wed, 13 Dec 2023 15:25:22 +0000 Subject: [PATCH 3/6] respect X-Forwarded-* in http listener --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3bf1ccc..061b207 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,6 +17,7 @@ COPY ./docker/wildfly/modules/yasson $JBOSS_HOME/modules/system/layers/base/org/ RUN /bin/sh -c 'echo -e "embed-server --std-out=echo\n \ /subsystem=undertow/server=default-server/ajp-listener=ajp:add(socket-binding=ajp, scheme=https, redirect-socket=https, enabled=true)\n \ +/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding, value=true)\n \ /subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)\n \ /subsystem=datasources/data-source=BeaconNetwork:add(driver-name=postgresql,jndi-name=java:jboss/datasources/BeaconNetwork,connection-url=\${env.BEACON_NETWORK_DB_CONNECTION_URL},user-name=\${env.BEACON_NETWORK_DB_USERNAME},password=\${env.BEACON_NETWORK_DB_PASSWORD})\n \ stop-embedded-server" > $JBOSS_HOME/bin/wildfly-config.cli' From 493dd50e54bbdde402398285f270cdcb5b4ebead Mon Sep 17 00:00:00 2001 From: SergiAguilo Date: Tue, 19 Dec 2023 11:32:41 +0100 Subject: [PATCH 4/6] Rephrase installation --- README.md | 56 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d7fdca2..c9ff2fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# beacon-network-backend +l# beacon-network-backend ###### Jakarta EE Platform 10 The implementation is developed and deployed on the [WildFly 30.0.0](http://wildfly.org/) server and is based on Jakarta RESTful Web Services 3.0 API ([JAX-RS 3.0](https://jakarta.ee/specifications/restful-ws/3.0/)). @@ -6,33 +6,43 @@ The implementation is developed and deployed on the [WildFly 30.0.0](http://wild ###### Beacon v2 Java implementation The implementation uses [Beacon v2 Java beacon-framework](https://github.com/elixir-europe/java-beacon-v2.api) model classes. -###### SQL Database -The Beacon Network Aggregator uses [Jakarta Persistence 3.1](https://jakarta.ee/specifications/persistence/3.1/) for logging. -The connection is defined in [persistence.xml](https://github.com/elixir-europe/beacon-network-backend/blob/master/src/main/resources/META-INF/persistence.xml). -Although the Aggregator may be used with any SQL database, it is configured to be used with [PostgreSQL](https://www.postgresql.org/) database. +## Installation -###### Docker Image -This repository is configured to automatically generate docker images on release tags ('vX.Y.Z'). -https://github.com/elixir-europe/beacon-network-backend/pkgs/container/beacon-network-backend -The image is based on official WildFly image that is extended with PostgreSQL driver and predeployed Beacon Network application. -There is also a [docker-compose.yaml](https://github.com/elixir-europe/beacon-network-backend/blob/master/docker/docker-compose.yaml) receipe which provides easy deployment. +### Docker Image (recommended) +This repository is configured to automatically generate [docker images](https://github.com/elixir-europe/beacon-network-backend/pkgs/container/beacon-network-backend) on release tags ('vX.Y.Z'). The image is based on official WildFly image that is extended with PostgreSQL driver and predeployed Beacon Network application. -###### Apache Maven build system +To have an easy deployment, go to the [docker folder](./docker) and run [docker compose](https://docs.docker.com/compose/): + +``` +docker-compose up -d +``` + +### Manual installation + +#### Apache Maven build system The build process is based on [Apache Maven](https://maven.apache.org/). Compiling: ```shell ->git clone https://github.com/elixir-europe/beacon-network-backend.git ->cd beacon-network-backend ->mvn install +git clone https://github.com/elixir-europe/beacon-network-backend.git +cd beacon-network-backend +mvn install ``` -This must create `beacon-network-v2-x.x.x.war` (**W**eb application **AR**chive) application in the `/target` directory. +This must create `beacon-network-v2-x.x.x.war` (**W**eb application **AR**chive) application in the `/target` directory. Alternatively, you can find this file in the Barcelona Supercomputing Center's [maven repository](https://inb.bsc.es/maven/es/bsc/inb/ga4gh/beacon-network-v2/0.0.9/beacon-network-v2-0.0.9.war). -###### BSC Maven Repository -In addition to the provided docker images, artifacts are stored on the Barcelona Supercomputing Center's maven repository: -https://inb.bsc.es/maven/es/bsc/inb/ga4gh/beacon-network-v2/0.0.9/beacon-network-v2-0.0.9.war +#### WilfFly server +WildFly is a free opensource JEE server and may be easy downloaded from it's website: (http://wildfly.org/). +The deployment is as simple: + +```shell +# Copy .war file to wildfly +cp target/beacon-network-v2-x.x.x.war $WILDFLY_HOME/standalone/deployments/ +# Run the application server +./$WILDFLY_HOME/bin/standalone.sh +``` + +### Configuration -###### Configuration There are three default configuration files in the `/BEACON-INF` directory: * `configuration.json` - standard beacon configuration file: [beaconConfigurationResponse.json](https://github.com/ga4gh-beacon/beacon-v2/blob/main/framework/json/responses/beaconConfigurationResponse.json) * `beacon-info.json` - standard beacon information file: [beaconInfoResponse.json](https://github.com/ga4gh-beacon/beacon-v2/blob/main/framework/json/responses/beaconInfoResponse.json) @@ -45,7 +55,7 @@ The example of the `beacon-network.json`: "https://ega-archive.org/test-beacon-apis/cineca" ] ``` -Note that the **W**eb application **AR**chive (WAR) is just a usual ZIP file so one can edit these configurations manually without the need to rebuild the application. +Note that the **W**eb application **AR**chive (WAR) is just a usual ZIP file so one can edit these configurations manually without the need to rebuild the application. The same with Docker, it is automatically updated with new beacons. It is also possible to define external directory for the configuration. ```bash @@ -54,6 +64,12 @@ export BEACON_NETWORK_CONFIG_DIR=/wildfly/BEACON-INF When the `BEACON_NETWORK_CONFIG_DIR` is set, the aggregator monitors the `$BEACON_NETWORK_CONFIG_DIR/beacon-network.json` to dynamically update the configuration. It also looks (but not actively monitoring) the `$BEACON_NETWORK_CONFIG_DIR/beacon-info.json` so deployers may change the beacon identifier and other metatada. +### SQL Database + +The Beacon Network Aggregator uses [Jakarta Persistence 3.1](https://jakarta.ee/specifications/persistence/3.1/) for logging. +The connection is defined in [persistence.xml](https://github.com/elixir-europe/beacon-network-backend/blob/master/src/main/resources/META-INF/persistence.xml). +Although the Aggregator may be used with any SQL database, it is configured to be used with [PostgreSQL](https://www.postgresql.org/) database. + The application provides simple SQL logging which level may be confirured via `BEACON_NETWORK_LOG_LEVEL` environment variable. The possible values are "**NONE**", "**METADATA**", "**REQUESTS**", "**RESPONSES**", "**ALL**" - "**NONE**" : No logging at all. From 2d42fa703742de713c238a3c2e2e3e5bc6e2c4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergi=20Aguil=C3=B3=20Castillo?= <51328442+SergiAguilo@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:34:52 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9ff2fa..aa25f46 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -l# beacon-network-backend +# beacon-network-backend ###### Jakarta EE Platform 10 The implementation is developed and deployed on the [WildFly 30.0.0](http://wildfly.org/) server and is based on Jakarta RESTful Web Services 3.0 API ([JAX-RS 3.0](https://jakarta.ee/specifications/restful-ws/3.0/)). @@ -41,7 +41,7 @@ cp target/beacon-network-v2-x.x.x.war $WILDFLY_HOME/standalone/deployments/ ./$WILDFLY_HOME/bin/standalone.sh ``` -### Configuration +## Configuration There are three default configuration files in the `/BEACON-INF` directory: * `configuration.json` - standard beacon configuration file: [beaconConfigurationResponse.json](https://github.com/ga4gh-beacon/beacon-v2/blob/main/framework/json/responses/beaconConfigurationResponse.json) From 4fbffe8c81f21cfaab94b1356a9ed8dd2f05d5f5 Mon Sep 17 00:00:00 2001 From: Dmitry Repchevsky Date: Wed, 20 Dec 2023 11:26:08 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aa25f46..d1ece0e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,14 @@ mvn install This must create `beacon-network-v2-x.x.x.war` (**W**eb application **AR**chive) application in the `/target` directory. Alternatively, you can find this file in the Barcelona Supercomputing Center's [maven repository](https://inb.bsc.es/maven/es/bsc/inb/ga4gh/beacon-network-v2/0.0.9/beacon-network-v2-0.0.9.war). #### WilfFly server -WildFly is a free opensource JEE server and may be easy downloaded from it's website: (http://wildfly.org/). +WildFly is a free opensource JEE server and may be easy downloaded from it's website: http://wildfly.org/. +Nevertheless, the sever requires some configuration which in a case of docker image is done by the [Dcokerfile](https://github.com/elixir-europe/beacon-network-backend/blob/2d42fa703742de713c238a3c2e2e3e5bc6e2c4c7/docker/Dockerfile#L15) recipe. + +The implementation relies on JSON-B 3.0 [Eclipse YassonTM](https://github.com/eclipse-ee4j/yasson) implementation, but requires yet **unreleased 3.0.4** version [yasson-3.0.4-SNAPSHOT.jar](https://jakarta.oss.sonatype.org/content/repositories/snapshots/org/eclipse/yasson/3.0.4-SNAPSHOT/). Once WildFly is updated to the 3.0.4 version of YassonTM this step would be unneccessary. + +The Beacon Network logging is implemented using [Jakarta Persistence 3.1](https://jakarta.ee/specifications/persistence/3.1/) and relies on [PostgreSQL](https://www.postgresql.org/) database. +The server must be pre-configured for the PostgreSQL and the PosgreSQL JDBC driver must be intalled into the WildFly (docker image recipe does this job). + The deployment is as simple: ```shell