Skip to content

Commit 12add6d

Browse files
committed
initial commit for java-jsi-clus-pct-ts
1 parent 4ad8f5f commit 12add6d

File tree

19 files changed

+1168
-0
lines changed

19 files changed

+1168
-0
lines changed

java-jsi-clus-pct-ts/.bumpversion.cfg

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 0.9.0
3+
commit = True
4+
tag = True
5+
tag_name = java-jsi-clus-pct-ts-{new_version}
6+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
7+
serialize = {major}.{minor}.{patch}
8+
9+
[bumpversion:file:pom.xml]
10+
search = <version>{current_version}</version><!-- bumpversion -->
11+
replace = <version>{new_version}</version><!-- bumpversion -->
12+

java-jsi-clus-pct-ts/.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.git/
2+
.idea/
3+
target/
4+
*~
5+
.settings
6+
.project

java-jsi-clus-pct-ts/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target/
2+
.classpath
3+
.settings
4+
.project

java-jsi-clus-pct-ts/Dockerfile

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM hbpmip/java-base-build:3.5.0-jdk-8-9 as build-java-env
2+
3+
COPY pom.xml /project/pom.xml
4+
RUN cp /usr/share/maven/ref/settings-docker.xml /root/.m2/settings.xml \
5+
&& mvn dependency:resolve
6+
7+
COPY src/ /project/src
8+
9+
# Repeating copy of the settings works better. I dunno why.
10+
RUN cp /usr/share/maven/ref/settings-docker.xml /root/.m2/settings.xml \
11+
&& mvn -Dmaven.test.skip=true package site
12+
13+
FROM hbpmip/java-jsi-clus:latest
14+
15+
MAINTAINER martin.breskvar@ijs.si
16+
17+
ENV DOCKER_IMAGE=java-jsi-clus-pct-ts \
18+
JAVA_CLASSPATH=${JAVA_CLASSPATH}:/usr/share/jars/jsi-clus-pct-ts.jar \
19+
JAVA_MAINCLASS=eu.humanbrainproject.mip.algorithms.jsi.clus.pct.ts.Entrypoint
20+
21+
COPY --from=build-java-env /project/target/jsi-clus-pct-ts.jar /usr/share/jars/jsi-clus-pct-ts.jar
22+
COPY --from=build-java-env /project/target/site/ /var/www/html/
23+
COPY src/ /src/
24+
25+
RUN chown -R compute:compute /src/ \
26+
&& chown -R root:www-data /var/www/html/
27+
28+
LABEL org.label-schema.build-date=$BUILD_DATE \
29+
org.label-schema.name="hbpmip/java-jsi-clus-pct-ts" \
30+
org.label-schema.description="PCT algorithm for time-series prediction" \
31+
org.label-schema.url="https://github.com/LREN-CHUV/algorithm-repository" \
32+
org.label-schema.vcs-type="git" \
33+
org.label-schema.vcs-url="https://github.com/LREN-CHUV/algorithm-repository.git" \
34+
org.label-schema.vcs-ref=$VCS_REF \
35+
org.label-schema.version="$VERSION" \
36+
org.label-schema.vendor="JSI" \
37+
org.label-schema.license="GPLv3" \
38+
org.label-schema.docker.dockerfile="Dockerfile" \
39+
org.label-schema.schema-version="1.0"

