Repository navigation
Expand file tree
/
Copy pathDockerfile.avx512
More file actions
72 lines (60 loc) · 2.99 KB
/
Copy pathDockerfile.avx512
File metadata and controls
72 lines (60 loc) · 2.99 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# lance-graph — Sapphire Rapids build (server/Railway)
# target-cpu=sapphirerapids: the x86-64-v4 AVX-512 baseline plus VNNI, BF16,
# FP16, VBMI2, BITALG and VPOPCNTDQ (AMX is runtime-detected by ndarray;
# stable rustc does not expose it as a cfg). Railway hosts are Sapphire Rapids,
# Emerald Rapids or newer; all of them carry these features.
#
# ONLY deploy on Sapphire Rapids or newer. On an older host ndarray's startup
# cpu_guard names the missing features and exits before main.
#
# The build stage runs the tests, so they execute on the build host: a build
# that lands on an older host fails here instead of in production.
#
# CPU detection & SIMD dispatch documentation: see Dockerfile.md
# This is the canonical deploy file. Dockerfile builds for the build host's
# CPU (native) as the fallback when a deploy does not name this one.
#
# Build: docker build -f Dockerfile.avx512 -t lance-graph-avx512 .
# Run: docker run --rm lance-graph-avx512
FROM debian:bookworm-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates gcc libc6-dev pkg-config libssl-dev git \
protobuf-compiler cmake \
&& rm -rf /var/lib/apt/lists/*
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --default-toolchain 1.99.0 --profile minimal \
&& rustc --version | grep -q "1.99.0"
# lance-graph path-deps two sibling repos: ndarray (`../ndarray` from the
# workspace root, `../../../ndarray` from a crate) and OGAR. With the
# workspace at /app both resolve to the filesystem root, so they are cloned
# to /ndarray and /OGAR. No branch is named: each repo's default branch
# (ndarray `master`, OGAR `main`) is the floating head the CI jobs also build.
RUN git clone --depth 1 https://github.com/AdaWorldAPI/ndarray.git /ndarray \
&& git clone --depth 1 https://github.com/AdaWorldAPI/OGAR.git /OGAR
WORKDIR /app
COPY Cargo.toml ./
COPY crates/ crates/
# Workspace member outside crates/ (the root Cargo.toml lists it).
COPY tools/ tools/
# Compile-time dispatch for Sapphire Rapids, everything inlined
ENV RUSTFLAGS="-C target-cpu=sapphirerapids"
# bgz17 standalone (zero deps, fast check)
RUN cargo build --release --manifest-path crates/bgz17/Cargo.toml 2>&1 \
&& echo "=== BGZ17 AVX-512 BUILD OK ==="
RUN cargo test --release --manifest-path crates/bgz17/Cargo.toml 2>&1 \
&& echo "=== BGZ17 AVX-512 TESTS OK ==="
# Workspace (skip python bindings)
RUN cargo build --release \
--workspace \
--exclude lance-graph-python \
2>&1 && echo "=== WORKSPACE AVX-512 BUILD OK ==="
RUN cargo test --release \
--workspace \
--exclude lance-graph-python \
2>&1 && echo "=== WORKSPACE AVX-512 TESTS OK ==="
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
CMD ["echo", "lance-graph build verified — Rust 1.99.0, target-cpu=sapphirerapids"]