feat(deploy,xceadmin): standalone xceadmin packaging + deploy-ha usability (bug-1566)

Three related enhancements to make /xce-deploy-ha's output a
self-contained, directly-usable cluster for manual testing:

- xceadmin now builds an installable wheel (meson-build.sh) with
  correct dependencies (click/pycapnp/PyYAML/jsonschema, verified
  against actual imports -- pyproject.toml was missing several).
- deploy-ha.sh resolves the deploy environment's own bash
  ($BASH_BIN, baked into every generated script's shebang -- this
  environment's deploy-ha.sh had drifted to #!/bin/sh while still
  using bash-only syntax) and generates scripts/start-worker.sh /
  scripts/start-scheduler.sh sharing the controllers' --peers, plus
  a standalone xceadmin install (wheel extracted directly, resolved
  $PYTHONPATH baked into a wrapper script -- nix devShell packages
  are $PYTHONPATH entries, not merged into python3's own
  site-packages, so a --system-site-packages venv can't see them).
- bug-1566: xceadmin's --controller option had no relationship to a
  deployment's actual peers (hardcoded localhost:9991 default) --
  every command required an explicit --controller or silently tried
  the wrong port. Fixed via a $XCEADMIN_CONTROLLER envvar fallback
  (click precedence: explicit flag > envvar > bare default),
  exported by deploy-ha.sh's generated scripts/xceadmin wrapper.

Fixed/validated via TDD + live reproduction against a real deployed
cluster in a fully stripped environment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-08-17 10:20:52 +00:00
parent 1c943e98fe
commit 0f1df4998e
Signed by: rshen
SSH key fingerprint: SHA256:8Vf2pZ3h6rJa7EhGK+WaAQ9Mta/apZvteW6g9U/WKKk
5 changed files with 266 additions and 12 deletions

View file

@ -60,5 +60,22 @@ rm -rf "$VENV_DIR"
echo "=== xceadmin (meson): running tests ==="
"$VENV_DIR/bin/python" -m pytest "$WORK_DIR/tests" -v
# Build an installable wheel from the SAME schema-synced $WORK_DIR the pinned
# install above just tested -- not a second, separately-assembled tree --
# so the wheel is guaranteed to carry the identical schema_files/ package
# data (Requirement 5.5) the just-passed test run actually exercised. Only
# reached after `set -e` has let the test run above succeed, so a wheel is
# never produced (or left stale) from a red test run. --no-deps: this is
# xceadmin's own wheel only, not a vendored bundle of click/pycapnp/etc --
# installing it still needs those from PyPI or (preferably) the nix shell,
# same as the pinned install just above.
DIST_DIR="$BUILD_DIR/dist"
echo "=== xceadmin (meson): building installable wheel ==="
rm -rf "$DIST_DIR"
mkdir -p "$DIST_DIR"
"$VENV_DIR/bin/pip" wheel "$WORK_DIR" --no-deps -w "$DIST_DIR" --quiet
WHEEL_FILE=$(ls "$DIST_DIR"/xceadmin-*.whl)
echo "=== xceadmin (meson): wheel built at $WHEEL_FILE ==="
touch "$STAMP_FILE"
echo "=== xceadmin (meson): done ==="