Repository navigation
Packaging and Releasing
A plugin goes to Beacon as an archive. The release workflow makes the archives for each platform. You can also make an archive by hand.
A plugin archive is a gzip tar. Its root holds the manifest, the SQL files and the library:
beacon-plugin.toml
sql/functions.sql
lib/libexample_native.so
| Plugin type | Archive name |
|---|---|
| Native, or native and SQL | <name>-<version>-df<major>-<target>.tar.gz |
| SQL only | <name>-<version>-any.tar.gz |
-
<major>is the DataFusion major version. The pack script reads it fromnative/Cargo.lock. -
<target>is the Rust target of the library, such asx86_64-unknown-linux-gnu. -
SHA256SUMSlists the archives insha256sumformat. Beacon checks the archive against it.
Beacon picks the archive with its own DataFusion major version and its own target.
When no native archive matches, it uses the any archive.
Build the library on the platform of the Beacon server. The Beacon server image is a Linux image. For that image, build on Linux or in WSL.
| Platform | Library file | Target |
|---|---|---|
| Linux, x86-64 | libexample_native.so |
x86_64-unknown-linux-gnu |
| Linux, ARM64 | libexample_native.so |
aarch64-unknown-linux-gnu |
| macOS, Apple silicon | libexample_native.dylib |
aarch64-apple-darwin |
| macOS, Intel | libexample_native.dylib |
x86_64-apple-darwin |
| Windows, x86-64 | example_native.dll |
x86_64-pc-windows-msvc |
Beacon loads only the library file of its own platform.
-
Build the library:
cargo build --release --locked --manifest-path native/Cargo.toml
-
Pack the plugin. Use the library file and the target of your platform:
python3 scripts/package-plugin.py . --out dist --library native/target/release/libexample_native.so --target x86_64-unknown-linux-gnu
The script writes the archive and SHA256SUMS in dist/. dist/ is in .gitignore.
For a SQL-only plugin, omit --library and --target.
To build a Linux library on Windows or macOS, use Docker:
docker run --rm -v "$PWD:/src" -w /src rust:1-bookworm cargo build --release --locked --manifest-path native/Cargo.toml-
Set
plugin.versioninbeacon-plugin.toml. -
Run the unit tests. See Testing.
-
Commit the change.
-
Push a tag
v<version>:git tag v0.1.0
git push origin v0.1.0
The workflow .github/workflows/release.yml starts for each tag v*:
- It stops when the tag is not
v<plugin.version>. - It builds the library on 5 runners.
- It packs one archive for each target.
- It writes one
SHA256SUMSfile for all archives. - It attaches the archives and
SHA256SUMSto the GitHub release of the tag. It makes the release when it does not exist.
| Runner | Target |
|---|---|
ubuntu-24.04 |
x86_64-unknown-linux-gnu |
ubuntu-24.04-arm |
aarch64-unknown-linux-gnu |
macos-15 |
aarch64-apple-darwin |
macos-15-intel |
x86_64-apple-darwin |
windows-2025 |
x86_64-pc-windows-msvc |
- To skip a target, remove its row from the matrix.
- The workflow runs no tests. Run them before you push the tag.
- The workflow uses
cargo build --locked. So commitnative/Cargo.lock.
For a SQL-only plugin, each build job writes the same <name>-<version>-any.tar.gz.
The publish job keeps one of them. Keep one row in the matrix for a SQL-only plugin.
- Increase
plugin.versionfor each release. A tag is fixed. Do not move a tag. - A new SDK ABI or a new DataFusion major version needs a new release. Plugins of the old release do not load in the new Beacon.
- Keep the old release for servers with the old Beacon. Set
plugin.beaconfor each release.
Next: Installing.
For Beacon v2.1.0-rc4 (SDK ABI 7, DataFusion 55). Template repository: maris-development/beacon-plugin-template.