Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/scripts/allen_courier_up.sh # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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/.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. 14 set -u 15 cd "$(dirname "$0")/.." 16 state="${HOME}/.local/state/aienos/allen" 17 mkdir -p "${state}/bin" "${state}/conversations" 18 if 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 21 fi 22 export PATH="${HOME}/.cargo/bin:${PATH}" 23 if [ -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}" 28 fi 29 nohup "${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; 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/" 36 else 37 echo "the relay did not stay up; see ${state}/relay.log" 38 exit 1 39 fi