java-jsi-clus-pct-ts/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[![DockerHub](https://img.shields.io/badge/docker-hbpmip%2Fjava--jsi--clus--pct--ts-008bb8.svg)](https://hub.docker.com/r/hbpmip/java-jsi-clus-pct-ts/) [![ImageVersion](https://images.microbadger.com/badges/version/hbpmip/java-jsi-clus-pct-ts.svg)](https://hub.docker.com/r/hbpmip/java-jsi-clus-pct-ts/tags "hbpmip/java-jsi-clus-pct-ts image tags") [![ImageLayers](https://images.microbadger.com/badges/image/hbpmip/java-jsi-clus-pct-ts.svg)](https://microbadger.com/#/images/hbpmip/java-jsi-clus-pct-ts "hbpmip/java-jsi-clus-pct-ts on microbadger")
2+
3+
# hbpmip/java-jsi-clus-pct-ts: Predictive Clustering Trees (PCTs) for time-series prediction from JSI
4+
5+
Implementation of the Predictive Clustering Trees capable of time-series prediction. http://kt.ijs.si
6+
7+
8+
## Usage
9+
10+
```sh
11+
12+
docker run --rm --env [list of environment variables] hbpmip/java-jsi-clus-pct-ts compute
13+
14+
```
15+
16+
where the environment variables are:
17+
18+
* NODE: name of the node (machine) used for execution
19+
* JOB_ID: ID of the job.
20+
* IN_JDBC_DRIVER: org.postgresql.Driver
21+
* IN_JDBC_URL: URL to the input database, e.g. jdbc:postgresql://db:5432/features
22+
* IN_JDBC_USER: User for the input database
23+
* IN_JDBC_PASSWORD: Password for the input database
24+
* OUT_JDBC_DRIVER: org.postgresql.Driver
25+
* OUT_JDBC_URL: URL to the output database, jdbc:postgresql://db:5432/woken
26+
* OUT_JDBC_USER: User for the output database
27+
* OUT_JDBC_PASSWORD: Password for the output database
28+
* PARAM_variables: List of target variables
29+
* PARAM_covariables: List of input variables
30+
* PARAM_query: Query selecting the data to feed into the algorithm for training
31+
* MODEL_PARAM_pruned: PCTs can be pruned or not. Use PARAM_pruned=yes to prune and MODEL_PARAM_pruned=no otherwise (default is MODEL_PARAM_pruned=yes)
32+
* MODEL_PARAM_minobj: Specify minimal number of examples in leaf nodes of the PCT (default is MODEL_PARAM_minobj=2)

java-jsi-clus-pct-ts/build.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail # trace ERR through pipes
4+
set -o errtrace # trace ERR through 'time command' and other functions
5+
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
6+
7+
get_script_dir () {
8+
SOURCE="${BASH_SOURCE[0]}"
9+
10+
while [ -h "$SOURCE" ]; do
11+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
12+
SOURCE="$( readlink "$SOURCE" )"
13+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
14+
done
15+
cd -P "$( dirname "$SOURCE" )"
16+
pwd
17+
}
18+
19+
cd "$(get_script_dir)"
20+
21+
if [[ $NO_SUDO || -n "$CIRCLECI" ]]; then
22+
CAPTAIN="captain"
23+
elif groups $USER | grep &>/dev/null '\bdocker\b'; then
24+
CAPTAIN="captain"
25+
else
26+
CAPTAIN="sudo captain"
27+
fi
28+
29+
BUILD_DATE=$(date -Iseconds) \
30+
VCS_REF=$(git describe --tags --dirty) \
31+
VERSION=$(git describe --tags --dirty) \
32+
$CAPTAIN build

java-jsi-clus-pct-ts/captain.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target_image:
2+
build: Dockerfile
3+
image: hbpmip/java-jsi-clus-pct-ts
4+
pre:
5+
- echo "Preparing java-jsi-clus-pct-ts"
6+
post:
7+
- echo "Finished java-jsi-clus-pct-ts"

java-jsi-clus-pct-ts/pom.xml

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>eu.humanbrainproject.mip.algorithms.jsi</groupId>
6+
<artifactId>jsi-clus-pct-ts</artifactId>
7+
<packaging>jar</packaging>
8+
<version>0.9.0</version><!-- bumpversion -->
9+
<name>java-jsi-clus-pct-ts</name>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<jdk.version>1.8</jdk.version>
14+
<compiler.plugin.version>3.6.2</compiler.plugin.version>
15+
<jar.plugin.version>3.0.2</jar.plugin.version>
16+
<surefire.plugin.version>2.19</surefire.plugin.version>
17+
<site.plugin.version>3.6</site.plugin.version>
18+
<info.reports.plugin.version>2.9</info.reports.plugin.version>
19+
<surefire.report.plugin.version>2.20</surefire.report.plugin.version>
20+
<jxr.plugin.version>2.5</jxr.plugin.version>
21+
<hadrian.version>0.8.5</hadrian.version>
22+
<junit.version>5.0.0</junit.version>
23+
<postgres.version>9.4.1212.jre7</postgres.version>
24+
<clus.version>1.0.0</clus.version>
25+
<jsi-clus.version>0.3.8</jsi-clus.version>
26+
<jackson.version>2.7.0</jackson.version>
27+
<mip.adapter.version>0.5.3</mip.adapter.version>
28+
</properties>
29+
30+
31+
<repositories>
32+
<repository>
33+
<id>maven</id>
34+
<url>https://repo.maven.apache.org/maven2</url>
35+
<name>Central Maven repository</name>
36+
</repository>
37+
38+
<repository>
39+
<id>opendatagroup</id>
40+
<url>http://repository.opendatagroup.com/maven</url>
41+
<name>Repository for Hadrian</name>
42+
</repository>
43+
44+
<repository>
45+
<snapshots>
46+
<enabled>false</enabled>
47+
</snapshots>
48+
<id>bintray-hbpmedical-mip</id>
49+
<name>bintray</name>
50+
<url>https://dl.bintray.com/hbpmedical/maven</url>
51+
</repository>
52+
</repositories>
53+
54+
<dependencies>
55+
<dependency>
56+
<groupId>eu.humanbrainproject.mip.algorithms</groupId>
57+
<artifactId>adapter</artifactId>
58+
<version>${mip.adapter.version}</version>
59+
</dependency>
60+
61+
<dependency>
62+
<groupId>eu.humanbrainproject.mip.algorithms</groupId>
63+
<artifactId>jsi-clus</artifactId>
64+
<version>${jsi-clus.version}</version>
65+
</dependency>
66+
<dependency>
67+
<groupId>si.ijs.kt</groupId>
68+
<artifactId>clus</artifactId>
69+
<version>${clus.version}</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.junit.jupiter</groupId>
73+
<artifactId>junit-jupiter-api</artifactId>
74+
<version>${junit.version}</version>
75+
<scope>test</scope>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>com.opendatagroup</groupId>
80+
<artifactId>hadrian</artifactId>
81+
<version>${hadrian.version}</version>
82+
<scope>test</scope>
83+
</dependency>
84+
85+
<dependency>
86+
<groupId>org.postgresql</groupId>
87+
<artifactId>postgresql</artifactId>
88+
<version>${postgres.version}</version>
89+
</dependency>
90+
91+
<dependency>
92+
<groupId>com.fasterxml.jackson.core</groupId>
93+
<artifactId>jackson-core</artifactId>
94+
<version>${jackson.version}</version>
95+
</dependency>
96+
</dependencies>
97+
98+
99+
100+
101+
<build>
102+
<finalName>${project.artifactId}</finalName>
103+
<testResources>
104+
<testResource>
105+
<directory>src/test/java</directory>
106+
<includes>
107+
<include>**/*.csv</include>
108+
<include>**/*.json</include>
109+
</includes>
110+
<filtering>false</filtering>
111+
</testResource>
112+
</testResources>
113+
<plugins>
114+
<plugin>
115+
<groupId>org.apache.maven.plugins</groupId>
116+
<artifactId>maven-compiler-plugin</artifactId>
117+
<version>${compiler.plugin.version}</version>
118+
<configuration>
119+
<source>${jdk.version}</source>
120+
<target>${jdk.version}</target>
121+
</configuration>
122+
</plugin>
123+
<plugin>
124+
<groupId>org.apache.maven.plugins</groupId>
125+
<artifactId>maven-jar-plugin</artifactId>
126+
<version>${jar.plugin.version}</version>
127+
</plugin>
128+
<plugin>
129+
<groupId>org.apache.maven.plugins</groupId>
130+
<artifactId>maven-surefire-plugin</artifactId>
131+
<version>${surefire.plugin.version}</version>
132+
<!-- lock down our surefire provider -->
133+
<dependencies>
134+
<dependency>
135+
<groupId>org.junit.platform</groupId>
136+
<artifactId>junit-platform-surefire-provider</artifactId>
137+
<version>1.0.0</version>
138+
</dependency>
139+
<dependency>
140+
<groupId>org.junit.jupiter</groupId>
141+
<artifactId>junit-jupiter-engine</artifactId>
142+
<version>5.0.0</version>
143+
</dependency>
144+
</dependencies>
145+
</plugin>
146+
<plugin>
147+
<groupId>org.apache.maven.plugins</groupId>
148+
<artifactId>maven-site-plugin</artifactId>
149+
<version>${site.plugin.version}</version>
150+
</plugin>
151+
</plugins>
152+
</build>
153+
154+
<reporting>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-project-info-reports-plugin</artifactId>
159+
<version>${info.reports.plugin.version}</version>
160+
</plugin>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-surefire-report-plugin</artifactId>
164+
<version>${surefire.report.plugin.version}</version>
165+
</plugin>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-jxr-plugin</artifactId>
169+
<version>${jxr.plugin.version}</version>
170+
</plugin>
171+
</plugins>
172+
</reporting>
173+
174+
</project>

0 commit comments

Comments
 (0)