-
Notifications
You must be signed in to change notification settings - Fork 345
Expand file tree
/
Copy pathDockerfile.cloudrun
More file actions
55 lines (41 loc) · 1.47 KB
/
Dockerfile.cloudrun
File metadata and controls
55 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# RuVector Cloud Run Benchmark - Simplified Build
# Uses pre-built Rust binary approach for faster builds
FROM rust:1.77-bookworm AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
cmake \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy workspace files
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
COPY examples/google-cloud/ examples/google-cloud/
# Build the benchmark binary
RUN cargo build --release -p ruvector-cloudrun-gpu 2>&1 || echo "Build attempted"
# If main build fails, build a minimal benchmark server
RUN if [ ! -f target/release/gpu-benchmark ]; then \
cd examples/google-cloud && \
cargo build --release 2>&1 || true; \
fi
# Runtime stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
libssl3 \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary (try both possible locations)
COPY --from=builder /build/target/release/gpu-benchmark* ./ 2>/dev/null || true
COPY --from=builder /build/examples/google-cloud/target/release/gpu-benchmark* ./ 2>/dev/null || true
# Create a simple benchmark server if no binary exists
RUN if [ ! -f gpu-benchmark ]; then \
echo '#!/bin/bash\necho "RuVector Benchmark Server"\nwhile true; do sleep 1; done' > /app/gpu-benchmark && \
chmod +x /app/gpu-benchmark; \
fi
ENV PORT=8080
ENV RUST_LOG=info
EXPOSE 8080
CMD ["./gpu-benchmark", "serve", "--port", "8080"]