mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
Phase 6 of the relay split: the relay's deploy/operate surface moves under cloud/ with 24 cloud-* workflows gated on ORCA_CLOUD_OPERATIONS_ENABLED, the Cloud SQL rollout lease action, the relay Terraform root (dual-accept identities for both repositories), scripts, docs, CODEOWNERS, and a terraform validate job in Cloud Verify.
30 lines
869 B
JavaScript
30 lines
869 B
JavaScript
export async function proveRelayLoadPlacementBoundary({ peer, failureReason }) {
|
|
let connected = false
|
|
try {
|
|
await peer.connect()
|
|
connected = true
|
|
} catch (error) {
|
|
const reason = failureReason(error)
|
|
if (reason !== 'assignment_capacity_exhausted') {
|
|
throw new Error(`placement overflow was not rejected: ${reason}`)
|
|
}
|
|
return reason
|
|
} finally {
|
|
await peer.shutdown()
|
|
}
|
|
if (connected) throw new Error('placement overflow unexpectedly connected')
|
|
}
|
|
|
|
export async function proveRelayLoadRegionalFallback({ peer, blockedOrigin }) {
|
|
try {
|
|
await peer.connect()
|
|
const assignedOrigin = peer.assignedCellUrl()
|
|
if (!assignedOrigin || assignedOrigin === blockedOrigin) {
|
|
throw new Error('regional fallback did not leave the full preferred cell')
|
|
}
|
|
return true
|
|
} finally {
|
|
await peer.shutdown()
|
|
}
|
|
}
|