Skip to content

Commit

Permalink
fix(ci): fix snapshot parity test and schedule it to be weekly (#5373)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 authored Mar 4, 2025
1 parent 838825c commit 5150593
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 45 deletions.
4 changes: 1 addition & 3 deletions .github/DOCKER_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ labels: ["Bug"]

## Description

Latest Docker check failed. Please check the logs for more information.

<!-- link will be added here in a follow-up once the corresponding workflow lands on main -->
Latest Docker check failed. Please [check the logs](https://github.com/ChainSafe/forest/actions/workflows/dockerfile-check.yml) for more information.
8 changes: 8 additions & 0 deletions .github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "[automated] Snapshot parity test failure"
labels: ["Bug"]
---

## Description

Latest snapshot parity test failed. Please [check the logs](https://github.com/ChainSafe/forest/actions/workflows/snapshot-parity.yml) for more information.
26 changes: 0 additions & 26 deletions .github/workflows/forest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -548,32 +548,6 @@ jobs:
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
snapshot-parity-checks:
needs:
- build-ubuntu
name: Calibnet snapshot parity checks
runs-on: ubuntu-24.04
# Run the job only on main to limit the runner cost.
# The downside is that the offending commit can only be caught after being merged
# and a manual revert is required.
# Note that running this step on non-draft PR does not save the cost as it always re-run
# all the jobs when a PR is moved out of draft. Also this parity test will be stale soon
# once we start including the F3(fast finality) metadata in the Forest snapshots.
if: github.ref == 'refs/heads/main'
env:
# We use a custom Dockerfile for CI to speed up the build process.
FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: 'forest-${{ runner.os }}'
- name: Run snapshot parity tests
run: ./scripts/tests/snapshot_parity/setup.sh
timeout-minutes: '${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}'
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
# Umbrella job to aggregate all integration tests and get their status
integration-tests-status:
needs:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/snapshot-parity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Snapshot parity test
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Runs at 00:00, only on Sunday
jobs:
snapshot-parity:
name: Snapshot parity test
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Run snapshot parity test
run: ./scripts/tests/snapshot_parity/setup.sh
timeout-minutes: 60
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
- uses: JasonEtco/create-an-issue@v2
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md
26 changes: 10 additions & 16 deletions scripts/tests/snapshot_parity/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
version: "3.8"

services:
init:
build:
context: ../../../.
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
init:
image: ${FOREST_IMAGE:-ghcr.io/chainsafe/forest:edge}
volumes:
- node-data:/data
- filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE}
networks:
- snapshot-parity-tests
environment:
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
entrypoint: [ "/bin/bash", "-c" ]
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euxo pipefail
Expand All @@ -30,9 +28,7 @@ services:
depends_on:
init:
condition: service_completed_successfully
build:
context: ../../../.
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
image: ${FOREST_IMAGE:-ghcr.io/chainsafe/forest:edge}
volumes:
- node-data:/data
- filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE}
Expand All @@ -41,7 +37,7 @@ services:
environment:
- FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE}
- FULLNODE_API_INFO=/dns/forest/tcp/${FOREST_RPC_PORT}/http
entrypoint: [ "/bin/bash", "-c" ]
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euxo pipefail
Expand Down Expand Up @@ -76,7 +72,7 @@ services:
- LOTUS_CHAINSTORE_ENABLESPLITSTORE=false
- LOTUS_SYNC_BOOTSTRAP_PEERS=1
- FULLNODE_API_INFO=/dns/lotus/tcp/${LOTUS_RPC_PORT}/http
entrypoint: [ "/bin/bash", "-c" ]
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euxo pipefail
Expand All @@ -85,20 +81,18 @@ services:
lotus sync wait
lotus chain export --tipset @$(ls /data/*.car.zst | tail -n 1 | grep -Eo '[0-9]+' | tail -n 1) --recent-stateroots ${EXPORT_EPOCHS} --skip-old-msgs /data/exported/lotus.car
kill -KILL $!
compare:
compare:
depends_on:
forest:
condition: service_completed_successfully
lotus:
condition: service_completed_successfully
build:
context: ../../../.
dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile}
image: ${FOREST_IMAGE:-ghcr.io/chainsafe/forest:edge}
volumes:
- node-data:/data
networks:
- snapshot-parity-tests
entrypoint: [ "/bin/bash", "-c" ]
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euxo pipefail
Expand All @@ -123,7 +117,7 @@ services:
image: busybox
networks:
- snapshot-parity-tests
entrypoint: [ "/bin/sh", "-c" ]
entrypoint: ["/bin/sh", "-c"]
command:
- |
set -euxo pipefail
Expand Down

0 comments on commit 5150593

Please sign in to comment.