-
Notifications
You must be signed in to change notification settings - Fork 18
108 lines (87 loc) · 3.07 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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