Skip to content
Merged
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
40 changes: 40 additions & 0 deletions GENERATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,43 @@ Tracking master keeps the source and the `@master` derivation toolchain moving t
so the catalog and jar never drift from the `run.py` that derives them.

The UDF layer is the generated `registerAll()` — zero hand-written registrations.

## Regenerating by hand

CI performs the steps below via `provision-meos`. To run them yourself you need a JDK, Maven,
CMake and the MEOS build dependencies.

**1. Derive libmeos and the catalog from MobilityDB master.** Both come from one commit; see
`MEOS-API/GENERATION.md` for the two commands:

```bash
MDB=~/src/MobilityDB # checkout at the commit you are deriving from
MEOSAPI=~/src/MEOS-API
cmake -S "$MDB" -B "$MDB/build" -DCMAKE_BUILD_TYPE=Release -DMEOS=ON -DALL=ON
cmake --build "$MDB/build" -j"$(nproc)"
cmake --install "$MDB/build" --prefix "$MDB/.prefix"
cd "$MEOSAPI" && MDB_SRC_ROOT="$MDB" python3 run.py "$MDB/.prefix/include"
```

**2. Build the JMEOS jar against that catalog and install it into the local Maven
repository** under the coordinates this build resolves — `org.jmeos:meos:1.0`:

```bash
cd ~/src/JMEOS # JMEOS main
CATALOG="$MEOSAPI/output/meos-idl.json" LIBMEOS="$MDB/.prefix/lib/libmeos.so" \
tools/regen-from-catalog.sh
mvn install:install-file -Dfile=jar/JMEOS.jar \
-DgroupId=org.jmeos -DartifactId=meos -Dversion=1.0 -Dpackaging=jar
```

**3. Stage the catalog and build.** `tools/meos-idl.json` is derived, not committed:

```bash
cd ~/src/MobilitySpark
cp "$MEOSAPI/output/meos-idl.json" tools/meos-idl.json
LD_LIBRARY_PATH="$MDB/.prefix/lib" mvn clean test
```

`generate-sources` runs `tools/codegen_jvm.py --engine spark --catalog tools/meos-idl.json
--jar <the installed jar> --out target/generated-sources/spark/...`, so the UDF layer is
regenerated by the build itself. `LD_LIBRARY_PATH` is how the tests find `libmeos.so`.
Loading