Harden workstation tier handling

This commit is contained in:
Jino Jose committed 2026-07-08 15:21:05 +05:30
1 parent 10b66569b6
commit 9a1d52230d
3 files changed
+33 -12

No files matched your search

+14 -3
View File
@@ -22,6 +22,8 @@ elif [ -f /opt/aipackage/autoinstall/.tier ]; then
else
TIER="basic" # default if no marker found
fi
DISPLAY_TIER="$TIER"
PRODUCT_CATEGORY="server"
PHASE="1"
SKIP_ROLES=""
SOFTWARE_ONLY=false
@@ -55,11 +57,19 @@ done
normalize_tier() {
case "$TIER" in
workstation)
DISPLAY_TIER="workstation"
PRODUCT_CATEGORY="workstation"
TIER="starter"
;;
entry|basic) TIER="basic" ;;
mid|pro) TIER="pro" ;;
advanced|max) TIER="max" ;;
starter) TIER="starter" ;;
esac
if [ "$PRODUCT_CATEGORY" = "server" ]; then
DISPLAY_TIER="$TIER"
fi
}
normalize_tier
@@ -191,7 +201,7 @@ PY
}
write_install_record() {
python3 - "$INSTALL_RECORD_JSON" "$TIER" "$PROFILE" "$SKIP_ROLES" "$GPU_AVAILABLE" "$FEASIBILITY_JSON" "$LICENSE_EVAL_JSON" <<'PY'
python3 - "$INSTALL_RECORD_JSON" "$TIER" "$PROFILE" "$SKIP_ROLES" "$GPU_AVAILABLE" "$FEASIBILITY_JSON" "$LICENSE_EVAL_JSON" "$DISPLAY_TIER" "$PRODUCT_CATEGORY" <<'PY'
import json, sys
from datetime import datetime, timezone
from pathlib import Path
@@ -226,8 +236,9 @@ components = {
payload = {
"schema": "cezen.install_record.v1",
"generated_at": datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z"),
"selected_tier": tier,
"selected_tier": sys.argv[8],
"provisioned_tier": tier,
"category": sys.argv[9],
"provisioned_profile": profile,
"skip_roles": skip_roles,
"components": components,
@@ -413,7 +424,7 @@ run_phase2() {
echo ""
echo "╔══════════════════════════════════════════╗"
echo "║ Nexus One AI installation complete! ║"
echo "║ Tier: $(printf '%-33s' "$TIER")║"
echo "║ Tier: $(printf '%-33s' "$DISPLAY_TIER")║"
echo "║ ║"
echo "║ Portal → http://localhost ║"
echo "║ Ollama API → http://localhost:11434 ║"