32 lines
840 B
Bash
32 lines
840 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# Operator smoke for cloud adapters — requires provider credentials.
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
PROVIDER="${1:-e2b}"
|
||
|
|
case "$PROVIDER" in
|
||
|
|
e2b)
|
||
|
|
PROFILE="profile.e2b-burst"
|
||
|
|
if [[ -z "${E2B_API_KEY:-}" ]]; then
|
||
|
|
echo "E2B_API_KEY not set — skipping live smoke" >&2
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
;;
|
||
|
|
modal)
|
||
|
|
PROFILE="profile.modal-gpu"
|
||
|
|
if [[ -z "${MODAL_TOKEN_ID:-}" ]]; then
|
||
|
|
echo "MODAL_TOKEN_ID not set — skipping live smoke" >&2
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
;;
|
||
|
|
*)
|
||
|
|
echo "Usage: $0 [e2b|modal]" >&2
|
||
|
|
exit 1
|
||
|
|
;;
|
||
|
|
esac
|
||
|
|
|
||
|
|
echo "Smoke: sandboxer create --profile $PROFILE"
|
||
|
|
STATUS=$(sandboxer create --profile "$PROFILE" --project sand-boxer)
|
||
|
|
ID=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin)['sandbox_id'])")
|
||
|
|
echo "Created: $ID"
|
||
|
|
sandboxer destroy "$ID"
|
||
|
|
echo "Destroyed: $ID"
|