Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indra on Java11 container #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions indra-mongo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@
<artifactId>maven-jar-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<indra.mongoURI>localhost:27017</indra.mongoURI>
</systemPropertyVariables>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion indra-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ This is a REST Service that interfaces with the Java Indra Client.
"t2": "car",
"t1": "engine"
}]
}' "http://localhost:8916/indra/v1/relatedness"
}' "http://localhost:8916/relatedness"
2 changes: 0 additions & 2 deletions indra-service/docker/.dockerignore

This file was deleted.

10 changes: 0 additions & 10 deletions indra-service/docker/Dockerfile

This file was deleted.

124 changes: 44 additions & 80 deletions indra-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<server.mainClass>org.lambda3.indra.service.Indra</server.mainClass>
<jersey.version>2.26</jersey.version>
<jackson.version>2.9.7</jackson.version>

</properties>

<profiles>
Expand All @@ -30,6 +29,8 @@
<id>docker</id>
<properties>
<skipDocker>true</skipDocker>
<server.image>lambdacube/indra</server.image>
<credHelper>pass</credHelper> <!-- defaults to docker-credential-pass -->
</properties>
</profile>
</profiles>
Expand All @@ -56,24 +57,6 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand All @@ -96,76 +79,46 @@
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
<goal>dockerBuild</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/docker-resources</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/docker</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<dockerDirectory>${project.build.directory}/docker-resources</dockerDirectory>
<pushImage>false</pushImage>
<imageName>lambdacube/indra:${project.version}-${buildNumber}</imageName>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<includes>
<include>*.tar.gz</include>
</includes>
</resource>
</resources>
<skip>${skipDocker}</skip>
<from>
<!-- adoptopenjdk:11-jre-openj9 - pinned to have an always reproducible image -->
<image>adoptopenjdk@sha256:ba0932092f38cdb9fb06cd6fdf0423ff1e4b7c0a288fb4fa396092af00f8c3ad</image>
</from>
<to>
<image>${server.image}</image>
<credHelper>${credHelper}</credHelper>
<tags>
<tag>${project.version}-${buildNumber}</tag>
</tags>
</to>
<container>
<mainClass>${server.mainClass}</mainClass>
<jvmFlags>
<jvmFlag>-Xmx4g</jvmFlag>
<jvmFlag>-Djava.net.preferIPv4Stack=true</jvmFlag>
<jvmFlag>-Dfile.encoding=UTF-8</jvmFlag>
<jvmFlag>-Dindra.http.host=0.0.0.0</jvmFlag>
<jvmFlag>-Dindra.luceneVectorsBaseDir=/data/lucene</jvmFlag>
<jvmFlag>-Dindra.annoyBaseDir=/data/annoy</jvmFlag>
<jvmFlag>-Dindra.luceneTranslationBaseDir=/data/translation</jvmFlag>
</jvmFlags>
<ports>
<port>8916</port>
</ports>
</container>
</configuration>

<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>tag-image</id>
<phase>package</phase>
<goals>
<goal>tag</goal>
</goals>
<configuration>
<image>lambdacube/indra:${project.version}-${buildNumber}</image>
<newName>lambdacube/indra:${project.version}</newName>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</plugin>

</plugins>
</build>

Expand All @@ -181,12 +134,23 @@
<artifactId>indra-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.lambda3.indra</groupId>
<artifactId>indra-mongo</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>

<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down
61 changes: 0 additions & 61 deletions indra-service/src/main/assembly/distribution.xml

This file was deleted.

17 changes: 0 additions & 17 deletions indra-service/src/main/config/start

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ public synchronized void stop() {
logger.info("Terminating Indra Service.");
httpServer.shutdownNow();
try {
spaceFactory.close();
if (spaceFactory != null) {
spaceFactory.close();
}
} catch (IOException e) {
logger.error("error closing the vector space factory.");
e.printStackTrace();
} finally {
try {
translatorFactory.close();
if (translatorFactory != null) {
translatorFactory.close();
}
} catch (IOException e) {
logger.error("error closing the translator factory.");
e.printStackTrace();
}
}
}


}
36 changes: 22 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<slf4j-version>1.7.12</slf4j-version>
<lucene.version>7.1.0</lucene.version>
<license.licenseName>mit</license.licenseName>
<jackson.version>2.9.7</jackson.version>
<jaxb.version>2.3.2</jaxb.version>
</properties>

<profiles>
Expand Down Expand Up @@ -182,20 +184,6 @@
<version>2.20</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.20</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -207,6 +195,15 @@
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>

<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.8.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -249,6 +246,17 @@
<version>${lucene.version}</version>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb.version}</version>
</dependency>

<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down