Skip to content
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
71 changes: 71 additions & 0 deletions exomiser-cli/exomiser
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

# ==========================================
# Exomiser executable launch script
# ==========================================

# Determine the Java command to use to start the JVM.
if [[ -n "$EXOMISER_JAVA_HOME" ]]; then
JAVA_CMD="$EXOMISER_JAVA_HOME/bin/java"
elif [[ -n "$JAVA_HOME" ]]; then
JAVA_CMD="$JAVA_HOME/bin/java"
elif [ -x /usr/libexec/java_home ]; then
JAVA_CMD="$(/usr/libexec/java_home -v 17+ 2>/dev/null)/bin/java" || JAVA_CMD=java
else
JAVA_CMD="$(which java)" || JAVA_CMD=java
fi

if [ ! -x "$JAVA_CMD" ] && ! command -v "$JAVA_CMD" &> /dev/null; then
echo "ERROR: Cannot find 'java'. Please make sure Java 17+ is installed." >&2
exit 1
fi

declare -a JVM_OPTS=()
declare -a ARGS=()

# Parse command line arguments to split JVM options from Exomiser arguments
while [[ $# -gt 0 ]]; do
case $1 in
-D*|-X*)
JVM_OPTS+=("$1")
;;
*)
ARGS+=("$1")
;;
esac
shift
done

# Mix in global JAVA_OPTS and EXOMISER_OPTS if they are set
if [[ -n "$JAVA_OPTS" ]]; then
read -a GLOBAL_JAVA_OPTS <<< "$JAVA_OPTS"
JVM_OPTS+=("${GLOBAL_JAVA_OPTS[@]}")
fi
if [[ -n "$EXOMISER_OPTS" ]]; then
read -a GLOBAL_EXO_OPTS <<< "$EXOMISER_OPTS"
JVM_OPTS+=("${GLOBAL_EXO_OPTS[@]}")
fi

# Determine the path to the jar
# It could be explicitly defined by EXOMISER_JAR
if [ -z "$EXOMISER_JAR" ]; then
# Default location inside the Docker container
if [ -f "/app/exomiser-cli.jar" ]; then
EXOMISER_JAR="/app/exomiser-cli.jar"
else
# Fallback: resolve relative to this script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [ -f "$SCRIPT_DIR/../exomiser-cli.jar" ]; then
EXOMISER_JAR="$SCRIPT_DIR/../exomiser-cli.jar"
elif [ -f "$SCRIPT_DIR/exomiser-cli.jar" ]; then
EXOMISER_JAR="$SCRIPT_DIR/exomiser-cli.jar"
else
echo "ERROR: Cannot find exomiser-cli.jar." >&2
echo "Please set EXOMISER_JAR to the location of the jar file." >&2
exit 1
fi
fi
fi

# Execute the application
exec "$JAVA_CMD" "${JVM_OPTS[@]}" -jar "$EXOMISER_JAR" "${ARGS[@]}"
33 changes: 33 additions & 0 deletions exomiser-cli/exomiser-bash.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Stage 1: Build the exomiser-cli application
FROM eclipse-temurin:21-jdk AS builder

# Set the working directory
WORKDIR /build

# Copy the maven wrapper and pom files
COPY mvnw .
COPY . .

# Build and install phenix-repository to local maven repo first
RUN ./mvnw install -DskipTests -pl phenix-repository -am

# Build only the CLI and its dependencies
RUN ./mvnw clean package -DskipTests -pl exomiser-cli -am

# Stage 2: Create the runtime bash image
# Use eclipse-temurin:25.0.2_10-jre as requested
FROM eclipse-temurin:25.0.2_10-jre

# Define volumes
VOLUME ["/exomiser-data", "/exomiser", "/results"]

# Set the working directory
WORKDIR /app

# Copy the built jar and its dependencies
COPY --from=builder /build/exomiser-cli/target/exomiser-cli-*.jar /app/exomiser-cli.jar
COPY --from=builder /build/exomiser-cli/target/lib /app/lib

