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

refactor: Polish fuzz build time #2721

Merged
merged 7 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 29 additions & 30 deletions .github/workflows/fuzz_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.


name: Fuzz Test

on:
Expand All @@ -39,27 +38,37 @@ concurrency:
cancel-in-progress: true

jobs:
fuzz-test-build-target:
fuzz-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Install libfuzz
shell: bash
run: sudo apt-get install -y libfuzzer-14-dev

- name: Install cargo fuzz
shell: bash
run: rustup install nightly && cargo +nightly install cargo-fuzz
- name: Build Fuzz Targets
shell: bash
working-directory: core/fuzz
run: cargo +nightly fuzz build
env:
CUSTOM_LIBFUZZER_PATH: /usr/lib/llvm-14/lib/libFuzzer.a

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: fuzz_targets
path: ./target/x86_64-unknown-linux-gnu/release/fuzz_*
fuzz-test-run-s3:
path: |
./target/x86_64-unknown-linux-gnu/release/fuzz_reader
./target/x86_64-unknown-linux-gnu/release/fuzz_writer

fuzz-test-s3:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
needs: fuzz-build
services:
minio:
image: wktk/minio-server
Expand All @@ -71,8 +80,10 @@ jobs:
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
fuzz-targets: [ fuzz_reader, fuzz_writer ]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Setup Test Bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
Expand All @@ -96,20 +107,17 @@ jobs:
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ACCESS_KEY_ID: minioadmin
OPENDAL_S3_SECRET_ACCESS_KEY: minioadmin
- name: Upload Crash Files
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: crash_s3_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
fuzz-test-run-fs:

fuzz-test-fs:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
needs: fuzz-build
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
fuzz-targets: [ fuzz_reader, fuzz_writer ]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
Expand All @@ -124,20 +132,17 @@ jobs:
env:
OPENDAL_FS_TEST: on
OPENDAL_FS_ROOT: ${{ runner.temp }}/
- name: Upload Crash Files
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: crash_fs_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
fuzz-test-run-memory:

fuzz-test-memory:
runs-on: ubuntu-latest
needs: fuzz-test-build-target
needs: fuzz-build
strategy:
fail-fast: true
matrix:
fuzz-targets: [ fuzz_reader, fuzz_range_reader, fuzz_writer ]
fuzz-targets: [ fuzz_reader, fuzz_writer ]
steps:
- name: Install libfuzzer
run: sudo apt-get install -y libfuzzer-14-dev
- name: Download Fuzz Targets
uses: actions/download-artifact@v3
with:
Expand All @@ -151,9 +156,3 @@ jobs:
run: ./target/${{ matrix.fuzz-targets }} -max_total_time=120
env:
OPENDAL_MEMORY_TEST: on
- name: Upload Crash Files
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: crash_memory_${{ matrix.fuzz-targets }}_${{ github.event_name }}_${{ github.run_attempt }}_${{ github.sha }}
path: ./crash*
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions core/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,15 @@ bytes = "1.2"
dotenvy = "0.15.6"
libfuzzer-sys = "0.4"
opendal = { path = ".." }
rand = "0.8"
sha2 = { version = "0.10.6" }
tokio = { version = "1", features = ["full"] }
uuid = { version = "1.3.0", features = ["v4"] }
uuid = { version = "1", features = ["v4"] }

[[bin]]
doc = false
name = "fuzz_reader"
path = "fuzz_reader.rs"
test = false

[[bin]]
doc = false
name = "fuzz_writer"
path = "fuzz_writer.rs"
test = false

[[bin]]
doc = false
name = "fuzz_range_reader"
path = "fuzz_range_reader.rs"
test = false
Loading