Skip to content

Commit

Permalink
Remove logs-collector from dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kalabukdima committed Oct 24, 2024
1 parent 89a4be0 commit de8ebb1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 38 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/network-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,6 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build logs collector
uses: docker/build-push-action@v5
with:
context: .
target: logs-collector
load: true
tags: subsquid/logs-collector:test
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Get logs collector version
run: echo "LOGS_COLLECTOR_VERSION=$(docker run --rm subsquid/logs-collector:test logs-collector --version | cut -d ' ' -f2)" >> $GITHUB_ENV

- name: Build & publish logs collector
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/386
target: logs-collector
push: true
tags: |
subsquid/logs-collector:${{ env.LOGS_COLLECTOR_VERSION }}
subsquid/logs-collector:${{ inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build pings collector
uses: docker/build-push-action@v5
with:
Expand Down
12 changes: 0 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ COPY crates/network-scheduler/healthcheck.sh .
RUN chmod +x ./healthcheck.sh
HEALTHCHECK --interval=5s CMD ./healthcheck.sh

FROM --platform=$BUILDPLATFORM network-base AS logs-collector

COPY --from=network-builder /app/target/release/logs-collector /usr/local/bin/logs-collector

ENV P2P_LISTEN_ADDRS="/ip4/0.0.0.0/udp/12345/quic-v1"

CMD ["logs-collector"]

COPY crates/logs-collector/healthcheck.sh .
RUN chmod +x ./healthcheck.sh
HEALTHCHECK --interval=5s CMD ./healthcheck.sh

FROM --platform=$BUILDPLATFORM network-base AS pings-collector

COPY --from=network-builder /app/target/release/pings-collector /usr/local/bin/pings-collector
Expand Down
15 changes: 15 additions & 0 deletions crates/logs-collector/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

P2P_LISTEN_ADDRS=$(echo "$P2P_LISTEN_ADDRS" | tr -d '[:space:]')

# Split the string on commas
IFS="," read -r -a ADDRS <<< "$P2P_LISTEN_ADDRS"

# Test all listen ports
for ADDR in "${ADDRS[@]}"; do
PORT=$(sed -E 's/.*\/(tcp|udp)\/([0-9]+).*/\2/' <<< "$ADDR")
if ! netstat -lntu | grep "$PORT" > /dev/null
then
exit 1
fi
done

0 comments on commit de8ebb1

Please sign in to comment.