Skip to content

Commit

Permalink
Rephrase installation
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiAguilo committed Dec 19, 2023
1 parent 01a9f76 commit 493dd50
Showing 1 changed file with 36 additions and 20 deletions.
56 changes: 36 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
# 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/)).

###### 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)
Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 493dd50

Please sign in to comment.