Skip to content

Commit

Permalink
chore: adding docker compose prometheus scrapes for primaries. (Myste…
Browse files Browse the repository at this point in the history
…nLabs/narwhal#425)

* fix: cleaned up how last image is produced for smaller size

Using the rust:1.60-slim-bullseye is about 1.4G on linux.
Just using debian:bullseye-slim is 160Mb.

* chore: adding narwhal primary prom scrape configs
  • Loading branch information
allan-bailey authored Jul 1, 2022
1 parent 3fef15a commit b795229
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 1 addition & 5 deletions narwhal/Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ RUN cargo build --${BUILD_MODE} --all-features --bin node
#################################################################

# Creat another layer so we can re-use caching
FROM rust:1.60-slim-bullseye
FROM debian:bullseye-slim
ARG BUILD_MODE
WORKDIR "$WORKDIR/narwhal"

RUN apt-get update \
&& apt-get install -y --no-install-recommends libssl1.1 iputils-ping telnet curl \
&& rm -rf /var/lib/apt/lists/*

# Copy the Narwhal node binary to bin folder
COPY --from=builder narwhal/target/${BUILD_MODE}/node bin/

Expand Down
14 changes: 14 additions & 0 deletions narwhal/Docker/gen.validators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,17 @@ EOF
./scripts/gen.committee.py -n ${num} -d ${target} > ${target}/committee.json

cp -r templates/{grafana,prometheus} ${target}/

# add the primary and worker nodes to the prometheus.yaml scrape configs.
t=$(($num - 1))
for i in $(seq -f %02g 0 ${t})
do
scrape="primary_${i}:8010"
cat >> ${target}/prometheus/prometheus.yml <<EOF
- job_name: 'primary_${i}'
scrape_interval: 10s
static_configs:
- targets: ['${scrape}']
EOF
done

0 comments on commit b795229

Please sign in to comment.