GithubHelp home page GithubHelp logo

cgfandia / dmagma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cgfandia-tii/dmagma

0.0 0.0 0.0 42 KB

Distributed version of ground-truth Magma fuzzing benchmark

Shell 1.21% Python 96.01% Dockerfile 2.78%

dmagma's Introduction

dMagma

tests lint Code style: black codecov

Distributed Magma fuzzing benchmark

Overview

flowchart TD;
    GeneralQueue[(General Queue)]
    FuzzingQueue[(Fuzzing Queue)]
    S3[\S3/]
    subgraph general workers
    gworker-0
    gworker-n
    end
    subgraph fuzzing workers
    fworker-0
    fworker-n
    end
    Trigger((Trigger))-. start_campaign .->GeneralQueue
    GeneralQueue-. start_campaign,reduce .-gworker-0 & gworker-n-. fuzzing-task .->FuzzingQueue
    FuzzingQueue-. fuzzing-task .->fworker-0 & fworker-n-- tar -->S3
    gworker-0 & gworker-n<-- tar,json -->S3
Loading

Development

Setup

  1. Define a development environment .env in the same directory of the docker-compose.yml:
    SHARED_VOLUME=shared-workdir-volume
    SHARED_PATH=/tmp/shared-workdir
    BROKER_USER=guest
    BROKER_PASS=guest
    S3_ACCESS_KEY=access_key
    S3_SECRET_KEY=secret_key
    
  2. Bootstrap the required services:
    docker compose up -d tasks-broker tasks-result tasks-monitor s3
  3. Install dependencies
    # all tests and executions have to be done in the context of the "src" folder
    cd src
    pip install -r requirements.txt -r requirements.dev.txt
  4. Perform the tests

Tests

Just to check that everything works:

docker compose up -d tasks-broker tasks-result s3 fuzzing-worker general-worker
cd src
pytest

If you want more control:

cd src
# Test locally (on the host)
export SHARED_PATH=/tmp/shared-workdir
export SHARED_VOLUME=${SHARED_PATH}
# Clear created docker images and partially S3 storage after the tests
export CLEAR_CACHE=1
pytest -m "not celery"

Test the celery tasks:

  1. Start the fuzzing worker
    # Test locally (on the host)
    export SHARED_PATH=/tmp/shared-workdir
    export SHARED_VOLUME=${SHARED_PATH}
    ./run-fuzzing-worker.sh -l INFO
  2. Start the general worker in the new terminal
    ./run-general-worker.sh -l INFO
  3. Run the tests in another terminal
    pytest -m "celery"

TODO

  • API
  • Remove dependency from the same docker volume of the fuzzing workers

dmagma's People

Contributors

cgfandia-tii avatar lint-action avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.