-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.interop_aggregator
86 lines (81 loc) · 3 KB
/
Dockerfile.interop_aggregator
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ARG PROFILE=release
FROM rust:1.76.0-alpine AS chef
RUN apk add --no-cache libc-dev
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install cargo-chef --version 0.1.60 && \
rm -r $CARGO_HOME/registry
WORKDIR /src
FROM chef AS planner
COPY Cargo.toml Cargo.lock /src/
COPY aggregator /src/aggregator
COPY aggregator_api /src/aggregator_api
COPY aggregator_core /src/aggregator_core
COPY client /src/client
COPY collector /src/collector
COPY core /src/core
COPY integration_tests /src/integration_tests
COPY interop_binaries /src/interop_binaries
COPY messages /src/messages
COPY tools /src/tools
COPY xtask /src/xtask
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder-aggregator
COPY --from=planner /src/recipe.json /src/recipe.json
ARG PROFILE
RUN cargo chef cook --features fpvec_bounded_l2 --profile $PROFILE -p janus_aggregator
COPY Cargo.toml Cargo.lock /src/
COPY aggregator /src/aggregator
COPY aggregator_api /src/aggregator_api
COPY aggregator_core /src/aggregator_core
COPY client /src/client
COPY collector /src/collector
COPY core /src/core
COPY db /src/db
COPY integration_tests /src/integration_tests
COPY interop_binaries /src/interop_binaries
COPY messages /src/messages
COPY tools /src/tools
COPY xtask /src/xtask
RUN cargo build --features fpvec_bounded_l2 --profile $PROFILE -p janus_aggregator \
--bin aggregation_job_creator \
--bin aggregation_job_driver \
--bin collection_job_driver
FROM chef AS builder-interop
COPY --from=planner /src/recipe.json /src/recipe.json
ARG PROFILE
RUN cargo chef cook --features fpvec_bounded_l2 --profile $PROFILE -p janus_interop_binaries
COPY Cargo.toml Cargo.lock /src/
COPY aggregator /src/aggregator
COPY aggregator_api /src/aggregator_api
COPY aggregator_core /src/aggregator_core
COPY client /src/client
COPY collector /src/collector
COPY core /src/core
COPY db /src/db
COPY integration_tests /src/integration_tests
COPY interop_binaries /src/interop_binaries
COPY messages /src/messages
COPY tools /src/tools
RUN cargo build --features fpvec_bounded_l2 --profile $PROFILE -p janus_interop_binaries \
--bin janus_interop_aggregator
FROM postgres:15-alpine AS final
RUN mkdir /logs && mkdir /etc/janus
RUN apk add --no-cache supervisor && rm -rf /tmp/* /var/cache/apk/*
COPY db /etc/janus/migrations
COPY interop_binaries/setup.sh /usr/local/bin/setup.sh
COPY interop_binaries/config/supervisord.conf \
interop_binaries/config/janus_interop_aggregator.yaml \
interop_binaries/config/aggregation_job_creator.yaml \
interop_binaries/config/aggregation_job_driver.yaml \
interop_binaries/config/collection_job_driver.yaml \
/etc/janus/
ARG PROFILE
COPY --from=builder-interop /src/target/$PROFILE/janus_interop_aggregator /usr/local/bin/
COPY --from=builder-aggregator \
/src/target/$PROFILE/aggregation_job_creator \
/src/target/$PROFILE/aggregation_job_driver \
/src/target/$PROFILE/collection_job_driver \
/usr/local/bin/
ENV RUST_LOG=info
EXPOSE 8080
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/janus/supervisord.conf"]