Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/bump-hrx-report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@
# there were no conflicts, which is the difference between "nothing conflicted" and "nobody looked".
set -uo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

run="" step="" log="" attempt=""
while [ $# -gt 0 ]; do
case "$1" in
--run) run=${2:?--run needs a URL}; shift 2 ;;
--step) step=${2:?--step needs a name}; shift 2 ;;
--log) log=${2:?--log needs a path or -}; shift 2 ;;
--attempt) attempt=${2:?--attempt needs a number}; shift 2 ;;
-h|--help) sed -n '3,17p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
-h|--help) usage; exit 0 ;;
*) echo "bump-hrx-report: unknown argument: $1" >&2; exit 2 ;;
esac
done
Expand Down
6 changes: 5 additions & 1 deletion scripts/check-ci-runners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
# says where else it belongs and why a scheduled red needs a workflow change (an RFC under CONTRIBUTING).
set -uo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

repo=1bit-MONSTER/engine
require=()
list=0
Expand All @@ -41,7 +45,7 @@ while [ $# -gt 0 ]; do
--repo) repo=$2; shift 2 ;;
--require) shift; while [ $# -gt 0 ] && [ "${1#-}" = "$1" ]; do require+=("$1"); shift; done ;;
--list) list=1; shift ;;
-h|--help) sed -n '16,33p' "$0"; exit 0 ;;
-h|--help) usage; exit 0 ;;
*) echo "check-ci-runners.sh: unknown option $1" >&2; exit 2 ;;
esac
done
Expand Down
6 changes: 5 additions & 1 deletion scripts/check-ubuntu-2604-lemond.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
# /opt/rocm-therock come in from the host and the engine's HRX llama-server runs on HRX0.
set -euo pipefail

[ $# -ge 2 ] || { sed -n '16,27p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -ge 2 ] || { usage; exit 2; }
pkg=$(readlink -f "$1") model=$(readlink -f "$2") gpu=${3:-}
name=1bit-u2604-check-$$
runtime=${CONTAINER_RUNTIME:-docker}
Expand Down
6 changes: 5 additions & 1 deletion scripts/fetch-rocm-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@
# stdout, diagnostics on stderr, so callers can use it as a command substitution.
set -euo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

root=$(cd "$(dirname "$0")/.." && pwd)
me=fetch-rocm-sdk
check=0
while [ $# -gt 0 ]; do
case "$1" in
--check) check=1; shift ;;
-h|--help) sed -n '16,26p' "$0"; exit 0 ;;
-h|--help) usage; exit 0 ;;
--) shift; break ;;
-*) echo "$me: unknown option $1" >&2; exit 2 ;;
*) break ;;
Expand Down
12 changes: 11 additions & 1 deletion scripts/hw-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,23 @@
# the gate.
set -uo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

# -h/--help is answered before anything else, in particular before the GPU queue below: printing the
# usage takes no hardware and must not claim the fleet's GPU token (measured: `hw-gate --help` queued on
# ~/GPU-TOKEN and held it for a moment while another pass was running).
case " $* " in
*" -h "*|*" --help "*) sed -n '16,66p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
*" -h "*|*" --help "*) usage; exit 0 ;;
esac

