|
|
@@ -1,13 +1,61 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
-docker run --name "tp-belarus" --rm -d -i tp-analysis:latest || exit 1
|
|
|
+# Populate array of months we care about
|
|
|
+months=()
|
|
|
+# 2020
|
|
|
+for i in {7..12}; do
|
|
|
+ months+=( 2020-$(printf %02d $i) )
|
|
|
+done
|
|
|
+# 2021
|
|
|
+for i in {1..4}; do
|
|
|
+ months+=( 2021-$(printf %02d $i) )
|
|
|
+done
|
|
|
+
|
|
|
+cd belarus-2020-2021
|
|
|
|
|
|
if [ "$1" == "--fast" ]; then
|
|
|
- docker exec tp-belarus sh -c "cd /home/analysis/belarus-2020-2021 && ./run.sh --fast" | tee section-3-results
|
|
|
+ echo "Repacking some pre-processed data for the next step..."
|
|
|
+ ./scripts/repack-preprocessed-data.sh
|
|
|
+ #docker exec tp-belarus sh -c "cd /home/analysis/belarus-2020-2021 && ./run.sh --fast" | tee section-3-results
|
|
|
else
|
|
|
- docker exec tp-belarus sh -c "cd /home/analysis/belarus-2020-2021 && ./run.sh" | tee section-3-results
|
|
|
+ #docker run --name "tp-belarus-process-data" --rm -d -i tp-analysis:latest || exit 1
|
|
|
+ echo "Downloading data from the Tor Project..."
|
|
|
+ ./scripts/download-bridge-data.sh
|
|
|
+
|
|
|
+ if [ "$1" == "-s" ]; then
|
|
|
+ # Do this step sequentially
|
|
|
+ for i in ${months[@]}; do
|
|
|
+ docker run --name "tp-belarus-${i}" --rm -d -i tp-analysis:latest || exit 1
|
|
|
+ docker exec tp-belarus-${i} sh -c "cd /home/analysis/belarus-2020-2021 && ./scripts/extract-extra-infos-archive.sh bridge-extra-infos-${i}.tar.xz"
|
|
|
+ docker cp tp-belarus-${i}:/home/analysis/belarus-2020-2021/data/bridge_data/bridge-extra-infos-${i}_processed.tar.xz . && docker stop tp-belarus-${i}
|
|
|
+ done
|
|
|
+ else
|
|
|
+ # Do this step in parallel
|
|
|
+ for i in ${months[@]}: do
|
|
|
+ docker run --name "tp-belarus-${i}" --rm -d -i tp-analysis:latest || exit 1
|
|
|
+ docker exec tp-belarus-${i} sh -c "cd /home/analysis/belarus-2020-2021 && ./scripts/extract-extra-infos-archive.sh bridge-extra-infos-${i}.tar.xz" &
|
|
|
+ done
|
|
|
+ wait
|
|
|
+ for i in ${months[@]}; do
|
|
|
+ docker cp tp-belarus-${i}:/home/analysis/belarus-2020-2021/data/bridge_data/bridge-extra-infos-${i}_processed.tar.xz . && docker stop tp-belarus-${i}
|
|
|
+ done
|
|
|
+ fi
|
|
|
fi
|
|
|
|
|
|
+docker run --name "tp-belarus" --rm -d -i tp-analysis:latest || exit 1
|
|
|
+docker exec tp-belarus sh -c "mkdir -p /home/analysis/belarus-2020-2021/data/bridge_data"
|
|
|
+
|
|
|
+# Copy archives to docker
|
|
|
+for i in data/*_processed.tar.xz; do
|
|
|
+ docker cp "${i}" tp-belarus:/home/analysis/belarus-2020-2021/data/bridge_data/
|
|
|
+done
|
|
|
+
|
|
|
+# Return to artifact root
|
|
|
+cd ..
|
|
|
+
|
|
|
+# Process the data
|
|
|
+docker exec tp-belarus sh -c "cd /home/analysis/belarus-2020-2021 && ./scripts/get-email-bridges.sh && ./scripts/clean-bridge-data.sh" && \
|
|
|
+docker exec tp-belarus sh -c "cd /home/analysis/belarus-2020-2021 && ./scripts/get-stats.sh" | tee section-3-results
|
|
|
docker cp tp-belarus:/home/analysis/belarus-2020-2021/appendix-a-results.tex . && \
|
|
|
docker cp tp-belarus:/home/analysis/belarus-2020-2021/appendix-a-results.pdf . && \
|
|
|
docker stop tp-belarus
|