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
aien-sovereign-core-mv / release / repro / inside.sh
| 1 | #!/usr/bin/env bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # Runs inside the release/repro/Dockerfile image, started by scripts/repro-container-build.sh (DRA-43). |
| 18 | # WORK holds core/, omega/ and physics/ checkouts; everything the build writes stays under WORK, so two runs from |
| 19 | # two WORK paths differ only in their paths. Mode `remap` builds with the core tree's own scripts/repro-build.sh; |
| 20 | # mode `plain` is the negative control (same build, no path remap). |
| 21 | set -euo pipefail |
| 22 | |
| 23 | work=${1:?usage: inside.sh WORK remap|plain PACKAGE} |
| 24 | mode=${2:?usage: inside.sh WORK remap|plain PACKAGE} |
| 25 | pkg=${3:?usage: inside.sh WORK remap|plain PACKAGE} |
| 26 | case "$mode" in remap|plain) ;; *) echo "inside.sh: mode must be remap or plain, got $mode" >&2; exit 2 ;; esac |
| 27 | |
| 28 | out=$work/out |
| 29 | mkdir -p "$out" "$work/home" "$work/lib" |
| 30 | export HOME=$work/home CARGO_HOME=$work/cargo-home CARGO_TARGET_DIR=$work/target |
| 31 | export SOURCE_DATE_EPOCH |
| 32 | SOURCE_DATE_EPOCH=$(git -C "$work/core" log -1 --format=%ct) |
| 33 | |
| 34 | # The GPU library, built the way omega's Makefile builds it (its CFLAGS, its physics.lock check). The Makefile |
| 35 | # assigns CFLAGS with ?=, so an inherited CFLAGS would replace its flags: build with CFLAGS unset. |
| 36 | env -u CFLAGS -u CXXFLAGS make -C "$work/omega" -j"${CARGO_BUILD_JOBS:-1}" \ |
| 37 | OUT_DIR="$work/lib" PHYSICS_DIR="$work/physics" "$work/lib/libomega_gpu.a" >"$out/make.log" 2>&1 |
| 38 | lib_sha=$(sha256sum "$work/lib/libomega_gpu.a" | cut -d' ' -f1) |
| 39 | cp "$work/lib/libomega_gpu.a" "$out/libomega_gpu.a" |
| 40 | |
| 41 | # Link that library the way the shipped engine was linked (crates/aien-omega-gpu/build.rs prebuilt mode). |
| 42 | export AIEN_OMEGA_GPU_LIB=$work/lib/libomega_gpu.a AIEN_OMEGA_GPU_LIB_SHA256=$lib_sha |
| 43 | cd "$work/core" |
| 44 | cargo fetch --locked >"$out/fetch.log" 2>&1 |
| 45 | if [ "$mode" = remap ]; then |
| 46 | bash scripts/repro-build.sh -p "$pkg" >"$out/cargo.log" 2>&1 |
| 47 | else |
| 48 | cargo build --release --locked -p "$pkg" >"$out/cargo.log" 2>&1 |
| 49 | fi |
| 50 | cp "$CARGO_TARGET_DIR/release/$pkg" "$out/$pkg" |
| 51 | |
| 52 | { |
| 53 | echo "work=$work" |
| 54 | echo "mode=$mode" |
| 55 | echo "core=$(git -C "$work/core" rev-parse HEAD)" |
| 56 | echo "omega=$(git -C "$work/omega" rev-parse HEAD)" |
| 57 | echo "physics=$(git -C "$work/physics" rev-parse HEAD)" |
| 58 | echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" |
| 59 | echo "CARGO_HOME=$CARGO_HOME" |
| 60 | echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR" |
| 61 | echo "rustc: $(rustc -vV | tr '\n' ' ')" |
| 62 | echo "gcc: $(gcc --version | head -n1)" |
| 63 | echo "ar: $(ar --version | head -n1)" |
| 64 | echo "ld: $(ld --version | head -n1)" |
| 65 | echo "make: $(make --version | head -n1)" |
| 66 | echo "ar members:" |
| 67 | ar tv "$out/libomega_gpu.a" |
| 68 | echo "sha256:" |
| 69 | (cd "$out" && sha256sum libomega_gpu.a "$pkg") |
| 70 | } >"$out/BUILD-INFO.txt" |
| 71 | cat "$out/BUILD-INFO.txt" |