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

ci(levm): silence messages #1837

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/scripts/publish_hive.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
curl -X POST $1 \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat results.md)" '{
$(jq -n --arg text "$(cat results_revm.md)" '{
"blocks": [
{
"type": "header",
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/publish_levm_hive.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
curl -X POST $1 \
-H 'Content-Type: application/json; charset=utf-8' \
--data @- <<EOF
$(jq -n --arg text "$(cat results.md)" '{
$(jq -n --arg text "$(cat results_levm.md)" '{
"blocks": [
{
"type": "header",
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/ci_bench_levm_in_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Benchmark LEVM vs REVM in PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this file not in ci_levm? That would be more consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because one file has the Integration Test job, making it a required check.
And the ci_bench_levm_in_pr.yaml only modifies the github comments.

The logic was separated in case of an external contribution, if we send the PR comment inside the Integration Test job in order to avoid repetition, the job will fail because the external contributor doesn't have access to the TOKENs

on:
pull_request:
branches: [ "**" ]
branches: ["**"]
paths:
- "crates/vm/levm/**"

Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
combine-results:
name: Combine Benchmark Results
runs-on: ubuntu-latest
needs: [ benchmark-pr, benchmark-main ]
needs: [benchmark-pr, benchmark-main]
steps:
- name: Download PR results
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -184,6 +184,8 @@ jobs:
cd crates/vm/levm && awk '/Summary: /,/Frontier/' test_result.txt;
- name: Check EF-TESTS status is 100%
id: check_tests
continue-on-error: true
run: |
cd crates/vm/levm
if [ "$(awk '/Summary:/ {print $(NF)}' test_result.txt)" != "(100.00%)" ]; then
Expand All @@ -210,12 +212,28 @@ jobs:
comment-author: "github-actions[bot]"
body-includes: "Summary:"

# If we have a failure, means that some ef-tests don't pass.
# If the condition is met, create or update the comment with the summary.
- name: Create Comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ steps.check_tests.outcome == 'failure' && github.event_name == 'pull_request' }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body-path: test_summary.txt
edit-mode: replace

# If we don't have a failure, means that all ef-tests pass.
# If comment-id != '', means that we've already created the comment.
# If both conditions are met, update the comment saying that all tests pass.
- name: Update Comment -- ALL
if: ${{ steps.check_tests.outcome != 'failure' && github.event_name == 'pull_request' && steps.fc.outputs.comment-id != '' }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Summary: All EF-TESTS pass.
edit-mode: replace
47 changes: 45 additions & 2 deletions .github/workflows/ci_levm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: LEVM

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "**" ]
branches: ["**"]
paths:
- "crates/vm/levm/**"

Expand Down Expand Up @@ -58,6 +58,49 @@ jobs:
echo "Percentage is not 100%."
exit 1
fi
hive-report-creation:
uses: ./.github/workflows/common_hive_reports.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these are ran daily, can't we take the results from the last (levm) daily run and compare it to the current run?

Copy link
Contributor Author

@fborello-lambda fborello-lambda Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's done in commit e91040b. We would have to merge it to fully test it

# Check we don't have a regression
hive-test-check:
# "Integration Test" is a required check, don't change the name
name: Integration Test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two integration test, can we do something like this instead? https://github.com/lambdaclass/ethrex/blob/main/.github/workflows/ci_l1.yaml#L207-L226

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5f3a652

needs: hive-report-creation
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Download results (levm)
uses: actions/download-artifact@v4
with:
name: results_levm.md

- name: Rename result (1)
run: cp results.md results_levm.md

- name: Download results (revm)
uses: actions/download-artifact@v4
with:
name: results_revm.md

- name: Rename result (2)
run: cp results.md results_revm.md

- name: Create diff message
run: |
bash .github/scripts/levm_revm_diff.sh results_revm.md results_levm.md >> diff.md
cat diff.md >> $GITHUB_STEP_SUMMARY
- name: Check Regression
run: |
if grep -q "No differences found" diff.md; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to check that levm has a regresion (levm vs levm), but that levm is equal to revm. So this check will fail until there is feature parity between revm and levm. Is that what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have to check against main, i will start with it, maybe it's too cumbersome for now. When LEVM is used as default we would definitely want the (levm vs levm) regression check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thinks it's done in commit e91040b. I save the daily artifact and use it for the comparison/check.

echo "No regression found."
else
echo "Regression found."
exit 1;
fi
test:
# "Test" is a required check, don't change the name
name: Test
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/common_hive_reports.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Run Hive Tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe I would move the reusable jobs to common/hive.yaml and common/hive_report.yaml

Copy link
Contributor Author

@fborello-lambda fborello-lambda Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to do it, the job doesn't run. Seems that the feature is not present on github's CI. There are some issues related to subfolders: https://github.com/orgs/community/discussions/18055. I don't know if it's a bug or what, because the actions' linter throws an error if i point to a common folder and there are no files


on: workflow_call
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit e91040b. The inputs let us create a daily artifact. I'm using that artifact for comparisons.


env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.81.0

jobs:
run-hive:
name: Hive (${{ matrix.vm }}) - ${{ matrix.test.name }}
runs-on: ubuntu-latest
strategy:
matrix:
vm: [levm, revm]
test:
- {
name: "Rpc Compat tests",
file_name: rpc-compat,
simulation: ethereum/rpc-compat,
}
- { name: "Devp2p eth tests", file_name: devp2p, simulation: devp2p }
- {
name: "Cancun Engine tests",
file_name: engine,
simulation: ethereum/engine,
}
- { name: "Sync tests", file_name: sync, simulation: ethereum/sync }

steps:
- name: Pull image
if: ${{ matrix.vm == 'revm' }}
run: |
docker pull ghcr.io/lambdaclass/ethrex:latest
docker tag ghcr.io/lambdaclass/ethrex:latest ethrex:latest

- name: Checkout sources
uses: actions/checkout@v4

- name: Build Image with LEVM
if: ${{ matrix.vm == 'levm' }}
run: cd crates/vm/levm && make build-image-levm

- name: Setup Go
uses: actions/setup-go@v5

- name: Setup Hive
run: make setup-hive

- name: Run Hive Simulation
run: cd hive && ./hive --client ethrex --sim ${{ matrix.test.simulation }} --sim.parallelism 16
continue-on-error: true

- name: Upload results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.test.file_name }}_${{ matrix.vm }}_logs
path: hive/workspace/logs/*-*.json
if-no-files-found: error

hive-report:
name: Generate and Save report (${{ matrix.vm }})
needs: run-hive
runs-on: ubuntu-latest
strategy:
matrix:
vm: [levm, revm]
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Download all results
uses: actions/download-artifact@v4
with:
path: hive/workspace/logs
pattern: "*_${{ matrix.vm }}_logs"
merge-multiple: true

- name: Caching
uses: Swatinem/rust-cache@v2

- name: Generate the hive report
run: cargo run -p hive_report > results.md

- name: Upload ${{matrix.vm}} result
uses: actions/upload-artifact@v4
with:
name: results_${{matrix.vm}}.md
path: results.md
if-no-files-found: error

- name: Post results in summary
run: |
echo "# Hive coverage report (${{ matrix.vm }})" >> $GITHUB_STEP_SUMMARY
cat results.md >> $GITHUB_STEP_SUMMARY
Loading