dice-group / LIMES

Link Discovery Framework for Metric Spaces.
https://limes.demos.dice-research.org/
GNU Affero General Public License v3.0
126 stars 54 forks source link

Include WordNet in Docker image #269

Closed KonradHoeffner closed 2 years ago

KonradHoeffner commented 2 years ago

I want to try the semantic measures, which require manual installation of WordNet. Wouldn't this be a perfect case for integration into the existing Dockerfile or, if that would increase image size too much, release of a second one?

KonradHoeffner commented 2 years ago

Doesn't seem to be a big difference:

$ docker images
REPOSITORY                 TAG       IMAGE ID       CREATED          SIZE
limes-wordnet              latest    88da794b602f   11 seconds ago   383MB
limes                      latest    f9f93f99b78c   21 minutes ago   350MB
########
## BUILD
# build first using maven
FROM maven:3.8-adoptopenjdk-16 as builder
WORKDIR /limes
ADD . /limes
WORKDIR /limes/limes-core/src/main/resources/wordnet
RUN curl https://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.gz --output WordNet-3.0.tar.gz && \
    tar -xzf WordNet-3.0.tar.gz && \
    rm WordNet-3.0.tar.gz && \
    mv WordNet-3.0/dict . && \
    rm -rf WordNet-3.0 && \
    curl https://wordnetcode.princeton.edu/wn3.1.dict.tar.gz --output wn3.1.dict.tar.gz && \
    tar -xzf wn3.1.dict.tar.gz && \
    rm wn3.1.dict.tar.gz
WORKDIR /limes
RUN mvn clean package shade:shade -Dmaven.test.skip=true
WORKDIR /limes/limes-core
RUN PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) && \
    cp -p ./target/limes-core-${PROJECT_VERSION}.jar /limes/limes.jar
##########
## RELEASE
# then run in a lighter jdk base
FROM adoptopenjdk/openjdk16:jre
WORKDIR /
VOLUME /data
# copy jar from build step
COPY --from=builder /limes/limes.jar limes.jar
ENV JAVA_OPTS="-Xmx2G"
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/limes.jar"]

Not tested though, I don't have a use case ready right now.

KonradHoeffner commented 2 years ago

Build like docker build -f wordnet.Dockerfile -t limes-wordnet.