deepline 0.3.562 → 0.3.563
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +50 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +44 -1
- package/dist/cli/{auth-OFHWBJ2W.mjs → auth-3YES4ACM.mjs} +5 -5
- package/dist/cli/auth-UC22BJN2.js +44 -0
- package/dist/cli/{billing-BORJ3ZHJ.js → billing-L2GDKBXK.js} +99 -99
- package/dist/cli/{billing-PPOC7TAY.mjs → billing-NZ2NCOQS.mjs} +8 -8
- package/dist/cli/{chunk-3OJLUVOS.mjs → chunk-2MAP42AM.mjs} +1 -1
- package/dist/cli/{chunk-YT4WIYFT.js → chunk-2UW5A57I.js} +9 -9
- package/dist/cli/{chunk-7IHSJ3RD.js → chunk-4KHRPJOW.js} +53 -53
- package/dist/cli/{chunk-3BV2OD25.js → chunk-4MPLA5RD.js} +48 -48
- package/dist/cli/{chunk-KJDS2X5S.mjs → chunk-6LPMQPSQ.mjs} +2 -2
- package/dist/cli/{chunk-SQFWIUNP.mjs → chunk-6U7CIG3C.mjs} +4 -4
- package/dist/cli/{chunk-7DRCIDPW.mjs → chunk-6UHRBEDV.mjs} +3 -3
- package/dist/cli/{chunk-WFVL6A7I.mjs → chunk-AYNDNXBJ.mjs} +1 -1
- package/dist/cli/{chunk-5YQVEV7I.mjs → chunk-BP2XRVBA.mjs} +5 -5
- package/dist/cli/{chunk-UVZQR7I6.js → chunk-CH7OVBBJ.js} +5 -5
- package/dist/cli/{chunk-EVZDU7CF.js → chunk-DA24O3ZV.js} +3 -3
- package/dist/cli/{chunk-AAIYXQRJ.mjs → chunk-DFCBNTVQ.mjs} +2 -2
- package/dist/cli/{chunk-YX47WHVT.js → chunk-DVWFK676.js} +6 -6
- package/dist/cli/{chunk-R5PPP3JU.js → chunk-ERT4ZMZT.js} +5 -5
- package/dist/cli/{chunk-GH5R65SB.js → chunk-FCRBXLIJ.js} +12 -12
- package/dist/cli/{chunk-LJXFCEP2.js → chunk-G5CY6KI2.js} +41 -41
- package/dist/cli/{chunk-RKB536LB.mjs → chunk-GVRVZQBY.mjs} +2 -2
- package/dist/cli/{chunk-LK4LR4K7.mjs → chunk-H2N324LF.mjs} +3 -3
- package/dist/cli/{chunk-AASSDBQ3.js → chunk-H3UIWEXF.js} +2 -2
- package/dist/cli/{chunk-J7XEUV5W.mjs → chunk-HST5XA3B.mjs} +2 -2
- package/dist/cli/{chunk-GAN6UYEN.js → chunk-IICHFEFE.js} +5 -5
- package/dist/cli/{chunk-5VXK34DQ.mjs → chunk-JVXHVEWX.mjs} +5 -5
- package/dist/cli/{chunk-ZQLEEOZR.mjs → chunk-K5FNC4VL.mjs} +2 -2
- package/dist/cli/{chunk-QWB4VW4T.js → chunk-K77ANXGU.js} +13 -13
- package/dist/cli/{chunk-EHUUHKWY.mjs → chunk-L5O7MWRZ.mjs} +5 -5
- package/dist/cli/{chunk-UC2ATYB3.mjs → chunk-L5QJRMFJ.mjs} +2 -2
- package/dist/cli/{chunk-RFB52LP5.js → chunk-LIO7CPM3.js} +8 -8
- package/dist/cli/{chunk-CIEMDAJE.js → chunk-MGOCWY7J.js} +100 -100
- package/dist/cli/{chunk-UZ4ELBHM.mjs → chunk-NCGDBNNF.mjs} +2 -2
- package/dist/cli/{chunk-IQJQB7J6.js → chunk-NS56OQUQ.js} +1 -1
- package/dist/cli/{chunk-4O47WP3B.js → chunk-NTRTFEI4.js} +26 -26
- package/dist/cli/{chunk-GAMCJW6E.mjs → chunk-O3NLECXL.mjs} +1 -1
- package/dist/cli/{chunk-P6XJRHLF.js → chunk-OZC6SSOB.js} +7 -7
- package/dist/cli/{chunk-USA6QRDO.mjs → chunk-POGS26GF.mjs} +1 -1
- package/dist/cli/{chunk-RYWWBTDB.js → chunk-QGIHGITM.js} +3 -3
- package/dist/cli/{chunk-Z2FC6UQQ.js → chunk-QGNITJYC.js} +15 -15
- package/dist/cli/{chunk-PDHLHEUL.js → chunk-QOLFZD6Q.js} +2 -2
- package/dist/cli/{chunk-GWJ4EOW2.mjs → chunk-RP2LCS7G.mjs} +11 -11
- package/dist/cli/{chunk-6BGEW3KU.js → chunk-SJ2LY4V5.js} +20 -20
- package/dist/cli/{chunk-5COJEZSB.js → chunk-T2RNEBV7.js} +4 -4
- package/dist/cli/{chunk-YB6N6WKX.js → chunk-TX5PQ7KP.js} +10 -10
- package/dist/cli/{chunk-J5P7VGV5.js → chunk-U77PK5R3.js} +20 -20
- package/dist/cli/{chunk-XHZFA67G.mjs → chunk-UMJWODG7.mjs} +1 -1
- package/dist/cli/{chunk-5KMZR36E.mjs → chunk-UUEVGLGO.mjs} +1 -1
- package/dist/cli/{chunk-5NGS4RLF.js → chunk-V4KKZGLT.js} +23 -23
- package/dist/cli/{chunk-7HFWEQ6Y.js → chunk-VYY6HNOC.js} +2 -2
- package/dist/cli/{chunk-L4KUAJFR.mjs → chunk-XDZZCRUG.mjs} +1 -1
- package/dist/cli/{chunk-YAXYFPBF.mjs → chunk-XTSQ3ZV5.mjs} +2 -2
- package/dist/cli/{chunk-5XS5BTMC.mjs → chunk-XWGWVLQQ.mjs} +4 -4
- package/dist/cli/{chunk-QC3NTBF7.mjs → chunk-XY5DE4TK.mjs} +5 -5
- package/dist/cli/{chunk-LXL7OZOG.mjs → chunk-YDXFVE4V.mjs} +1 -1
- package/dist/cli/{chunk-WDKU7NOR.mjs → chunk-ZX3UZCWC.mjs} +1 -1
- package/dist/cli/concurrent-runs-help-NMNGH7QN.js +22 -0
- package/dist/cli/{concurrent-runs-help-IRM4PNIE.mjs → concurrent-runs-help-VEZX3RK4.mjs} +6 -6
- package/dist/cli/{csv-6T4CONXY.mjs → csv-RJBNLD23.mjs} +4 -4
- package/dist/cli/{csv-UEFHJV5P.js → csv-W5C4JCYL.js} +13 -13
- package/dist/cli/{db-PNDYQRRC.js → db-GYCRUH4V.js} +27 -27
- package/dist/cli/{db-P6SN3JUE.mjs → db-VVGP2KCM.mjs} +6 -6
- package/dist/cli/describe-HJ564FPP.js +50 -0
- package/dist/cli/{describe-U2ZIQ4JH.mjs → describe-HZW272Y6.mjs} +18 -18
- package/dist/cli/{executions-7AOZES2Z.js → executions-D37NX6CD.js} +8 -8
- package/dist/cli/{executions-WELIUVIV.mjs → executions-N4ZA4ZD5.mjs} +6 -6
- package/dist/cli/{feedback-66WWUWIR.mjs → feedback-4PB4ACBV.mjs} +6 -6
- package/dist/cli/{feedback-XTTK5GLD.js → feedback-W6CY6UBA.js} +14 -14
- package/dist/cli/git-LMRN2YR5.js +26 -0
- package/dist/cli/{git-S23WMQAB.mjs → git-WHIEYIVM.mjs} +5 -5
- package/dist/cli/index.js +143 -143
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-DEHG2ILN.mjs → integrations-ASNRHKLO.mjs} +7 -7
- package/dist/cli/{integrations-MPKN5JRT.js → integrations-HXY5DR6D.js} +20 -20
- package/dist/cli/{legacy-noops-IKVIOTDJ.js → legacy-noops-PJNDUOWG.js} +9 -9
- package/dist/cli/{legacy-noops-7TU2COQH.mjs → legacy-noops-YYX2W2WX.mjs} +6 -6
- package/dist/cli/{mcp-5ZFZKBX2.js → mcp-APKPI24N.js} +24 -24
- package/dist/cli/{mcp-BGUKF2AA.mjs → mcp-T32DPP4D.mjs} +4 -4
- package/dist/cli/{monitors-EUSWYOUL.js → monitors-BY4DJFCF.js} +100 -100
- package/dist/cli/{monitors-2QZUTM7K.mjs → monitors-DTJD3IUI.mjs} +7 -7
- package/dist/cli/{org-W4S2QIOX.js → org-2GMHKAQK.js} +121 -121
- package/dist/cli/{org-FDA5EGQC.mjs → org-GQYIJBKO.mjs} +6 -6
- package/dist/cli/{outcomes-KZ7SM5TM.mjs → outcomes-3ASEQLIF.mjs} +6 -6
- package/dist/cli/{outcomes-WF34PZAX.js → outcomes-4XY4F57P.js} +14 -14
- package/dist/cli/{play-XYJBKWRX.js → play-2LDJMIG2.js} +324 -324
- package/dist/cli/{play-XHHJYBBZ.mjs → play-EX7PB6CI.mjs} +19 -19
- package/dist/cli/{providers-WHPZMDA6.mjs → providers-GAERKWYW.mjs} +6 -6
- package/dist/cli/{providers-SCT2LUCO.js → providers-IDIFP5PU.js} +9 -9
- package/dist/cli/{quickstart-IXLB34QZ.js → quickstart-7NL5YAJF.js} +6 -6
- package/dist/cli/{quickstart-L45XFREM.mjs → quickstart-E2GCIGR4.mjs} +4 -4
- package/dist/cli/{run-SAWTV6NP.mjs → run-2EPOAEJ5.mjs} +23 -23
- package/dist/cli/{run-EZCUNFI7.js → run-3CEY5JF3.js} +44 -44
- package/dist/cli/search-ILJXFKNF.js +32 -0
- package/dist/cli/{search-GW2P4KNN.mjs → search-TYRKGVKB.mjs} +7 -7
- package/dist/cli/{search-output-WRDJJFBW.js → search-output-FRRT574G.js} +6 -6
- package/dist/cli/{search-output-ASU6D6XX.mjs → search-output-O7FYSGYQ.mjs} +4 -4
- package/dist/cli/{secrets-AAV7JKPF.js → secrets-5W2ZF2JB.js} +15 -15
- package/dist/cli/{secrets-N5EAETGP.mjs → secrets-5YL7RU2B.mjs} +6 -6
- package/dist/cli/{sessions-WYISBB4D.mjs → sessions-VWENSY3G.mjs} +6 -6
- package/dist/cli/sessions-YMXBFVB3.js +23 -0
- package/dist/cli/{settings-WOIN3AIB.js → settings-JQOMJTOC.js} +85 -85
- package/dist/cli/{settings-X7BTX2N3.mjs → settings-W6FCYDJC.mjs} +12 -12
- package/dist/cli/{setup-APLGF5BY.mjs → setup-3JUQWZTS.mjs} +9 -9
- package/dist/cli/{setup-J3RS6UKU.js → setup-DJIVQUBT.js} +49 -49
- package/dist/cli/{skills-UGPVOIYQ.mjs → skills-7JTWCFL3.mjs} +7 -7
- package/dist/cli/skills-T36PD3IA.js +37 -0
- package/dist/cli/{tools-6WNR75VQ.mjs → tools-DRR3KDV2.mjs} +17 -17
- package/dist/cli/tools-X53FZHIC.js +57 -0
- package/dist/cli/update-BISEE3LC.js +37 -0
- package/dist/cli/{update-XG2EJRAG.mjs → update-KL43AZPW.mjs} +9 -9
- package/dist/cli/{views-LUNVYDBY.mjs → views-FFTXTJ7U.mjs} +6 -6
- package/dist/cli/{views-FSB6OV5N.js → views-HX4GM53H.js} +21 -21
- package/dist/cli/{workflow-TEJ7J2EQ.mjs → workflow-QO7BRZLM.mjs} +7 -7
- package/dist/cli/{workflow-RWTUI4GA.js → workflow-R2K6CH2X.js} +17 -17
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +112 -112
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-FM3JO6FN.js +0 -44
- package/dist/cli/concurrent-runs-help-RGKC4GDM.js +0 -22
- package/dist/cli/describe-DDP4Q7SK.js +0 -50
- package/dist/cli/git-53OSBVPB.js +0 -26
- package/dist/cli/search-S5KQIDCG.js +0 -32
- package/dist/cli/sessions-H33DKDTF.js +0 -23
- package/dist/cli/skills-7PT2KDQN.js +0 -37
- package/dist/cli/tools-Q2PVYNUE.js +0 -57
- package/dist/cli/update-C64JFIMU.js +0 -37
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.563',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -1651,6 +1651,7 @@ export async function sweepOrphanEarlyModalSandboxes(input: {
|
|
|
1651
1651
|
nowMs?: () => number;
|
|
1652
1652
|
sleep?: (ms: number) => Promise<void>;
|
|
1653
1653
|
limit?: number;
|
|
1654
|
+
listLimit?: number;
|
|
1654
1655
|
}): Promise<EarlySandboxSweepOutcome> {
|
|
1655
1656
|
return await sweepOrphanEarlySandboxes({
|
|
1656
1657
|
calls: earlyModalSandboxCalls(input),
|
|
@@ -1659,6 +1660,7 @@ export async function sweepOrphanEarlyModalSandboxes(input: {
|
|
|
1659
1660
|
...(input.nowMs === undefined ? {} : { nowMs: input.nowMs }),
|
|
1660
1661
|
...(input.sleep === undefined ? {} : { sleep: input.sleep }),
|
|
1661
1662
|
...(input.limit === undefined ? {} : { limit: input.limit }),
|
|
1663
|
+
...(input.listLimit === undefined ? {} : { listLimit: input.listLimit }),
|
|
1662
1664
|
});
|
|
1663
1665
|
}
|
|
1664
1666
|
|
|
@@ -159,9 +159,10 @@ export type EarlySandboxEntry<TSandbox = EarlySandboxHandle> = {
|
|
|
159
159
|
*
|
|
160
160
|
* It also counts this process's outstanding early sandboxes (`outstanding`);
|
|
161
161
|
* the worker lane's per-process cap reads it. One counts from `put` until the
|
|
162
|
-
* first of: its create fails (the entry resolves null), a launch
|
|
163
|
-
* (
|
|
164
|
-
* entry's TTL.
|
|
162
|
+
* first of: its create fails (the entry resolves null), a launch adopts it
|
|
163
|
+
* (`settle` after the re-tag), the reaper or sweep settles its sandbox id
|
|
164
|
+
* (`settle`), or the entry's TTL. A launch that takes the entry but refuses
|
|
165
|
+
* the sandbox does not release it: the sandbox is alive until reaped. Each path releases at most once, so no path double-counts and
|
|
165
166
|
* an error path never leaks a slot past the TTL.
|
|
166
167
|
*/
|
|
167
168
|
export class EarlySandboxRegistry<
|
|
@@ -200,13 +201,28 @@ export class EarlySandboxRegistry<
|
|
|
200
201
|
return this.#outstanding.size;
|
|
201
202
|
}
|
|
202
203
|
|
|
204
|
+
/** The same count for one org's hints (entries put with that `orgId`). */
|
|
205
|
+
outstandingForOrg(orgId: string): number {
|
|
206
|
+
let count = 0;
|
|
207
|
+
for (const owner of this.#outstandingOrg.values())
|
|
208
|
+
if (owner === orgId) count += 1;
|
|
209
|
+
return count;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
readonly #outstandingOrg = new Map<
|
|
213
|
+
Promise<EarlySandboxEntry<TSandbox> | null>,
|
|
214
|
+
string
|
|
215
|
+
>();
|
|
216
|
+
|
|
203
217
|
put(
|
|
204
218
|
key: string,
|
|
205
219
|
entry: Promise<EarlySandboxEntry<TSandbox> | null>,
|
|
206
220
|
ttlMs: number = EARLY_SANDBOX_REAP_AFTER_MS * 2,
|
|
221
|
+
orgId?: string,
|
|
207
222
|
): void {
|
|
208
223
|
this.#entries.set(key, entry);
|
|
209
224
|
this.#outstanding.add(entry);
|
|
225
|
+
if (orgId) this.#outstandingOrg.set(entry, orgId);
|
|
210
226
|
void entry.then(
|
|
211
227
|
(resolved) => {
|
|
212
228
|
if (!this.#outstanding.has(entry)) return;
|
|
@@ -231,7 +247,9 @@ export class EarlySandboxRegistry<
|
|
|
231
247
|
() => this.#taken.delete(key),
|
|
232
248
|
EARLY_SANDBOX_REAP_AFTER_MS * 2,
|
|
233
249
|
).unref?.();
|
|
234
|
-
this
|
|
250
|
+
// Still outstanding: an adoption that refuses this sandbox leaves it
|
|
251
|
+
// alive until the reaper or sweep ends it. A successful adoption
|
|
252
|
+
// settles it by id (`settle`); otherwise the reap does, or the TTL.
|
|
235
253
|
for (const handler of this.#takeHandlers) handler(key);
|
|
236
254
|
}
|
|
237
255
|
return entry;
|
|
@@ -257,6 +275,7 @@ export class EarlySandboxRegistry<
|
|
|
257
275
|
|
|
258
276
|
#release(entry: Promise<EarlySandboxEntry<TSandbox> | null>): void {
|
|
259
277
|
if (!this.#outstanding.delete(entry)) return;
|
|
278
|
+
this.#outstandingOrg.delete(entry);
|
|
260
279
|
for (const [sandboxId, held] of this.#outstandingBySandboxId) {
|
|
261
280
|
if (held === entry) this.#outstandingBySandboxId.delete(sandboxId);
|
|
262
281
|
}
|
|
@@ -500,7 +519,7 @@ export function startEarlySandbox<TSandbox extends EarlySandboxHandle>(
|
|
|
500
519
|
});
|
|
501
520
|
return null;
|
|
502
521
|
});
|
|
503
|
-
adapter.registry.put(key, started);
|
|
522
|
+
adapter.registry.put(key, started, undefined, orgId);
|
|
504
523
|
logEarlySandbox(adapter.logScope, 'hint_accepted', {
|
|
505
524
|
key,
|
|
506
525
|
orgId,
|
|
@@ -639,7 +658,14 @@ export function scheduleEarlySandboxReap(input: {
|
|
|
639
658
|
export const EARLY_SANDBOX_SWEEP_INTERVAL_MS = 60_000;
|
|
640
659
|
/** ±20% per interval, and a first pass in [0, 40%] of it. */
|
|
641
660
|
export const EARLY_SANDBOX_SWEEP_JITTER_RATIO = 0.2;
|
|
661
|
+
/** Orphans one pass terminates; the rest wait for the next pass. */
|
|
642
662
|
const EARLY_SANDBOX_SWEEP_LIMIT = 20;
|
|
663
|
+
/**
|
|
664
|
+
* Early sandboxes one pass reads. Larger than the termination limit so young
|
|
665
|
+
* (still adoptable) sandboxes, which the pass skips, cannot fill it and keep
|
|
666
|
+
* older orphans out of every pass on a busy worker.
|
|
667
|
+
*/
|
|
668
|
+
const EARLY_SANDBOX_SWEEP_LIST_LIMIT = 100;
|
|
643
669
|
const EARLY_SANDBOX_SWEEP_CONFIRM_ATTEMPTS = 5;
|
|
644
670
|
|
|
645
671
|
export type EarlySandboxSweepOutcome = {
|
|
@@ -647,6 +673,8 @@ export type EarlySandboxSweepOutcome = {
|
|
|
647
673
|
terminated: number;
|
|
648
674
|
unconfirmed: number;
|
|
649
675
|
young: number;
|
|
676
|
+
/** Orphans past this pass's termination limit, left for the next pass. */
|
|
677
|
+
deferred: number;
|
|
650
678
|
};
|
|
651
679
|
|
|
652
680
|
export async function sweepOrphanEarlySandboxes(input: {
|
|
@@ -664,9 +692,14 @@ export async function sweepOrphanEarlySandboxes(input: {
|
|
|
664
692
|
nowMs?: () => number;
|
|
665
693
|
sleep?: (ms: number) => Promise<void>;
|
|
666
694
|
limit?: number;
|
|
695
|
+
listLimit?: number;
|
|
667
696
|
}): Promise<EarlySandboxSweepOutcome> {
|
|
668
697
|
const nowMs = input.nowMs ?? Date.now;
|
|
669
698
|
const limit = input.limit ?? EARLY_SANDBOX_SWEEP_LIMIT;
|
|
699
|
+
const listLimit = Math.max(
|
|
700
|
+
limit,
|
|
701
|
+
input.listLimit ?? EARLY_SANDBOX_SWEEP_LIST_LIMIT,
|
|
702
|
+
);
|
|
670
703
|
const ids = new Set<string>();
|
|
671
704
|
// One listing: the retired F2 hedge tag is no longer swept (nothing
|
|
672
705
|
// creates it, and no hedge leg ever carried an environment tag).
|
|
@@ -674,12 +707,15 @@ export async function sweepOrphanEarlySandboxes(input: {
|
|
|
674
707
|
source: EARLY_SANDBOX_SOURCE_TAG,
|
|
675
708
|
[EARLY_ENVIRONMENT_TAG]: input.environment,
|
|
676
709
|
})) {
|
|
677
|
-
if (ids.size >=
|
|
710
|
+
if (ids.size >= listLimit) break;
|
|
678
711
|
if (listed.sandboxId?.trim()) ids.add(listed.sandboxId.trim());
|
|
679
712
|
}
|
|
680
713
|
let terminated = 0;
|
|
681
714
|
let unconfirmed = 0;
|
|
682
715
|
let young = 0;
|
|
716
|
+
let deferred = 0;
|
|
717
|
+
// Claimed synchronously after each tag read, so at most `limit` terminate.
|
|
718
|
+
let claimed = 0;
|
|
683
719
|
await Promise.all(
|
|
684
720
|
[...ids].map(async (sandboxId) => {
|
|
685
721
|
try {
|
|
@@ -697,6 +733,11 @@ export async function sweepOrphanEarlySandboxes(input: {
|
|
|
697
733
|
young += 1;
|
|
698
734
|
return;
|
|
699
735
|
}
|
|
736
|
+
if (claimed >= limit) {
|
|
737
|
+
deferred += 1;
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
claimed += 1;
|
|
700
741
|
const confirmAttempts = await terminateEarlySandboxConfirmed({
|
|
701
742
|
sandbox: fresh,
|
|
702
743
|
readExitCode: readEarlySandboxExitCode(input.calls),
|
|
@@ -724,7 +765,7 @@ export async function sweepOrphanEarlySandboxes(input: {
|
|
|
724
765
|
}
|
|
725
766
|
}),
|
|
726
767
|
);
|
|
727
|
-
return { observed: ids.size, terminated, unconfirmed, young };
|
|
768
|
+
return { observed: ids.size, terminated, unconfirmed, young, deferred };
|
|
728
769
|
}
|
|
729
770
|
|
|
730
771
|
/** PB: the runner limits a pre-boot fixed, which a launch must match. */
|
|
@@ -993,6 +1034,8 @@ export async function adoptEarlySandbox<
|
|
|
993
1034
|
// Re-tag first: from here the sandbox is an ordinary launch sandbox for
|
|
994
1035
|
// every cleanup and reconciliation path, and the reaper skips it.
|
|
995
1036
|
await sandbox.setTags({ ...input.createTags, earlyKey: key });
|
|
1037
|
+
// Adopted: it is the launch's sandbox now, no longer early capacity.
|
|
1038
|
+
registry.settle(sandbox.sandboxId);
|
|
996
1039
|
input.emitStage('early:adopted', {
|
|
997
1040
|
key,
|
|
998
1041
|
how,
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts
CHANGED
|
@@ -68,6 +68,14 @@ export const EARLY_SANDBOX_POLICY_LEAD_PROVIDER: RuntimeSandboxProviderId =
|
|
|
68
68
|
*/
|
|
69
69
|
export const EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER = 16;
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Of those, the most one org's hints may hold. A hint is sent before credit
|
|
73
|
+
* admission, so without it one org's request burst could hold every slot
|
|
74
|
+
* (each unadopted sandbox is billed to nobody until the reaper ends it) and
|
|
75
|
+
* starve other orgs' early starts. A hint past it is refused the same way.
|
|
76
|
+
*/
|
|
77
|
+
export const EARLY_SANDBOX_MAX_OUTSTANDING_PER_ORG_PER_WORKER = 4;
|
|
78
|
+
|
|
71
79
|
export type EarlySandboxAdapterSelectionRefusal =
|
|
72
80
|
| 'lane_lead_not_single'
|
|
73
81
|
| 'adapter_missing'
|
|
@@ -89,6 +97,7 @@ export type EarlySandboxHintRefusal =
|
|
|
89
97
|
| 'worker_draining'
|
|
90
98
|
| 'no_idle_slot'
|
|
91
99
|
| 'outstanding_cap'
|
|
100
|
+
| 'org_outstanding_cap'
|
|
92
101
|
| 'listener_unavailable'
|
|
93
102
|
| `listener_${EarlySandboxListenerHintRefusal}`;
|
|
94
103
|
|
|
@@ -245,12 +254,31 @@ export function outstandingEarlySandboxes(
|
|
|
245
254
|
return total;
|
|
246
255
|
}
|
|
247
256
|
|
|
257
|
+
/** One org's outstanding early sandboxes in this process, over every registry. */
|
|
258
|
+
export function outstandingEarlySandboxesForOrg(
|
|
259
|
+
orgId: string,
|
|
260
|
+
adapters: Readonly<
|
|
261
|
+
Partial<Record<RuntimeSandboxProviderId, EarlySandboxAdapter>>
|
|
262
|
+
> = EARLY_SANDBOX_ADAPTERS,
|
|
263
|
+
): number {
|
|
264
|
+
const registries = new Set(
|
|
265
|
+
Object.values(adapters).flatMap((adapter) =>
|
|
266
|
+
adapter ? [adapter.registry] : [],
|
|
267
|
+
),
|
|
268
|
+
);
|
|
269
|
+
let total = 0;
|
|
270
|
+
for (const registry of registries)
|
|
271
|
+
total += registry.outstandingForOrg(orgId);
|
|
272
|
+
return total;
|
|
273
|
+
}
|
|
274
|
+
|
|
248
275
|
function refuseEarlySandboxHint(input: {
|
|
249
276
|
reason: EarlySandboxHintRefusal;
|
|
250
277
|
backend: PlayRuntimeBackendId;
|
|
251
278
|
workflowId: string;
|
|
252
279
|
sandboxPlacementPolicyId: string | null;
|
|
253
280
|
outstanding?: number;
|
|
281
|
+
cap?: number;
|
|
254
282
|
}): false {
|
|
255
283
|
console.error(
|
|
256
284
|
JSON.stringify({
|
|
@@ -263,7 +291,7 @@ function refuseEarlySandboxHint(input: {
|
|
|
263
291
|
? {}
|
|
264
292
|
: {
|
|
265
293
|
outstanding: input.outstanding,
|
|
266
|
-
cap: EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER,
|
|
294
|
+
cap: input.cap ?? EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER,
|
|
267
295
|
}),
|
|
268
296
|
}),
|
|
269
297
|
);
|
|
@@ -354,6 +382,21 @@ export function startWorkerLaneEarlySandbox(
|
|
|
354
382
|
outstanding,
|
|
355
383
|
});
|
|
356
384
|
}
|
|
385
|
+
const hintOrgId = input.orgId?.trim();
|
|
386
|
+
if (hintOrgId) {
|
|
387
|
+
const orgOutstanding = outstandingEarlySandboxesForOrg(
|
|
388
|
+
hintOrgId,
|
|
389
|
+
input.adapters ?? EARLY_SANDBOX_ADAPTERS,
|
|
390
|
+
);
|
|
391
|
+
if (orgOutstanding >= EARLY_SANDBOX_MAX_OUTSTANDING_PER_ORG_PER_WORKER) {
|
|
392
|
+
return refuseEarlySandboxHint({
|
|
393
|
+
...hint,
|
|
394
|
+
reason: 'org_outstanding_cap',
|
|
395
|
+
outstanding: orgOutstanding,
|
|
396
|
+
cap: EARLY_SANDBOX_MAX_OUTSTANDING_PER_ORG_PER_WORKER,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
357
400
|
const request = {
|
|
358
401
|
workflowId: input.workflowId,
|
|
359
402
|
orgId: input.orgId ?? null,
|
|
@@ -14,15 +14,15 @@ import {
|
|
|
14
14
|
reportSetupCompleted,
|
|
15
15
|
resolvePendingAuthClaimForResume,
|
|
16
16
|
statusBannerLine
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-H2N324LF.mjs";
|
|
18
|
+
import "./chunk-GVRVZQBY.mjs";
|
|
19
|
+
import "./chunk-UMJWODG7.mjs";
|
|
20
|
+
import "./chunk-XDZZCRUG.mjs";
|
|
21
21
|
import "./chunk-ASB47RXJ.mjs";
|
|
22
22
|
import "./chunk-DLIRSHV6.mjs";
|
|
23
23
|
import "./chunk-Z3A2S3QM.mjs";
|
|
24
24
|
import "./chunk-2MGZAI54.mjs";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-AYNDNXBJ.mjs";
|
|
26
26
|
import "./chunk-WZYKRD7T.mjs";
|
|
27
27
|
import "./chunk-KRD6H754.mjs";
|
|
28
28
|
export {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunk4KHRPJOWjs = require('./chunk-4KHRPJOW.js');
|
|
18
|
+
require('./chunk-U77PK5R3.js');
|
|
19
|
+
require('./chunk-DA24O3ZV.js');
|
|
20
|
+
require('./chunk-T2RNEBV7.js');
|
|
21
|
+
require('./chunk-6VLFQZK6.js');
|
|
22
|
+
require('./chunk-XNYIZMNQ.js');
|
|
23
|
+
require('./chunk-LFQJW4S2.js');
|
|
24
|
+
require('./chunk-CFJFUVX2.js');
|
|
25
|
+
require('./chunk-NS56OQUQ.js');
|
|
26
|
+
require('./chunk-OG64RBAC.js');
|
|
27
|
+
require('./chunk-COGTRVWW.js');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunk4KHRPJOWjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk4KHRPJOWjs.authStatusLine; exports.clearPendingClaim = _chunk4KHRPJOWjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk4KHRPJOWjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunk4KHRPJOWjs.handleRegister; exports.handleStatus = _chunk4KHRPJOWjs.handleStatus; exports.handleWait = _chunk4KHRPJOWjs.handleWait; exports.httpJson = _chunk4KHRPJOWjs.httpJson; exports.readPendingAuthClaim = _chunk4KHRPJOWjs.readPendingAuthClaim; exports.readStatusBanner = _chunk4KHRPJOWjs.readStatusBanner; exports.registerAuthCommands = _chunk4KHRPJOWjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunk4KHRPJOWjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunk4KHRPJOWjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk4KHRPJOWjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk4KHRPJOWjs.statusBannerLine;
|