Skip to content

Commit a8b6fcc

Browse files
committed
fix(model-server): use output of gradle application plugin to run the model-server
Instead of copying all the jar libraries and having our own shell script we can just use the gradle plugin, that already assembles everything properly.
1 parent 9530a0c commit a8b6fcc

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

model-server/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
FROM registry.access.redhat.com/ubi8/openjdk-11:1.21-1.1736337912
22
USER root
3-
WORKDIR /usr/modelix-model
3+
WORKDIR /model-server/
44
EXPOSE 28101
55
HEALTHCHECK CMD curl --fail http://localhost:28101/health || exit 1
6-
COPY run-model-server.sh /usr/modelix-model/
7-
COPY build/dependency-libs/ /usr/modelix-model/model-server/build/libs/
8-
COPY build/libs/ /usr/modelix-model/model-server/build/libs/
9-
ENTRYPOINT ["./run-model-server.sh"]
6+
7+
COPY build/install/model-server/ /model-server/
8+
9+
ENV MODEL_SERVER_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5071 -XX:MaxRAMPercentage=75 -Djdbc.url=$jdbc_url"
10+
ENTRYPOINT ["/model-server/bin/model-server"]

model-server/build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,8 @@ val fatJarArtifact = artifacts.add("archives", fatJarFile) {
113113
builtBy("shadowJar")
114114
}
115115

116-
task("copyLibs", Sync::class) {
117-
into(project.layout.buildDirectory.dir("dependency-libs"))
118-
from(configurations.runtimeClasspath)
119-
}
120-
121116
tasks.named("assemble") {
122-
finalizedBy("copyLibs")
117+
dependsOn("installDist")
123118
}
124119

125120
application {

model-server/run-model-server.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)