Verified Commit e0b5f196 authored by Jim Newsome's avatar Jim Newsome
Browse files

Compress tor trace on the fly

parent a9bdef85
......@@ -209,6 +209,12 @@ run-sim:
- pip3 install -I jobs/src/tornettools
- tornettools generate jobs/network-data/relayinfo_staging_*.json jobs/network-data/userinfo_staging_*.json jobs/src/tmodel --network_scale $SCALE --prefix jobs/tornet --tor jobs/opt/tor/bin/tor --torgencert jobs/opt/tor/bin/tor-gencert --process_scale $PROCESS_SCALE
# Set up a "syslog" to collect trace data, and compress it on the fly.
# We'll need to explicitly kill the `nc` job later to ensure xz flushes its
# buffers.
- apt-get install -y netcat xz-utils
- ( nc -lkU /dev/log & echo $! > nc.pid ) | grep " Tor" | xz -2 - > tor-trace.txt.xz &
# Run simulation
- apt-get install -y libevent-2.1-7 libssl1.1 zlib1g libglib2.0-0 libigraph0v5 libprocps8 stow sysstat python3 python3-pip
- pip3 install -r jobs/src/tornettools/requirements.txt
......@@ -219,7 +225,7 @@ run-sim:
- stow -d jobs/opt -t $HOME/.local tor
# TODO: Collect trace data from more tor instances; working on space issues.
# https://gitlab.torproject.org/jnewsome/sponsor-61-sims/-/issues/4
- echo "Log [sim]debug file $CI_PROJECT_DIR/jobs/tornet/tor-trace.txt" >> jobs/tornet/conf/tor.relay.exitonly.torrc
- echo "Log [sim]debug syslog" >> jobs/tornet/conf/tor.relay.exitonly.torrc
# Record all warnings and errors
- echo "Log warn-warn file $CI_PROJECT_DIR/jobs/tornet/tor-warn.txt" >> jobs/tornet/conf/tor.common.torrc
......@@ -247,6 +253,9 @@ run-sim:
- PARALLELISM=20
- tornettools simulate -s $CI_PROJECT_DIR/jobs/opt/shadow/bin/shadow -a "--use-cpu-pinning=true --interpose-method=preload -p $PARALLELISM --template-directory=shadow.data.template" $CI_PROJECT_DIR/jobs/tornet
# Kill our "syslog" process
- kill `cat nc.pid`
# Parse simulation results.
# The raw results are too large to save as an artifact.
# Parse the logs and save the results of that.
......@@ -266,7 +275,7 @@ run-sim:
- 'jobs/tornet/**/*.json.xz'
- 'jobs/tornet/**/*.json'
- jobs/tornet/shadow.log.warn
- jobs/tornet/tor-trace.txt
- jobs/tornet/tor-trace.txt.xz
- jobs/tornet/tor-warn.txt
- jobs/tornet/tor-err.txt
- jobs/tornet/sysinfo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment