From 0c28231c3bf8f1db710de826f21ddd666b440c4f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 Mar 2026 11:37:03 +0000 Subject: [PATCH] chore(script): add run-registry-tests --- docs/devops/single_azure_vm/docker/README.md | 1 + scripts/run-registry-tests.sh | 38 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 scripts/run-registry-tests.sh diff --git a/docs/devops/single_azure_vm/docker/README.md b/docs/devops/single_azure_vm/docker/README.md index 332f9deb..64c20e0c 100644 --- a/docs/devops/single_azure_vm/docker/README.md +++ b/docs/devops/single_azure_vm/docker/README.md @@ -320,6 +320,7 @@ All optional — defaults work for most setups: - Keep backend ports closed publicly once DNS and NSG rules are aligned. Docker-internal service discovery remains unchanged. - `ollama.bytelyst.com` reverse proxies to the host Ollama listener on `172.17.0.1:11434`; keep it restricted to trusted cross-VM or internal clients. - **Network guard:** run `source scripts/switch-network.sh` and honor `NETWORK=corp|home` before running pnpm/npm or hitting gitea/api endpoints so proxy settings flip to the correct environment. +- **Quick check:** use `scripts/run-registry-tests.sh` to install, test, and verify `https://api.bytelyst.com`, `https://gitea.bytelyst.com`, and `https://ollama.bytelyst.com`. ## Known Limitations diff --git a/scripts/run-registry-tests.sh b/scripts/run-registry-tests.sh new file mode 100755 index 00000000..ea34739c --- /dev/null +++ b/scripts/run-registry-tests.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -euo pipefail + +readonly BASEDIR="/opt/bytelyst/learning_ai_common_plat" +readonly TOKEN_FILE="${GITEA_NPM_TOKEN_FILE:-$HOME/.gitea_npm_token}" + +if [[ -z "${GITEA_NPM_TOKEN:-}" ]]; then + if [[ -f "$TOKEN_FILE" ]]; then + export GITEA_NPM_TOKEN + GITEA_NPM_TOKEN="$(<"$TOKEN_FILE")" + else + echo "Need GITEA_NPM_TOKEN (file $TOKEN_FILE or env)." + exit 1 + fi +fi + +source "$BASEDIR/scripts/switch-network.sh" >/dev/null +export NETWORK="${NETWORK:-home}" + +cd "$BASEDIR" +corepack pnpm install +corepack pnpm test + +echo "Verifying HTTP responses..." +for url in \ + https://api.bytelyst.com/platform/health \ + https://gitea.bytelyst.com/api/packages/ByteLyst/npm/ \ + https://ollama.bytelyst.com/api/version \ +; do + if curl -sSfI "$url" >/tmp/last-curl.out; then + status=$(head -n1 /tmp/last-curl.out) + echo "$url -> $status" + else + echo "$url -> failed, see /tmp/last-curl.out" + fi +done + +echo "Done. pnpm install/test + endpoint verification complete."