Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/cancel_prev_run_all_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# instance to run at once per branch, canceling obsolete runs.
#
# Based on https://github.com/styfle/cancel-workflow-action#advanced-pull-requests-from-forks
#
# TODO: should we replace this with 'cancel-in-progress'?
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
name: Cancel previous run-all-steps
permissions: read-all
on:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Update packages
run: sudo apt-get update
Expand Down Expand Up @@ -51,7 +53,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Update packages
run: sudo apt-get update
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/parse_and_plot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Update packages
run: sudo apt-get update
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:

- name: Upload pdfs
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: pdfs
path: pdfs
Expand All @@ -94,7 +96,7 @@ jobs:
# .github/workflows/parse_and_plot_output to a new expected output.
- name: Upload plot data
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: parse_and_plot_output
path: parse_and_plot_output/tornet.plot.data
30 changes: 18 additions & 12 deletions .github/workflows/run_all_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
RUSTPROFILE: minimal
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Update packages
run: sudo apt-get update
Expand Down Expand Up @@ -73,18 +75,19 @@ jobs:

- name: Restore shadow build cache
id: restore-shadow-build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/opt/shadow
key: shadow-${{ env.SHADOW_COMMIT }}-${{ env.CACHE_VERSION }}

- name: Checkout shadow
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: shadow/shadow
ref: ${{ env.SHADOW_COMMIT }}
path: shadow
persist-credentials: false

- name: Install shadow deps
run: |
Expand All @@ -104,7 +107,7 @@ jobs:

- name: Restore tor build cache
id: restore-tor-build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/opt/tor
Expand All @@ -122,11 +125,12 @@ jobs:
make install

- name: Checkout tgen
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: shadow/tgen
ref: ${{ env.TGEN_COMMIT }}
path: tgen
persist-credentials: false

- name: Build tgen deps
run: sudo apt-get install -y cmake gcc libglib2.0-dev libigraph-dev make
Expand All @@ -143,11 +147,12 @@ jobs:
pip3 install -I ../tools

- name: Checkout oniontrace
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: shadow/oniontrace
ref: ${{ env.ONIONTRACE_COMMIT }}
path: oniontrace
persist-credentials: false

- name: Install oniontrace deps
run: sudo apt-get install -y cmake gcc libglib2.0-0 libglib2.0-dev make
Expand All @@ -165,7 +170,7 @@ jobs:

- name: Restore net data cache
id: restore-net-data-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: netdata
key: netdata-${{ env.NETDATA_MONTH }}-${{ env.NETDATA_LAST_DAY}}-${{ env.CACHE_VERSION }}
Expand All @@ -184,10 +189,11 @@ jobs:
find consensuses-*/ -type f | tail -n +100 | xargs rm

- name: Checkout tmodel
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: tmodel-ccs2018/tmodel-ccs2018.github.io
path: tmodel-ccs2018.github.io
persist-credentials: false

- name: Install custom deps
run: |
Expand Down Expand Up @@ -274,7 +280,7 @@ jobs:
run: tornettools archive tornet

- name: Upload tornet
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: tornet
Expand All @@ -285,7 +291,7 @@ jobs:
# necessary - e.g. when the output of the tgen or oniontrace parsers
# changes in some significant way.
- name: Upload parse_and_plot input
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: parse_and_plot_input
path: |
Expand All @@ -298,7 +304,7 @@ jobs:
# Typically this is only needed when the output changes in some
# significant way.
- name: Upload plot data
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: run_all_steps_output
path: |
Expand All @@ -311,7 +317,7 @@ jobs:
# the lines from the current run are not expected to be identical to the
# lines from the previous run.
- name: Upload plots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: plots
path: pdfs/*.pdf
2 changes: 1 addition & 1 deletion tornettools/plot_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __compute_sample_mean_and_error(bucket_list, confidence):
resolution_variance = sum([res**2 for res in resolutions]) / 12

m, v = mean(emp_sample), var(emp_sample)
assert(k == len(emp_sample))
assert k == len(emp_sample)
s = sqrt(v + resolution_variance / k)
e = z * s

Expand Down
4 changes: 2 additions & 2 deletions tornettools/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def load_json_data(infile_path):
return data

def find_matching_files_in_dir(search_dir, filepattern):
if type(filepattern) == str:
if isinstance(filepattern, str):
# Interpret as a literal string
logging.info(f"Searching for files containing {filepattern} in directory tree at {search_dir}")
filepattern = re.compile('.*' + re.escape(filepattern) + '.*')
Expand All @@ -72,7 +72,7 @@ def find_matching_files_in_dir(search_dir, filepattern):
# e.g.:
# start_bytes = aka_int(2**20, 1048576)
def aka_int(x, y):
assert(x == y)
assert x == y
return x

# Looks for the given data point, first in
Expand Down
Loading