interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / evidence / qwen38-serve-fast-20261019 / swap.sh

21 lines · 1465 bytes Raw Blame History
1#!/bin/bash
2# swap.sh <new-start-script>: stop keepalive, SIGTERM the live 27B (drains the reply in flight),
3# install the new start script (old kept as .bak-<ts>), start, wait for /v1/models. Prints timestamps.
4set -uo pipefail
5S=$HOME/.local/state/aien-q38; NEW=$1; TS=$(date -u +%Y%m%dT%H%M%SZ)
6ts() { date -u +%FT%T.%3NZ; }
7echo "$(ts) stop keepalive $(cat $S/keepalive.pid)"; kill "$(cat $S/keepalive.pid)"
8# Shortest downtime: wait (up to 10 min) for a moment with no client connected, so the drain is empty.
9for i in $(seq 1 3000); do [ "$(ss -Htn state established "( sport = :18091 )" | wc -l)" = 0 ] && break; sleep 0.2; done
10echo "$(ts) open client connections: $(ss -Htn state established "( sport = :18091 )" | wc -l)"
11OLD=$(cat $S/serve.pid)
12echo "$(ts) SIGTERM old server $OLD"; T0=$(date +%s.%N); kill -TERM "$OLD"
13while kill -0 "$OLD" 2>/dev/null; do sleep 0.2; done
14T1=$(date +%s.%N); echo "$(ts) old server exited"
15cp -p $S/start-27b.sh $S/start-27b.sh.bak-$TS && cp "$NEW" $S/start-27b.sh && echo "$(ts) start script swapped (backup start-27b.sh.bak-$TS)"
16$S/start-27b.sh
17until curl -s -m 2 127.0.0.1:18091/v1/models | grep -q qwen3.8-27b-fp8; do
18 kill -0 "$(cat $S/serve.pid)" 2>/dev/null || { echo "$(ts) NEW SERVER DIED"; exit 1; }
19 sleep 0.5; done
20T2=$(date +%s.%N); echo "$(ts) new server answers /v1/models, pid $(cat $S/serve.pid)"
21echo "drain_s=$(echo "$T1 - $T0" | bc) load_s=$(echo "$T2 - $T1" | bc) down_s=$(echo "$T2 - $T0" | bc)"