Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable write batching for PSQL #5

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
958b69f
Disable write batching for PSQL
georgeee Oct 2, 2023
9c48a98
Reformat
georgeee Oct 2, 2023
992f0d1
Use AWS instead of GCP
georgeee Oct 10, 2023
cc5a7d0
Do not process gossip-related checkpoints
georgeee Oct 17, 2023
5cc061c
Change block_trace_checkpoint's indices
georgeee Oct 17, 2023
bea98b2
Allow remote_addr to contain no port
georgeee Oct 18, 2023
5aa1065
Allow to configure fetch interval
georgeee Oct 20, 2023
0f795cf
Remove execution_age
georgeee Dec 19, 2023
4672063
Don't initialize schema on start
georgeee Dec 19, 2023
a6bd1c5
Make block trace status handling optional
georgeee Jan 4, 2024
49ea25a
Implement support for discovery via online URL
georgeee Feb 10, 2024
8da121c
Introduce additional CLI option to override URLs fetched from the Upt…
shimkiv Dec 2, 2024
c1b9292
Update discovery.rs
shimkiv Dec 2, 2024
371cf96
Renaming (part of review comments).
shimkiv Dec 2, 2024
d5bc429
Merge remote-tracking branch 'origin/feat/url-override' into feat/url…
shimkiv Dec 2, 2024
8ef067a
Renaming (part of review comments).
shimkiv Dec 2, 2024
5bbb125
Generalize the NodeIdentity creation and usage (part of review commen…
shimkiv Dec 2, 2024
b932239
Add some comments.
shimkiv Dec 2, 2024
28dbde7
Use host_overrides during the AWS discovery (review comment).
shimkiv Dec 2, 2024
3473bdd
Merge pull request #1 from shimkiv/feat/url-override
georgeee Dec 2, 2024
e432f57
Update Dockerfile
shimkiv Dec 2, 2024
a302a80
Merge pull request #2 from shimkiv/patch-1
georgeee Dec 3, 2024
07d662e
Update Dockerfile
shimkiv Dec 3, 2024
d0782e8
Merge pull request #3 from shimkiv/patch-1
georgeee Dec 3, 2024
4b7d014
Pass the --handle-status-change CLI arg down to consumer
shimkiv Dec 5, 2024
1c236ab
Merge pull request #4 from shimkiv/patch-1
georgeee Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG BASE_IMAGE_VERSION=bookworm
ARG BUILD_IMAGE=ocaml/opam
#ARG BUILD_IMAGE_VERSION=alpine-3.17-ocaml-4.14
ARG BUILD_IMAGE_VERSION=debian-12-ocaml-4.14
ARG RUST_VERSION=1.82.0
## The above default works if the built machine doesn't change and keeps layers cached.
## Alternatively, `build.Dockerfile` can be used to prepare a builder image to use as a base.
## docker build . -t internal-trace-consumer:build --target builder
Expand All @@ -13,46 +14,47 @@ ARG BUILD_IMAGE_VERSION=debian-12-ocaml-4.14

## Trace consumer program (OCaml)
FROM ${BUILD_IMAGE}:${BUILD_IMAGE_VERSION} AS builder

#RUN sudo apk add linux-headers sqlite sqlite-dev
RUN sudo apt-get update && sudo apt-get install -y pkg-config sqlite3 libsqlite3-dev libpq-dev
USER root
RUN apt-get update \
&& apt-get install -y libpq-dev libsqlite3-dev pkg-config sqlite3 \
&& rm -rf /var/lib/apt/lists/*
USER opam
COPY --chown=opam opam.export .
RUN opam switch import --unlock-base opam.export
RUN sudo chown -R opam:opam /home/opam/.opam \
&& opam update \
&& opam switch import --unlock-base opam.export

FROM builder AS intermediate

WORKDIR /src
COPY --chown=opam:opam . /src/code
RUN cd /src/code && opam exec -- dune build src/internal_trace_consumer.exe
WORKDIR /src/code
RUN opam exec -- dune build src/internal_trace_consumer.exe

## Remote trace fetcher program (Rust)
FROM rust:1.69.0-${BASE_IMAGE_VERSION} AS rust-builder

FROM rust:${RUST_VERSION}-${BASE_IMAGE_VERSION} AS rust-builder
WORKDIR /app

#RUN apk add --no-cache libgcc libstdc++ openssl openssl-dev musl-dev
RUN apt-get update && apt-get install -y pkg-config libssl-dev

RUN apt-get update \
&& apt-get install -y pkg-config libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY ./internal-log-fetcher/Cargo.toml ./internal-log-fetcher/Cargo.lock ./
COPY ./internal-log-fetcher/src ./src
COPY ./internal-log-fetcher/graphql ./graphql

# These RUSTFLAGS are required to properly build an alpine binary
# linked to OpenSSL that doesn't segfault
RUN env RUSTFLAGS="-C target-feature=-crt-static" cargo build --release

## Final image
FROM ${BASE_IMAGE}:${BASE_IMAGE_VERSION} AS app

#RUN apk add --no-cache libgcc libstdc++ openssl sqlite-libs
RUN apt-get update && apt-get install -y libssl3 libpq5 libsqlite3-0 ca-certificates

RUN apt-get update \
&& apt-get install -y ca-certificates libpq5 libsqlite3-0 libssl3 \
&& rm -rf /var/lib/apt/lists/*
COPY ./entrypoint.sh /entrypoint.sh
COPY --from=rust-builder /app/target/release/internal-log-fetcher /internal_log_fetcher
COPY --from=intermediate /src/code/_build/default/src/internal_trace_consumer.exe /internal_trace_consumer

EXPOSE 9080

ENTRYPOINT [ "/entrypoint.sh" ]

CMD [ "consumer", "serve", "--trace-file", "/traces/internal-trace.jsonl", "--port", "9080" ]
Loading