forked from divviup/janus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.interop_aggregator
95 lines (89 loc) · 3.42 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
87
88
89
90
91
92
93
94
95
ARG PROFILE=release
FROM rust:1.82.0-alpine AS chef
ENV CARGO_INCREMENTAL=0
RUN apk add --no-cache libc-dev cmake make
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
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
COPY xtask /src/xtask
RUN cargo build --features fpvec_bounded_l2 --profile $PROFILE -p janus_interop_binaries
FROM rust:1.82.0-alpine AS sqlx
ENV CARGO_INCREMENTAL=0
ARG SQLX_VERSION=0.7.2
RUN apk add --no-cache libc-dev
RUN cargo install sqlx-cli \
--version ${SQLX_VERSION} \
--no-default-features --features postgres
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/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 /usr/local/bin/janus_interop_aggregator
COPY --from=builder-aggregator \
/src/target/$PROFILE/janus_aggregator \
/usr/local/bin/
RUN ln -s /usr/local/bin/janus_aggregator /usr/local/bin/aggregator && \
ln -s /usr/local/bin/janus_aggregator /usr/local/bin/aggregation_job_creator && \
ln -s /usr/local/bin/janus_aggregator /usr/local/bin/aggregation_job_driver && \
ln -s /usr/local/bin/janus_aggregator /usr/local/bin/collection_job_driver
COPY --from=sqlx /usr/local/cargo/bin/sqlx /usr/local/bin/
ENV RUST_LOG=info
EXPOSE 8080
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/janus/supervisord.conf"]