yams/scripts/dev/run_s3_plugin_smoke.sh
Trevon 72647bbaf7
chore: stabilize CI, faiss, metadata, docker, and simeon (#25)
- CI warm: ccache dep, continue-on-error, 60min timeout, YAMS_DISABLE_FAISS
- Faiss: YAMS_HAS_FAISS guard, Apple Clang disable, OpenMP detection
- Metadata: retry constraint failures, deduplicate batch UPSERT entries
- Docker: wget for Zig, gfortran, YAMS_DISABLE_FAISS=1
- CI config: free-disk-space v1.3.1, libomp-18-dev, experimental trigger
- Weekly benchmarks: faiss disable, ccache, diagnostics capture
- Simeon: bump to 7763a97, EntropyRouter, concept_count
- CorpusStats: extraction readiness fields
- Remove committed artifacts (.wrangler, .artifacts, dispatcher_external)
- Fix .vscode/settings.json hardcoded path

Signed-off-by: trvon <git@trevon.dev>
2026-05-07 21:07:59 -04:00

58 lines
1.8 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
builddir="${1:-builddir}"
smoke_exe="${builddir}/tests/plugins/yams_s3_plugin_smoke"
required=(
"YAMS_RUN_LIVE_S3_SMOKE"
"S3_TEST_BUCKET"
"AWS_ACCESS_KEY_ID"
"AWS_SECRET_ACCESS_KEY"
)
missing=()
for var in "${required[@]}"; do
if [[ -z "${!var:-}" ]]; then
missing+=("${var}")
fi
done
if [[ ${#missing[@]} -gt 0 ]]; then
echo "Missing required environment variables: ${missing[*]}" >&2
echo "Required: YAMS_RUN_LIVE_S3_SMOKE=1, S3_TEST_BUCKET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY" >&2
echo "Recommended for R2: AWS_REGION=auto, S3_TEST_ENDPOINT=<accountid>.r2.cloudflarestorage.com" >&2
exit 2
fi
if [[ "${YAMS_RUN_LIVE_S3_SMOKE}" != "1" ]]; then
echo "YAMS_RUN_LIVE_S3_SMOKE must be set to 1 to run the live S3/R2 smoke test." >&2
exit 2
fi
if [[ ${#AWS_ACCESS_KEY_ID} -ne 32 || "${AWS_ACCESS_KEY_ID}" == *-* ]]; then
echo "AWS_ACCESS_KEY_ID does not look like an R2 S3 access key (expected 32 chars)." >&2
echo "Tip: use R2 S3 API credentials, not a Cloudflare API bearer token." >&2
exit 2
fi
if [[ ${#AWS_SECRET_ACCESS_KEY} -lt 40 ]]; then
echo "AWS_SECRET_ACCESS_KEY looks too short for S3-compatible credentials." >&2
echo "Tip: use the paired R2 S3 Secret Access Key from 'Manage R2 API tokens'." >&2
exit 2
fi
export AWS_REGION="${AWS_REGION:-auto}"
export S3_TEST_USE_PATH_STYLE="${S3_TEST_USE_PATH_STYLE:-0}"
if [[ -x "${smoke_exe}" && -f "${builddir}/build.ninja" ]]; then
meson test -C "${builddir}" s3_plugin_smoke --print-errorlogs --verbose --no-rebuild
else
if [[ ! -d "${builddir}" ]]; then
meson setup "${builddir}"
fi
meson setup "${builddir}" --reconfigure
meson compile -C "${builddir}" yams_object_storage_s3 yams_s3_plugin_smoke
meson test -C "${builddir}" s3_plugin_smoke --print-errorlogs --verbose
fi