My implementation of gossip-gloomers - the fly.io distributed systems challenge (https://fly.io/dist-sys/)
1#!/usr/bin/env bash
2
3go install .
4
5rm results/results.edn
6
7# Go back to where maelstrom is so that the additional files that are created when running it
8# don't end up in the mounted volume and on our local machines
9cd /home/linuxbrew/maelstrom/
10
11if [ "$TEST_TO_RUN" = 'echo' ]; then
12 ./maelstrom test -w echo --bin ../go/bin/gossip-gloomers --node-count 1 --time-limit 10
13elif [ "$TEST_TO_RUN" = 'unique-ids' ]; then
14 ./maelstrom test -w unique-ids --bin ../go/bin/gossip-gloomers --node-count 3 --time-limit 30 --availability total --nemesis partition
15elif [ "$TEST_TO_RUN" = 'broadcast-single' ]; then
16 ./maelstrom test -w broadcast --bin ../go/bin/gossip-gloomers --node-count 1 --time-limit 20 --rate 10
17elif [ "$TEST_TO_RUN" = 'broadcast-multi' ]; then
18 ./maelstrom test -w broadcast --bin ../go/bin/gossip-gloomers --node-count 5 --time-limit 20 --rate 10
19elif [ "$TEST_TO_RUN" = 'broadcast-fault' ]; then
20 ./maelstrom test -w broadcast --bin ../go/bin/gossip-gloomers --node-count 5 --time-limit 20 --rate 10 --nemesis partition
21elif [ "$TEST_TO_RUN" = 'broadcast-efficiency-1' ]; then
22 ./maelstrom test -w broadcast --bin ../go/bin/gossip-gloomers --node-count 25 --time-limit 20 --rate 100 --latency 100
23 cp store/latest/results.edn ../app/results/results.edn
24else
25 echo "invalid input"
26fi