Skip to content

Commit

Permalink
Merge pull request #5 from Cortze/random-peering
Browse files Browse the repository at this point in the history
Random peering
  • Loading branch information
cortze authored May 15, 2021
2 parents 9a933f1 + bd31415 commit 90d488b
Show file tree
Hide file tree
Showing 25 changed files with 1,403 additions and 216 deletions.
62 changes: 6 additions & 56 deletions armiarma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ LaunchAnalyzer(){
# Set the Paths for the gossip-metrics.json peerstore.json and output
csv="${folderPath}/examples/${aux}/metrics/metrics.csv"
peerstore="${folderPath}/examples/${aux}/metrics/peerstore.json"
extrametrics="${folderPath}/examples/${aux}/metrics/extra-metrics.csv"
plots="${folderPath}/examples/${aux}/plots"


Expand All @@ -248,7 +249,7 @@ LaunchAnalyzer(){
# Run the Analyzer
echo " Launching analyzer"
echo ""
python ./src/analyzer/armiarma-analyzer.py "$csv" "$peerstore" "$plots"
python ./src/analyzer/armiarma-analyzer.py "$csv" "$peerstore" "$extrametrics" "$plots"

# Deactivate the VENV
deactivate
Expand Down Expand Up @@ -299,7 +300,6 @@ while getopts ":hcpfdts" option; do

LaunchAnalyzer "$2" "$PWD"

echo "Note: If the Metrics Visualizer doesn't try opening the url: 'localhost:8000/graphs' or refresh the page"
echo ""
xdg-open "${plots}/MetricsSummary.pdf"

Expand Down Expand Up @@ -360,7 +360,7 @@ while getopts ":hcpfdts" option; do
echo " Crawler selected"
echo
echo " network: $networkName"
echo " metrics-folder: ${IEXEC_OUT}/$folderName"
echo " metrics-folder: examples/$folderName"
echo


Expand Down Expand Up @@ -456,6 +456,7 @@ while getopts ":hcpfdts" option; do
# Set the Paths for the gossip-metrics.json peerstore.json and output
csv="${folderPath}/examples/${folderName}/metrics/metrics.csv"
peerstore="${folderPath}/examples/${folderName}/metrics/peerstore.json"
extrametrics="${folderPath}/examples/${aux}/metrics/extra-metrics.csv"
plots="${folderPath}/examples/${folderName}/plots"

if [[ -d $plots ]]; then
Expand All @@ -467,7 +468,7 @@ while getopts ":hcpfdts" option; do
# Run the Analyzer
echo " Launching analyzer"
echo ""
python3 ./src/analyzer/armiarma-analyzer.py "$csv" "$peerstore" "$plots"
python3 ./src/analyzer/armiarma-analyzer.py "$csv" "$peerstore" "$extrametrics" "$plots"

## ---- END OF ANALYZER ----

Expand All @@ -476,66 +477,15 @@ while getopts ":hcpfdts" option; do
cd "${folderPath}/examples"

echo "Exporting results to $IEXEC_OUT"
cp -r "${folderName}/plots/MetricsSummary.pdf" "${IEXEC_OUT}"
cp -r "${folderName}/plots/MetricsSummary.pdf" "${IEXEC_OUT}/"


# Generate the proof of computation
echo "{ \"deterministic-output-path\" : \"/iexec_out/MetricsSummary.pdf\" }" > "${IEXEC_OUT}/computed.json"


ls -l $IEXEC_OUT

echo "Exit KUMO execution"
exit;;

t) # Test flag, testing the environment to check if everything is working fine
echo "testing internet connection"
sleep 5
ping -c 4 google.com
echo "Working or not?"
cd src
echo ""

# Test is the shell environment actually works
echo "testing shell environment"
for i in {1..10..1}
do
echo "printing test test/$i"
done

echo "testing Rumor"
./bin/armiarma file crawler/iexec_test.rumor --formatter="terminal" --level="info"
echo "end test of Rumor"
echo ""

echo "Copying the results"
cp -r metrics/ "${IEXEC_OUT}/metrics/"

echo "testing python env"
python3 analyzer/python-env-test.py
echo "end python env test"
echo ""
echo "{ \"deterministic-output-path\" : \"/iexec_out/metrics/\" }" > "${IEXEC_OUT}/computed.json"
exit;;

s) # Test the analyzer part in the iexec platform

echo " Launching analyzer"
echo "$PWD"

csv="${IEXEC_IN}/${IEXEC_INPUT_FILE_NAME_1}"
peerstore="${IEXEC_IN}/${IEXEC_INPUT_FILE_NAME_2}"
plots="${IEXEC_OUT}/plots"

mkdir "${IEXEC_OUT}/plots/"
python3 ./src/analyzer/armiarma-analyzer.py "$csv" "$peerstore" "$plots"
#python3 ./src/analyzer/python-test.py

echo ""
echo "{ \"deterministic-output-path\" : \"/iexec_out/plots/\" }" > "${IEXEC_OUT}/computed.json"
echo "Analyzer Finished!"
exit;;

\?) # incorrect option
echo "Invalid option"
echo
Expand Down
Loading

0 comments on commit 90d488b

Please sign in to comment.