interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / scripts / allen_courier_up.sh

39 lines · 2148 bytes Raw Blame History
1#!/usr/bin/env bash
2# allen_courier_up.sh -- starts the relay that answers Allen's courier, on the Spark.
3#
4# The relay listens on UDP port 47033 (Allen's Ethernet courier, native/kernel/x86/courier_udp.h)
5# and asks the model server on this machine (127.0.0.1:18091), one request at a time,
6# waiting and asking again with growing pauses while the server says it is busy (503). Every
7# exchange is kept, one line each, in ~/.local/state/aienos/allen/conversations/<date>.jsonl:
8# that is Allen's learning corpus (a data pipeline, not weight training).
9#
10# It is a plain background process (nohup), not a systemd unit, on purpose: it opens a port on
11# the LAN that anyone there can talk to (the courier has no password yet), so it should run
12# only while Allen is being tried, and stop with one command: pkill -f 'allen-courier.*--udp 47033'
13# Safe to run twice: it does nothing when the relay already runs. Never touches the model server.
14set -u
15cd "$(dirname "$0")/.."
16state="${HOME}/.local/state/aienos/allen"
17mkdir -p "${state}/bin" "${state}/conversations"
18if pgrep -f 'allen-courier.*--udp 47033' >/dev/null; then
19 echo "the relay is already running: $(pgrep -af 'allen-courier.*--udp 47033' | head -1)"
20 exit 0
21fi
22export PATH="${HOME}/.cargo/bin:${PATH}"
23if [ -z "${ALLEN_RELAY_BIN:-}" ]; then
24 cargo build -q --release --offline -p allen-courier || { echo "the relay does not build"; exit 1; }
25 sha="$(sha256sum "${CARGO_TARGET_DIR:-target}/release/allen-courier" | cut -c1-12)"
26 cp "${CARGO_TARGET_DIR:-target}/release/allen-courier" "${state}/bin/allen-courier-${sha}"
27 ALLEN_RELAY_BIN="${state}/bin/allen-courier-${sha}"
28fi
29nohup "${ALLEN_RELAY_BIN}" --udp 47033 --model "${ALLEN_MODEL:-127.0.0.1:18091}" \
30 --log-dir "${state}/conversations" --work "${state}/work" \
31 >>"${state}/relay.log" 2>&1 </dev/null &
32sleep 1
33if pgrep -f 'allen-courier.*--udp 47033' >/dev/null; then
34 echo "the relay is up: $(pgrep -af 'allen-courier.*--udp 47033' | head -1)"
35 echo "log: ${state}/relay.log learning log: ${state}/conversations/"
36else
37 echo "the relay did not stay up; see ${state}/relay.log"
38 exit 1
39fi