Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
redmitry committed Nov 27, 2023
2 parents c16cecd + 673675b commit 5ceba66
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.BSC_GITLAB_MAVEN_REPO }}

- name: Log into the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
if: github.ref_type == 'tag'
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -52,13 +52,13 @@ jobs:

- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v3
if: github.ref_type == 'tag'
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push the Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v3
if: github.ref_type == 'tag'
with:
context: .
Expand Down
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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-frameworky](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

###### 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.

###### 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
```
This must create `beacon-network-v2-x.x.x.war` (**W**eb application **AR**chive) application in the `/target` directory.

###### 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

###### Configuration
There are three 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

The example of the `beacon-network.json`:
```json
[
"https://beacons.bsc.es/beacon/v2.0.0",
"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.

It is also possible to define external directory for the `beacon-network.json` 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.

12 changes: 11 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
FROM maven:3.9.5-eclipse-temurin-17-alpine as builder

COPY pom.xml .

RUN mvn dependency:go-offline --no-transfer-progress

COPY src/ /src/

RUN mvn clean install -DskipTests --no-transfer-progress

# Beacon Network 2.0 image
FROM quay.io/wildfly/wildfly:30.0.0.Final-jdk17

Expand All @@ -14,7 +24,7 @@ stop-embedded-server" > $JBOSS_HOME/bin/wildfly-config.cli'
RUN $JBOSS_HOME/bin/jboss-cli.sh --file="$JBOSS_HOME/bin/wildfly-config.cli"
RUN rm -rf $JBOSS_HOME/standalone/configuration/standalone_xml_history/current/*

ADD ./target/beacon-network-v2-*.war $JBOSS_HOME/standalone/deployments/beacon-network-v2.war
COPY --from=builder /target/beacon-network-v2-*.war $JBOSS_HOME/standalone/deployments/beacon-network-v2.war

# Expose AJP port
EXPOSE 8009

0 comments on commit 5ceba66

Please sign in to comment.