Fluxer PostgreSQL→Cassandra migration tool
Type-aware migration from Fluxer's PostgreSQL fluxer_kv backend to the native Apache Cassandra schema, plus scylla-feature image builds and a full cutover runbook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Identical to Dockerfile but compiled with --features scylla for Apache Cassandra support.
|
||||
# The feature is named "scylla" after the Rust crate — the runtime target is Cassandra.
|
||||
|
||||
FROM rust:1-bookworm AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release -p fluxer-messages --features scylla
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG BUILD_VERSION=""
|
||||
|
||||
WORKDIR /usr/local/bin
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /usr/src/app/target/release/fluxer-messages /usr/local/bin/fluxer-messages
|
||||
|
||||
ENV BUILD_VERSION="${BUILD_VERSION}"
|
||||
|
||||
USER 65532:65532
|
||||
|
||||
EXPOSE 8090
|
||||
|
||||
CMD ["/usr/local/bin/fluxer-messages"]
|
||||
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Identical to Dockerfile but compiled with --features scylla for Apache Cassandra support.
|
||||
# The feature is named "scylla" after the Rust crate — the runtime target is Cassandra.
|
||||
|
||||
FROM rust:1-bookworm AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release -p fluxer-users --features scylla
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
ARG BUILD_VERSION=""
|
||||
|
||||
WORKDIR /usr/local/bin
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /usr/src/app/target/release/fluxer-users /usr/local/bin/fluxer-users
|
||||
|
||||
ENV BUILD_VERSION="${BUILD_VERSION}"
|
||||
|
||||
USER 65532:65532
|
||||
|
||||
EXPOSE 8090
|
||||
|
||||
CMD ["/usr/local/bin/fluxer-users"]
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the two Fluxer Rust shard services WITH the `scylla` feature, which the
|
||||
# public ghcr.io images are compiled WITHOUT. Tag them to match your stack's
|
||||
# FLUXER_IMAGE_TAG so the custom images never drift out of sync on upgrades.
|
||||
#
|
||||
# Usage:
|
||||
# ./build-cassandra-images.sh <git-tag> [path-to-fluxer-source]
|
||||
# Example:
|
||||
# ./build-cassandra-images.sh v1 ~/fluxer-src
|
||||
set -euo pipefail
|
||||
|
||||
TAG="${1:?usage: build-cassandra-images.sh <git-tag> [source-dir]}"
|
||||
SRC="${2:-$HOME/fluxer-src}"
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
if [[ ! -f "$SRC/Cargo.toml" ]]; then
|
||||
echo "error: $SRC is not a Fluxer source checkout (no Cargo.toml)." >&2
|
||||
echo "Clone it first: git clone https://github.com/fluxerapp/fluxer.git $SRC" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ">> checking out $TAG in $SRC"
|
||||
git -C "$SRC" fetch --tags --quiet
|
||||
git -C "$SRC" checkout "$TAG"
|
||||
|
||||
# Drop the scylla-enabled Dockerfiles into the source tree (build context = repo root).
|
||||
cp "$HERE/Dockerfile.messages.cassandra" "$SRC/fluxer_messages/Dockerfile.cassandra"
|
||||
cp "$HERE/Dockerfile.users.cassandra" "$SRC/fluxer_users/Dockerfile.cassandra"
|
||||
|
||||
echo ">> building fluxer-messages-cassandra:$TAG"
|
||||
docker build -f "$SRC/fluxer_messages/Dockerfile.cassandra" -t "fluxer-messages-cassandra:$TAG" "$SRC"
|
||||
|
||||
echo ">> building fluxer-users-cassandra:$TAG"
|
||||
docker build -f "$SRC/fluxer_users/Dockerfile.cassandra" -t "fluxer-users-cassandra:$TAG" "$SRC"
|
||||
|
||||
echo ">> done. images:"
|
||||
docker images | grep -E "fluxer-(messages|users)-cassandra" | grep "$TAG"
|
||||
Reference in New Issue
Block a user