2024-07-30 16:23:23 -07:00
|
|
|
# build filter using rust toolchain
|
|
|
|
|
FROM rust:1.80.0 as builder
|
2024-09-16 19:20:27 -07:00
|
|
|
RUN rustup -v target add wasm32-wasi
|
2024-09-27 16:41:39 -07:00
|
|
|
WORKDIR /arch
|
2024-10-16 14:20:26 -07:00
|
|
|
COPY crates .
|
2024-07-30 16:23:23 -07:00
|
|
|
|
2024-10-16 14:20:26 -07:00
|
|
|
RUN cd prompt_gateway && cargo build --release --target wasm32-wasi
|
|
|
|
|
RUN cd llm_gateway && cargo build --release --target wasm32-wasi
|
2024-07-30 16:23:23 -07:00
|
|
|
|
|
|
|
|
# copy built filter into envoy image
|
2024-10-07 00:03:25 -07:00
|
|
|
FROM envoyproxy/envoy:v1.31-latest as envoy
|
2024-10-01 10:02:23 -07:00
|
|
|
|
|
|
|
|
#Build config generator, so that we have a single build image for both Rust and Python
|
|
|
|
|
FROM python:3-slim as arch
|
2024-10-18 13:15:19 -07:00
|
|
|
COPY --from=builder /arch/target/wasm32-wasi/release/prompt_gateway.wasm /etc/envoy/proxy-wasm-plugins/prompt_gateway.wasm
|
|
|
|
|
COPY --from=builder /arch/target/wasm32-wasi/release/llm_gateway.wasm /etc/envoy/proxy-wasm-plugins/llm_gateway.wasm
|
2024-10-01 10:02:23 -07:00
|
|
|
COPY --from=envoy /usr/local/bin/envoy /usr/local/bin/envoy
|
|
|
|
|
WORKDIR /config
|
|
|
|
|
COPY arch/requirements.txt .
|
|
|
|
|
RUN pip install -r requirements.txt
|
2024-10-09 15:53:12 -07:00
|
|
|
COPY arch/tools/cli/config_generator.py .
|
2024-10-01 10:02:23 -07:00
|
|
|
COPY arch/envoy.template.yaml .
|
|
|
|
|
COPY arch/arch_config_schema.yaml .
|
|
|
|
|
|
|
|
|
|
CMD ["sh", "-c", "python config_generator.py && envoy -c /etc/envoy/envoy.yaml --component-log-level wasm:debug"]
|