16 lines
1.2 KiB
Bash
16 lines
1.2 KiB
Bash
# flood: twenty fake servers (flood1..20.test, ten actors each) for load runs (load.sh), from tools/pasture/flood/flood.cs,
|
|||
|
|
# a .NET file-based app published once into .flood and run on the runtime image PrivaPub uses. Its keys live in the
|
||
|
|
# pasture-flood volume, so `flood run` (podman exec) speaks as the actors `flood serve` answers for.
|
||
|
|
flood_up() {
|
||
|
|
local dotnet=${DOTNET:-$(command -v dotnet || echo ~/.dotnet/dotnet)}
|
||
|
|
[ -x "$here/.flood/flood" ] || "$dotnet" publish "$here/flood/flood.cs" -r linux-x64 --self-contained true -o "$here/.flood" -v quiet
|
||
|
|
podman volume exists pasture-flood || podman volume create --label pasture=1 pasture-flood >/dev/null
|
||
|
|
podman run -d --replace --name pasture-flood --network $net --label pasture=1 -w /app -v "$here/.flood:/app:Z,ro" \
|
||
|
|
-v pasture-flood:/state -v "$ca/bundle.pem:/etc/ssl/certs/ca-certificates.crt:z,ro" -e SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
|
||
|
|
mcr.microsoft.com/dotnet/runtime-deps:10.0 /app/flood serve >/dev/null
|
||
|
|
for _ in $(seq 1 60); do
|
||
|
|
site flood1.test -s -o /dev/null -w '%{http_code}' https://flood1.test:6443/users/u0 2>/dev/null | grep -q 200 && break
|
||
|
|
sleep 2
|
||
|
|
done
|
||
|
|
echo "flood: https://flood1.test:6443 .. flood20.test"
|
||
|
|
}
|