From c10d7b88b091d221ede0577cc1965393f40fbed4 Mon Sep 17 00:00:00 2001 From: Kunal Bhargava Date: Thu, 12 Dec 2024 21:48:42 +0000 Subject: [PATCH] self-hosted runner, solfuzz-agave kachow --- .github/workflows/build-common.yml | 21 ++++----------------- Makefile | 6 +++++- scripts/run_test_vectors.sh | 27 ++++++++++++++++----------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-common.yml b/.github/workflows/build-common.yml index 0e94e9d..837d5c5 100644 --- a/.github/workflows/build-common.yml +++ b/.github/workflows/build-common.yml @@ -12,7 +12,7 @@ on: jobs: test: name: cargo check + test - runs-on: ubuntu-latest + runs-on: [self-hosted] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.76.0 @@ -22,8 +22,8 @@ jobs: - name: Install dependencies run: | - sudo apt-get install protobuf-compiler - sudo apt-get install libudev-dev + sudo dnf install protobuf-compiler + sudo dnf install systemd-devel - name: Clone protosol run: make fetch_proto @@ -35,25 +35,12 @@ jobs: cargo fmt --all -- --check cargo clippy --all -- -D warnings - - name: Test - run: | - cargo check --release - cargo test --release - cargo clean - - name: Run binaries build - run: make -j binaries + run: make -j test binaries shared_obj - name: Run test-vectors run: | ./scripts/run_test_vectors.sh - rm -rf dump/ - - - name: Clean up binaries - run: make clean - - - name: Run shared obj build - run: make -j shared_obj - uses: actions/upload-artifact@v4 if: ${{ inputs.upload_artifacts }} diff --git a/Makefile b/Makefile index 627ed1c..885a4f0 100644 --- a/Makefile +++ b/Makefile @@ -52,5 +52,9 @@ binaries: tests/self_test: tests/self_test.c $(CC) -o $@ $< -Werror=all -pedantic -ldl -fsanitize=address,fuzzer-no-link -fsanitize-coverage=inline-8bit-counters +test: + $(CARGO) check --release + $(CARGO) test --release + clean: - $(CARGO) clean + $(CARGO) clean \ No newline at end of file diff --git a/scripts/run_test_vectors.sh b/scripts/run_test_vectors.sh index 15d058b..5cfa7db 100755 --- a/scripts/run_test_vectors.sh +++ b/scripts/run_test_vectors.sh @@ -22,17 +22,22 @@ else cd ../.. fi -find dump/test-vectors/instr/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_instr {} + > $LOG_PATH/test_exec_instr.log 2>&1 -# secp256r1 currently not working, agave has bugs -# find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1 -find dump/test-vectors/txn/fixtures/precompile/ed25519 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1 -find dump/test-vectors/txn/fixtures/precompile/secp256k1 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1 -find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_txn.log 2>&1 -find dump/test-vectors/cpi/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_cpi {} + > $LOG_PATH/test_exec_cpi.log 2>&1 -find dump/test-vectors/syscall/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_vm_syscall {} + > $LOG_PATH/test_exec_vm_syscall.log 2>&1 -find dump/test-vectors/vm_interp/fixtures/latest -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp.log 2>&1 -find dump/test-vectors/vm_interp/fixtures/v0 -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp.log 2>&1 -find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_elf_loader {} + > $LOG_PATH/test_exec_elf_loader.log 2>&1 +parallel_commands() { + echo "find dump/test-vectors/instr/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_instr {} + > $LOG_PATH/test_exec_instr.log 2>&1" + # secp256r1 currently not working, agave has bugs + # echo "find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1" + echo "find dump/test-vectors/txn/fixtures/precompile/ed25519 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile_ed25519.log 2>&1" + echo "find dump/test-vectors/txn/fixtures/precompile/secp256k1 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile_secp256k1.log 2>&1" + echo "find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_txn.log 2>&1" + echo "find dump/test-vectors/cpi/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_cpi {} + > $LOG_PATH/test_exec_cpi.log 2>&1" + echo "find dump/test-vectors/syscall/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_vm_syscall {} + > $LOG_PATH/test_exec_vm_syscall.log 2>&1" + echo "find dump/test-vectors/vm_interp/fixtures/latest -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp_latest.log 2>&1" + echo "find dump/test-vectors/vm_interp/fixtures/v0 -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp_v0.log 2>&1" + echo "find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_elf_loader {} + > $LOG_PATH/test_exec_elf_loader.log 2>&1" +} + +# Run the commands in parallel +parallel_commands | xargs -I CMD -P 4 bash -c CMD failed=`grep -wR FAIL $LOG_PATH | wc -l` passed=`grep -wR OK $LOG_PATH | wc -l`