Update README.md #90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
- push | |
jobs: | |
benchmark: | |
defaults: | |
run: | |
shell: sh | |
env: | |
SNOWFLAKE_CACHE: 0 | |
SNOWFLAKE_DEST: ~/.local/share | |
SNOWFLAKE_DIRNAME: webrtc-handshakes | |
SNOWFLAKE_SHA: d1f3e7dd6be279 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
python-version: | |
- '3.9' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# note: IFF running on Windows... | |
# | |
# - name: Set up console (Windows) | |
# if: runner.os == 'Windows' | |
# run: echo "PYTHONIOENCODING=UTF-8" >> $GITHUB_ENV | |
- name: Determine pip cache path | |
id: pip-cache | |
run: echo ::set-output name=dir::$(pip cache dir) | |
- name: Set up pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-nprintml-${{ hashFiles('setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-pip-nprintml- | |
${{ runner.os }}-${{ matrix.python-version }}-pip- | |
${{ runner.os }}-${{ matrix.python-version }}- | |
${{ runner.os }}- | |
- name: Build nprintML | |
run: python -m pip install --editable . | |
- name: Ensure libpcap (Linux) | |
if: runner.os == 'Linux' | |
run: sudo apt-get install libpcap-dev | |
- name: Ensure argp (macOS) | |
if: runner.os == 'macOS' | |
run: brew install argp-standalone | |
- name: Build nPrint | |
run: python -m nprintml.net.install --force | |
- name: Set up snowflake data cache | |
id: snowflake-cache | |
uses: actions/cache@v2 | |
with: | |
key: webrtc-handshakes-${{ env.SNOWFLAKE_SHA }}-${{ env.SNOWFLAKE_CACHE }} | |
path: ${{ env.SNOWFLAKE_DEST }}/${{ env.SNOWFLAKE_DIRNAME }} | |
- name: Retrieve snowflake data | |
if: steps.snowflake-cache.outputs.cache-hit != 'true' | |
run: wget --quiet https://raw.githubusercontent.com/kyle-macmillan/snowflake_fingerprintability/$SNOWFLAKE_SHA/webrtc-handshakes.zip | |
- name: Unpack snowflake data | |
if: steps.snowflake-cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ${{ env.SNOWFLAKE_DEST }} | |
unzip -qd ${{ env.SNOWFLAKE_DEST }} webrtc-handshakes.zip | |
- name: Benchmark | |
run: | | |
nml --traceback \ | |
--udp \ | |
--ipv4 \ | |
--aggregator pcap \ | |
--label-file ./test/data/snowflake/snowflake-label.csv \ | |
--pcap-dir ${{ env.SNOWFLAKE_DEST }}/${{ env.SNOWFLAKE_DIRNAME }} \ | |
--output benchmark | |
- name: Print report | |
run: cat benchmark/meta.toml | |
- name: Archive report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: meta-${{ runner.os }}-${{ matrix.python-version }}.toml | |
path: benchmark/meta.toml |