# No arguments at all is a usage error, not a hardware run. With an empty "$*" the case above does not match, so the gate used
# to walk straight into the GPU queue below: measured 2026-11-12, when an audit that ran every script's usage path took two
# tickets (`gpu-hold[...] queued 'hw-gate pid ...'`) instead of printing help. It claimed and released within seconds, but a
# usage path must take no hardware, and this one is now answered before the queue like -h/--help.
[ $# -gt 0 ] || { usage; exit 2; }

# Fair GPU queue (the protocol is written down in ~/amd-oss/GPU-TOKEN.md on the box): when the gpu-hold helper
# is installed, the whole gate runs inside one claim on ~/GPU-TOKEN instead of racing for it with a noclobber
# open. Claims are served in arrival order, a killed run cannot leave the token behind, the die temperature
Expand Down
5 changes: 4 additions & 1 deletion scripts/install-ci-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@
# --verify only report the installed unit's state
set -euo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

name=strixhalo-engine labels=pr-agent user=ghrunner groups=docker memory_max=48G
token_file='' runner_dir='' runner_version='' env_file='' hold_state=/var/lib/1bit-fleet hold_group=fleethold owner_user=bcloud no_hold=0 migrate=0 dry=0 verify=0
usage() { sed -n '16,48p' "$0"; }

while [ $# -gt 0 ]; do
case $1 in
Expand Down
6 changes: 5 additions & 1 deletion scripts/mk-kernel-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@
# the family it is building, so each family is proven in that family's container:
# docs/install-any-distro.md.
set -euo pipefail

# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }
umask 022

[ $# -ge 2 ] || { sed -n '16,62p' "$0"; exit 2; }
[ $# -ge 2 ] || { usage; exit 2; }
out=$1 ver=$2; shift 2
repo=$(cd "$(dirname "$0")/.." && pwd)

Expand Down
6 changes: 5 additions & 1 deletion scripts/mk-plugin-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
# LIBHSA overrides the HSA runtime source; the default is the system's libhsa-runtime64.so.1.
set -euo pipefail

[ $# -ge 3 ] || { sed -n '18,34p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -ge 3 ] || { usage; exit 2; }
bundle=$(cd "$1" && pwd) out=$2 ver=$3
[ -x "$bundle/1bit" ] || { echo "not a 1bit bundle: $bundle (no 1bit binary)" >&2; exit 1; }
[ -d "$bundle/hrx/llama/bin" ] || { echo "not a 1bit bundle: $bundle (no hrx/llama/bin)" >&2; exit 1; }
Expand Down
6 changes: 5 additions & 1 deletion scripts/pack-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
# The produced file's path is the only thing on stdout.
set -euo pipefail

[ $# -eq 3 ] || { sed -n '16,52p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -eq 3 ] || { usage; exit 2; }
fmt=$1 root=$2 out=$3
repo=$(cd "$(dirname "$0")/.." && pwd)
# shellcheck source=scripts/pack-version.sh
Expand Down
6 changes: 5 additions & 1 deletion scripts/pack-proof.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
# it supports, named once here so a release cannot quietly prove itself on something else.
set -uo pipefail

[ $# -eq 2 ] || { sed -n '16,43p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -eq 2 ] || { usage; exit 2; }
dir=$(cd "$1" && pwd) || exit 2
# shellcheck source=scripts/pack-version.sh
. "$(dirname "$0")/pack-version.sh"
Expand Down
6 changes: 5 additions & 1 deletion scripts/package-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
# unpacks it into the Lemonade + onebit package as 1bit/ (docs/releases.md).
set -euo pipefail

[ $# -ge 3 ] || { sed -n '16,27p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -ge 3 ] || { usage; exit 2; }
build=$(cd "$1" && pwd) out=$2 ver=$3
src=$(cd "$(dirname "$0")/.." && pwd)
name=1bit-$ver-linux-x86_64
Expand Down
6 changes: 5 additions & 1 deletion scripts/weekly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
# what the build scripts each list; preflight (at the end) checks the toolchain, hipcc, patchelf and the kernel image.
set -euo pipefail

[ $# -ge 1 ] || { sed -n '16,33p' "$0"; exit 2; }
# usage(): the header comment as prose, anchored on the comment block rather than a line range -- two of these ranges had
# drifted past the end of their header and printed code to whoever asked for help (engine#2129).
usage() { awk 'NR>1 && /^#/ {sub(/^# ?/,""); print; next} NR>1 {exit}' "$0"; }

[ $# -ge 1 ] || { usage; exit 2; }
W=$(mkdir -p "$1" && cd "$1" && pwd); shift
STAGES=${*:-bumps build test package release}
REPO=1bit-MONSTER/engine
Expand Down
Loading