sorcery-go/scripts/deploy_grid.sh

44 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Sorcery-Go: Deploy Grid
# Finalises the environment and prepares for the first Glibc Stress Test.
# Supports all runtimes: lxc, podman, firecracker, baremetal.
set -e
SORCERY="${SORCERY:-./build/sorcery}"
RUNTIME="${SORCERY_GO_RUNTIME:-auto}"
echo "⚡ Initialising the Sorcery-Go Sovereign Coven..."
echo " Runtime: $RUNTIME"
# 1. Setup Directory Structure
mkdir -p bin pkg grimoire tablet tomb docs manifests
mkdir -p /var/lib/sorcery-go/ebpf/maps
# 2. Initialize the State Database
"$SORCERY" init --db ./tablet/state.db
# 3. Load eBPF Security Programs (replaces AppArmor)
echo "→ Loading eBPF Tomb Guard..."
"$SORCERY" ward reinforce 2>/dev/null || {
echo " (eBPF programs will be loaded at warding startup)"
}
# 4. Start the Warding Monitor (background)
if [ -x ./build/warding ]; then
nohup ./build/warding watch > /var/log/sorcery/warding.log 2>&1 &
echo $! > /run/warding.pid
echo "✓ Warding monitor started (PID $(cat /run/warding.pid))"
fi
# 5. Launch the Coven Mirror WebUI
# (foreground by default; use --background for systemd/OpenRC)
if [ "$1" = "--background" ]; then
nohup "$SORCERY" web --port 8080 --cockpit-integration \
> /var/log/sorcery/web.log 2>&1 &
echo $! > /run/sorcery-web.pid
echo "✓ Coven Mirror running in background (PID $(cat /run/sorcery-web.pid))"
echo " Open: http://localhost:8080"
else
echo "✓ Launching Coven Mirror in foreground..."
"$SORCERY" web --port 8080 --cockpit-integration
fi