Promote v0.5.0 to production
This commit is contained in:
+271
-17
@@ -99,7 +99,7 @@ EDITION_GIVEN=0; [ -z "${GPUK_EDITION:-}" ] || EDITION_GIVEN=1
|
||||
PROFILE=""
|
||||
RESET_MANIFEST=0
|
||||
REINSTALL=0
|
||||
DOMAIN=""
|
||||
DOMAIN=""; NO_DOMAIN=0
|
||||
VERSION=""
|
||||
IMAGE=""
|
||||
WORKER_BINARY=""
|
||||
@@ -120,6 +120,62 @@ warn() { echo " ${YELLOW}!${RESET} $*"; }
|
||||
step() { echo; echo "${BOLD}$*${RESET}"; }
|
||||
die() { echo " ${RED}✗${RESET} $*" >&2; exit 1; }
|
||||
|
||||
# Only a standalone installer invoked directly as the shell's script can remove
|
||||
# itself. Piped input, sourced wrappers, repository copies and the installed CLI
|
||||
# have no eligible path. Missing identity tools leave the file in place.
|
||||
INSTALLER_SELF=""; INSTALLER_SELF_STAT=""; INSTALLER_SELF_HASH=""
|
||||
remember_standalone_installer() {
|
||||
for _tool in readlink stat sha256sum; do
|
||||
command -v "$_tool" >/dev/null 2>&1 || return 0
|
||||
done
|
||||
[ -f "$0" ] && [ ! -L "$0" ] && [ -r "/proc/$$/cmdline" ] || return 0
|
||||
# Shell argv[1] is the script only for direct `sh path` / shebang invocation.
|
||||
# -c, -s and extra interpreter flags are deliberately not guessed through.
|
||||
_self_arg=$(tr '\000' '\n' < "/proc/$$/cmdline" | sed -n '2p')
|
||||
[ "$_self_arg" = "$0" ] || return 0
|
||||
_self_path=$(readlink -f -- "$0") || return 0
|
||||
[ "$_self_path" != "$(readlink -f -- "$GPUK_CLI" 2>/dev/null || true)" ] || return 0
|
||||
[ ! -f "$(dirname "$_self_path")/../../dev.sh" ] || return 0
|
||||
_self_dir=$(dirname "$_self_path")
|
||||
while :; do
|
||||
[ ! -e "$_self_dir/.git" ] && [ ! -L "$_self_dir/.git" ] || return 0
|
||||
[ "$_self_dir" != / ] || break
|
||||
_self_dir=$(dirname "$_self_dir")
|
||||
done
|
||||
[ "$(sed -n '2p' "$_self_path")" = '# GPU Kitchen — one-command install (specs/plateforme/installation/README.md).' ] || return 0
|
||||
[ "$(tail -n 1 "$_self_path")" = 'main "$@"' ] || return 0
|
||||
_self_owner=$(stat -c %u -- "$_self_path") || return 0
|
||||
_self_user=$(id -u)
|
||||
case "$_self_owner" in
|
||||
"$_self_user") ;;
|
||||
"${SUDO_UID:-}") [ "$_self_user" -eq 0 ] || return 0 ;;
|
||||
*) return 0 ;;
|
||||
esac
|
||||
INSTALLER_SELF_STAT=$(stat -c '%d:%i:%u:%s:%Y:%Z' -- "$_self_path") || return 0
|
||||
INSTALLER_SELF_HASH=$(sha256sum -- "$_self_path" | cut -d' ' -f1) || return 0
|
||||
case "$INSTALLER_SELF_HASH" in ''|*[!a-f0-9]*) return 0 ;; esac
|
||||
[ "${#INSTALLER_SELF_HASH}" -eq 64 ] || return 0
|
||||
INSTALLER_SELF="$_self_path"
|
||||
}
|
||||
|
||||
remove_expired_standalone_installer() {
|
||||
[ -n "$INSTALLER_SELF" ] || return 0
|
||||
[ -f "$INSTALLER_SELF" ] && [ ! -L "$INSTALLER_SELF" ] || return 0
|
||||
[ "$(readlink -f -- "$0" 2>/dev/null || true)" = "$INSTALLER_SELF" ] || return 0
|
||||
[ "$(stat -c '%d:%i:%u:%s:%Y:%Z' -- "$INSTALLER_SELF" 2>/dev/null || true)" = "$INSTALLER_SELF_STAT" ] || return 0
|
||||
[ "$(sha256sum -- "$INSTALLER_SELF" 2>/dev/null | cut -d' ' -f1)" = "$INSTALLER_SELF_HASH" ] || return 0
|
||||
rm -f -- "$INSTALLER_SELF" 2>/dev/null || true
|
||||
}
|
||||
|
||||
installer_failure() { # exit status, ordinary failure message
|
||||
_installer_status="$1"; shift
|
||||
[ "$_installer_status" -ne 78 ] || remove_expired_standalone_installer
|
||||
echo " ${RED}✗${RESET} $*" >&2
|
||||
exit "$_installer_status"
|
||||
}
|
||||
|
||||
remember_standalone_installer
|
||||
|
||||
# `curl … | sudo sh` leaves stdin holding the script itself, so questions are
|
||||
# asked and answered on the controlling terminal — /dev/tty — when there is one
|
||||
# (INS-45). No terminal (CI, provisioning), --non-interactive or --dry-run keep
|
||||
@@ -130,9 +186,10 @@ can_prompt() {
|
||||
(: < /dev/tty) 2>/dev/null
|
||||
}
|
||||
|
||||
ask() { # $1 = prompt → $REPLY (empty on EOF)
|
||||
ASK_EOF=0
|
||||
ask() { # $1 = prompt → $REPLY (empty on EOF, which also sets ASK_EOF=1)
|
||||
printf '%s' "$1" > /dev/tty
|
||||
IFS= read -r REPLY < /dev/tty || REPLY=""
|
||||
IFS= read -r REPLY < /dev/tty || { REPLY=""; ASK_EOF=1; }
|
||||
}
|
||||
|
||||
usage() {
|
||||
@@ -160,7 +217,8 @@ Options:
|
||||
--domain <d> Name the UI is reached by through a reverse proxy, any
|
||||
profile: allowed as a host of the install, proxy trusted for
|
||||
the client address, and a filled TLS reverse-proxy example
|
||||
written to <data-root>/caddy/Caddyfile
|
||||
written to <data-root>/caddy/Caddyfile. A re-run keeps it
|
||||
--no-domain Drop the domain an existing install was given
|
||||
--reinstall On a host that already runs GPU Kitchen, reinstall over it
|
||||
(settings kept, merged into its manifest) instead of the
|
||||
default re-run, which is 'gpuk update'
|
||||
@@ -203,6 +261,7 @@ while [ $# -gt 0 ]; do
|
||||
--network) NETWORK="$2"; NETWORK_GIVEN=1; shift 2 ;;
|
||||
--profile) PROFILE="$2"; shift 2 ;;
|
||||
--domain) DOMAIN="$2"; shift 2 ;;
|
||||
--no-domain) NO_DOMAIN=1; shift ;;
|
||||
--non-interactive) NON_INTERACTIVE=1; shift ;;
|
||||
--reset-manifest) RESET_MANIFEST=1; shift ;;
|
||||
--reinstall) REINSTALL=1; shift ;;
|
||||
@@ -246,6 +305,7 @@ done
|
||||
|
||||
echo
|
||||
echo "${BOLD}GPU Kitchen — installing the $EDITION controller${RESET}"
|
||||
echo "Installing means you accept the GPU Kitchen Community License: https://gpu.kitchen/license" # [WEB-212]
|
||||
|
||||
# ── 0. An existing install (INS-03) ──────────────────────────────────────────
|
||||
# Re-running this script is the update path, so before checking anything it
|
||||
@@ -344,7 +404,10 @@ case "$EXISTING" in
|
||||
[ "$NETWORK_GIVEN" -eq 0 ] || [ "$NETWORK" = "${C_NETMODE:-host}" ] || reconfigure "--network"
|
||||
[ "$EDITION_GIVEN" -eq 0 ] || [ "$EDITION" = "$_edition" ] || reconfigure "--edition"
|
||||
[ -z "$PROFILE" ] || [ "$PROFILE" = "$_profile" ] || reconfigure "--profile"
|
||||
[ -z "$DOMAIN" ] || reconfigure "--domain"
|
||||
_domain=$(manifest_str GPUK_DOMAIN)
|
||||
[ -z "$DOMAIN" ] || [ "$DOMAIN" = "$_domain" ] || reconfigure "--domain"
|
||||
[ "$NO_DOMAIN" -eq 0 ] || [ -z "$_domain" ] || reconfigure "--no-domain"
|
||||
[ "$NO_DOMAIN" -eq 1 ] || [ -n "$DOMAIN" ] || DOMAIN="$_domain"
|
||||
[ -z "$IMAGE" ] || reconfigure "--image"
|
||||
[ -z "$VERSION" ] || reconfigure "--version"
|
||||
[ -z "$WORKER_BINARY" ] || reconfigure "--worker-binary"
|
||||
@@ -401,6 +464,14 @@ esac
|
||||
# An install older than gpuk-on-the-host has nothing to hand the update to: the
|
||||
# only way forward is a reinstall over it. Offer it on a terminal, and always
|
||||
# print the complete command — never a flag to splice in by hand.
|
||||
# Retirement deliberately removes programs while retaining the recovery set.
|
||||
# The current signed release can be installed directly over that preserved state.
|
||||
if [ "$EXISTING" = "manifest" ] && [ ! -x "$GPUK_CLI" ] \
|
||||
&& [ "$(cat "$ETC_DIR/beta-retired" 2>/dev/null || true)" = "$((0xce8c74e7 ^ 0xa5c39e17))" ]; then
|
||||
REINSTALL=1
|
||||
reconfigure "recovering the expired beta's data"
|
||||
fi
|
||||
|
||||
if [ "$EXISTING" = "manifest" ] && [ -z "$RECONFIGURE" ] && [ "$DRY_RUN" -eq 0 ] \
|
||||
&& [ ! -x "$GPUK_CLI" ]; then
|
||||
step "Update — this install predates gpuk on the host"
|
||||
@@ -429,7 +500,9 @@ if [ "$EXISTING" = "manifest" ] && [ -z "$RECONFIGURE" ]; then
|
||||
echo " existing : yes — updated in place"
|
||||
exit 0
|
||||
fi
|
||||
"$GPUK_CLI" update || die "the update failed — gpuk reported the cause just above"
|
||||
_update_status=0
|
||||
"$GPUK_CLI" update || _update_status=$?
|
||||
[ "$_update_status" -eq 0 ] || installer_failure "$_update_status" "the update failed — gpuk reported the cause just above"
|
||||
echo
|
||||
echo "${BOLD}${GREEN}GPU Kitchen is up to date.${RESET}"
|
||||
echo
|
||||
@@ -658,6 +731,144 @@ else
|
||||
resolve_port "inference" "$INFERENCE_PORT" "--inference-port"; INFERENCE_PORT="$RESOLVED"
|
||||
fi
|
||||
|
||||
# BEGIN GENERATED INTERNET REACHABILITY — tools/gen-install-reachability.mjs from deployments/install/reachability.sh.in and packages/contracts/data/public-address-ranges.json; DO NOT EDIT
|
||||
# Whether the Internet reaches this machine, one finding per line:
|
||||
# public <ipv4> <interface> a public IPv4 on an interface (the controller listens there)
|
||||
# ipv6 <ipv6> <interface> a global IPv6: reported only, nothing listens on IPv6
|
||||
# cloud <ipv4> a public IPv4 the cloud metadata service maps 1:1 to it
|
||||
# unknown no `ip` nor `hostname -I` to read the addresses
|
||||
# The ranges come from packages/contracts/data/public-address-ranges.json, the controller's
|
||||
# own definition too. GPUK_CLOUD_METADATA_URL is a test seam.
|
||||
reach_classify() { # stdin: "<interface> <family> <address>[/prefix]" lines
|
||||
awk '
|
||||
function v4int(a, o, n, i, x) {
|
||||
n = split(a, o, ".")
|
||||
if (n != 4) return -1
|
||||
x = 0
|
||||
for (i = 1; i <= 4; i++) {
|
||||
if (o[i] !~ /^[0-9]+$/ || o[i] + 0 > 255) return -1
|
||||
x = x * 256 + o[i]
|
||||
}
|
||||
return x
|
||||
}
|
||||
function hexval(h, i, c, x) {
|
||||
x = 0
|
||||
for (i = 1; i <= length(h); i++) {
|
||||
c = index("0123456789abcdef", substr(h, i, 1))
|
||||
if (c == 0) return -1
|
||||
x = x * 16 + c - 1
|
||||
}
|
||||
return x
|
||||
}
|
||||
function v6head32(a, h, n, h1, h2) {
|
||||
n = split(tolower(a), h, ":")
|
||||
if (n < 3 || h[1] == "" || length(h[1]) > 4 || length(h[2]) > 4) return -1
|
||||
h1 = hexval(h[1])
|
||||
h2 = (h[2] == "") ? 0 : hexval(h[2])
|
||||
if (h1 < 0 || h2 < 0) return -1
|
||||
return h1 * 65536 + h2
|
||||
}
|
||||
function v4public(a, x) {
|
||||
x = v4int(a)
|
||||
if (x < 0) return 0
|
||||
if (x >= 0 && x <= 16777215) return 0 # 0.0.0.0/8 this network
|
||||
if (x >= 167772160 && x <= 184549375) return 0 # 10.0.0.0/8 private
|
||||
if (x >= 1681915904 && x <= 1686110207) return 0 # 100.64.0.0/10 CGNAT
|
||||
if (x >= 2130706432 && x <= 2147483647) return 0 # 127.0.0.0/8 loopback
|
||||
if (x >= 2851995648 && x <= 2852061183) return 0 # 169.254.0.0/16 link local
|
||||
if (x >= 2886729728 && x <= 2887778303) return 0 # 172.16.0.0/12 private
|
||||
if (x >= 3221225472 && x <= 3221225727) return 0 # 192.0.0.0/24 IETF protocol assignments
|
||||
if (x >= 3221225984 && x <= 3221226239) return 0 # 192.0.2.0/24 documentation
|
||||
if (x >= 3232235520 && x <= 3232301055) return 0 # 192.168.0.0/16 private
|
||||
if (x >= 3323068416 && x <= 3323199487) return 0 # 198.18.0.0/15 benchmarking
|
||||
if (x >= 3325256704 && x <= 3325256959) return 0 # 198.51.100.0/24 documentation
|
||||
if (x >= 3405803776 && x <= 3405804031) return 0 # 203.0.113.0/24 documentation
|
||||
if (x >= 3758096384 && x <= 4294967295) return 0 # 224.0.0.0/3 multicast and reserved
|
||||
return 1
|
||||
}
|
||||
function v6global(a, x) {
|
||||
x = v6head32(a)
|
||||
if (x < 0) return 0
|
||||
if (x < 536870912 || x > 1073741823) return 0 # outside 2000::/3
|
||||
if (x >= 536939960 && x <= 536939960) return 0 # 2001:db8::/32 documentation
|
||||
return 1
|
||||
}
|
||||
{
|
||||
addr = $3; sub(/\/.*/, "", addr)
|
||||
if ($2 == "inet" && v4public(addr)) print "public", addr, $1
|
||||
else if ($2 == "inet6" && v6global(addr)) print "ipv6", addr, $1
|
||||
else if ($2 == "cloud" && v4public(addr)) print "cloud", addr
|
||||
}'
|
||||
}
|
||||
|
||||
reach_cloud_ipv4() { # a public IPv4 from AWS, Google Cloud or Azure metadata, or nothing
|
||||
command -v curl >/dev/null 2>&1 || return 0
|
||||
_md="${GPUK_CLOUD_METADATA_URL:-http://169.254.169.254}"
|
||||
curl -s -o /dev/null --connect-timeout 1 -m 1 "$_md/" 2>/dev/null || return 0
|
||||
_tok=$(curl -sf --connect-timeout 1 -m 1 -X PUT \
|
||||
-H 'X-aws-ec2-metadata-token-ttl-seconds: 60' "$_md/latest/api/token" 2>/dev/null) || _tok=""
|
||||
if [ -n "$_tok" ]; then
|
||||
_ip=$(curl -sf -m 1 -H "X-aws-ec2-metadata-token: $_tok" \
|
||||
"$_md/latest/meta-data/public-ipv4" 2>/dev/null) || _ip=""
|
||||
else
|
||||
_ip=$(curl -sf -m 1 "$_md/latest/meta-data/public-ipv4" 2>/dev/null) || _ip=""
|
||||
fi
|
||||
[ -n "$_ip" ] || _ip=$(curl -sf -m 1 -H 'Metadata-Flavor: Google' \
|
||||
"$_md/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" 2>/dev/null) || _ip=""
|
||||
[ -n "$_ip" ] || _ip=$(curl -sf -m 1 -H 'Metadata: true' \
|
||||
"$_md/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2021-02-01&format=text" 2>/dev/null) || _ip=""
|
||||
case "$_ip" in
|
||||
*[!0-9.]*|"") return 0 ;;
|
||||
esac
|
||||
printf '%s\n' "$_ip"
|
||||
}
|
||||
|
||||
reach_findings() {
|
||||
if command -v ip >/dev/null 2>&1; then
|
||||
ip -o addr show 2>/dev/null | awk '{ print $2, $3, $4 }' | reach_classify
|
||||
elif _reach_h=$(hostname -I 2>/dev/null); then
|
||||
for _a in $_reach_h; do
|
||||
case "$_a" in *:*) echo "- inet6 $_a" ;; *) echo "- inet $_a" ;; esac
|
||||
done | reach_classify
|
||||
else
|
||||
echo "unknown"
|
||||
fi
|
||||
_cloud=$(reach_cloud_ipv4)
|
||||
[ -z "$_cloud" ] || echo "- cloud $_cloud" | reach_classify
|
||||
}
|
||||
|
||||
# Why the Home lab profile is refused (INS-89), or nothing. $1 = reach_findings output.
|
||||
homelab_refusal_reason() {
|
||||
_why=$(printf '%s\n' "$1" | awk '
|
||||
$1 == "public" { print "This machine is reachable from the Internet: it has the public address " $2 " on " $3 "."; exit }
|
||||
$1 == "cloud" { print "This machine is reachable from the Internet: its cloud provider gives it the public address " $2 "."; exit }
|
||||
$1 == "unknown" { print "GPU Kitchen cannot read the addresses of this machine (no ip or hostname command), so it cannot tell whether the Internet reaches it."; exit }')
|
||||
[ -n "$_why" ] || return 0
|
||||
echo "$_why The Home lab profile lets anyone who reaches it in without signing in, so it is not allowed here. Use --profile small-team (control from this machine only), --profile managed-network (sign-in required) or --profile public (sign-in, behind a TLS reverse proxy)."
|
||||
}
|
||||
|
||||
# The first public IPv4 of this machine, for the controller ([INS-93]); nothing when none.
|
||||
# $1 = reach_findings output.
|
||||
public_ipv4_of() {
|
||||
printf '%s\n' "$1" | awk '$1 == "public" || $1 == "cloud" { print $2; exit }'
|
||||
}
|
||||
|
||||
# A global IPv6 address of this machine (INS-92): reported, never refused. $1 = findings.
|
||||
global_ipv6_note() {
|
||||
_v6=$(printf '%s\n' "$1" | awk '$1 == "ipv6" { print $2 " on " $3; exit }')
|
||||
[ -z "$_v6" ] || echo "This machine has the global IPv6 address $_v6. GPU Kitchen listens on IPv4 only, so the Internet does not reach it there."
|
||||
}
|
||||
# END GENERATED INTERNET REACHABILITY
|
||||
|
||||
# ── Internet reachability (INS-89, INS-90) ────────────────────────────────────
|
||||
# Home lab trusts the network. On a machine the Internet reaches, it is refused here,
|
||||
# before anything is downloaded, and the profile question does not offer it.
|
||||
HOMELAB_REFUSAL=""
|
||||
if [ "$PROFILE" = "homelab" ] || { [ -z "$PROFILE" ] && can_prompt; }; then
|
||||
HOMELAB_REFUSAL=$(homelab_refusal_reason "$(reach_findings)")
|
||||
fi
|
||||
[ "$PROFILE" != "homelab" ] || [ -z "$HOMELAB_REFUSAL" ] || die "$HOMELAB_REFUSAL"
|
||||
|
||||
# ── 2. Resolve the release ───────────────────────────────────────────────────
|
||||
step "Release — resolving the version to install"
|
||||
|
||||
@@ -886,10 +1097,23 @@ if [ -z "$PROFILE" ] && can_prompt; then
|
||||
already issued is revoked.
|
||||
|
||||
PROFILES
|
||||
# [INS-90] On a machine the Internet reaches, Home lab is not offered, and Enter
|
||||
# asks again instead of choosing it. A closed terminal stops with the reason.
|
||||
[ -z "$HOMELAB_REFUSAL" ] || printf ' %s\n\n' "Home lab is not available here. $HOMELAB_REFUSAL" > /dev/tty
|
||||
while :; do
|
||||
ask " Choose a profile [1-4, Enter = 1 (Home lab)]: "
|
||||
if [ -n "$HOMELAB_REFUSAL" ]; then
|
||||
ask " Choose a profile [2-4]: "
|
||||
[ "$ASK_EOF" -eq 0 ] || die "$HOMELAB_REFUSAL"
|
||||
else
|
||||
ask " Choose a profile [1-4, Enter = 1 (Home lab)]: "
|
||||
fi
|
||||
case "$REPLY" in
|
||||
""|1|homelab) PROFILE="homelab" ;;
|
||||
""|1|homelab)
|
||||
if [ -n "$HOMELAB_REFUSAL" ]; then
|
||||
printf '%s\n' " Home lab is not available here: pick 2, 3 or 4" > /dev/tty
|
||||
continue
|
||||
fi
|
||||
PROFILE="homelab" ;;
|
||||
2|small-team) PROFILE="small-team" ;;
|
||||
3|managed-network) PROFILE="managed-network" ;;
|
||||
4|public) PROFILE="public" ;;
|
||||
@@ -979,6 +1203,7 @@ set -- install \
|
||||
|
||||
[ -z "$PROFILE" ] || set -- "$@" --profile "$PROFILE"
|
||||
[ -z "$DOMAIN" ] || set -- "$@" --domain "$DOMAIN"
|
||||
[ "$NO_DOMAIN" -eq 0 ] || set -- "$@" --no-domain
|
||||
[ "$RESET_MANIFEST" -eq 0 ] || set -- "$@" --reset-manifest
|
||||
# Inherited from the manifest or given by flag; unset on a first install, so
|
||||
# gpuk's own default (bridge, INS-49) applies and this script never restates it.
|
||||
@@ -986,7 +1211,12 @@ set -- install \
|
||||
|
||||
if [ -n "$WORKER_BINARY" ]; then
|
||||
[ -f "$WORKER_BINARY" ] || die "no such worker binary: $WORKER_BINARY"
|
||||
set -- "$@" --binary "$WORKER_BINARY"
|
||||
cp "$WORKER_BINARY" "$TMP/gpu-kitchen-worker"
|
||||
chmod +x "$TMP/gpu-kitchen-worker"
|
||||
_candidate_status=0
|
||||
GPUK_MANIFEST_PATH="$MANIFEST" "$TMP/gpu-kitchen-worker" check-release || _candidate_status=$?
|
||||
[ "$_candidate_status" -eq 0 ] || installer_failure "$_candidate_status" "this worker release cannot be installed; use the current release"
|
||||
set -- "$@" --binary "$TMP/gpu-kitchen-worker"
|
||||
ok "using a locally-built gpu-kitchen-worker"
|
||||
elif [ -n "${WORKER_RELEASE_BASE:-}" ]; then
|
||||
# The privileged daemon: downloaded here, its minisign signature checked
|
||||
@@ -1027,6 +1257,10 @@ elif [ -n "${WORKER_RELEASE_BASE:-}" ]; then
|
||||
fi
|
||||
ok "gpu-kitchen-worker signature verified (build $_build)"
|
||||
fi
|
||||
chmod +x "$TMP/gpu-kitchen-worker"
|
||||
_candidate_status=0
|
||||
GPUK_MANIFEST_PATH="$MANIFEST" "$TMP/gpu-kitchen-worker" check-release || _candidate_status=$?
|
||||
[ "$_candidate_status" -eq 0 ] || installer_failure "$_candidate_status" "this worker release cannot be installed; use the current release"
|
||||
set -- "$@" --binary "$TMP/gpu-kitchen-worker"
|
||||
fi
|
||||
# else: gpuk reuses an already-installed binary, or fails with its own message.
|
||||
@@ -1036,7 +1270,9 @@ step "Installing — this pulls the image, so it can take a few minutes"
|
||||
# failed apply, a missing binary…), so the cause is the line right above this
|
||||
# one. journalctl only has something to say once the daemon has started, and
|
||||
# gpuk points at `gpuk logs` itself in that case.
|
||||
sh "$GPUK_SCRIPT" "$@" || die "the install failed — gpuk reported the cause just above"
|
||||
_install_status=0
|
||||
sh "$GPUK_SCRIPT" "$@" || _install_status=$?
|
||||
[ "$_install_status" -eq 0 ] || installer_failure "$_install_status" "the install failed — gpuk reported the cause just above"
|
||||
|
||||
# ── 5. Wait for the app, then say where it is ────────────────────────────────
|
||||
step "Waiting for the controller to answer"
|
||||
@@ -1072,8 +1308,20 @@ case "$PROFILE" in
|
||||
[ -z "$CLAIM_KEY" ] || CLAIM_SUFFIX="/start?key=${CLAIM_KEY}"
|
||||
;;
|
||||
esac
|
||||
echo " ${BOLD}Open:${RESET} http://${HOSTNAME_FQDN}:${PORT}${CLAIM_SUFFIX}"
|
||||
[ -n "$LAN_IP" ] && echo " http://${LAN_IP}:${PORT}${CLAIM_SUFFIX}"
|
||||
if [ "$PROFILE" = "public" ]; then
|
||||
# [INS-83] The plain-HTTP UI port answers on this machine's loopback only: the
|
||||
# way in is the TLS front, or an SSH tunnel until it serves.
|
||||
if [ -n "$DOMAIN" ]; then
|
||||
echo " ${BOLD}Open:${RESET} https://${DOMAIN}${CLAIM_SUFFIX} (once the HTTPS steps below are done)"
|
||||
else
|
||||
echo " ${BOLD}Open:${RESET} https://<your-domain>${CLAIM_SUFFIX} (once your TLS reverse proxy serves it)"
|
||||
fi
|
||||
echo " Before that, from your computer: ssh -L ${PORT}:127.0.0.1:${PORT} <this server>"
|
||||
echo " then http://localhost:${PORT}${CLAIM_SUFFIX}"
|
||||
else
|
||||
echo " ${BOLD}Open:${RESET} http://${HOSTNAME_FQDN}:${PORT}${CLAIM_SUFFIX}"
|
||||
[ -n "$LAN_IP" ] && echo " http://${LAN_IP}:${PORT}${CLAIM_SUFFIX}"
|
||||
fi
|
||||
echo
|
||||
case "$PROFILE" in
|
||||
homelab|small-team)
|
||||
@@ -1108,10 +1356,10 @@ case "$PROFILE" in
|
||||
echo " 3. sudo cp $DATA_ROOT/caddy/Caddyfile /etc/caddy/Caddyfile"
|
||||
echo " sudo systemctl reload caddy"
|
||||
echo " A filled example was written to $DATA_ROOT/caddy/Caddyfile."
|
||||
echo " Until then the UI answers in cleartext on the URLs above."
|
||||
else
|
||||
echo " ${BOLD}HTTPS:${RESET} the public profile requires a TLS reverse proxy before any"
|
||||
echo " public exposure. See deployments/controller/Caddyfile.example."
|
||||
echo " ${BOLD}HTTPS:${RESET} put a TLS reverse proxy on this machine in front of"
|
||||
echo " http://127.0.0.1:${PORT}, and send /v1 to the inference API on the"
|
||||
echo " Docker bridge address, port ${INFERENCE_PORT}. See deployments/controller/Caddyfile.example."
|
||||
fi
|
||||
echo
|
||||
;;
|
||||
@@ -1134,7 +1382,13 @@ if [ -n "$DOMAIN" ] && [ "$PROFILE" != "public" ]; then
|
||||
echo " Caddy example was written to $DATA_ROOT/caddy/Caddyfile."
|
||||
echo
|
||||
fi
|
||||
echo " Inference endpoint : http://${HOSTNAME_FQDN}:${INFERENCE_PORT}/v1"
|
||||
# [INS-87] Under public the proxy answers on this machine only (the Docker bridge): tools
|
||||
# outside reach it through the TLS front, which routes /v1 to it.
|
||||
if [ "$PROFILE" = "public" ]; then
|
||||
echo " Inference endpoint : https://${DOMAIN:-<your-domain>}/v1 (through the HTTPS front)"
|
||||
else
|
||||
echo " Inference endpoint : http://${HOSTNAME_FQDN}:${INFERENCE_PORT}/v1"
|
||||
fi
|
||||
echo " Version : ${VERSION}"
|
||||
echo
|
||||
|
||||
@@ -1161,7 +1415,7 @@ if [ -n "$EXISTING_CACHE" ]; then
|
||||
echo " place. Nothing is moved or deleted."
|
||||
echo
|
||||
fi
|
||||
echo " Update : re-run this command, or press Update in the UI, or: gpuk update"
|
||||
echo " Update : automatic, once a day in the slot set in Settings > Updates; now: gpuk update"
|
||||
echo " Status : gpuk status Logs: gpuk logs"
|
||||
echo " Remove : gpuk uninstall (service only) or gpuk uninstall --purge (all but the data root)"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user