mirror of
https://github.com/andrewyng/openworker.git
synced 2026-11-20 20:37:44 +00:00
Allow developers to easily build AI apps without worrying about the harness part. Bundles the Rust agent runtime as a SDK (Rust and TypeScript) for building desktop and web applications. Applications can manage a local harness or connect to an authenticated harness service on k8s with separately scaled workers and sandbox execution. The implementation is primarily contained in harness/, with deployment tooling in deploy/, Markdown guides in docs/harness/guides/, and the static documentation site in docs-site/. It does not replace the existing Python harness or migrate OpenWorker Desktop. Co-authored-by: Devika Verma <devikaverma11@gmail.com>
17 lines
638 B
JavaScript
17 lines
638 B
JavaScript
// Read-only, bounded ingress-stop observation. An empty initial list is success;
|
|
// an unavailable Kubernetes API is not proof that the pods disappeared.
|
|
export async function waitForEmptyPods(
|
|
list,
|
|
{ timeoutMs = 120000, intervalMs = 250 } = {},
|
|
) {
|
|
const until = Date.now() + timeoutMs;
|
|
while (true) {
|
|
const result = await list();
|
|
if (!Array.isArray(result.items)) throw Error("Invalid pod-list response");
|
|
if (result.items.length === 0) return;
|
|
if (Date.now() >= until)
|
|
throw Error("Ingress pods did not disappear before cleanup deadline");
|
|
await new Promise((r) => setTimeout(r, intervalMs));
|
|
}
|
|
}
|