Week 1 — deployment prerequisites: - Add TIDAL_API_KEY Bearer auth middleware (constant-time comparison) - Handle SIGTERM alongside ctrl-c for graceful shutdown - Remove test-utils feature from production tidal-server binary - Fix standalone Dockerfile; add cluster Dockerfile and docker-compose - Extract MultiRegionState into state.rs with per-region TidalDb map Week 2 — operational middleware and observability: - Add body limit (2MB), request timeout (30s), concurrency limit (100) - Add SetRequestIdLayer + PropagateRequestIdLayer (x-request-id header) - Add TraceLayer with structured spans including request ID - Activate Prometheus /metrics endpoint via --metrics flag - Add monitoring.md, recovery.md, prometheus-alerts.yaml, grafana-dashboard.json Week 3 — query latency histograms and middleware integration tests: - Add QUERY_LATENCY_BOUNDS (100µs–10s) histogram to tidal library - Instrument retrieve() and search() with tidaldb_retrieve/search_latency_us - Fix: search() latency now recorded on error paths (was skipped via ?) - Lib+bin split in tidal-server enabling integration tests - Add 8 middleware integration tests (auth, body limit, request ID) - Add 2 Prometheus alert rules and 2 Grafana latency panels Post-review fixes: - Fix SIGTERM handler compilation on non-Unix targets (#[cfg(unix)] guard) - Exempt /health from TimeoutLayer + ConcurrencyLimitLayer (prevents false liveness failures under load) - Case-insensitive Bearer scheme matching per RFC 7235 §2.1
41 lines
1.5 KiB
Docker
41 lines
1.5 KiB
Docker
# LEGACY: This file was originally a simulated multi-region cluster image.
|
|
# The cluster mode has been removed from tidal-server. This Dockerfile now
|
|
# builds an identical standalone image and is preserved only to avoid breaking
|
|
# existing CI references.
|
|
#
|
|
# For new deployments use docker/standalone/Dockerfile instead.
|
|
FROM rust:1.91 as builder
|
|
WORKDIR /app
|
|
|
|
# Copy workspace manifests first for caching.
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY tidal/Cargo.toml tidal/Cargo.toml
|
|
COPY tidalctl/Cargo.toml tidalctl/Cargo.toml
|
|
COPY tidal-server/Cargo.toml tidal-server/Cargo.toml
|
|
COPY applications/forage/engine/Cargo.toml applications/forage/engine/Cargo.toml
|
|
COPY applications/forage/server/Cargo.toml applications/forage/server/Cargo.toml
|
|
COPY applications/forage/embedder/Cargo.toml applications/forage/embedder/Cargo.toml
|
|
COPY applications/iknowyou/engine/Cargo.toml applications/iknowyou/engine/Cargo.toml
|
|
|
|
# Copy full workspace.
|
|
COPY . .
|
|
|
|
RUN cargo build -p tidal-server --release
|
|
|
|
FROM debian:bookworm-slim
|
|
WORKDIR /srv
|
|
RUN useradd --system --home /srv tidal && \
|
|
apt-get update && apt-get install -y ca-certificates curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /app/target/release/tidal-server /usr/local/bin/tidal-server
|
|
COPY tidal-server/config /etc/tidal-server
|
|
|
|
USER tidal
|
|
EXPOSE 9400
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD curl -f -H "Authorization: Bearer ${TIDAL_API_KEY:-}" http://localhost:9400/health || exit 1
|
|
|
|
ENTRYPOINT ["tidal-server", "standalone", "--listen", "0.0.0.0:9400"]
|