Files
ThothII/scripts/test-pi-user-auth-compose.sh
T

37 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT HUP INT TERM
auth_file="$tmp/auth.json"
printf '%s\n' '{}' >"$auth_file"
chmod 0600 "$auth_file"
rendered=$(THT_WORKSPACE_GIT_REMOTE=https://git.example.invalid/platform/thoth-workspaces.git \
PI_AUTH_FILE="$auth_file" docker compose config)
printf '%s\n' "$rendered" | grep -q "source: $auth_file"
printf '%s\n' "$rendered" | grep -q 'target: /home/thoth/.pi/agent/auth.json'
printf '%s\n' "$rendered" | grep -A4 'target: /home/thoth/.pi/agent/auth.json' \
| grep -q 'read_only: true'
python3 - <<'PY'
import json
from pathlib import Path
settings = json.loads(Path("deploy/pi/settings.json").read_text())
assert settings["enabledModels"] == [
"zai/glm-5.2",
"deepseek/deepseek-v4-flash",
"deepseek/deepseek-v4-pro",
"aritmolab/qwen3.6-35b-a3b",
]
PY
grep -q '^ARG PI_VERSION=0.80.3$' docker/core.Dockerfile
grep -q '^PI_AUTH_FILE=/absolute/path/to/pi-auth.json$' deploy/env/local.env.example
grep -q '^PI_AUTH_FILE=/absolute/path/to/pi-auth.json$' deploy/env/server.env.example
echo "Pi user-auth Compose contract passed."