Skip to content

Commit a58ad6f

Browse files
ndr-dsdeuszx
andauthored
Backport of explorer stack + some fixes and code cleanups (#4878)
## Motivation Backport a few PRs: - **Make sending traces to Tempo less confusing (#4771)** - **Add otlp_exporter_endpoint option to proxy/server as well (#4829)** - **Stop using init and entrypoint scripts (#4830)** - **Use release_max_level_trace instead (#4554)** - **Make all heap profile logs trace (#4845)** - **exporter: Add retry logging to indexer connection (#4846)** - **Fix notification forwarding to avoid duplicate messages and handle lag (#4848)** - **Fix a few explorer frontend bugs (#4849)** - **Add support for exporter/indexer/explorer stack deployment (#4850)** - **Stop getting service monitor CRD from GitHub (#4855)** - **Fix small bug on exporter config (#4870)** - **Make sure that the Scylla config ConfigMap exists when Scylla gets created (#4871)** - **Remove UNIQUE constraints – those should be tracked by the node anyway (#4852)** ## Proposal Backport ## Test Plan CI --------- Co-authored-by: deuszx <[email protected]>
1 parent 65a0d61 commit a58ad6f

File tree

46 files changed

+2175
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2175
-492
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
- uses: actions-rust-lang/setup-rust-toolchain@v1
120120
- name: Run metrics tests
121121
run: |
122-
cargo test --locked -p linera-base --features metrics
122+
cargo test --locked -p linera-base --features metrics,opentelemetry
123123
124124
wasm-application-test:
125125
needs: changed-files

CLI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ Client implementation and command-line tool for the Linera blockchain
147147

148148
Default value: `10`
149149
* `--chrome-trace-exporter` — Enable OpenTelemetry Chrome JSON exporter for trace data analysis
150-
* `--otel-trace-file <OTEL_TRACE_FILE>` — Output file path for Chrome trace JSON format. Can be visualized in chrome://tracing or Perfetto UI
151-
* `--otel-exporter-otlp-endpoint <OTEL_EXPORTER_OTLP_ENDPOINT>` — OpenTelemetry OTLP exporter endpoint (requires tempo feature)
150+
* `--chrome-trace-file <CHROME_TRACE_FILE>` — Output file path for Chrome trace JSON format. Can be visualized in chrome://tracing or Perfetto UI
151+
* `--otlp-exporter-endpoint <OTLP_EXPORTER_ENDPOINT>` — OpenTelemetry OTLP exporter endpoint (requires opentelemetry feature)
152152
* `--wait-for-outgoing-messages` — Whether to wait until a quorum of validators has confirmed that all sent cross-chain messages have been delivered
153153
* `--long-lived-services` — (EXPERIMENTAL) Whether application services can persist in some cases between queries
154154
* `--blanket-message-policy <BLANKET_MESSAGE_POLICY>` — The policy for handling incoming messages

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ tonic-web = "0.12"
258258
tonic-web-wasm-client = "0.6.0"
259259
tower = "0.4.13"
260260
tower-http = "0.6.6"
261-
tracing = { version = "0.1.40", features = ["release_max_level_debug"] }
261+
tracing = { version = "0.1.40", features = ["release_max_level_trace"] }
262262
tracing-chrome = "0.7.2"
263263
tracing-opentelemetry = "0.31.0"
264264
tracing-subscriber = { version = "0.3.18", default-features = false, features = [

docker/Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ARG binaries=
2525
ARG copy=${binaries:+_copy}
2626
ARG build_flag=--release
2727
ARG build_folder=release
28-
ARG build_features=scylladb,metrics,memory-profiling,tempo
28+
ARG build_features=scylladb,metrics,memory-profiling,opentelemetry
2929
ARG rustflags="-C force-frame-pointers=yes"
3030

3131
FROM rust:1.74-slim-bookworm AS builder
@@ -119,13 +119,3 @@ COPY --from=binaries \
119119
linera-server \
120120
linera-proxy \
121121
./
122-
123-
COPY --chmod=755 \
124-
docker/server-entrypoint.sh \
125-
docker/server-init.sh \
126-
docker/proxy-entrypoint.sh \
127-
docker/proxy-init.sh \
128-
docker/compose-server-entrypoint.sh \
129-
docker/compose-proxy-entrypoint.sh \
130-
docker/compose-server-init.sh \
131-
./

docker/Dockerfile.indexer

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ ENV GIT_COMMIT=${git_commit}
7373
ENV RUSTFLAGS=${rustflags}
7474

7575

76-
# Build block exporter with scylladb and metrics features
76+
# Build linera CLI and block exporter with scylladb and metrics features
7777
RUN cargo build ${build_flag:+"$build_flag"} \
78-
-p linera-service \
78+
--bin linera \
7979
--bin linera-exporter \
8080
--features $build_features
8181

@@ -86,6 +86,7 @@ RUN cargo build ${build_flag:+"$build_flag"} \
8686

8787
# Move binaries to avoid directory conflicts and clean up to save space
8888
RUN mv \
89+
target/"$build_folder"/linera \
8990
target/"$build_folder"/linera-exporter \
9091
target/"$build_folder"/linera-indexer-grpc \
9192
./
@@ -94,6 +95,7 @@ RUN mv \
9495
FROM scratch AS builder_copy
9596
ARG binaries
9697
COPY \
98+
"$binaries"/linera \
9799
"$binaries"/linera-exporter \
98100
"$binaries"/linera-indexer-grpc \
99101
./
@@ -121,8 +123,9 @@ RUN update-ca-certificates
121123

122124
ARG target
123125

124-
# Copy only indexer and exporter binaries
126+
# Copy linera CLI, indexer and exporter binaries
125127
COPY --from=binaries \
128+
linera \
126129
linera-indexer-grpc \
127130
linera-exporter \
128131
./

docker/compose-proxy-entrypoint.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

docker/compose-server-entrypoint.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

docker/compose-server-init.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

docker/docker-compose.yml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ services:
4747
container_name: proxy
4848
ports:
4949
- "19100:19100"
50-
command: ["./compose-proxy-entrypoint.sh", "1"]
50+
command:
51+
- ./linera-proxy
52+
- --storage
53+
- scylladb:tcp:scylla:9042
54+
- --storage-replication-factor
55+
- "1"
56+
- /config/server.json
5157
volumes:
5258
- .:/config
5359
labels:
@@ -60,7 +66,17 @@ services:
6066
image: "${LINERA_IMAGE:-us-docker.pkg.dev/linera-io-dev/linera-public-registry/linera:testnet_conway_release}"
6167
deploy:
6268
replicas: 4
63-
command: ["./compose-server-entrypoint.sh", "scylladb:tcp:scylla:9042", "1"]
69+
command:
70+
- ./linera-server
71+
- run
72+
- --storage
73+
- scylladb:tcp:scylla:9042
74+
- --server
75+
- /config/server.json
76+
- --shard
77+
- "0"
78+
- --storage-replication-factor
79+
- "1"
6480
volumes:
6581
- .:/config
6682
labels:
@@ -72,7 +88,30 @@ services:
7288
shard-init:
7389
image: "${LINERA_IMAGE:-us-docker.pkg.dev/linera-io-dev/linera-public-registry/linera:testnet_conway_release}"
7490
container_name: shard-init
75-
command: ["./compose-server-init.sh", "scylladb:tcp:scylla:9042", "1"]
91+
command:
92+
- sh
93+
- -c
94+
- |
95+
while true; do
96+
./linera storage check-existence --storage scylladb:tcp:scylla:9042
97+
status=$$?
98+
if [ $$status -eq 0 ]; then
99+
echo "Database already exists, no need to initialize."
100+
exit 0
101+
elif [ $$status -eq 1 ]; then
102+
echo "Database does not exist, attempting to initialize..."
103+
if ./linera storage initialize --storage scylladb:tcp:scylla:9042 --genesis /config/genesis.json; then
104+
echo "Initialization successful."
105+
exit 0
106+
else
107+
echo "Initialization failed, retrying in 5 seconds..."
108+
sleep 5
109+
fi
110+
else
111+
echo "An unexpected error occurred (status: $$status), retrying in 5 seconds..."
112+
sleep 5
113+
fi
114+
done
76115
volumes:
77116
- .:/config
78117
depends_on:

docker/proxy-entrypoint.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)