rein-aharness/deploy/scripts/install-claim-loop-user.sh
tegwick 94a15d67aa feat: k8s:// ClusterIP claim env + complete payload target_repo
Resolve llm-connect / actcore-api / edge-relay without port-forward.
Include target_repo on FI and Binky complete payloads for ops UI artefacts.
2026-08-05 17:23:03 +02:00

36 lines
1.6 KiB
Bash
Executable file

#!/usr/bin/env bash
# Install rein-aharness claim-loop as a user systemd service (railiance01).
# Run from a rein-aharness checkout ON the host:
# ./deploy/scripts/install-claim-loop-user.sh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
UNIT_DIR="${HOME}/.config/systemd/user"
ENV_DIR="${HOME}/.config/rein-aharness"
BIN_DIR="${HOME}/bin"
mkdir -p "${UNIT_DIR}" "${ENV_DIR}" "${BIN_DIR}"
cp -f "${ROOT}/deploy/systemd/rein-aharness-claim-loop.service" "${UNIT_DIR}/"
# Durable env loader + k8s:// ClusterIP resolution (no port-forward)
install -m 755 "${ROOT}/deploy/scripts/rein-aharness-claim" "${BIN_DIR}/rein-aharness-claim"
if [[ ! -f "${ENV_DIR}/claim-loop.env" ]]; then
cp "${ROOT}/deploy/systemd/claim-loop.env.example" "${ENV_DIR}/claim-loop.env"
chmod 600 "${ENV_DIR}/claim-loop.env"
echo "Created ${ENV_DIR}/claim-loop.env — set ACTIVITY_CORE_WORKER_TOKEN and REPO_MAP paths."
else
echo "Keeping existing ${ENV_DIR}/claim-loop.env"
echo " Tip: migrate URLs with ${ROOT}/deploy/scripts/refresh-claim-loop-k8s-urls.sh"
fi
# Ensure package entrypoint exists
if [[ ! -x "${ROOT}/.venv/bin/rein-aharness" ]]; then
echo "warning: ${ROOT}/.venv/bin/rein-aharness missing; install with: cd ${ROOT} && uv sync"
fi
systemctl --user daemon-reload
systemctl --user enable rein-aharness-claim-loop.service
echo "Enabled. Start when env is filled:"
echo " systemctl --user start rein-aharness-claim-loop.service"
echo " journalctl --user -u rein-aharness-claim-loop -f"
echo "llm-connect / actcore-api: use k8s:// URLs (see activity-core docs/llm-connect-host-access.md)."
echo "Do not rely on kubectl port-forward for production claim-loop."