# Copy executable exomiser script and make it available on the PATH
COPY exomiser-cli/exomiser /usr/local/bin/exomiser
RUN chmod +x /usr/local/bin/exomiser
32 changes: 32 additions & 0 deletions exomiser-cli/exomiser-distroless.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Stage 1: Build the exomiser-cli application
FROM eclipse-temurin:21-jdk AS builder

# Set the working directory
WORKDIR /build

# Copy the maven wrapper and pom files
COPY mvnw .
COPY . .

# Build and install phenix-repository to local maven repo first
RUN ./mvnw install -DskipTests -pl phenix-repository -am

# Build only the CLI and its dependencies
RUN ./mvnw clean package -DskipTests -pl exomiser-cli -am

# Stage 2: Create the runtime distroless image
# Use the base image defined in pom.xml docker.base.image
FROM gcr.io/distroless/java25-debian13@sha256:4eadd00d3bff73e6a7491dd36653c1d318ac93fb1fb2cd5eef768fd2b4238408

# Define volumes
VOLUME ["/exomiser-data", "/exomiser", "/results"]

# Set the working directory
WORKDIR /app

# Copy the built jar and its dependencies
COPY --from=builder /build/exomiser-cli/target/exomiser-cli-*.jar /app/exomiser-cli.jar
COPY --from=builder /build/exomiser-cli/target/lib /app/lib

# Run the jar
ENTRYPOINT ["java", "-jar", "/app/exomiser-cli.jar"]
119 changes: 34 additions & 85 deletions exomiser-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,63 +215,28 @@
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>build-docker-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
<goal>exec</goal>
</goals>
<configuration>
<from>
<image>
${docker.base.image}
</image>
<platforms>
<platform>
<os>linux</os>
<architecture>arm64</architecture>
</platform>
<!-- No longer provided was this for MacOS? -->
<!-- <platform>-->
<!-- <os>linux</os>-->
<!-- <architecture>arm</architecture>-->
<!-- </platform>-->
<platform>
<os>linux</os>
<architecture>amd64</architecture>
</platform>
</platforms>
</from>
<to>
<image>
${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}-bash
</image>
<tags>
<tag>latest-bash</tag>
<tag>${project.parent.version}-bash</tag>
</tags>
</to>
<container>
<entrypoint>
<arg>/bin/bash</arg>
</entrypoint>
<volumes>
<volume>/exomiser-data</volume>
<volume>/exomiser</volume>
<volume>/results</volume>
</volumes>
</container>
<extraDirectories>
<permissions>
<permission>
<file>/entrypoint.sh</file>
<mode>755</mode>
</permission>
</permissions>
</extraDirectories>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}-bash</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:latest-bash</argument>
<argument>-f</argument>
<argument>exomiser-bash.dockerfile</argument>
<argument>..</argument>
</arguments>
</configuration>
</execution>
</executions>
Expand All @@ -284,48 +249,32 @@
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>build-docker-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
<goal>exec</goal>
</goals>
<configuration>
<from>
<image>
${docker.base.image}
</image>
<platforms>
<platform>
<os>linux</os>
<architecture>arm64</architecture>
</platform>
<platform>
<os>linux</os>
<architecture>amd64</architecture>
</platform>
</platforms>
</from>
<to>
<image>
${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}
</image>
<tags>
<tag>latest</tag>
<tag>latest-distroless</tag>
<tag>${project.parent.version}-distroless</tag>
</tags>
</to>
<container>
<volumes>
<volume>/exomiser-data</volume>
<volume>/exomiser</volume>
<volume>/results</volume>
</volumes>
</container>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:latest</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:latest-distroless</argument>
<argument>-t</argument>
<argument>${docker.registry}/${docker.repository}/${project.artifactId}:${project.parent.version}-distroless</argument>
<argument>-f</argument>
<argument>exomiser-distroless.dockerfile</argument>
<argument>..</argument>
</arguments>
</configuration>
</execution>
</executions>
Expand Down
4 changes: 0 additions & 4 deletions exomiser-cli/src/main/jib/enable_exomiser.sh

This file was deleted.

Empty file modified mvnw
100644 → 100755
Empty file.