Skip to content

Commit

Permalink
Remove unnecessary scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Aug 28, 2024
1 parent b4e6296 commit bef857f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 79 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/network-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ jobs:
# Extract inputs with defaults for non-workflow_dispatch events
percent="${{ matrix.netem_loss }}"
scaling_factor="${{ matrix.scaling_factor }}"
target_peer="alice"
target_peer="hydra-node-1"
other_peers="172.16.238.20 172.16.238.30"
peers_info_json=$(.github/workflows/network/peers_info_json.sh)
.github/workflows/network/run_pumba.sh $target_peer $percent $peers_info_json
.github/workflows/network/run_pumba.sh $target_peer $percent $other_peers
# Run benchmark on demo
mkdir benchmarks
Expand Down
60 changes: 0 additions & 60 deletions .github/workflows/network/peers_info_json.sh

This file was deleted.

18 changes: 3 additions & 15 deletions .github/workflows/network/run_pumba.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
#!/usr/bin/env bash

if ! command -v jq &> /dev/null
then
echo "jq is required for this script ~ install it."
exit 1
fi

target_peer=$1
target_node_name=$1

percent=$2

peers_info_json=$3

target_node_name=$(echo "$peers_info_json" | jq -r ".$target_peer.node_name")
rest_node_names=$3

# Build Pumba netem command
unselected_networks=$(echo "$peers_info_json" | jq -r --arg selected_peer "$target_peer" '
to_entries[] | select(.key != $selected_peer) | .value.network
')

nix_command="nix run github:noonio/pumba/noon/add-flake -- -l debug --random netem --duration 20m"

while IFS= read -r network; do
nix_command+=" --target $network"
done <<< "$unselected_networks"
done <<< "$rest_node_names"

nix_command+=" loss --percent \"$percent\" \"re2:$target_node_name\" &"

Expand Down

0 comments on commit bef857f

Please sign in to comment.