Skip to content

Commit e29c4c8

Browse files
Updated gradle wrapper and fixed Docker build and README.
1 parent 4ca1c33 commit e29c4c8

8 files changed

Lines changed: 106 additions & 47 deletions

File tree

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
FROM openjdk:8-jdk-alpine
1+
FROM openjdk:13-jdk-alpine
22
VOLUME /tmp
3-
ARG JAR_FILE
3+
ARG JAR_FILE="build/libs/sifgraph-server*.jar"
4+
ARG DATA_FILE="data.txt.gz"
5+
ENV DATA_URL="file:${DATA_FILE}"
46
COPY ${JAR_FILE} app.jar
5-
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
7+
COPY ${DATA_FILE} .
8+
ENTRYPOINT ["java","-Xmx16g","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar", "--sifgraph.data=${DATA_URL}"]
9+
EXPOSE 8080

README.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ on the Pathway Commons' [Extended SIF](http://www.pathwaycommons.org/pc2/formats
1010
Clone the repository.
1111

1212
See `src/main/resources/config/application.properties` comments;
13-
download the extended SIF data file and update the properties accordingly
13+
download a Pathway Commons Extended SIF data archive and save it as data.txt.gz in this project directory, e.g.:
14+
15+
```commandline
16+
wget -O data.txt.gz "https://www.pathwaycommons.org/archives/PC2/v12/PathwayComons12.All.hgnc.txt.gz"
17+
```
18+
1419
(alternatively, set `--sifgraph.data=...`, etc., options at
1520
the end of the `java -jar` command (see below), or set `SIFGRAPH_DATA` system variable.)
1621

@@ -23,22 +28,55 @@ Build:
2328
Run:
2429

2530
```commandline
26-
java -jar build/libs/sifgraph-server-0.3.0.jar -Xmx4g --sifgraph.data="file:/path/to/graph.txt.gz" --server.port=8080
31+
java -Xmx8g -jar build/libs/sifgraph-server*.jar
2732
```
2833

2934
Note: override the default list of SIF patterns using `--sifgraph.relationships=...` if needed (depends on the data).
3035

31-
If you want to run __different instances__ of the graph server, e.g., for different species, then simply
32-
copy src/main/resources/config/application.properties to the work/current directory,
36+
If you want to run __different instances__ of the graph server, e.g., for different species, then
37+
copy src/main/resources/config/application.properties to the work directory,
3338
rename (e.g., my.properties), modify (e.g., set another `server.port`, `sifgraph.relationships`
3439
and `sifgraph.data` file), and run as:
3540

3641
```commandline
37-
java -jar build/libs/sifgraph-server.jar --spring.config.name=my
42+
java -Xmx8g -jar build/libs/sifgraph-server*.jar --spring.config.name=my
3843
```
3944

45+
or
46+
47+
```commandline
48+
java -Xmx8g -jar build/libs/sifgraph-server*.jar --sifgraph.data="file:<other.file>" --server.port=<otherPort>
49+
```
50+
51+
4052
RESTful API (Swagger docs):
4153

4254
Once the app is built and running,
4355
the auto-generated documentation is available at
4456
`http://localhost:8080/sifgraph/`
57+
58+
59+
## Docker
60+
You can also build and run the docker image as follows
61+
(`<PORT>` - actual port number where the server will run; data file download step above is also required).
62+
63+
```commandline
64+
./gradlew build
65+
docker build . -t pathwaycommons/sifgraph-server
66+
docker run -it --rm --name sifgraph-server -p <PORT>:8080 pathwaycommons/sifgraph-server
67+
```
68+
69+
Optionally, (a member of 'pathwaycommons' group) can now push the latest Docker image there:
70+
71+
```commandline
72+
docker login
73+
docker push pathwaycommons/sifgraph-server
74+
```
75+
76+
So, other users could skip building from sources and simply run the app:
77+
```commandline
78+
docker pull
79+
docker run -p <PORT>:8080 -t pathwaycommons/sifgraph-server
80+
```
81+
82+
(you can `Ctrl-c` and quit the console; the container is still there running; check with `docker ps`)

build.gradle

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
springBootVersion = '2.1.0.RELEASE'
3+
springBootVersion = '2.2.6.RELEASE'
44
}
55
repositories {
66
maven {
@@ -9,15 +9,13 @@ buildscript {
99
}
1010
dependencies {
1111
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
12-
classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.20.1"
1312
}
1413
}
1514

1615
apply plugin: 'java'
1716
apply plugin: 'idea'
1817
apply plugin: 'org.springframework.boot'
1918
apply plugin: 'io.spring.dependency-management'
20-
apply plugin: 'com.palantir.docker'
2119

2220
repositories {
2321
mavenCentral()
@@ -47,15 +45,5 @@ dependencies {
4745

4846
sourceCompatibility = 1.8
4947
group = 'pathwaycommons'
50-
version = '0.3.0'
48+
version = '0.3.1'
5149

52-
docker {
53-
dependsOn build
54-
name "${project.group}/${bootJar.baseName}"
55-
files bootJar.archivePath
56-
buildArgs(['JAR_FILE': "${bootJar.archiveName}"])
57-
}
58-
59-
task wrapper(type: Wrapper) {
60-
gradleVersion = '4.8.1'
61-
}

gradle/wrapper/gradle-wrapper.jar

4.18 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Nov 19 13:21:17 EST 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip

gradlew

Lines changed: 31 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/config/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ management.endpoints.web.exposure.include=health,info
66
#management.endpoints.web.exposure.exclude=
77

88
# data location (Pathway Commons Extended SIF format)
9-
#"http://www.pathwaycommons.org/archives/PC2/v10/PathwayCommons10.All.hgnc.txt.gz"
9+
#"https://www.pathwaycommons.org/downloads/PathwayCommons*.All.hgnc.txt.gz"
1010
# manually download and use the local file
11-
sifgraph.data=file:/home/igor/Downloads/PathwayCommons10.All.hgnc.txt.gz
11+
sifgraph.data=file:data.txt.gz
1212

1313
# comma-separated list of org.pathwaycommons.sif.util.EdgeAnnotationType names used in the text data file;
1414
# note: which column names are out there depends on actual input file (it can be customized too); default are:

0 commit comments

Comments
 (0)