deepline 0.3.542 → 0.3.544
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/client-core.ts +112 -2
- package/dist/bundling-sources/sdk/src/index.ts +7 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
- package/dist/bundling-sources/sdk/src/types.ts +10 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +3 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +43 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +49 -55
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +229 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
- package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
- package/dist/cli/auth-ENBXAKQS.js +43 -0
- package/dist/cli/{auth-IGBGOB4E.mjs → auth-IMWJAHPU.mjs} +5 -5
- package/dist/cli/{billing-IB2TWE74.js → billing-Y55PR2PV.js} +101 -101
- package/dist/cli/{billing-N37W2I62.mjs → billing-YQMW3QJI.mjs} +12 -12
- package/dist/cli/chunk-22OBDYHP.js +455 -0
- package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
- package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
- package/dist/cli/{chunk-D44DP4KJ.js → chunk-3I26HMJ7.js} +37 -17
- package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-3JDA23NN.mjs} +2 -2
- package/dist/cli/{chunk-QXNOSCYL.js → chunk-3KGMM4KS.js} +1 -1
- package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-456RRXAP.mjs} +5 -5
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-FGGPCAGC.js → chunk-4PKHFW56.js} +18 -18
- package/dist/cli/{chunk-QONO7FRF.mjs → chunk-57G4NYOL.mjs} +1 -1
- package/dist/cli/{chunk-46V7QSJE.mjs → chunk-5PR4VLLL.mjs} +3 -3
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-AKY7KZRJ.js → chunk-7GNZEOTH.js} +6 -6
- package/dist/cli/{chunk-LFMQVSEI.js → chunk-7HMMTSDA.js} +5 -5
- package/dist/cli/{chunk-ORA5TMML.mjs → chunk-BEQ7RQLT.mjs} +5 -5
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-GM73TZ2W.js → chunk-C4P2KLWT.js} +41 -41
- package/dist/cli/{chunk-DNGACHFX.js → chunk-COJHT2KF.js} +22 -22
- package/dist/cli/{chunk-6SLEHAXX.js → chunk-DF2X7GJG.js} +5 -5
- package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DVDWAC2M.mjs} +7 -3
- package/dist/cli/{chunk-5CAVURVS.js → chunk-DYDHLBSK.js} +53 -53
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-EHLCWGWN.js → chunk-G26VJCNT.js} +4 -4
- package/dist/cli/{chunk-WL2GUGNZ.js → chunk-GQHRGBHV.js} +7 -7
- package/dist/cli/{chunk-DADH3WPE.mjs → chunk-GV45TTI6.mjs} +2 -2
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-H4SAHB3Q.mjs} +3 -3
- package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-HAQRF6DJ.mjs} +2 -2
- package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-HBSWATOU.mjs} +6 -6
- package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-HVJQF5BI.mjs} +2 -2
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-HXM2JUGD.mjs} +1 -1
- package/dist/cli/{chunk-JPT6VE54.js → chunk-IFIJ4DBJ.js} +2 -2
- package/dist/cli/{chunk-HAITCPCG.js → chunk-JBWOE6AP.js} +16 -16
- package/dist/cli/{chunk-AWLPERL3.js → chunk-JWVG7ZPX.js} +3 -3
- package/dist/cli/{chunk-3XXXMSSP.js → chunk-KE6CSCUF.js} +44 -44
- package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-LPUBBUKX.mjs} +24 -4
- package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-LQ6RRYXN.mjs} +5 -5
- package/dist/cli/{chunk-FFDZT255.mjs → chunk-LW274RO7.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-VHJUH3TB.js → chunk-ON56ISO6.js} +3 -3
- package/dist/cli/{chunk-4I47NCRI.js → chunk-PDJ4UDCO.js} +498 -328
- package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-PFGOCUH3.mjs} +1 -1
- package/dist/cli/{chunk-Q7WDXLYO.js → chunk-PKRW76XG.js} +2 -2
- package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-PMW5YP72.mjs} +37 -190
- package/dist/cli/{chunk-5APOJWJF.mjs → chunk-Q7ZOWNKR.mjs} +183 -13
- package/dist/cli/{chunk-WACIN4PR.mjs → chunk-REEOMNCO.mjs} +3 -3
- package/dist/cli/{chunk-DMXLZ57N.js → chunk-RG34YBDE.js} +2 -2
- package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-RJPDCSTD.mjs} +4 -4
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-AUFE624T.js → chunk-RUFR4PUO.js} +10 -10
- package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-SK3HPU2J.mjs} +1 -1
- package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-SKS53WM6.mjs} +4 -4
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-CFZCRM6R.js → chunk-UHIAQPVA.js} +26 -26
- package/dist/cli/{chunk-D7GWEBMF.js → chunk-UNMNGRPB.js} +7 -7
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-TTBHOMAA.js → chunk-W7X4KH45.js} +316 -469
- package/dist/cli/chunk-WBSGPLH5.mjs +455 -0
- package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-WUEORIOY.mjs} +1 -1
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-YIRVKMON.mjs} +1 -1
- package/dist/cli/{chunk-NDNEARE3.js → chunk-Z44YTSTA.js} +13 -13
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-ZHY4T5M6.mjs} +1 -1
- package/dist/cli/{chunk-E7B73LGT.js → chunk-ZY6FL4O4.js} +24 -20
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-KBWPKSTP.mjs} +7 -7
- package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
- package/dist/cli/{csv-CAVA3EMS.mjs → csv-M5EBEMZH.mjs} +4 -4
- package/dist/cli/{csv-XZAM7EYZ.js → csv-XGGDZTQI.js} +13 -13
- package/dist/cli/{db-PPGEOBNG.js → db-CVPR54XK.js} +29 -29
- package/dist/cli/{db-HD332QI7.mjs → db-M6FJ6J6E.mjs} +8 -8
- package/dist/cli/describe-RUODIS6M.js +50 -0
- package/dist/cli/describe-X6QA2U3C.mjs +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-AFEOLB4A.mjs → executions-EHTS2XJX.mjs} +8 -8
- package/dist/cli/{executions-4ZKBL7IC.js → executions-VJEEWN22.js} +10 -10
- package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-76VGY4GP.mjs} +6 -6
- package/dist/cli/{feedback-M6Y33JKT.js → feedback-DQPUCUXO.js} +14 -14
- package/dist/cli/{git-632RYEF6.mjs → git-IY6DKKLR.mjs} +5 -5
- package/dist/cli/git-RLHTSYRY.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-242LE3TQ.mjs +98 -0
- package/dist/cli/integrations-CQSTIKFY.js +98 -0
- package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
- package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-U72DO6ZF.js} +9 -9
- package/dist/cli/{mcp-PESLHAAC.mjs → mcp-JJH6JR52.mjs} +72 -15
- package/dist/cli/{mcp-35QA6YG7.js → mcp-L473BKLJ.js} +89 -32
- package/dist/cli/{monitors-4DTUZLAI.js → monitors-3TF2DOFD.js} +119 -104
- package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-VSYHUBKC.mjs} +26 -11
- package/dist/cli/{org-DJNKMFCZ.mjs → org-S5VIKU2E.mjs} +8 -8
- package/dist/cli/{org-FWCBZMER.js → org-YKVI2ZTI.js} +90 -90
- package/dist/cli/{play-PHVQEEEZ.mjs → play-C7T5A3QM.mjs} +44 -25
- package/dist/cli/{play-FZ45M4KD.js → play-DOWEG45Y.js} +374 -355
- package/dist/cli/{providers-46E67QG7.mjs → providers-BMVVX3VD.mjs} +10 -9
- package/dist/cli/{providers-QJU6FMDD.js → providers-TAZPPFTB.js} +13 -12
- package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-A3WKMKTW.mjs} +4 -4
- package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-HD6FQXGR.js} +6 -6
- package/dist/cli/{run-WKSIRXEC.js → run-BVVV2UX7.js} +49 -48
- package/dist/cli/{run-2W2TJ6QA.mjs → run-FV7TWNOC.mjs} +28 -27
- package/dist/cli/{search-Y2CFLSYB.mjs → search-MGK6WIKS.mjs} +9 -9
- package/dist/cli/search-VJFCWUZN.js +32 -0
- package/dist/cli/{search-output-2IK6ZZDY.js → search-output-6Y7KEPIE.js} +6 -6
- package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-GM7LDZKE.mjs} +4 -4
- package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-4RFAR7YI.mjs} +8 -8
- package/dist/cli/{secrets-JVJIHGU4.js → secrets-SISXIXSZ.js} +17 -17
- package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-CE3OMEG7.mjs} +6 -6
- package/dist/cli/sessions-OWWZJZXH.js +22 -0
- package/dist/cli/{settings-5WHMFRNQ.js → settings-4HPM3K4A.js} +89 -89
- package/dist/cli/{settings-YQOPF3AI.mjs → settings-E22IDSX2.mjs} +16 -16
- package/dist/cli/{setup-3VJMKDEU.js → setup-BDRSNLKX.js} +49 -49
- package/dist/cli/{setup-O5U5IEVW.mjs → setup-BK65MDZ6.mjs} +9 -9
- package/dist/cli/{skills-G6J5PF35.mjs → skills-FI2GZMR4.mjs} +7 -7
- package/dist/cli/skills-ZLBFUAFR.js +36 -0
- package/dist/cli/tools-3K72VE33.js +57 -0
- package/dist/cli/{tools-AG7SWL5Y.mjs → tools-HMMWYUNW.mjs} +20 -19
- package/dist/cli/update-QZV6DH5V.js +34 -0
- package/dist/cli/{update-K73DD6CR.mjs → update-WDKBSXV5.mjs} +9 -9
- package/dist/cli/{views-4D2OTLIO.js → views-775AUDWQ.js} +23 -23
- package/dist/cli/{views-MO6DIOMR.mjs → views-JYIJCO23.mjs} +8 -8
- package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-4H6KQRFQ.js} +19 -19
- package/dist/cli/{workflow-MMZMAELI.mjs → workflow-FKKHE3IU.mjs} +9 -9
- package/dist/{client-DLG9mHDh.d.mts → client-ANT3pyoa.d.mts} +1 -1
- package/dist/{client-X-FJD5Dp.d.ts → client-DD_FyJVd.d.ts} +1 -1
- package/dist/{client-core-WtnqyBwY.d.mts → client-core-Dg9tKhdB.d.mts} +339 -3
- package/dist/{client-core-0jmHfFBv.d.ts → client-core-QHmo73k1.d.ts} +339 -3
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
- package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
- package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
- package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
- package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +147 -133
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +23 -4
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +2 -2
- package/dist/plays/run-request.mjs +1 -1
- 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.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
- package/dist/cli/auth-2PH6RSKL.js +0 -43
- package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
- package/dist/cli/describe-5TFFB2PM.js +0 -49
- package/dist/cli/describe-THQU7N47.mjs +0 -49
- package/dist/cli/git-AQLQYWRI.js +0 -25
- package/dist/cli/search-YLJFCJTK.js +0 -32
- package/dist/cli/sessions-TZ33UCPS.js +0 -22
- package/dist/cli/skills-WZY3XDT3.js +0 -36
- package/dist/cli/tools-BXQBL72Q.js +0 -56
- package/dist/cli/update-XYP5EII6.js +0 -34
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import type { ModalClient, SidecarCreateParams } from 'modal';
|
|
3
2
|
import type { PlayRunnerBackend, PlayRunnerCallbacks } from '../types';
|
|
4
3
|
import {
|
|
@@ -42,7 +41,6 @@ import {
|
|
|
42
41
|
INLINE_BAKED_RUNNER_UNVERIFIED_EXIT_CODE,
|
|
43
42
|
INLINE_ENVELOPE_INCOMPLETE_EXIT_CODE,
|
|
44
43
|
PrebootedRunnerLimitsMismatchError,
|
|
45
|
-
samePlaySandboxRuntimeLimits,
|
|
46
44
|
stageRunnerPayload,
|
|
47
45
|
type BakedRunnerExpectation,
|
|
48
46
|
type PrebootedRunnerLaunch,
|
|
@@ -78,10 +76,32 @@ import {
|
|
|
78
76
|
executePrewarmSentAtAdmission,
|
|
79
77
|
type ModalSupervisorRunPin,
|
|
80
78
|
} from '../../modal-supervisor-sidecar';
|
|
79
|
+
import { resolveExperimentSwitch } from '../../experiment-switches';
|
|
81
80
|
import {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
adoptEarlySandbox,
|
|
82
|
+
EARLY_PREBOOT_VERDICT_TIMEOUT_MS,
|
|
83
|
+
EARLY_SANDBOX_IDLE_TIMEOUT_MS,
|
|
84
|
+
EARLY_SANDBOX_START,
|
|
85
|
+
EARLY_SANDBOX_TERMINATE_CONFIRM_ATTEMPTS,
|
|
86
|
+
earlySandboxCreateTags,
|
|
87
|
+
earlySandboxLimitsKey,
|
|
88
|
+
EarlySandboxRegistry,
|
|
89
|
+
logEarlySandbox,
|
|
90
|
+
logEarlySandboxReapUnconfirmed,
|
|
91
|
+
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
92
|
+
readEarlySandboxExitCode,
|
|
93
|
+
reapEarlySandboxById,
|
|
94
|
+
scheduleEarlySandboxReap,
|
|
95
|
+
sleepMs,
|
|
96
|
+
sweepOrphanEarlySandboxes,
|
|
97
|
+
terminateEarlySandboxConfirmed,
|
|
98
|
+
type EarlySandboxAdapter,
|
|
99
|
+
type EarlySandboxEntry,
|
|
100
|
+
type EarlySandboxPreboot,
|
|
101
|
+
type EarlySandboxProviderCalls,
|
|
102
|
+
type EarlySandboxStartRequest,
|
|
103
|
+
type EarlySandboxSweepOutcome,
|
|
104
|
+
} from '../early-sandbox';
|
|
85
105
|
|
|
86
106
|
const MODAL_RUNNER_READY_TIMEOUT_MS =
|
|
87
107
|
RUNTIME_RELIABILITY_POLICY.sandbox.runnerReadyTimeoutMs;
|
|
@@ -1251,135 +1271,48 @@ export async function pinModalSupervisorSidecar(input: {
|
|
|
1251
1271
|
}
|
|
1252
1272
|
|
|
1253
1273
|
/**
|
|
1254
|
-
*
|
|
1255
|
-
*
|
|
1256
|
-
*
|
|
1257
|
-
*
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
*
|
|
1261
|
-
* supervisor and uploads the payload as today; otherwise it creates its own.
|
|
1262
|
-
* Orphans: a short Modal idle timeout, plus an exact-id reaper that
|
|
1263
|
-
* terminates the early sandbox if it is still unadopted after the reap delay.
|
|
1264
|
-
* Off.
|
|
1274
|
+
* Modal's early-sandbox Adapter. The provider-neutral Module
|
|
1275
|
+
* (`../early-sandbox.ts`) owns early start (E2), pre-boot (PB) and in-process
|
|
1276
|
+
* adoption (A1): the registry, the org-scoped key and identity refusal, the
|
|
1277
|
+
* adoption-age rules, the exact-id reaper and the durable orphan sweep. This
|
|
1278
|
+
* Adapter supplies the Modal calls: the early create (image, CPU, regions,
|
|
1279
|
+
* create tags), tag reads and writes, termination, the tag listing, the PB
|
|
1280
|
+
* pre-boot exec, and S1, the supervisor sidecar, which only Modal has.
|
|
1265
1281
|
*/
|
|
1266
|
-
|
|
1267
|
-
const EARLY_MODAL_SANDBOX_SOURCE_TAG = 'deepline-play-runner-early';
|
|
1268
|
-
const EARLY_MODAL_SANDBOX_IDLE_TIMEOUT_MS = 60_000;
|
|
1269
|
-
const EARLY_MODAL_SANDBOX_REAP_AFTER_MS = 90_000;
|
|
1270
|
-
/**
|
|
1271
|
-
* No launch adopts an early sandbox older than this (create request -> adopt
|
|
1272
|
-
* check). Kept well under EARLY_MODAL_SANDBOX_REAP_AFTER_MS so a reaper can
|
|
1273
|
-
* never terminate a sandbox that a launch is in the middle of adopting.
|
|
1274
|
-
* Adoption is normally ~1-2 s after create.
|
|
1275
|
-
*/
|
|
1276
|
-
export const EARLY_MODAL_SANDBOX_MAX_ADOPTION_AGE_MS = 60_000;
|
|
1277
|
-
/** Create-request time (epoch ms), set in the create tags. */
|
|
1278
|
-
const EARLY_CREATED_AT_TAG = 'earlyCreatedAtMs';
|
|
1282
|
+
const EARLY_MODAL_LOG_SCOPE = 'play-runner.modal.early';
|
|
1279
1283
|
|
|
1280
|
-
export type EarlyModalSandboxEntry =
|
|
1281
|
-
sandbox: ModalSandbox;
|
|
1282
|
-
startedAtMs: number;
|
|
1283
|
-
/** The tags this process last set on the early sandbox. */
|
|
1284
|
-
tags: Record<string, string>;
|
|
1285
|
-
};
|
|
1284
|
+
export type EarlyModalSandboxEntry = EarlySandboxEntry<ModalSandbox>;
|
|
1286
1285
|
|
|
1287
|
-
/**
|
|
1288
|
-
|
|
1289
|
-
* the entry, so each early sandbox is handed to at most one in-process
|
|
1290
|
-
* adoption; an unadopted entry expires after twice the reap delay.
|
|
1291
|
-
*/
|
|
1292
|
-
export class EarlyModalSandboxRegistry {
|
|
1293
|
-
readonly #entries = new Map<string, Promise<EarlyModalSandboxEntry | null>>();
|
|
1294
|
-
|
|
1295
|
-
has(key: string): boolean {
|
|
1296
|
-
return this.#entries.has(key);
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
put(
|
|
1300
|
-
key: string,
|
|
1301
|
-
entry: Promise<EarlyModalSandboxEntry | null>,
|
|
1302
|
-
ttlMs: number = EARLY_MODAL_SANDBOX_REAP_AFTER_MS * 2,
|
|
1303
|
-
): void {
|
|
1304
|
-
this.#entries.set(key, entry);
|
|
1305
|
-
setTimeout(() => {
|
|
1306
|
-
if (this.#entries.get(key) === entry) this.#entries.delete(key);
|
|
1307
|
-
}, ttlMs).unref?.();
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
take(key: string): Promise<EarlyModalSandboxEntry | null> | undefined {
|
|
1311
|
-
const entry = this.#entries.get(key);
|
|
1312
|
-
this.#entries.delete(key);
|
|
1313
|
-
return entry;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1286
|
+
/** This process's unadopted early Modal sandboxes (see EarlySandboxRegistry). */
|
|
1287
|
+
export class EarlyModalSandboxRegistry extends EarlySandboxRegistry<ModalSandbox> {}
|
|
1316
1288
|
const earlyModalSandboxes = new EarlyModalSandboxRegistry();
|
|
1317
1289
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
* so two orgs can name the same one; neither may find the other's sandbox.
|
|
1321
|
-
*/
|
|
1322
|
-
export function earlyModalSandboxKey(input: {
|
|
1323
|
-
orgId: string;
|
|
1324
|
-
workflowId: string;
|
|
1325
|
-
}): string {
|
|
1326
|
-
return createHash('sha256')
|
|
1327
|
-
.update(JSON.stringify([input.orgId, input.workflowId]))
|
|
1328
|
-
.digest('hex')
|
|
1329
|
-
.slice(0, 40);
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
/**
|
|
1333
|
-
* Why an early sandbox's tags do not belong to this launch's run, or null.
|
|
1334
|
-
* Checked on every adoption path, before the sandbox is re-tagged or used.
|
|
1335
|
-
*/
|
|
1336
|
-
export function earlyModalSandboxIdentityRefusal(
|
|
1337
|
-
tags: Record<string, string>,
|
|
1338
|
-
expected: { key: string; orgId: string; workflowId: string },
|
|
1339
|
-
): 'key_mismatch' | 'org_mismatch' | 'workflow_mismatch' | null {
|
|
1340
|
-
if (tags.earlyKey !== expected.key) return 'key_mismatch';
|
|
1341
|
-
if (tags.orgId !== expected.orgId) return 'org_mismatch';
|
|
1342
|
-
if (tags.workflowId !== expected.workflowId) return 'workflow_mismatch';
|
|
1343
|
-
return null;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
/** Age of an early sandbox from its create tag; null when it has none. */
|
|
1347
|
-
function earlyModalSandboxAgeMs(
|
|
1348
|
-
tags: Record<string, string>,
|
|
1349
|
-
nowMs: number,
|
|
1350
|
-
): number | null {
|
|
1351
|
-
const createdAtMs = Number(tags[EARLY_CREATED_AT_TAG]);
|
|
1352
|
-
return Number.isSafeInteger(createdAtMs) && createdAtMs > 0
|
|
1353
|
-
? nowMs - createdAtMs
|
|
1354
|
-
: null;
|
|
1290
|
+
function logEarlyModalSandbox(event: string, extra: Record<string, unknown>) {
|
|
1291
|
+
logEarlySandbox(EARLY_MODAL_LOG_SCOPE, event, extra);
|
|
1355
1292
|
}
|
|
1356
1293
|
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1294
|
+
/** Exact-id lookups; enough for the reaper and a confirmed termination. */
|
|
1295
|
+
function earlyModalSandboxLookups(
|
|
1296
|
+
client: Pick<ModalClient, 'sandboxes'>,
|
|
1297
|
+
): Pick<EarlySandboxProviderCalls<ModalSandbox>, 'fromId' | 'logScope'> {
|
|
1298
|
+
return {
|
|
1299
|
+
logScope: EARLY_MODAL_LOG_SCOPE,
|
|
1300
|
+
fromId: (sandboxId) => client.sandboxes.fromId(sandboxId),
|
|
1301
|
+
};
|
|
1363
1302
|
}
|
|
1364
1303
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1304
|
+
/** Lookups plus the tag listing, bound to the Modal app. */
|
|
1305
|
+
function earlyModalSandboxCalls(input: {
|
|
1306
|
+
client: Pick<ModalClient, 'sandboxes'>;
|
|
1307
|
+
modalAppId: string;
|
|
1308
|
+
}): EarlySandboxProviderCalls<ModalSandbox> {
|
|
1309
|
+
return {
|
|
1310
|
+
...earlyModalSandboxLookups(input.client),
|
|
1311
|
+
list: (tags) =>
|
|
1312
|
+
input.client.sandboxes.list({ appId: input.modalAppId, tags }),
|
|
1313
|
+
};
|
|
1370
1314
|
}
|
|
1371
1315
|
|
|
1372
|
-
/**
|
|
1373
|
-
* Start (fire and forget) the early sandbox for an admitted run. Idempotent
|
|
1374
|
-
* per process; a second hint for the same run is ignored.
|
|
1375
|
-
*/
|
|
1376
|
-
/**
|
|
1377
|
-
* Source tag of the retired F2 hedged early create (docs/runtime-speed-
|
|
1378
|
-
* experiments.md). Nothing creates it now; the reaper and the durable sweep
|
|
1379
|
-
* still treat it as unadopted, so a leg left by an older worker is reaped.
|
|
1380
|
-
*/
|
|
1381
|
-
const EARLY_MODAL_SANDBOX_HEDGE_TAG = 'deepline-play-runner-early-hedge';
|
|
1382
|
-
|
|
1383
1316
|
/**
|
|
1384
1317
|
* S1 (off): with E2, start the supervisor sidecar (both gateways) on the early
|
|
1385
1318
|
* sandbox right after its create, so the gateways have listened and fetched
|
|
@@ -1407,79 +1340,7 @@ const earlyModalForeignAdoptionClaims = new WeakMap<
|
|
|
1407
1340
|
Promise<unknown>
|
|
1408
1341
|
>();
|
|
1409
1342
|
|
|
1410
|
-
|
|
1411
|
-
* A1 (off): adopting an early sandbox this process created checks the tags
|
|
1412
|
-
* this process set instead of reading them back from Modal (one RPC fewer on
|
|
1413
|
-
* the launch path, ~20 ms). Only for a fresh entry this process created and
|
|
1414
|
-
* has not handed out (the registry's `take`), whose foreign-adoption claim is
|
|
1415
|
-
* confirmed on the sandbox; every other adoption reads the tags back. The
|
|
1416
|
-
* exit-code read, the identity check and the re-tag are unchanged. Per-run
|
|
1417
|
-
* capable (experiment switch A1).
|
|
1418
|
-
*/
|
|
1419
|
-
export const ADOPT_IN_PROCESS_EARLY_SANDBOX_WITHOUT_TAG_READ = false;
|
|
1420
|
-
|
|
1421
|
-
/**
|
|
1422
|
-
* PB (off): with E2 and the baked runner image, the early sandbox also starts
|
|
1423
|
-
* the baked runner right after its create, before the run is adopted, so
|
|
1424
|
-
* shell start, watchdog setup and runner bundle evaluation (~200-380 ms) are
|
|
1425
|
-
* off the launch path. One exec runs, in order: the baked-runner verify guard
|
|
1426
|
-
* (verdict line first; a non-ok verdict exits 98 before anything else), the
|
|
1427
|
-
* runtime watchdog starting the runner as `--wait-config <configPath>`, and
|
|
1428
|
-
* the crash-terminal epilogue, all at fixed per-sandbox paths. It holds no
|
|
1429
|
-
* credentials or customer data: no envelope, config or token exists in the
|
|
1430
|
-
* sandbox until the run is adopted. The watchdog's runtime/memory limits and
|
|
1431
|
-
* the runner's V8 flags are fixed at pre-boot from the early sandbox's own
|
|
1432
|
-
* (standard) profile, the same one its `limitsKey` encodes; adoption refuses a
|
|
1433
|
-
* run whose limits differ, and staging asserts it again.
|
|
1434
|
-
*
|
|
1435
|
-
* Adoption (in this process only) delivers the envelope in one exec: stdin to
|
|
1436
|
-
* a file (same guard as the inline launch), then the run's files, config LAST
|
|
1437
|
-
* via rename; the waiting runner picks it up and proceeds exactly as today
|
|
1438
|
-
* (heartbeat, readiness, park fence). Readiness is confirmed as today, and
|
|
1439
|
-
* also fails fast (deferred to a new attempt) if the delivery exec fails or
|
|
1440
|
-
* the pre-boot chain exits first.
|
|
1441
|
-
*
|
|
1442
|
-
* Not adopted (an ordinary sandbox is created and this one is reaped): a
|
|
1443
|
-
* sandbox whose pre-boot another process started (tag), one whose pre-boot
|
|
1444
|
-
* is ambiguous (exec error, late or missing verdict without a confirmed exit
|
|
1445
|
-
* 98), one whose pre-boot already exited, one older than
|
|
1446
|
-
* EARLY_PREBOOT_MAX_ADOPTION_AGE_MS, or a launch whose PB resolves off. A
|
|
1447
|
-
* pre-boot that provably never started (exit 98 confirmed, or no baked plan)
|
|
1448
|
-
* is adopted and launched today's way.
|
|
1449
|
-
*
|
|
1450
|
-
* Orphans: the exact-id reaper (EARLY_MODAL_SANDBOX_REAP_AFTER_MS, 90 s after
|
|
1451
|
-
* create) terminates an unadopted sandbox and the waiting runner with it; the
|
|
1452
|
-
* running exec may keep Modal's idle timeout from firing, so the reaper is the
|
|
1453
|
-
* killer. If the reap itself fails, the runner gives up its config wait at
|
|
1454
|
-
* its own 120 s deadline (runner-app WAIT_CONFIG_TIMEOUT_MS), the chain exits
|
|
1455
|
-
* (the epilogue has no crash pusher or config and pushes nothing), and the
|
|
1456
|
-
* then-idle sandbox ends at the 60 s idle timeout; the watchdog's own 240 s
|
|
1457
|
-
* startup deadline is a later backstop. Adoption itself is ~1-2 s after
|
|
1458
|
-
* create, far inside every bound. Per-run capable (experiment switch PB).
|
|
1459
|
-
*/
|
|
1460
|
-
export const PREBOOT_RUNNER_IN_EARLY_SANDBOX = false;
|
|
1461
|
-
const EARLY_PREBOOT_TAG = 'earlyPreboot';
|
|
1462
|
-
/**
|
|
1463
|
-
* A pre-boot older than this is not adopted: its watchdog's startup deadline
|
|
1464
|
-
* runs from pre-boot, and the runner's config wait has a 120 s deadline.
|
|
1465
|
-
*/
|
|
1466
|
-
const EARLY_PREBOOT_MAX_ADOPTION_AGE_MS = 30_000;
|
|
1467
|
-
/** Bound on the pre-boot's verdict line, and on its exit after a refusal. */
|
|
1468
|
-
const EARLY_PREBOOT_VERDICT_TIMEOUT_MS = 15_000;
|
|
1469
|
-
export type EarlyModalPreboot =
|
|
1470
|
-
| {
|
|
1471
|
-
status: 'running';
|
|
1472
|
-
runner: PrebootedRunnerLaunch;
|
|
1473
|
-
/** The pre-boot chain's exit code (runner, then epilogue). */
|
|
1474
|
-
exited: Promise<number>;
|
|
1475
|
-
/** Set once `exited` settles with a code. */
|
|
1476
|
-
exitCode: number | null;
|
|
1477
|
-
startedAtMs: number;
|
|
1478
|
-
}
|
|
1479
|
-
/** Provably nothing ran: today's launch may use this sandbox. */
|
|
1480
|
-
| { status: 'not_started'; reason: string }
|
|
1481
|
-
/** Cannot prove what ran: never adopted. */
|
|
1482
|
-
| { status: 'ambiguous'; reason: string };
|
|
1343
|
+
export type EarlyModalPreboot = EarlySandboxPreboot<PrebootedRunnerLaunch>;
|
|
1483
1344
|
const earlyModalPreboots = new WeakMap<
|
|
1484
1345
|
ModalSandbox,
|
|
1485
1346
|
Promise<EarlyModalPreboot>
|
|
@@ -1597,57 +1458,10 @@ export async function startEarlyModalPreboot(input: {
|
|
|
1597
1458
|
? fail('not_started', `verdict_${verdict}`)
|
|
1598
1459
|
: fail('ambiguous', `verdict_${verdict}_exit_${code ?? 'unknown'}`);
|
|
1599
1460
|
}
|
|
1600
|
-
/**
|
|
1601
|
-
* An early sandbox on a slow host may not have a running container yet when
|
|
1602
|
-
* it is terminated, so its exit code can stay unset for a while (FAST1c: 2 of
|
|
1603
|
-
* 12 unconfirmed after ~11 s). Re-terminate and re-read with a backoff capped at
|
|
1604
|
-
* 2 s, ~60 s in all, before handing it to the 90 s exact-id reaper.
|
|
1605
|
-
*/
|
|
1606
|
-
const EARLY_MODAL_SANDBOX_HEDGE_CONFIRM_ATTEMPTS = 35;
|
|
1607
|
-
const earlyHedgeConfirmDelayMs = (attempt: number) =>
|
|
1608
|
-
Math.min(200 * attempt, 2_000);
|
|
1609
1461
|
|
|
1610
1462
|
/**
|
|
1611
|
-
*
|
|
1612
|
-
*
|
|
1613
|
-
* miss a terminate). Returns the attempts it took; throws when the read-back
|
|
1614
|
-
* never confirms within `attempts`, or on a provider error.
|
|
1615
|
-
*/
|
|
1616
|
-
export async function terminateModalSandboxConfirmed(input: {
|
|
1617
|
-
sandbox: Pick<ModalSandbox, 'terminate' | 'sandboxId'>;
|
|
1618
|
-
readExitCode: (sandboxId: string) => Promise<number | null>;
|
|
1619
|
-
sleep: (ms: number) => Promise<void>;
|
|
1620
|
-
attempts: number;
|
|
1621
|
-
}): Promise<number> {
|
|
1622
|
-
for (let attempt = 1; attempt <= input.attempts; attempt++) {
|
|
1623
|
-
// Idempotent; repeated because a not-yet-running sandbox may miss it.
|
|
1624
|
-
await input.sandbox.terminate();
|
|
1625
|
-
if ((await input.readExitCode(input.sandbox.sandboxId)) !== null)
|
|
1626
|
-
return attempt;
|
|
1627
|
-
await input.sleep(earlyHedgeConfirmDelayMs(attempt));
|
|
1628
|
-
}
|
|
1629
|
-
throw new Error('termination not confirmed by read-back');
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
const sleepMs = (ms: number) =>
|
|
1633
|
-
new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
1634
|
-
|
|
1635
|
-
const readModalExitCode =
|
|
1636
|
-
(client: Pick<ModalClient, 'sandboxes'>) => async (sandboxId: string) =>
|
|
1637
|
-
await (await client.sandboxes.fromId(sandboxId)).poll();
|
|
1638
|
-
|
|
1639
|
-
function isUnadoptedEarlyModalSandbox(tags: Record<string, string>): boolean {
|
|
1640
|
-
return (
|
|
1641
|
-
tags.source === EARLY_MODAL_SANDBOX_SOURCE_TAG ||
|
|
1642
|
-
tags.source === EARLY_MODAL_SANDBOX_HEDGE_TAG
|
|
1643
|
-
);
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
/**
|
|
1647
|
-
* Reap one early (or hedge) sandbox by exact id if it is still unadopted: a
|
|
1648
|
-
* fresh tag read (an adopted sandbox carries ordinary launch tags), then a
|
|
1649
|
-
* confirmed termination. An unconfirmed one keeps its early tag, so the
|
|
1650
|
-
* durable sweep (sweepOrphanEarlyModalSandboxes) still finds it.
|
|
1463
|
+
* Reap one early (or hedge) Modal sandbox by exact id if it is still
|
|
1464
|
+
* unadopted (see reapEarlySandboxById).
|
|
1651
1465
|
*/
|
|
1652
1466
|
export async function reapEarlyModalSandboxById(input: {
|
|
1653
1467
|
client: Pick<ModalClient, 'sandboxes'>;
|
|
@@ -1656,168 +1470,40 @@ export async function reapEarlyModalSandboxById(input: {
|
|
|
1656
1470
|
attempts?: number;
|
|
1657
1471
|
sleep?: (ms: number) => Promise<void>;
|
|
1658
1472
|
}): Promise<'not_early' | 'terminated'> {
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const confirmAttempts = await terminateModalSandboxConfirmed({
|
|
1662
|
-
sandbox: fresh,
|
|
1663
|
-
readExitCode: readModalExitCode(input.client),
|
|
1664
|
-
sleep: input.sleep ?? sleepMs,
|
|
1665
|
-
attempts: input.attempts ?? EARLY_MODAL_SANDBOX_HEDGE_CONFIRM_ATTEMPTS,
|
|
1666
|
-
});
|
|
1667
|
-
logEarlyModalSandbox('reaped_unadopted', {
|
|
1473
|
+
return await reapEarlySandboxById({
|
|
1474
|
+
calls: earlyModalSandboxLookups(input.client),
|
|
1668
1475
|
key: input.key,
|
|
1669
1476
|
sandboxId: input.sandboxId,
|
|
1670
|
-
|
|
1477
|
+
...(input.attempts === undefined ? {} : { attempts: input.attempts }),
|
|
1478
|
+
...(input.sleep === undefined ? {} : { sleep: input.sleep }),
|
|
1671
1479
|
});
|
|
1672
|
-
return 'terminated';
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
function logEarlyModalSandboxReapUnconfirmed(input: {
|
|
1676
|
-
event: string;
|
|
1677
|
-
key: string;
|
|
1678
|
-
sandboxId: string;
|
|
1679
|
-
error: unknown;
|
|
1680
|
-
}) {
|
|
1681
|
-
// Loud: the sandbox keeps its early tag, so the durable sweep retries it.
|
|
1682
|
-
console.error(
|
|
1683
|
-
JSON.stringify({
|
|
1684
|
-
event: `play-runner.modal.early.${input.event}`,
|
|
1685
|
-
key: input.key,
|
|
1686
|
-
sandboxId: input.sandboxId,
|
|
1687
|
-
error:
|
|
1688
|
-
input.error instanceof Error
|
|
1689
|
-
? input.error.message
|
|
1690
|
-
: String(input.error),
|
|
1691
|
-
}),
|
|
1692
|
-
);
|
|
1693
1480
|
}
|
|
1694
1481
|
|
|
1695
|
-
/**
|
|
1696
|
-
* In-process exact-id reaper: after EARLY_MODAL_SANDBOX_REAP_AFTER_MS,
|
|
1697
|
-
* terminate the sandbox (confirmed) if it still carries an early (or hedge)
|
|
1698
|
-
* tag, i.e. no launch adopted it. The fast path only: the durable guarantee is
|
|
1699
|
-
* the early tag itself, set by the create call, which the worker's sweep reads
|
|
1700
|
-
* even after this process is gone.
|
|
1701
|
-
*/
|
|
1702
|
-
function scheduleEarlyModalSandboxReap(input: {
|
|
1703
|
-
client: ModalClient;
|
|
1704
|
-
key: string;
|
|
1705
|
-
sandboxId: string;
|
|
1706
|
-
}): void {
|
|
1707
|
-
const reap = setTimeout(() => {
|
|
1708
|
-
void reapEarlyModalSandboxById(input).catch((error: unknown) =>
|
|
1709
|
-
logEarlyModalSandboxReapUnconfirmed({
|
|
1710
|
-
event: 'reap_unconfirmed',
|
|
1711
|
-
key: input.key,
|
|
1712
|
-
sandboxId: input.sandboxId,
|
|
1713
|
-
error,
|
|
1714
|
-
}),
|
|
1715
|
-
);
|
|
1716
|
-
}, EARLY_MODAL_SANDBOX_REAP_AFTER_MS);
|
|
1717
|
-
reap.unref?.();
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
/**
|
|
1721
|
-
* Durable orphan cleanup for E2/PB early sandboxes (and retired F2 legs). The cleanup
|
|
1722
|
-
* obligation is recorded before (atomically with) every early create: the
|
|
1723
|
-
* create request itself carries the early (or hedge) source tag and its
|
|
1724
|
-
* create time, and Modal holds those tags for the sandbox's life. The main
|
|
1725
|
-
* path's `ambiguous_modal_creates` row cannot be used here: the hint arrives
|
|
1726
|
-
* before the run is enqueued, so there is no run row or attempt lease to
|
|
1727
|
-
* fence it to. Once adopted, a sandbox carries the run's create tags and the
|
|
1728
|
-
* main path's obligation (recorded before adoption) covers it.
|
|
1729
|
-
*
|
|
1730
|
-
* This pass lists only unadopted early sandboxes (the source-tag selector),
|
|
1731
|
-
* skips any younger than EARLY_MODAL_SANDBOX_REAP_AFTER_MS, re-reads each
|
|
1732
|
-
* one's tags by exact id, and terminates it with a bounded confirmation. No
|
|
1733
|
-
* launch adopts past EARLY_MODAL_SANDBOX_MAX_ADOPTION_AGE_MS (60 s < 90 s), so
|
|
1734
|
-
* whichever worker created it, an early sandbox this old is an orphan. One
|
|
1735
|
-
* not confirmed this pass keeps its tag and is retried by the next.
|
|
1736
|
-
*/
|
|
1737
|
-
export const EARLY_MODAL_SANDBOX_SWEEP_INTERVAL_MS = 60_000;
|
|
1738
|
-
const EARLY_MODAL_SANDBOX_SWEEP_LIMIT = 20;
|
|
1739
|
-
const EARLY_MODAL_SANDBOX_SWEEP_CONFIRM_ATTEMPTS = 5;
|
|
1740
|
-
|
|
1482
|
+
/** The durable orphan sweep over one Modal app (see sweepOrphanEarlySandboxes). */
|
|
1741
1483
|
export async function sweepOrphanEarlyModalSandboxes(input: {
|
|
1742
1484
|
client: Pick<ModalClient, 'sandboxes'>;
|
|
1743
1485
|
modalAppId: string;
|
|
1744
1486
|
nowMs?: () => number;
|
|
1745
1487
|
sleep?: (ms: number) => Promise<void>;
|
|
1746
1488
|
limit?: number;
|
|
1747
|
-
}): Promise<{
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
const limit = input.limit ?? EARLY_MODAL_SANDBOX_SWEEP_LIMIT;
|
|
1755
|
-
const ids = new Set<string>();
|
|
1756
|
-
for (const source of [
|
|
1757
|
-
EARLY_MODAL_SANDBOX_SOURCE_TAG,
|
|
1758
|
-
EARLY_MODAL_SANDBOX_HEDGE_TAG,
|
|
1759
|
-
]) {
|
|
1760
|
-
for await (const listed of input.client.sandboxes.list({
|
|
1761
|
-
appId: input.modalAppId,
|
|
1762
|
-
tags: { source },
|
|
1763
|
-
})) {
|
|
1764
|
-
if (ids.size >= limit) break;
|
|
1765
|
-
if (listed.sandboxId?.trim()) ids.add(listed.sandboxId.trim());
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
let terminated = 0;
|
|
1769
|
-
let unconfirmed = 0;
|
|
1770
|
-
let young = 0;
|
|
1771
|
-
await Promise.all(
|
|
1772
|
-
[...ids].map(async (sandboxId) => {
|
|
1773
|
-
try {
|
|
1774
|
-
const fresh = await input.client.sandboxes.fromId(sandboxId);
|
|
1775
|
-
const tags = await fresh.getTags();
|
|
1776
|
-
if (!isUnadoptedEarlyModalSandbox(tags)) return;
|
|
1777
|
-
const ageMs = earlyModalSandboxAgeMs(tags, nowMs());
|
|
1778
|
-
// A sandbox without a create time predates the tag and is past any
|
|
1779
|
-
// adoption (adoption refuses it), so it is reaped.
|
|
1780
|
-
if (ageMs !== null && ageMs < EARLY_MODAL_SANDBOX_REAP_AFTER_MS) {
|
|
1781
|
-
young += 1;
|
|
1782
|
-
return;
|
|
1783
|
-
}
|
|
1784
|
-
const confirmAttempts = await terminateModalSandboxConfirmed({
|
|
1785
|
-
sandbox: fresh,
|
|
1786
|
-
readExitCode: readModalExitCode(input.client),
|
|
1787
|
-
sleep: input.sleep ?? sleepMs,
|
|
1788
|
-
attempts: EARLY_MODAL_SANDBOX_SWEEP_CONFIRM_ATTEMPTS,
|
|
1789
|
-
});
|
|
1790
|
-
terminated += 1;
|
|
1791
|
-
logEarlyModalSandbox('swept_orphan', {
|
|
1792
|
-
key: tags.earlyKey ?? null,
|
|
1793
|
-
sandboxId,
|
|
1794
|
-
ageMs,
|
|
1795
|
-
confirmAttempts,
|
|
1796
|
-
});
|
|
1797
|
-
} catch (error) {
|
|
1798
|
-
unconfirmed += 1;
|
|
1799
|
-
logEarlyModalSandboxReapUnconfirmed({
|
|
1800
|
-
event: 'sweep_unconfirmed',
|
|
1801
|
-
key: 'sweep',
|
|
1802
|
-
sandboxId,
|
|
1803
|
-
error,
|
|
1804
|
-
});
|
|
1805
|
-
}
|
|
1806
|
-
}),
|
|
1807
|
-
);
|
|
1808
|
-
return { observed: ids.size, terminated, unconfirmed, young };
|
|
1489
|
+
}): Promise<EarlySandboxSweepOutcome> {
|
|
1490
|
+
return await sweepOrphanEarlySandboxes({
|
|
1491
|
+
calls: earlyModalSandboxCalls(input),
|
|
1492
|
+
...(input.nowMs === undefined ? {} : { nowMs: input.nowMs }),
|
|
1493
|
+
...(input.sleep === undefined ? {} : { sleep: input.sleep }),
|
|
1494
|
+
...(input.limit === undefined ? {} : { limit: input.limit }),
|
|
1495
|
+
});
|
|
1809
1496
|
}
|
|
1810
1497
|
|
|
1811
1498
|
/**
|
|
1812
1499
|
* The worker's sweep pass. Early sandboxes exist only under the
|
|
1813
|
-
* modal_sidecar profile (
|
|
1500
|
+
* modal_sidecar profile (the Adapter's startUnavailable refuses otherwise), so with it
|
|
1814
1501
|
* off this makes no provider call.
|
|
1815
1502
|
*/
|
|
1816
1503
|
export async function sweepOrphanEarlyModalSandboxesForWorker(input: {
|
|
1817
1504
|
runtimeSchedulerSchema: string | null;
|
|
1818
1505
|
}): Promise<
|
|
1819
|
-
|
|
|
1820
|
-
| { skipped: 'sidecar_profile_off' | 'app_missing' }
|
|
1506
|
+
EarlySandboxSweepOutcome | { skipped: 'sidecar_profile_off' | 'app_missing' }
|
|
1821
1507
|
> {
|
|
1822
1508
|
if (!DURABLE_RUNS_ROLLOUT.modalSupervisorSidecar)
|
|
1823
1509
|
return { skipped: 'sidecar_profile_off' };
|
|
@@ -1840,290 +1526,246 @@ export async function sweepOrphanEarlyModalSandboxesForWorker(input: {
|
|
|
1840
1526
|
});
|
|
1841
1527
|
}
|
|
1842
1528
|
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
limits: null,
|
|
1873
|
-
});
|
|
1874
|
-
const resources = modalSandboxResourcesForPlay(modalConfig.limits);
|
|
1875
|
-
const memoryPolicy = resolveModalSandboxMemoryPolicy({
|
|
1876
|
-
limits: modalConfig.limits,
|
|
1877
|
-
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
1878
|
-
});
|
|
1879
|
-
const app = await modalLaunchLookup({
|
|
1880
|
-
client: modalConfig.client,
|
|
1881
|
-
key: `app:${modalConfig.appName}`,
|
|
1882
|
-
enabled: true,
|
|
1883
|
-
load: () =>
|
|
1884
|
-
modalConfig.client.apps.fromName(modalConfig.appName, {
|
|
1885
|
-
createIfMissing: true,
|
|
1886
|
-
}),
|
|
1887
|
-
});
|
|
1888
|
-
const runnerImage = await resolveModalRunnerImage({
|
|
1889
|
-
client: modalConfig.client,
|
|
1890
|
-
configuredHash: await bakedRunnerLookupHash({
|
|
1891
|
-
bundle: buildPlayRunnerBundle,
|
|
1529
|
+
/**
|
|
1530
|
+
* The Modal create behind startEarlySandbox: resolve the app and image, create
|
|
1531
|
+
* with the early tags, then arm the sandbox (exact-id reaper, PB pre-boot, S1
|
|
1532
|
+
* supervisor).
|
|
1533
|
+
*/
|
|
1534
|
+
async function createEarlyModalSandbox(
|
|
1535
|
+
input: EarlySandboxStartRequest & {
|
|
1536
|
+
key: string;
|
|
1537
|
+
orgId: string;
|
|
1538
|
+
hintAtMs: number;
|
|
1539
|
+
},
|
|
1540
|
+
): Promise<EarlyModalSandboxEntry> {
|
|
1541
|
+
const { key, orgId, hintAtMs } = input;
|
|
1542
|
+
const modalConfig = await loadModalRequiredConfig({
|
|
1543
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
1544
|
+
limits: null,
|
|
1545
|
+
});
|
|
1546
|
+
const resources = modalSandboxResourcesForPlay(modalConfig.limits);
|
|
1547
|
+
const memoryPolicy = resolveModalSandboxMemoryPolicy({
|
|
1548
|
+
limits: modalConfig.limits,
|
|
1549
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
1550
|
+
});
|
|
1551
|
+
const app = await modalLaunchLookup({
|
|
1552
|
+
client: modalConfig.client,
|
|
1553
|
+
key: `app:${modalConfig.appName}`,
|
|
1554
|
+
enabled: true,
|
|
1555
|
+
load: () =>
|
|
1556
|
+
modalConfig.client.apps.fromName(modalConfig.appName, {
|
|
1557
|
+
createIfMissing: true,
|
|
1892
1558
|
}),
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
)
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1559
|
+
});
|
|
1560
|
+
const runnerImage = await resolveModalRunnerImage({
|
|
1561
|
+
client: modalConfig.client,
|
|
1562
|
+
configuredHash: await bakedRunnerLookupHash({
|
|
1563
|
+
bundle: buildPlayRunnerBundle,
|
|
1564
|
+
}),
|
|
1565
|
+
explicitImage: modalConfig.imageExplicit === true,
|
|
1566
|
+
defaultImage: () =>
|
|
1567
|
+
modalConfig.client.images.fromRegistry(modalConfig.image),
|
|
1568
|
+
lookupPublished: (ref) => modalConfig.client.images.fromName(ref),
|
|
1569
|
+
});
|
|
1570
|
+
const baseImage = runnerImage.image;
|
|
1571
|
+
const image = isModalPreviewEvaluation({
|
|
1572
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
1573
|
+
})
|
|
1574
|
+
? await modalLaunchLookup({
|
|
1575
|
+
client: modalConfig.client,
|
|
1576
|
+
key: `preview-python-image:${app.appId}:${runnerImage.ref ?? modalConfig.image}`,
|
|
1577
|
+
enabled: true,
|
|
1578
|
+
load: () =>
|
|
1579
|
+
withModalCallSignal(
|
|
1580
|
+
AbortSignal.timeout(MODAL_SANDBOX_CREATE_TIMEOUT_MS),
|
|
1581
|
+
() =>
|
|
1582
|
+
baseImage
|
|
1583
|
+
.dockerfileCommands([
|
|
1584
|
+
'RUN apt-get update && apt-get install -y --no-install-recommends python3 python-is-python3 && rm -rf /var/lib/apt/lists/*',
|
|
1585
|
+
])
|
|
1586
|
+
.build(app),
|
|
1587
|
+
),
|
|
1588
|
+
})
|
|
1589
|
+
: baseImage;
|
|
1590
|
+
const cpu = modalSupervisorLaunch().cpu || resources.physicalCpuCores;
|
|
1591
|
+
const timeoutMs = modalSandboxLifetimeMs(modalConfig.limits);
|
|
1592
|
+
const createRequestedAtMs = Date.now();
|
|
1593
|
+
const earlyParams = {
|
|
1594
|
+
cpu,
|
|
1595
|
+
cpuLimit: cpu,
|
|
1596
|
+
timeoutMs,
|
|
1597
|
+
// Orphan guard: an unadopted early sandbox runs no command and
|
|
1598
|
+
// terminates after this idle window (PB runs one; the exact-id reaper
|
|
1599
|
+
// ends that sandbox, see PREBOOT_RUNNER_IN_EARLY_SANDBOX).
|
|
1600
|
+
idleTimeoutMs: EARLY_SANDBOX_IDLE_TIMEOUT_MS,
|
|
1601
|
+
workdir: modalConfig.workdir,
|
|
1602
|
+
memoryMiB: memoryPolicy.reservationMemoryMiB,
|
|
1603
|
+
memoryLimitMiB: memoryPolicy.memoryLimitMiB,
|
|
1604
|
+
outboundCidrAllowlist: [],
|
|
1605
|
+
regions:
|
|
1606
|
+
modalSupervisorLaunch().regions ?? MODAL_SUPERVISOR_DEFAULT_REGIONS,
|
|
1607
|
+
};
|
|
1608
|
+
// PB: the pre-boot claim rides on the create tags, so no other process
|
|
1609
|
+
// can see this sandbox without it.
|
|
1610
|
+
const preboot =
|
|
1611
|
+
runnerImage.baked &&
|
|
1612
|
+
resolveExperimentSwitch(
|
|
1613
|
+
'PB',
|
|
1614
|
+
input.experimentSwitchOverrides,
|
|
1615
|
+
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
1616
|
+
);
|
|
1617
|
+
const earlyTags = earlySandboxCreateTags({
|
|
1618
|
+
key,
|
|
1619
|
+
orgId,
|
|
1620
|
+
workflowId: input.workflowId,
|
|
1621
|
+
createRequestedAtMs,
|
|
1622
|
+
limitsKey: earlySandboxLimitsKey({
|
|
1922
1623
|
cpu,
|
|
1923
|
-
|
|
1624
|
+
memoryMiB: earlyParams.memoryMiB,
|
|
1924
1625
|
timeoutMs,
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
key,
|
|
1977
|
-
sandboxId: late.sandboxId,
|
|
1978
|
-
confirmAttempts,
|
|
1979
|
-
});
|
|
1980
|
-
} catch (error) {
|
|
1981
|
-
// Its early tag (from the create) keeps it in the durable sweep.
|
|
1982
|
-
logEarlyModalSandboxReapUnconfirmed({
|
|
1983
|
-
event: 'late_create_terminate_unconfirmed',
|
|
1984
|
-
key,
|
|
1985
|
-
sandboxId: late.sandboxId,
|
|
1986
|
-
error,
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
},
|
|
1990
|
-
onLateFailure: async () => undefined,
|
|
1991
|
-
});
|
|
1992
|
-
const sandbox = await awaitEarlyCreate(createEarly());
|
|
1993
|
-
logEarlyModalSandbox('created', {
|
|
1626
|
+
}),
|
|
1627
|
+
preboot,
|
|
1628
|
+
});
|
|
1629
|
+
const createEarly = () =>
|
|
1630
|
+
modalConfig.client.sandboxes.create(app, image, {
|
|
1631
|
+
...earlyParams,
|
|
1632
|
+
tags: earlyTags,
|
|
1633
|
+
});
|
|
1634
|
+
const lookups = earlyModalSandboxLookups(modalConfig.client);
|
|
1635
|
+
const awaitEarlyCreate = (create: Promise<ModalSandbox>) =>
|
|
1636
|
+
awaitModalSandboxCreate({
|
|
1637
|
+
create,
|
|
1638
|
+
onLateSuccess: async (late) => {
|
|
1639
|
+
try {
|
|
1640
|
+
const confirmAttempts = await terminateEarlySandboxConfirmed({
|
|
1641
|
+
sandbox: late,
|
|
1642
|
+
readExitCode: readEarlySandboxExitCode(lookups),
|
|
1643
|
+
sleep: sleepMs,
|
|
1644
|
+
attempts: EARLY_SANDBOX_TERMINATE_CONFIRM_ATTEMPTS,
|
|
1645
|
+
});
|
|
1646
|
+
logEarlyModalSandbox('late_create_terminated', {
|
|
1647
|
+
key,
|
|
1648
|
+
sandboxId: late.sandboxId,
|
|
1649
|
+
confirmAttempts,
|
|
1650
|
+
});
|
|
1651
|
+
} catch (error) {
|
|
1652
|
+
// Its early tag (from the create) keeps it in the durable sweep.
|
|
1653
|
+
logEarlySandboxReapUnconfirmed({
|
|
1654
|
+
logScope: EARLY_MODAL_LOG_SCOPE,
|
|
1655
|
+
event: 'late_create_terminate_unconfirmed',
|
|
1656
|
+
key,
|
|
1657
|
+
sandboxId: late.sandboxId,
|
|
1658
|
+
error,
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
onLateFailure: async () => undefined,
|
|
1663
|
+
});
|
|
1664
|
+
const sandbox = await awaitEarlyCreate(createEarly());
|
|
1665
|
+
logEarlyModalSandbox('created', {
|
|
1666
|
+
key,
|
|
1667
|
+
workflowId: input.workflowId,
|
|
1668
|
+
sandboxId: sandbox.sandboxId,
|
|
1669
|
+
hintToRequestMs: createRequestedAtMs - hintAtMs,
|
|
1670
|
+
createMs: Date.now() - createRequestedAtMs,
|
|
1671
|
+
});
|
|
1672
|
+
// Arm the early sandbox: exact-id reaper, PB pre-boot, S1 supervisor.
|
|
1673
|
+
const armEarlySandbox = (sandbox: ModalSandbox) => {
|
|
1674
|
+
// Exact-id reaper: if no launch adopted it, terminate it by id.
|
|
1675
|
+
scheduleEarlySandboxReap({
|
|
1676
|
+
calls: lookups,
|
|
1994
1677
|
key,
|
|
1995
|
-
workflowId: input.workflowId,
|
|
1996
1678
|
sandboxId: sandbox.sandboxId,
|
|
1997
|
-
hintToRequestMs: createRequestedAtMs - hintAtMs,
|
|
1998
|
-
createMs: Date.now() - createRequestedAtMs,
|
|
1999
1679
|
});
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
key,
|
|
2006
|
-
sandboxId: sandbox.sandboxId,
|
|
2007
|
-
});
|
|
2008
|
-
if (preboot) {
|
|
2009
|
-
earlyModalPreboots.set(
|
|
1680
|
+
if (preboot) {
|
|
1681
|
+
earlyModalPreboots.set(
|
|
1682
|
+
sandbox,
|
|
1683
|
+
startEarlyModalPreboot({
|
|
1684
|
+
key,
|
|
2010
1685
|
sandbox,
|
|
2011
|
-
|
|
1686
|
+
bakedRunner: modalBakedRunnerExpectation({
|
|
1687
|
+
imageBaked: true,
|
|
1688
|
+
bundlePromise: buildPlayRunnerBundle(),
|
|
1689
|
+
}),
|
|
1690
|
+
workDir: modalConfig.workdir,
|
|
1691
|
+
sandboxRuntimeLimits: modalConfig.limits,
|
|
1692
|
+
...(memoryPolicy.memoryLimitMiB > memoryPolicy.reservationMemoryMiB
|
|
1693
|
+
? { memoryLimitMiB: memoryPolicy.memoryLimitMiB }
|
|
1694
|
+
: {}),
|
|
1695
|
+
}),
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
const earlySupervisor = resolveExperimentSwitch(
|
|
1699
|
+
'S1',
|
|
1700
|
+
input.experimentSwitchOverrides,
|
|
1701
|
+
START_SUPERVISOR_WITH_EARLY_SANDBOX,
|
|
1702
|
+
);
|
|
1703
|
+
// PB's claim rode on the create tags, so it is already on the sandbox.
|
|
1704
|
+
if (preboot) earlyModalForeignAdoptionClaims.set(sandbox, Promise.resolve());
|
|
1705
|
+
let tags: Record<string, string> = earlyTags;
|
|
1706
|
+
if (earlySupervisor) {
|
|
1707
|
+
tags = { ...earlyTags, [EARLY_SUPERVISOR_TAG]: '1' };
|
|
1708
|
+
const supervisorStartedAtMs = Date.now();
|
|
1709
|
+
// Tag first (with the plan lookup): a launch in another process sees
|
|
1710
|
+
// the sidecar claim and does not adopt this sandbox.
|
|
1711
|
+
const claimTagged = sandbox.setTags(tags);
|
|
1712
|
+
claimTagged.catch(() => undefined);
|
|
1713
|
+
if (!preboot) earlyModalForeignAdoptionClaims.set(sandbox, claimTagged);
|
|
1714
|
+
const ready = (async () => {
|
|
1715
|
+
const [plan] = await Promise.all([
|
|
1716
|
+
resolveModalSupervisorPlan({
|
|
1717
|
+
client: modalConfig.client,
|
|
1718
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
1719
|
+
}),
|
|
1720
|
+
claimTagged,
|
|
1721
|
+
]);
|
|
1722
|
+
await createModalSupervisorSidecar({
|
|
1723
|
+
sandbox,
|
|
1724
|
+
plan,
|
|
1725
|
+
cancellation: new Promise<never>(() => undefined),
|
|
1726
|
+
});
|
|
1727
|
+
})();
|
|
1728
|
+
ready.then(
|
|
1729
|
+
() =>
|
|
1730
|
+
logEarlyModalSandbox('supervisor_created', {
|
|
2012
1731
|
key,
|
|
2013
|
-
sandbox,
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
? { memoryLimitMiB: memoryPolicy.memoryLimitMiB }
|
|
2022
|
-
: {}),
|
|
1732
|
+
sandboxId: sandbox.sandboxId,
|
|
1733
|
+
elapsedMs: Date.now() - supervisorStartedAtMs,
|
|
1734
|
+
}),
|
|
1735
|
+
(error: unknown) =>
|
|
1736
|
+
logEarlyModalSandbox('supervisor_failed', {
|
|
1737
|
+
key,
|
|
1738
|
+
sandboxId: sandbox.sandboxId,
|
|
1739
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2023
1740
|
}),
|
|
2024
|
-
);
|
|
2025
|
-
}
|
|
2026
|
-
const earlySupervisor = resolveExperimentSwitch(
|
|
2027
|
-
'S1',
|
|
2028
|
-
input.experimentSwitchOverrides,
|
|
2029
|
-
START_SUPERVISOR_WITH_EARLY_SANDBOX,
|
|
2030
1741
|
);
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
const supervisorStartedAtMs = Date.now();
|
|
2038
|
-
// Tag first (with the plan lookup): a launch in another process sees
|
|
2039
|
-
// the sidecar claim and does not adopt this sandbox.
|
|
2040
|
-
const claimTagged = sandbox.setTags(tags);
|
|
2041
|
-
claimTagged.catch(() => undefined);
|
|
2042
|
-
if (!preboot) earlyModalForeignAdoptionClaims.set(sandbox, claimTagged);
|
|
2043
|
-
const ready = (async () => {
|
|
2044
|
-
const [plan] = await Promise.all([
|
|
2045
|
-
resolveModalSupervisorPlan({
|
|
2046
|
-
client: modalConfig.client,
|
|
2047
|
-
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
2048
|
-
}),
|
|
2049
|
-
claimTagged,
|
|
2050
|
-
]);
|
|
2051
|
-
await createModalSupervisorSidecar({
|
|
2052
|
-
sandbox,
|
|
2053
|
-
plan,
|
|
2054
|
-
cancellation: new Promise<never>(() => undefined),
|
|
2055
|
-
});
|
|
2056
|
-
})();
|
|
2057
|
-
ready.then(
|
|
2058
|
-
() =>
|
|
2059
|
-
logEarlyModalSandbox('supervisor_created', {
|
|
2060
|
-
key,
|
|
2061
|
-
sandboxId: sandbox.sandboxId,
|
|
2062
|
-
elapsedMs: Date.now() - supervisorStartedAtMs,
|
|
2063
|
-
}),
|
|
2064
|
-
(error: unknown) =>
|
|
2065
|
-
logEarlyModalSandbox('supervisor_failed', {
|
|
2066
|
-
key,
|
|
2067
|
-
sandboxId: sandbox.sandboxId,
|
|
2068
|
-
error: error instanceof Error ? error.message : String(error),
|
|
2069
|
-
}),
|
|
2070
|
-
);
|
|
2071
|
-
earlyModalSupervisors.set(sandbox, ready);
|
|
2072
|
-
}
|
|
2073
|
-
return tags;
|
|
2074
|
-
};
|
|
2075
|
-
const tags = armEarlySandbox(sandbox);
|
|
2076
|
-
return { sandbox, startedAtMs: createRequestedAtMs, tags };
|
|
2077
|
-
})().catch((error: unknown) => {
|
|
2078
|
-
logEarlyModalSandbox('create_failed', {
|
|
2079
|
-
key,
|
|
2080
|
-
error: error instanceof Error ? error.message : String(error),
|
|
2081
|
-
});
|
|
2082
|
-
return null;
|
|
2083
|
-
});
|
|
2084
|
-
earlyModalSandboxes.put(key, started);
|
|
2085
|
-
logEarlyModalSandbox('hint_accepted', { key, workflowId: input.workflowId });
|
|
2086
|
-
return true;
|
|
1742
|
+
earlyModalSupervisors.set(sandbox, ready);
|
|
1743
|
+
}
|
|
1744
|
+
return tags;
|
|
1745
|
+
};
|
|
1746
|
+
const tags = armEarlySandbox(sandbox);
|
|
1747
|
+
return { sandbox, startedAtMs: createRequestedAtMs, tags };
|
|
2087
1748
|
}
|
|
2088
1749
|
|
|
2089
1750
|
/**
|
|
2090
|
-
*
|
|
2091
|
-
*
|
|
2092
|
-
* deliver to, or one that provably never started).
|
|
1751
|
+
* Modal's early-sandbox Adapter. Early sandboxes start only under the
|
|
1752
|
+
* modal_sidecar profile.
|
|
2093
1753
|
*/
|
|
2094
|
-
export
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
// A running runner nobody will deliver to would share the sandbox with
|
|
2105
|
-
// today's launch.
|
|
2106
|
-
if (!input.wanted) return 'preboot_unwanted';
|
|
2107
|
-
if (preboot.exitCode !== null) return 'preboot_exited';
|
|
2108
|
-
if (input.nowMs - preboot.startedAtMs > EARLY_PREBOOT_MAX_ADOPTION_AGE_MS)
|
|
2109
|
-
return 'preboot_stale';
|
|
2110
|
-
if (
|
|
2111
|
-
!samePlaySandboxRuntimeLimits(
|
|
2112
|
-
preboot.runner.sandboxRuntimeLimits,
|
|
2113
|
-
input.sandboxRuntimeLimits,
|
|
2114
|
-
) ||
|
|
2115
|
-
preboot.runner.memoryLimitMiB !== input.memoryLimitMiB
|
|
2116
|
-
)
|
|
2117
|
-
return 'preboot_limits_mismatch';
|
|
2118
|
-
return null;
|
|
2119
|
-
}
|
|
1754
|
+
export const modalEarlySandboxAdapter: EarlySandboxAdapter<ModalSandbox> = {
|
|
1755
|
+
provider: 'modal',
|
|
1756
|
+
logScope: EARLY_MODAL_LOG_SCOPE,
|
|
1757
|
+
registry: earlyModalSandboxes,
|
|
1758
|
+
startUnavailable: () =>
|
|
1759
|
+
DURABLE_RUNS_ROLLOUT.modalSupervisorSidecar ? null : 'sidecar_profile_off',
|
|
1760
|
+
createEarly: createEarlyModalSandbox,
|
|
1761
|
+
sweepOrphansForWorker: sweepOrphanEarlyModalSandboxesForWorker,
|
|
1762
|
+
};
|
|
1763
|
+
|
|
2120
1764
|
|
|
2121
1765
|
/**
|
|
2122
|
-
* Adopt this run's early sandbox by exact id, or return null so the
|
|
2123
|
-
* creates its own
|
|
2124
|
-
*
|
|
2125
|
-
* key is org-scoped, and every path checks the sandbox's org and workflow
|
|
2126
|
-
* tags against this run before re-tagging it; a mismatch is refused loudly.
|
|
1766
|
+
* Adopt this run's early Modal sandbox by exact id, or return null so the
|
|
1767
|
+
* launch creates its own (see adoptEarlySandbox). A sandbox whose S1 sidecar
|
|
1768
|
+
* another process started is refused, like a foreign pre-boot.
|
|
2127
1769
|
*/
|
|
2128
1770
|
export async function adoptEarlyModalSandbox(input: {
|
|
2129
1771
|
client: ModalClient;
|
|
@@ -2142,185 +1784,27 @@ export async function adoptEarlyModalSandbox(input: {
|
|
|
2142
1784
|
registry?: EarlyModalSandboxRegistry;
|
|
2143
1785
|
nowMs?: () => number;
|
|
2144
1786
|
}): Promise<ModalSandbox | null> {
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
how = 'in_process';
|
|
2167
|
-
}
|
|
2168
|
-
if (!sandbox) {
|
|
2169
|
-
for await (const listed of input.client.sandboxes.list({
|
|
2170
|
-
appId: input.modalAppId,
|
|
2171
|
-
tags: { source: EARLY_MODAL_SANDBOX_SOURCE_TAG, earlyKey: key },
|
|
2172
|
-
})) {
|
|
2173
|
-
sandbox = await input.client.sandboxes.fromId(listed.sandboxId);
|
|
2174
|
-
how = 'by_tag';
|
|
2175
|
-
break;
|
|
2176
|
-
}
|
|
2177
|
-
}
|
|
2178
|
-
if (!sandbox) {
|
|
2179
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2180
|
-
key,
|
|
2181
|
-
reason: 'not_found',
|
|
2182
|
-
elapsedMs: nowMs() - startedAt,
|
|
2183
|
-
});
|
|
2184
|
-
return null;
|
|
2185
|
-
}
|
|
2186
|
-
// A1 may skip the read only for this process's own, fresh, untaken entry
|
|
2187
|
-
// whose foreign-adoption claim is confirmed on the sandbox: then no other
|
|
2188
|
-
// process can have adopted (re-tagged) it. Everything else is read back.
|
|
2189
|
-
const foreignClaim =
|
|
2190
|
-
how === 'in_process'
|
|
2191
|
-
? earlyModalForeignAdoptionClaims.get(sandbox)
|
|
2192
|
-
: undefined;
|
|
2193
|
-
const trustLocalTags =
|
|
2194
|
-
how === 'in_process' &&
|
|
2195
|
-
localEntry !== null &&
|
|
2196
|
-
nowMs() - localEntry.startedAtMs <
|
|
2197
|
-
EARLY_MODAL_SANDBOX_MAX_ADOPTION_AGE_MS &&
|
|
2198
|
-
resolveExperimentSwitch(
|
|
2199
|
-
'A1',
|
|
2200
|
-
input.context.experimentSwitchOverrides,
|
|
2201
|
-
ADOPT_IN_PROCESS_EARLY_SANDBOX_WITHOUT_TAG_READ,
|
|
2202
|
-
) &&
|
|
2203
|
-
foreignClaim !== undefined &&
|
|
2204
|
-
(await foreignClaim.then(
|
|
2205
|
-
() => true,
|
|
2206
|
-
() => false,
|
|
2207
|
-
));
|
|
2208
|
-
const tags =
|
|
2209
|
-
trustLocalTags && localEntry ? localEntry.tags : await sandbox.getTags();
|
|
2210
|
-
const identityRefusal = earlyModalSandboxIdentityRefusal(tags, {
|
|
2211
|
-
key,
|
|
2212
|
-
orgId,
|
|
2213
|
-
workflowId: input.workflowId,
|
|
2214
|
-
});
|
|
2215
|
-
if (identityRefusal) {
|
|
2216
|
-
// Never expected: the key already names this org and workflow. Loud,
|
|
2217
|
-
// and the sandbox is left untouched for its own reaper.
|
|
2218
|
-
console.error(
|
|
2219
|
-
JSON.stringify({
|
|
2220
|
-
event: 'play-runner.modal.early.adopt_refused_identity',
|
|
2221
|
-
reason: identityRefusal,
|
|
2222
|
-
key,
|
|
2223
|
-
how,
|
|
2224
|
-
sandboxId: sandbox.sandboxId,
|
|
2225
|
-
runId: input.context.runId ?? null,
|
|
2226
|
-
}),
|
|
2227
|
-
);
|
|
2228
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2229
|
-
key,
|
|
2230
|
-
reason: identityRefusal,
|
|
2231
|
-
sandboxId: sandbox.sandboxId,
|
|
2232
|
-
elapsedMs: nowMs() - startedAt,
|
|
2233
|
-
});
|
|
2234
|
-
return null;
|
|
2235
|
-
}
|
|
2236
|
-
const ageMs =
|
|
2237
|
-
how === 'in_process' && localEntry
|
|
2238
|
-
? nowMs() - localEntry.startedAtMs
|
|
2239
|
-
: earlyModalSandboxAgeMs(tags, nowMs());
|
|
2240
|
-
if (ageMs === null || ageMs >= EARLY_MODAL_SANDBOX_MAX_ADOPTION_AGE_MS) {
|
|
2241
|
-
// Past the adoption window the reapers own it.
|
|
2242
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2243
|
-
key,
|
|
2244
|
-
reason: 'early_stale',
|
|
2245
|
-
sandboxId: sandbox.sandboxId,
|
|
2246
|
-
ageMs,
|
|
2247
|
-
elapsedMs: nowMs() - startedAt,
|
|
2248
|
-
});
|
|
2249
|
-
return null;
|
|
2250
|
-
}
|
|
2251
|
-
if (how !== 'in_process' && tags[EARLY_SUPERVISOR_TAG]) {
|
|
2252
|
-
// S1: another process started this sandbox's supervisor; a second
|
|
2253
|
-
// sidecar create here would collide. Create an ordinary sandbox.
|
|
2254
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2255
|
-
key,
|
|
2256
|
-
reason: 'early_supervisor_foreign',
|
|
2257
|
-
sandboxId: sandbox.sandboxId,
|
|
2258
|
-
elapsedMs: nowMs() - startedAt,
|
|
2259
|
-
});
|
|
2260
|
-
return null;
|
|
2261
|
-
}
|
|
2262
|
-
if (how !== 'in_process' && tags[EARLY_PREBOOT_TAG]) {
|
|
2263
|
-
// PB: another process started a runner here and holds its delivery
|
|
2264
|
-
// plan; nothing may be delivered to it from this process.
|
|
2265
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2266
|
-
key,
|
|
2267
|
-
reason: 'early_preboot_foreign',
|
|
2268
|
-
sandboxId: sandbox.sandboxId,
|
|
2269
|
-
elapsedMs: nowMs() - startedAt,
|
|
2270
|
-
});
|
|
2271
|
-
return null;
|
|
2272
|
-
}
|
|
2273
|
-
const prebootPending =
|
|
2274
|
-
how === 'in_process' ? earlyModalPreboots.get(sandbox) : undefined;
|
|
2275
|
-
const prebootRefusal = prebootPending
|
|
2276
|
-
? earlyPrebootAdoptionRefusal({
|
|
2277
|
-
preboot: await prebootPending,
|
|
2278
|
-
...input.preboot,
|
|
2279
|
-
nowMs: Date.now(),
|
|
2280
|
-
})
|
|
2281
|
-
: null;
|
|
2282
|
-
if (prebootRefusal) {
|
|
2283
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2284
|
-
key,
|
|
2285
|
-
reason: prebootRefusal,
|
|
2286
|
-
sandboxId: sandbox.sandboxId,
|
|
2287
|
-
elapsedMs: nowMs() - startedAt,
|
|
2288
|
-
});
|
|
2289
|
-
return null;
|
|
2290
|
-
}
|
|
2291
|
-
if (
|
|
2292
|
-
tags.source !== EARLY_MODAL_SANDBOX_SOURCE_TAG ||
|
|
2293
|
-
tags.earlyKey !== key ||
|
|
2294
|
-
tags.limitsKey !== input.expectedLimitsKey ||
|
|
2295
|
-
(await sandbox.poll()) !== null
|
|
2296
|
-
) {
|
|
2297
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2298
|
-
key,
|
|
2299
|
-
reason: 'mismatch_or_exited',
|
|
2300
|
-
sandboxId: sandbox.sandboxId,
|
|
2301
|
-
elapsedMs: nowMs() - startedAt,
|
|
2302
|
-
});
|
|
2303
|
-
return null;
|
|
2304
|
-
}
|
|
2305
|
-
// Re-tag first: from here the sandbox is an ordinary launch sandbox for
|
|
2306
|
-
// every cleanup and reconciliation path, and the reaper skips it.
|
|
2307
|
-
await sandbox.setTags({ ...input.createTags, earlyKey: key });
|
|
2308
|
-
emitModalStage(input.context, 'early:adopted', {
|
|
2309
|
-
key,
|
|
2310
|
-
how,
|
|
2311
|
-
sandboxId: sandbox.sandboxId,
|
|
2312
|
-
elapsedMs: nowMs() - startedAt,
|
|
2313
|
-
});
|
|
2314
|
-
return sandbox;
|
|
2315
|
-
} catch (error) {
|
|
2316
|
-
emitModalStage(input.context, 'early:adopt_miss', {
|
|
2317
|
-
key,
|
|
2318
|
-
reason: 'error',
|
|
2319
|
-
error: error instanceof Error ? error.message : String(error),
|
|
2320
|
-
elapsedMs: nowMs() - startedAt,
|
|
2321
|
-
});
|
|
2322
|
-
return null;
|
|
2323
|
-
}
|
|
1787
|
+
return await adoptEarlySandbox({
|
|
1788
|
+
calls: earlyModalSandboxCalls(input),
|
|
1789
|
+
registry: input.registry ?? earlyModalSandboxes,
|
|
1790
|
+
workflowId: input.workflowId,
|
|
1791
|
+
orgId: input.context.orgId,
|
|
1792
|
+
runId: input.context.runId,
|
|
1793
|
+
experimentSwitchOverrides: input.context.experimentSwitchOverrides,
|
|
1794
|
+
expectedLimitsKey: input.expectedLimitsKey,
|
|
1795
|
+
createTags: input.createTags,
|
|
1796
|
+
preboot: input.preboot,
|
|
1797
|
+
// S1: another process started this sandbox's supervisor; a second
|
|
1798
|
+
// sidecar create here would collide. Create an ordinary sandbox.
|
|
1799
|
+
foreignClaimTags: [
|
|
1800
|
+
{ tag: EARLY_SUPERVISOR_TAG, reason: 'early_supervisor_foreign' },
|
|
1801
|
+
],
|
|
1802
|
+
inProcessPreboot: (sandbox) => earlyModalPreboots.get(sandbox),
|
|
1803
|
+
inProcessForeignAdoptionClaim: (sandbox) =>
|
|
1804
|
+
earlyModalForeignAdoptionClaims.get(sandbox),
|
|
1805
|
+
emitStage: (stage, extra) => emitModalStage(input.context, stage, extra),
|
|
1806
|
+
...(input.nowMs === undefined ? {} : { nowMs: input.nowMs }),
|
|
1807
|
+
});
|
|
2324
1808
|
}
|
|
2325
1809
|
|
|
2326
1810
|
export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
@@ -2600,7 +2084,7 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2600
2084
|
resolveExperimentSwitch(
|
|
2601
2085
|
'E2',
|
|
2602
2086
|
config.context.experimentSwitchOverrides,
|
|
2603
|
-
|
|
2087
|
+
EARLY_SANDBOX_START,
|
|
2604
2088
|
) &&
|
|
2605
2089
|
supervisorPlan &&
|
|
2606
2090
|
config.context.workflowId
|
|
@@ -2608,7 +2092,7 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2608
2092
|
client: modalConfig.client,
|
|
2609
2093
|
modalAppId: app.appId,
|
|
2610
2094
|
workflowId: config.context.workflowId,
|
|
2611
|
-
expectedLimitsKey:
|
|
2095
|
+
expectedLimitsKey: earlySandboxLimitsKey({
|
|
2612
2096
|
cpu: createParams.cpu,
|
|
2613
2097
|
memoryMiB: createParams.memoryMiB,
|
|
2614
2098
|
timeoutMs: createParams.timeoutMs,
|