mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-15 13:58:20 +00:00
Cargo feature split: metal-gpu (macOS), vulkan-gpu (Linux), no-default (CPU). Docker builds with --no-default-features for pure CPU raster path. All GPU code gated behind feature flags — no compilation errors on Linux. Encoder detection probes actual encoder functionality (not just ffmpeg list). Tested: docker run hyperframes-native:test → 51/51 pass on Linux ARM64.
45 lines
1.6 KiB
Docker
45 lines
1.6 KiB
Docker
# HyperFrames Native Renderer — Linux CI Test Image
|
|
#
|
|
# Tests the Rust native renderer on Linux without GPU access.
|
|
# Validates: CPU raster rendering, FFmpeg pipe encoding, scene parsing,
|
|
# element painting, effects, image compositing, animated pipeline.
|
|
#
|
|
# Usage (from repo root):
|
|
# docker build -f packages/native-renderer/Dockerfile.test \
|
|
# --build-context native=packages/native-renderer \
|
|
# -t hyperframes-native:test .
|
|
# docker run --rm hyperframes-native:test
|
|
# docker run --rm hyperframes-native:test bench
|
|
|
|
FROM rust:1.87-bookworm
|
|
|
|
# ── System dependencies ─────────────────────────────────────────────────────
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
clang \
|
|
libclang-dev \
|
|
pkg-config \
|
|
libfontconfig1-dev \
|
|
libfreetype6-dev \
|
|
ninja-build \
|
|
python3 \
|
|
git \
|
|
ffmpeg \
|
|
fonts-liberation \
|
|
fonts-dejavu-core \
|
|
fontconfig \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& fc-cache -fv
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy only the Rust crate (target/ excluded via .dockerignore)
|
|
COPY Cargo.toml Cargo.lock* ./
|
|
COPY src ./src
|
|
COPY tests ./tests
|
|
COPY benches ./benches
|
|
|
|
# Build with NO GPU features — pure CPU raster + FFmpeg libx264
|
|
RUN cargo build --release --no-default-features --tests 2>&1 | tail -3 && echo "Build succeeded"
|
|
|
|
ENTRYPOINT ["sh", "-c", "if [ \"$1\" = bench ]; then cargo bench --release --no-default-features 2>&1 | grep -E 'time:|Benchmarking'; else cargo test --release --no-default-features -- --test-threads=1 && echo 'All tests passed on Linux.'; fi", "--"]
|