Skip to content
Merged
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
23 changes: 10 additions & 13 deletions benchmark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ RUN apt-get update \
&& apt-get update \
&& apt-get install -y java-21-amazon-corretto-jdk

# Build MobilityDB with MEOS
RUN git clone --depth 1 https://github.com/MobilityDB/MobilityDB.git -b stable-1.3 /usr/local/src/MobilityDB
RUN mkdir -p /usr/local/src/MobilityDB/build
# Build MobilityDB with MEOS. The jar this image runs is generated from the
# catalog of MobilityDB master with every family on, so the library must answer
# for the same surface: -DALL=ON is what CMakeLists.txt turns into the family
# list, and a narrower build leaves the jar naming symbols libmeos lacks.
RUN git clone --depth 1 https://github.com/MobilityDB/MobilityDB.git -b master /usr/local/src/MobilityDB
RUN mkdir -p /usr/local/src/MobilityDB/build
RUN cd /usr/local/src/MobilityDB/build && \
cmake -DMEOS=ON .. && \
cmake -DMEOS=ON -DALL=ON .. && \
make -j$(nproc) && \
make install
make install && \
ldconfig

# Set up Maven
ENV MAVEN_HOME /usr/share/maven
Expand All @@ -28,19 +32,12 @@ COPY --from=maven:3.9.6-eclipse-temurin-11 /usr/local/bin/mvn-entrypoint.sh /usr
COPY --from=maven:3.9.6-eclipse-temurin-11 /usr/share/maven/ref/settings-docker.xml /usr/share/maven/ref/settings-docker.xml
RUN ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn

# Set up MobilityDB-JMEOS
RUN git clone --depth 1 --branch fix-tests-using-docker https://github.com/MobilityDB/JMEOS /usr/local/jmeos
RUN rm /usr/local/jmeos/src/main/resources/lib/libmeos.so
RUN cp /usr/local/lib/libmeos.so /usr/local/jmeos/src/main/resources/lib/libmeos.so
RUN rm /usr/local/jmeos/jar/*

# Clean up
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*lists/*
RUN apt-get remove --purge --autoremove -y curl gnupg

# Copy project-specific files
COPY target/flink-kafka2postgres-1.0-SNAPSHOT.jar /app/flink-kafka2postgres.jar
COPY jar/JMEOS.jar /usr/local/jar/JMEOS.jar
COPY wait-for-it.sh /app/wait-for-it.sh

# Make the wait-for-it script executable
Expand All @@ -53,4 +50,4 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
WORKDIR /app

# Set entrypoint with the correct classpath
ENTRYPOINT ["/app/wait-for-it.sh", "kafka:29092", "--", "java", "-cp", "/app/flink-kafka2postgres.jar:/usr/local/jar/JMEOS.jar", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "aisdata.Query9_Main"]
ENTRYPOINT ["/app/wait-for-it.sh", "kafka:29092", "--", "java", "-cp", "/app/flink-kafka2postgres.jar", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "aisdata.Query9_Main"]
86 changes: 0 additions & 86 deletions benchmark/Dockerfile_q8_meos_kalman

This file was deleted.

4 changes: 2 additions & 2 deletions benchmark/run_query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ declare -A QUERY_DESC=(
[5]="Trajectory Creation and High-Speed Alert"
[6]="Positional Divergence for a Device"
[7]="Global Closest Device Pairs (Top-k)"
[8]="Trajectory Denoising — MEOS native EKF (marianaGarcez fork)"
[8]="Trajectory Denoising — MEOS native EKF"
[9]="Windowed Per-Device kNN Join"
)

declare -A QUERY_DOCKERFILE=(
[1]="" [2]="" [3]="" [4]="" [5]="" [6]="" [7]="" [8]="Dockerfile_q8_meos_kalman" [9]=""
[1]="" [2]="" [3]="" [4]="" [5]="" [6]="" [7]="" [8]="" [9]=""
)

QUERY_NUM="${1:-}"
Expand Down
5 changes: 3 additions & 2 deletions benchmark/src/main/java/aisdata/Query8_V2_Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
* Query 8 V2 - Trajectory Denoising with MEOS native EKF (AIS dataset)
*
* <p>Uses the Extended Kalman Filter implemented natively in MEOS via
* {@code temporal_ext_kalman_filter()} (PR #749: marianaGarcez/MobilityDB fork).
* {@code temporal_ext_kalman_filter()}, a public entry of {@code meos.h} that
* the generated JMEOS surface carries.
*
* <p>Original MobilityNebula pseudocode:
* <pre>
Expand All @@ -51,7 +52,7 @@ public class Query8_V2_Main {

private static final Logger logger = LoggerFactory.getLogger(Query8_V2_Main.class);

// EKF parameters: degree² units (C reference example defaults: https://github.com/marianaGarcez/MobilityDB/blob/e3319c1e6fc9157d19cb0580e097224cd42a8214/meos/examples/ais_ekf_clean.c)
// EKF parameters: degree² units (C reference example defaults: meos/examples/ais_ekf_clean.c)
private static final double GATE = 8.0;
private static final double Q = 5e-10;
private static final double R = 4e-6;
Expand Down
7 changes: 4 additions & 3 deletions benchmark/src/main/java/sncbdata/Query8_V2_Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
* Query 8 V2 - Trajectory Denoising with MEOS native EKF (SNCB dataset)
*
* <p>Uses the Extended Kalman Filter implemented natively in MEOS via
* {@code temporal_ext_kalman_filter()} (PR #749: marianaGarcez/MobilityDB fork).
* {@code temporal_ext_kalman_filter()}, a public entry of {@code meos.h} that
* the generated JMEOS surface carries.
* This replaces the Apache Commons Math Kalman Filter used in V1.
*
* <p>Original MobilityNebula pseudocode:
Expand All @@ -55,7 +56,7 @@
* </ul>
*
* <h2>Build requirement</h2>
* <p>Requires {@code libmeos.so} compiled from the {@code marianaGarcez/MobilityDB}
* <p>Requires {@code libmeos.so} compiled from {@code MobilityDB/MobilityDB}
* fork (branch {@code master}) and {@code GeneratedFunctions.java} patched to expose
* {@code temporal_ext_kalman_filter}, both handled by {@code Dockerfile.q8v2}.
*
Expand All @@ -66,7 +67,7 @@ public class Query8_V2_Main {

private static final Logger logger = LoggerFactory.getLogger(Query8_V2_Main.class);

// EKF parameters: degree² units (C reference example defaults: https://github.com/marianaGarcez/MobilityDB/blob/e3319c1e6fc9157d19cb0580e097224cd42a8214/meos/examples/ais_ekf_clean.c)
// EKF parameters: degree² units (C reference example defaults: meos/examples/ais_ekf_clean.c)
private static final double GATE = 3.0;

private static final double Q = 5e-10;
Expand Down
Loading