Skip to content

Commit

Permalink
Merge branch 'index-instead-jpa'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
IgorRodchenkov committed Feb 12, 2024
2 parents f175919 + 63a21f8 commit 7db47ab
Show file tree
Hide file tree
Showing 118 changed files with 5,225 additions and 5,213 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
build:
runs-on: ubuntu-latest
env:
_JAVA_OPTIONS: "--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
JDK_JAVA_OPTIONS: "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
java-version: 20
distribution: 'temurin'
cache: maven
- name: Build with Maven and JDK-17
- name: Build with Maven and JDK-20
run: mvn --batch-mode --update-snapshots package
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# builds the image after maven build from local sources
# todo: test (perhaps get the data from PC2 and the fat JAR/WAR from M2 repo instead of using local build)
FROM openjdk:17
ARG WRK=target/work
VOLUME /work
WORKDIR /work
COPY target/cpath2.war .
# copy the data except listed in .dockerignore
COPY $WRK .
FROM eclipse-temurin:latest
ARG APP_JAR
# persistent volume containing the app data (biopax model ad index files;
# can use target/work demo/test data)
COPY ${APP_JAR} cpath2.war
#home/work dir (properties, data) to mount as docker volume/bind (with e.g. terraform or docker-compose)
ENV CPATH2_HOME /work
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dfile.encoding=UTF-8", "-Xmx64g",\
"-Dspring.profiles.active=docker", "-jar", "cpath2.war", "--server", \
"--add-opens=java.base/java.lang=ALL-UNNAMED", \
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED"]
ENV JDK_JAVA_OPTIONS="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"
#start the app in the workdir to use the "production" application.properties (if present)
WORKDIR ${CPATH2_HOME}
ENTRYPOINT ["java", "-server", "-Djava.security.egd=file:/dev/./urandom", \
"-Dfile.encoding=UTF-8", "-Xss32m", "-Xmx64g", \
"-Dspring.profiles.active=docker", \
"-Dpaxtools.model.safeset=list", \
"-Dpaxtools.normalizer.use-latest-registry=true", \
"-jar", "/cpath2.war", "--server"]
EXPOSE 8080
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Expect that most queries or example links won't return any result as there are n
instance; try to find e.g. all the pathways there with `http://localhost:8080/search?q=*&type=pathway`
(remove `type` parameter to list all the objects; use "Accept:application/xml" header to get XML instead of JSON result).

Alternatively, can run/debug the demo/dev app as:

mvn spring-boot:run


## Configuration

### Working directory
Expand Down Expand Up @@ -94,7 +99,8 @@ Copy the latest paxtools.jar into this current directory and run -
sh export.sh 2>&1 >console.out &

(- which takes overnight or a day and night); upload/copy/move (but keep at least blacklist.txt, *All.BIOPAX.owl.gz)
all the files from this here and ../data/ directories to the file server, or configure so that they can be downloaded from e.g. `http://www.pathwaycommons.org/archives/PC2/v{version_number}` (or else).
all the files from this here and ../data/ directories to the file server, or configure so that they can be downloaded
from e.g. `http://www.pathwaycommons.org/archives/PC2/v{version_number}` (or else).

Once the instance is configured and data processed, run the web service using the same
script as follows:
Expand All @@ -116,7 +122,7 @@ simply include to the cpath2.sh Java options like:
### Data

One (a data manager) has to find, download, re-pack (zip) and put original
biological pathway data files to the data/ sub-directory.
biological pathway data files to the data/ subdirectory.

#### Warehouse data

Expand All @@ -138,3 +144,21 @@ Prepare original BioPAX and PSI-MI/PSI-MITAB data archives in the 'data' folder
- download (wget) original files or archives from the pathway resource (e.g., `wget http://www.reactome.org/download/current/biopax3.zip`)
- extract what you need (e.g. some species data only)
- create a new zip archive using name like `<IDENTIFIER>.zip` (datasource identifier, e.g., `reactome_human.zip`).


## Docker

### build the project and image from sources
```
mvn clean install
mvn dockerfile:build
#mvn dockerfile:tag
#mvn dockerfile:push
```

### run
Run with docker (can also do with compose or terraform).
Have to bind /work dir (test/demo instance data is in the target/work)
```
docker run --rm --name cpath2 -v '<fullpath_to>/target/work:/work' -p 8080:8080 -it pathwaycommons/cpath2
```
Loading

0 comments on commit 7db47ab

Please sign in to comment.