work-packet 0.1.0__py3-none-any.whl
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.
- work_packet/__about__.py +9 -0
- work_packet/__init__.py +2 -0
- work_packet/__main__.py +3 -0
- work_packet/actions.py +281 -0
- work_packet/archived.py +161 -0
- work_packet/attention.py +175 -0
- work_packet/bghook.py +60 -0
- work_packet/blobs.py +71 -0
- work_packet/brief.py +622 -0
- work_packet/briefagent.py +470 -0
- work_packet/briefing.py +167 -0
- work_packet/card.py +423 -0
- work_packet/check.py +399 -0
- work_packet/checkpoint.py +202 -0
- work_packet/cli.py +3761 -0
- work_packet/clock.py +220 -0
- work_packet/closeout.py +737 -0
- work_packet/convert.py +151 -0
- work_packet/cost.py +126 -0
- work_packet/credentials.py +276 -0
- work_packet/ctxhook.py +178 -0
- work_packet/dash/__init__.py +1 -0
- work_packet/dash/agent.py +524 -0
- work_packet/dash/app.py +3292 -0
- work_packet/dash/board.js +142 -0
- work_packet/dash/compose.js +25 -0
- work_packet/dash/console.js +247 -0
- work_packet/dash/console.py +617 -0
- work_packet/dash/crawl.py +72 -0
- work_packet/dash/data.py +2215 -0
- work_packet/dash/desk.js +183 -0
- work_packet/dash/desk.py +113 -0
- work_packet/dash/dfmrun.py +297 -0
- work_packet/dash/events.py +237 -0
- work_packet/dash/guard.py +355 -0
- work_packet/dash/ide.js +18 -0
- work_packet/dash/ide.py +1660 -0
- work_packet/dash/ide_desk.js +103 -0
- work_packet/dash/ide_forward.js +22 -0
- work_packet/dash/ide_forward.py +285 -0
- work_packet/dash/ide_presence.js +29 -0
- work_packet/dash/live.js +37 -0
- work_packet/dash/login.py +346 -0
- work_packet/dash/markup.js +191 -0
- work_packet/dash/markup.py +287 -0
- work_packet/dash/new.js +308 -0
- work_packet/dash/newjobs.py +154 -0
- work_packet/dash/notify.js +54 -0
- work_packet/dash/packets.js +66 -0
- work_packet/dash/page.js +50 -0
- work_packet/dash/pane.js +40 -0
- work_packet/dash/panels.py +154 -0
- work_packet/dash/plan.py +465 -0
- work_packet/dash/render_gate.py +92 -0
- work_packet/dash/resolve.js +131 -0
- work_packet/dash/restart.py +125 -0
- work_packet/dash/runner.py +298 -0
- work_packet/dash/sched.js +21 -0
- work_packet/dash/sched.py +159 -0
- work_packet/dash/server.py +638 -0
- work_packet/dash/shell.js +168 -0
- work_packet/dash/shells.py +265 -0
- work_packet/dash/studio.js +572 -0
- work_packet/dash/studio.py +1038 -0
- work_packet/dash/studio_chart.js +136 -0
- work_packet/dash/studio_edit.js +61 -0
- work_packet/dash/studio_files.js +323 -0
- work_packet/dash/studio_wait.js +5 -0
- work_packet/dash/tailscale.py +113 -0
- work_packet/dash/templates/_answer.html +65 -0
- work_packet/dash/templates/_autoopen.html +11 -0
- work_packet/dash/templates/_close.html +61 -0
- work_packet/dash/templates/_console.html +28 -0
- work_packet/dash/templates/_dfm.html +53 -0
- work_packet/dash/templates/_inbox.html +33 -0
- work_packet/dash/templates/_log.html +23 -0
- work_packet/dash/templates/_markup_css.html +23 -0
- work_packet/dash/templates/_note.html +17 -0
- work_packet/dash/templates/_open.html +26 -0
- work_packet/dash/templates/_outline.html +44 -0
- work_packet/dash/templates/_panels.html +7 -0
- work_packet/dash/templates/_pause.html +44 -0
- work_packet/dash/templates/_plan.html +26 -0
- work_packet/dash/templates/_project_tasks.html +26 -0
- work_packet/dash/templates/_report.html +56 -0
- work_packet/dash/templates/_sched.html +68 -0
- work_packet/dash/templates/_settings.html +37 -0
- work_packet/dash/templates/_side.html +32 -0
- work_packet/dash/templates/_snapshot.html +47 -0
- work_packet/dash/templates/_tabs.html +111 -0
- work_packet/dash/templates/_tokens.html +130 -0
- work_packet/dash/templates/_vscode.html +37 -0
- work_packet/dash/templates/backlog.html +56 -0
- work_packet/dash/templates/base.html +299 -0
- work_packet/dash/templates/board.html +290 -0
- work_packet/dash/templates/brief.html +75 -0
- work_packet/dash/templates/close.html +62 -0
- work_packet/dash/templates/closed.html +24 -0
- work_packet/dash/templates/closed_one.html +47 -0
- work_packet/dash/templates/compose.html +163 -0
- work_packet/dash/templates/console_list.html +19 -0
- work_packet/dash/templates/console_view.html +28 -0
- work_packet/dash/templates/desk.html +78 -0
- work_packet/dash/templates/doc.html +36 -0
- work_packet/dash/templates/docs_wait.html +19 -0
- work_packet/dash/templates/ide_open.html +20 -0
- work_packet/dash/templates/job.html +17 -0
- work_packet/dash/templates/learn.html +16 -0
- work_packet/dash/templates/live.html +117 -0
- work_packet/dash/templates/missing.html +11 -0
- work_packet/dash/templates/new.html +126 -0
- work_packet/dash/templates/overview.html +326 -0
- work_packet/dash/templates/packet.html +272 -0
- work_packet/dash/templates/packets.html +103 -0
- work_packet/dash/templates/plan.html +132 -0
- work_packet/dash/templates/project.html +69 -0
- work_packet/dash/templates/project_console.html +14 -0
- work_packet/dash/templates/project_cost.html +30 -0
- work_packet/dash/templates/project_settings.html +23 -0
- work_packet/dash/templates/project_steps.html +36 -0
- work_packet/dash/templates/project_tasks.html +13 -0
- work_packet/dash/templates/rhythm.html +36 -0
- work_packet/dash/templates/run.html +99 -0
- work_packet/dash/templates/runs.html +19 -0
- work_packet/dash/templates/sched.html +181 -0
- work_packet/dash/templates/settings.html +46 -0
- work_packet/dash/templates/shutdown.html +33 -0
- work_packet/dash/templates/stats.html +113 -0
- work_packet/dash/templates/step.html +121 -0
- work_packet/dash/templates/studio.html +178 -0
- work_packet/dash/templates/studio_chart.html +63 -0
- work_packet/dash/templates/studio_frame.html +27 -0
- work_packet/dash/templates/studio_table_frame.html +26 -0
- work_packet/dash/templates/task.html +64 -0
- work_packet/dash/tls.py +198 -0
- work_packet/dash/tokens.py +640 -0
- work_packet/dash/vendor/codemirror/codemirror.js +35 -0
- work_packet/dash/vendor/draw/chunks/abnfDiagram-VCTEODGH-IYHP3IKK.js +1 -0
- work_packet/dash/vendor/draw/chunks/ar-SA-G6X2FPQ2-KEJZLJKC.js +10 -0
- work_packet/dash/vendor/draw/chunks/architecture-7GRP2DOG-2Z5WCH7N.js +1 -0
- work_packet/dash/vendor/draw/chunks/architectureDiagram-5GKGNRK7-6IPZX4AZ.js +36 -0
- work_packet/dash/vendor/draw/chunks/az-AZ-76LH7QW2-7N7KEOCQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/bg-BG-XCXSNQG7-HBXPEYW3.js +5 -0
- work_packet/dash/vendor/draw/chunks/blockDiagram-I7D4REHJ-HIFF6SER.js +129 -0
- work_packet/dash/vendor/draw/chunks/bn-BD-2XOGV67Q-6CR6S4VC.js +5 -0
- work_packet/dash/vendor/draw/chunks/c4Diagram-7LVT6UL2-Y4HANMKS.js +38 -0
- work_packet/dash/vendor/draw/chunks/ca-ES-6MX7JW3Y-ZSE2E6LE.js +8 -0
- work_packet/dash/vendor/draw/chunks/chunk-2A6SUL6G.js +11 -0
- work_packet/dash/vendor/draw/chunks/chunk-2A6SUL6G.js.LEGAL.txt +7 -0
- work_packet/dash/vendor/draw/chunks/chunk-3WSYJLFQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-4GVQQSXF.js +2 -0
- work_packet/dash/vendor/draw/chunks/chunk-57H65VIK.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-5WBZJIWU.js +3 -0
- work_packet/dash/vendor/draw/chunks/chunk-5XG7XPNZ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-6M4R4AFF.js +15 -0
- work_packet/dash/vendor/draw/chunks/chunk-6XR5RTUC.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-A5OTNI3R.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-AXGGC3JO.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-B2JFCMGE.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-CXPI5MBX.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-DFOXX6I4.js +231 -0
- work_packet/dash/vendor/draw/chunks/chunk-DGMO5G7F.js +62 -0
- work_packet/dash/vendor/draw/chunks/chunk-DH3UA6CM.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-DWHQWEYA.js +2 -0
- work_packet/dash/vendor/draw/chunks/chunk-DWHQWEYA.js.LEGAL.txt +12 -0
- work_packet/dash/vendor/draw/chunks/chunk-E4KINRNQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-E6R25O4I.js +206 -0
- work_packet/dash/vendor/draw/chunks/chunk-EEVTYQYK.js +322 -0
- work_packet/dash/vendor/draw/chunks/chunk-EEVTYQYK.js.LEGAL.txt +17 -0
- work_packet/dash/vendor/draw/chunks/chunk-ETOMFKZJ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-FOIVC3BR.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-GGAT5HMK.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-GKM4W5P2.js +128 -0
- work_packet/dash/vendor/draw/chunks/chunk-GKM4W5P2.js.LEGAL.txt +5 -0
- work_packet/dash/vendor/draw/chunks/chunk-H4FYLJME.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-HGJHQCPF.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-HHQUKJHL.js +2 -0
- work_packet/dash/vendor/draw/chunks/chunk-IS3RX4DZ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-IYCTUSGP.js +2 -0
- work_packet/dash/vendor/draw/chunks/chunk-K4BSAQ4O.js +10 -0
- work_packet/dash/vendor/draw/chunks/chunk-KNE6VAJC.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-KRICN4CP.js +32 -0
- work_packet/dash/vendor/draw/chunks/chunk-MJLMSHIR.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-MOYIBIMG.js +7 -0
- work_packet/dash/vendor/draw/chunks/chunk-NCSVWE73.js +19 -0
- work_packet/dash/vendor/draw/chunks/chunk-NWKTNFXW.js +35 -0
- work_packet/dash/vendor/draw/chunks/chunk-NWKTNFXW.js.LEGAL.txt +26 -0
- work_packet/dash/vendor/draw/chunks/chunk-NZE35NHD.js +162 -0
- work_packet/dash/vendor/draw/chunks/chunk-NZE35NHD.js.LEGAL.txt +16 -0
- work_packet/dash/vendor/draw/chunks/chunk-OFOH6VT4.js +168 -0
- work_packet/dash/vendor/draw/chunks/chunk-OTJMTYEK.js +2 -0
- work_packet/dash/vendor/draw/chunks/chunk-PMH6RVNG.js +23 -0
- work_packet/dash/vendor/draw/chunks/chunk-PMH6RVNG.js.LEGAL.txt +67 -0
- work_packet/dash/vendor/draw/chunks/chunk-PQZIXT6L.js +12 -0
- work_packet/dash/vendor/draw/chunks/chunk-REYPBTG2.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-TCGTRZFC.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-UEXIOLKA.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-UJJQB6FQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-UKWDWKKQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-V2JVHE45.js +72 -0
- work_packet/dash/vendor/draw/chunks/chunk-VCMTQKGO.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-VS6DJ7TG.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-WWJTG7EC.js +88 -0
- work_packet/dash/vendor/draw/chunks/chunk-X3JYDHLS.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-XN7N7522.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-YMWFUA6I.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-YSBIDXHK.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-ZBMVOOGI.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-ZCPSHBYU.js +1 -0
- work_packet/dash/vendor/draw/chunks/chunk-ZQNYZDUV.js +1 -0
- work_packet/dash/vendor/draw/chunks/classDiagram-ZZMXUADV-A3HYCVIK.js +1 -0
- work_packet/dash/vendor/draw/chunks/classDiagram-v2-VYDZK3BY-OR3UKMCB.js +1 -0
- work_packet/dash/vendor/draw/chunks/cose-bilkent-JH36ORCC-ZBHMVVRC.js +1 -0
- work_packet/dash/vendor/draw/chunks/cs-CZ-2BRQDIVT-WAS2JIES.js +11 -0
- work_packet/dash/vendor/draw/chunks/cynefin-OW5HDTMX-DNKJZJNJ.js +1 -0
- work_packet/dash/vendor/draw/chunks/cynefinDiagram-5FMLGOSQ-WZR4IPO2.js +62 -0
- work_packet/dash/vendor/draw/chunks/da-DK-5WZEPLOC-Y3K4BJKR.js +5 -0
- work_packet/dash/vendor/draw/chunks/dagre-GXQ25YYZ-NMUGD2TZ.js +4 -0
- work_packet/dash/vendor/draw/chunks/de-DE-XR44H4JA-R4WZKVJM.js +8 -0
- work_packet/dash/vendor/draw/chunks/diagram-S7CK7UJ4-KHOFK7GC.js +30 -0
- work_packet/dash/vendor/draw/chunks/diagram-UQ7AKVKN-3RLQX3F5.js +41 -0
- work_packet/dash/vendor/draw/chunks/diagram-VSXAHHWV-GXRQZGLU.js +3 -0
- work_packet/dash/vendor/draw/chunks/diagram-VX7I27RA-6PVSGYKP.js +24 -0
- work_packet/dash/vendor/draw/chunks/diagram-Z3DM3KII-YO2BWTGT.js +24 -0
- work_packet/dash/vendor/draw/chunks/directory-open-01563666-NLU3R3YR.js +1 -0
- work_packet/dash/vendor/draw/chunks/directory-open-4ed118d0-XLHSEDDC.js +1 -0
- work_packet/dash/vendor/draw/chunks/dist-X7FFHJYY.js +1 -0
- work_packet/dash/vendor/draw/chunks/ebnfDiagram-PWID7BFC-LIYXDZ32.js +1 -0
- work_packet/dash/vendor/draw/chunks/el-GR-BZB4AONW-V3KZ7AFO.js +10 -0
- work_packet/dash/vendor/draw/chunks/en-B4ZKOASM-YYJQHWSP.js +1 -0
- work_packet/dash/vendor/draw/chunks/erDiagram-RLTQ6QDP-2DJVT3NO.js +99 -0
- work_packet/dash/vendor/draw/chunks/es-ES-U4NZUMDT-3B3P6QZB.js +9 -0
- work_packet/dash/vendor/draw/chunks/eu-ES-A7QVB2H4-2N3JY2V3.js +11 -0
- work_packet/dash/vendor/draw/chunks/eventmodeling-NTZA5JFV-H5NMJ7UT.js +1 -0
- work_packet/dash/vendor/draw/chunks/fa-IR-HGAKTJCU-EEK6JILC.js +8 -0
- work_packet/dash/vendor/draw/chunks/fi-FI-Z5N7JZ37-UHRGEABJ.js +6 -0
- work_packet/dash/vendor/draw/chunks/file-open-002ab408-QL4G5Y3G.js +1 -0
- work_packet/dash/vendor/draw/chunks/file-open-7c801643-BHEAEOP5.js +1 -0
- work_packet/dash/vendor/draw/chunks/file-save-3189631c-X44O5Z2G.js +1 -0
- work_packet/dash/vendor/draw/chunks/file-save-745eba88-LWULGU5X.js +1 -0
- work_packet/dash/vendor/draw/chunks/flowDiagram-HODETNUW-DG3GYRDD.js +1 -0
- work_packet/dash/vendor/draw/chunks/fr-FR-RHASNOE6-AKSPOWGA.js +9 -0
- work_packet/dash/vendor/draw/chunks/ganttDiagram-EL5Y4UJY-EVS2NILE.js +292 -0
- work_packet/dash/vendor/draw/chunks/gitGraph-4MIJSDKK-AGIRN4FW.js +1 -0
- work_packet/dash/vendor/draw/chunks/gitGraphDiagram-WWUBYQGX-3PTH6ZIY.js +106 -0
- work_packet/dash/vendor/draw/chunks/gl-ES-HMX3MZ6V-CB33P6KB.js +10 -0
- work_packet/dash/vendor/draw/chunks/he-IL-6SHJWFNN-FCZNWKRK.js +10 -0
- work_packet/dash/vendor/draw/chunks/hi-IN-IWLTKZ5I-JYCAAJJJ.js +4 -0
- work_packet/dash/vendor/draw/chunks/hu-HU-A5ZG7DT2-RI7FK2E5.js +7 -0
- work_packet/dash/vendor/draw/chunks/id-ID-SAP4L64H-C6IOLM4B.js +10 -0
- work_packet/dash/vendor/draw/chunks/image-GAAHSSAO-UTPEFMNS.js +1 -0
- work_packet/dash/vendor/draw/chunks/image-blob-reduce.esm-KMSEY24P.js +3 -0
- work_packet/dash/vendor/draw/chunks/image-blob-reduce.esm-KMSEY24P.js.LEGAL.txt +10 -0
- work_packet/dash/vendor/draw/chunks/info-A6RAGUB7-65F2CQLR.js +1 -0
- work_packet/dash/vendor/draw/chunks/infoDiagram-27XIBGKW-3E4TD4YZ.js +2 -0
- work_packet/dash/vendor/draw/chunks/ishikawaDiagram-5VMMS53U-QV4CMB66.js +70 -0
- work_packet/dash/vendor/draw/chunks/it-IT-JPQ66NNP-72DFKLGV.js +11 -0
- work_packet/dash/vendor/draw/chunks/ja-JP-DBVTYXUO-KD37IMEP.js +8 -0
- work_packet/dash/vendor/draw/chunks/journeyDiagram-3NMN7TZE-7JEXCTW7.js +139 -0
- work_packet/dash/vendor/draw/chunks/kaa-6HZHGXH3-TCQIKBL4.js +1 -0
- work_packet/dash/vendor/draw/chunks/kab-KAB-ZGHBKWFO-C6XARYJN.js +8 -0
- work_packet/dash/vendor/draw/chunks/kanban-definition-UXKFOSKX-BGSHEGSQ.js +89 -0
- work_packet/dash/vendor/draw/chunks/katex-O25S2MFU.js +257 -0
- work_packet/dash/vendor/draw/chunks/kk-KZ-P5N5QNE5-XONCJNK3.js +1 -0
- work_packet/dash/vendor/draw/chunks/km-KH-HSX4SM5Z-OQX6J7CL.js +11 -0
- work_packet/dash/vendor/draw/chunks/ko-KR-MTYHY66A-VBXJ6C52.js +9 -0
- work_packet/dash/vendor/draw/chunks/ku-TR-6OUDTVRD-I4JMXP2I.js +9 -0
- work_packet/dash/vendor/draw/chunks/lt-LT-XHIRWOB4-FNR5H4LC.js +3 -0
- work_packet/dash/vendor/draw/chunks/lv-LV-5QDEKY6T-FEKLQ5BI.js +7 -0
- work_packet/dash/vendor/draw/chunks/mindmap-definition-YA3MSWOX-JJY52ZYZ.js +96 -0
- work_packet/dash/vendor/draw/chunks/mr-IN-CRQNXWMA-DLCZ4ZRB.js +13 -0
- work_packet/dash/vendor/draw/chunks/my-MM-5M5IBNSE-EHIIYKJP.js +1 -0
- work_packet/dash/vendor/draw/chunks/nb-NO-T6EIAALU-7N2HTYRU.js +10 -0
- work_packet/dash/vendor/draw/chunks/nl-NL-IS3SIHDZ-MOD6UX3Z.js +8 -0
- work_packet/dash/vendor/draw/chunks/nn-NO-6E72VCQL-EO4EK5CI.js +8 -0
- work_packet/dash/vendor/draw/chunks/oc-FR-POXYY2M6-3OCVSSCM.js +8 -0
- work_packet/dash/vendor/draw/chunks/pa-IN-N4M65BXN-YXWDCFG5.js +4 -0
- work_packet/dash/vendor/draw/chunks/packet-AYTQ26CC-A265IQGE.js +1 -0
- work_packet/dash/vendor/draw/chunks/pegDiagram-XKGWAZYB-DLDXNRBB.js +1 -0
- work_packet/dash/vendor/draw/chunks/percentages-BXMCSKIN-373SJ4JI.js +1 -0
- work_packet/dash/vendor/draw/chunks/pica-CSPC6DGP.js +3 -0
- work_packet/dash/vendor/draw/chunks/pica-CSPC6DGP.js.LEGAL.txt +14 -0
- work_packet/dash/vendor/draw/chunks/pie-WAS4IAKB-XTWJ4XYX.js +1 -0
- work_packet/dash/vendor/draw/chunks/pieDiagram-E7YTZNPT-TZORDS35.js +39 -0
- work_packet/dash/vendor/draw/chunks/pl-PL-T2D74RX3-EX2EC77W.js +9 -0
- work_packet/dash/vendor/draw/chunks/pt-BR-5N22H2LF-B3YAUDIP.js +9 -0
- work_packet/dash/vendor/draw/chunks/pt-PT-UZXXM6DQ-FRJOQAUZ.js +9 -0
- work_packet/dash/vendor/draw/chunks/quadrantDiagram-AXDQQJYC-JXJE5Z47.js +7 -0
- work_packet/dash/vendor/draw/chunks/radar-RG4KPBEZ-YJ2V3WS4.js +1 -0
- work_packet/dash/vendor/draw/chunks/railroad-74A4TZTK-TQCCW43F.js +1 -0
- work_packet/dash/vendor/draw/chunks/railroad-abnf-HS5TGJTU-KES3ZXDD.js +1 -0
- work_packet/dash/vendor/draw/chunks/railroad-ebnf-LZEXJU2U-RSI23BRN.js +1 -0
- work_packet/dash/vendor/draw/chunks/railroad-peg-WCYAUIDC-WN6UQARL.js +1 -0
- work_packet/dash/vendor/draw/chunks/railroadDiagram-O6MQD6OU-2XJMU5H3.js +1 -0
- work_packet/dash/vendor/draw/chunks/requirementDiagram-BXWQKSXE-6MOMC63A.js +84 -0
- work_packet/dash/vendor/draw/chunks/ro-RO-JPDTUUEW-ZVNZR3AH.js +11 -0
- work_packet/dash/vendor/draw/chunks/roundRect-EOJX3UJR.js +1 -0
- work_packet/dash/vendor/draw/chunks/ru-RU-B4JR7IUQ-C4G6WLHG.js +9 -0
- work_packet/dash/vendor/draw/chunks/sankeyDiagram-P5KCCOFB-35N7JVPZ.js +40 -0
- work_packet/dash/vendor/draw/chunks/sequenceDiagram-WJ2MYXX4-QGY6QK72.js +162 -0
- work_packet/dash/vendor/draw/chunks/si-LK-N5RQ5JYF-5BT2K3LR.js +1 -0
- work_packet/dash/vendor/draw/chunks/sizeCapture-INFHLROL-MFTOEHAO.js +1 -0
- work_packet/dash/vendor/draw/chunks/sk-SK-C5VTKIMK-OGVWZ7IE.js +6 -0
- work_packet/dash/vendor/draw/chunks/sl-SI-NN7IZMDC-BTGH6UGJ.js +6 -0
- work_packet/dash/vendor/draw/chunks/stateDiagram-D77RDMKH-27CRDXRJ.js +1 -0
- work_packet/dash/vendor/draw/chunks/stateDiagram-v2-MP3YSRHH-BQHZNOVQ.js +1 -0
- work_packet/dash/vendor/draw/chunks/subset-shared.chunk-SVRVB3Z4.js +1 -0
- work_packet/dash/vendor/draw/chunks/subset-worker.chunk-I2CVDE6L.js +1 -0
- work_packet/dash/vendor/draw/chunks/sv-SE-XGPEYMSR-FOOGTB4Y.js +10 -0
- work_packet/dash/vendor/draw/chunks/swimlanes-42K2YHIH-63I6QWBZ.js +1 -0
- work_packet/dash/vendor/draw/chunks/swimlanesDiagram-VR7AAH4N-3B2UDBAU.js +8 -0
- work_packet/dash/vendor/draw/chunks/ta-IN-2NMHFXQM-SAE3PZAY.js +9 -0
- work_packet/dash/vendor/draw/chunks/th-TH-HPSO5L25-4OPUJMQQ.js +2 -0
- work_packet/dash/vendor/draw/chunks/timeline-definition-24CTP7MA-CQDE4BLV.js +120 -0
- work_packet/dash/vendor/draw/chunks/tr-TR-DEFEU3FU-WLELAJAL.js +7 -0
- work_packet/dash/vendor/draw/chunks/treeView-Q6P3EWNA-IIOWVAIH.js +1 -0
- work_packet/dash/vendor/draw/chunks/treemap-WGGIJYW6-RVAEJ543.js +1 -0
- work_packet/dash/vendor/draw/chunks/uk-UA-QMV73CPH-Z6BPEBSW.js +6 -0
- work_packet/dash/vendor/draw/chunks/vennDiagram-4TSXK5OY-LN6NUZLY.js +34 -0
- work_packet/dash/vendor/draw/chunks/vi-VN-M7AON7JQ-CQBLIYY5.js +5 -0
- work_packet/dash/vendor/draw/chunks/wardley-WFR3VGLG-YIQTVMO6.js +1 -0
- work_packet/dash/vendor/draw/chunks/wardleyDiagram-VM6X3IG4-N7NFCY55.js +78 -0
- work_packet/dash/vendor/draw/chunks/xychartDiagram-S5SC5T6Z-R6PTX6RL.js +7 -0
- work_packet/dash/vendor/draw/chunks/zh-CN-LNUGB5OW-Q2DWG53W.js +10 -0
- work_packet/dash/vendor/draw/chunks/zh-HK-E62DVLB3-FSFIHZX5.js +1 -0
- work_packet/dash/vendor/draw/chunks/zh-TW-RAJ6MFWO-4H6R2NTS.js +9 -0
- work_packet/dash/vendor/draw/excalidraw.css +1 -0
- work_packet/dash/vendor/draw/excalidraw.js +156 -0
- work_packet/dash/vendor/draw/excalidraw.js.LEGAL.txt +45 -0
- work_packet/dash/vendor/draw/fonts/Assistant/Assistant-Bold.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Assistant/Assistant-Medium.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Assistant/Assistant-Regular.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Assistant/Assistant-SemiBold.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Cascadia/CascadiaCode-Regular.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Liberation/LiberationSans-Regular.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2 +0 -0
- work_packet/dash/vendor/draw/fonts/Virgil/Virgil-Regular.woff2 +0 -0
- work_packet/dash/vendor/draw/mermaid-to-excalidraw.js +1 -0
- work_packet/dash/vendor/draw/mermaid.js +1 -0
- work_packet/dash/vendor/manifest.json +947 -0
- work_packet/dash/vendor/novnc/LICENSE.txt +62 -0
- work_packet/dash/vendor/novnc/novnc.js +5 -0
- work_packet/dash/vendor/term/LICENSE.txt +21 -0
- work_packet/dash/vendor/term/addon-fit.js +2 -0
- work_packet/dash/vendor/term/xterm.css +285 -0
- work_packet/dash/vendor/term/xterm.js +2 -0
- work_packet/dash/vendor/vega/vega.js +202 -0
- work_packet/dash/vendor/vega/vega.js.LEGAL.txt +13 -0
- work_packet/dash/vendored.py +102 -0
- work_packet/deliver.py +252 -0
- work_packet/desktop.py +145 -0
- work_packet/desktop_bin/xdg-mime +28 -0
- work_packet/docs.py +464 -0
- work_packet/executor.py +1745 -0
- work_packet/faults.py +28 -0
- work_packet/forecast.py +268 -0
- work_packet/forges.py +416 -0
- work_packet/frontmatter.py +90 -0
- work_packet/fsutil.py +122 -0
- work_packet/harness/__init__.py +184 -0
- work_packet/harness/claude.py +264 -0
- work_packet/harness/codex.py +132 -0
- work_packet/history.py +630 -0
- work_packet/hookcmd.py +296 -0
- work_packet/hooks.py +122 -0
- work_packet/icsfeed.py +207 -0
- work_packet/ide.py +563 -0
- work_packet/ide_launch.py +176 -0
- work_packet/ide_ports.py +99 -0
- work_packet/ide_releases.py +363 -0
- work_packet/ide_sessions.py +1406 -0
- work_packet/ide_stranded.py +257 -0
- work_packet/inbox.py +220 -0
- work_packet/index.py +101 -0
- work_packet/jobs.py +263 -0
- work_packet/journal.py +87 -0
- work_packet/layout.py +55 -0
- work_packet/learn.py +234 -0
- work_packet/lease.py +124 -0
- work_packet/ledger.py +487 -0
- work_packet/ledger_collect.py +708 -0
- work_packet/limits.py +158 -0
- work_packet/livecard.py +100 -0
- work_packet/migrate.py +567 -0
- work_packet/milestones.py +184 -0
- work_packet/model.py +151 -0
- work_packet/notes.py +132 -0
- work_packet/notify.py +301 -0
- work_packet/packet.py +110 -0
- work_packet/pathhook.py +91 -0
- work_packet/planning.py +279 -0
- work_packet/plugins.py +121 -0
- work_packet/pr.py +230 -0
- work_packet/presence.py +351 -0
- work_packet/prices.toml +75 -0
- work_packet/procs.py +136 -0
- work_packet/profiles.py +125 -0
- work_packet/profiles.toml +22 -0
- work_packet/progress.py +391 -0
- work_packet/project.py +458 -0
- work_packet/prompt.py +308 -0
- work_packet/prompts/brief.md +68 -0
- work_packet/prompts/console.md +54 -0
- work_packet/prompts/harness-claude.md +5 -0
- work_packet/prompts/instruct-list.md +20 -0
- work_packet/prompts/instruct-outline.md +40 -0
- work_packet/prompts/instruct-plan-only.md +26 -0
- work_packet/prompts/protocol.md +342 -0
- work_packet/prompts/resolve.md +71 -0
- work_packet/prompts/sizing-bounded.md +17 -0
- work_packet/prompts/sizing-persistent.md +7 -0
- work_packet/prompts/step.md +23 -0
- work_packet/prompts/studio.md +100 -0
- work_packet/questions.py +233 -0
- work_packet/registry.py +537 -0
- work_packet/report.py +282 -0
- work_packet/requests.py +496 -0
- work_packet/resolve.py +97 -0
- work_packet/reviews.py +465 -0
- work_packet/sched/__init__.py +2 -0
- work_packet/sched/authz.py +72 -0
- work_packet/sched/backends/__init__.py +131 -0
- work_packet/sched/backends/local.py +120 -0
- work_packet/sched/backends/lsf.py +204 -0
- work_packet/sched/backends/slurm.py +209 -0
- work_packet/sched/budget.py +697 -0
- work_packet/sched/classes.py +45 -0
- work_packet/sched/config.py +237 -0
- work_packet/sched/control.py +298 -0
- work_packet/sched/dispatcher.py +617 -0
- work_packet/sched/doctor.py +205 -0
- work_packet/sched/events.py +89 -0
- work_packet/sched/explain.py +168 -0
- work_packet/sched/gates.py +256 -0
- work_packet/sched/home_lease.py +188 -0
- work_packet/sched/ide.py +87 -0
- work_packet/sched/ide_job.py +256 -0
- work_packet/sched/ide_relay.py +207 -0
- work_packet/sched/ide_tls.py +96 -0
- work_packet/sched/jobs.py +135 -0
- work_packet/sched/queue.py +117 -0
- work_packet/sched/xproxy.py +625 -0
- work_packet/scheduler.py +146 -0
- work_packet/schema.py +1565 -0
- work_packet/scribe.py +498 -0
- work_packet/session_usage.py +120 -0
- work_packet/sessionhooks.py +216 -0
- work_packet/settings.py +171 -0
- work_packet/setup.py +1257 -0
- work_packet/skills.py +252 -0
- work_packet/spawn.py +78 -0
- work_packet/split.py +308 -0
- work_packet/starters/__init__.py +608 -0
- work_packet/starters/builtin.py +319 -0
- work_packet/stats.py +577 -0
- work_packet/statusline.py +75 -0
- work_packet/studio/__init__.py +2 -0
- work_packet/studio/chart.py +210 -0
- work_packet/studio/content.py +105 -0
- work_packet/studio/data.py +361 -0
- work_packet/studio/kernel.py +233 -0
- work_packet/studio/kernel_main.py +242 -0
- work_packet/studio/kinds.py +73 -0
- work_packet/studio/model.py +290 -0
- work_packet/studio/primer.py +105 -0
- work_packet/studio/record.py +166 -0
- work_packet/studio/render.py +446 -0
- work_packet/studio/renders.py +334 -0
- work_packet/studio/tree.py +340 -0
- work_packet/studio/versions.py +153 -0
- work_packet/studio/watch.py +188 -0
- work_packet/templates.py +601 -0
- work_packet/timelog.py +115 -0
- work_packet/tomlio.py +24 -0
- work_packet/toolcost.py +275 -0
- work_packet/tui/__init__.py +1 -0
- work_packet/tui/setup_app.py +522 -0
- work_packet/tui/terminal.py +212 -0
- work_packet/views.py +463 -0
- work_packet/waiting.py +127 -0
- work_packet/watch.py +507 -0
- work_packet/workspace.py +343 -0
- work_packet-0.1.0.dist-info/METADATA +162 -0
- work_packet-0.1.0.dist-info/RECORD +505 -0
- work_packet-0.1.0.dist-info/WHEEL +5 -0
- work_packet-0.1.0.dist-info/entry_points.txt +2 -0
- work_packet-0.1.0.dist-info/licenses/LICENSE +202 -0
- work_packet-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""The ``local`` backend: ``wpk step`` as a child process on this host.
|
|
2
|
+
|
|
3
|
+
Cores and memory are counted, not enforced (plan decision 8). A job's ref
|
|
4
|
+
is ``<pid>:<start ticks>``, so a restarted wpkd can tell a job it started
|
|
5
|
+
from a new process that reused the PID.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import signal
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
import threading
|
|
13
|
+
|
|
14
|
+
from ... import procs
|
|
15
|
+
from . import DONE, PENDING, RUNNING, Backend, JobState
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _alive(pid, start):
|
|
19
|
+
st = procs._stat(pid)
|
|
20
|
+
return st is not None and st["state"] != "Z" and (start is None or st["start"] == start)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _reap(pid, start):
|
|
24
|
+
"""The exit code of an adopted job that is our child: after an in-place
|
|
25
|
+
restart (dash/restart.py) the steps the old image started are still this
|
|
26
|
+
process's children, with no Popen to wait on them. None if it is not ours."""
|
|
27
|
+
st = procs._stat(pid)
|
|
28
|
+
if st is None or st["state"] != "Z" or (start is not None and st["start"] != start):
|
|
29
|
+
return None
|
|
30
|
+
try:
|
|
31
|
+
got, status = os.waitpid(pid, os.WNOHANG)
|
|
32
|
+
except ChildProcessError:
|
|
33
|
+
return None
|
|
34
|
+
return os.waitstatus_to_exitcode(status) if got == pid else None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _split(ref):
|
|
38
|
+
pid, _, start = ref.partition(":")
|
|
39
|
+
return int(pid), (int(start) if start else None)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def step_argv(path, lost=None):
|
|
43
|
+
argv = [sys.executable, "-m", "work_packet", "step", path]
|
|
44
|
+
if lost:
|
|
45
|
+
argv += ["--lost", lost]
|
|
46
|
+
return argv
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Local(Backend):
|
|
50
|
+
name = "local"
|
|
51
|
+
poll_s = 2.0 # a child's exit calls on_exit at once; this
|
|
52
|
+
# catches adopted jobs (not our children)
|
|
53
|
+
holds_room_while_pending = False # nothing pends: a job starts at once
|
|
54
|
+
|
|
55
|
+
def __init__(self, h=None):
|
|
56
|
+
self.h = h
|
|
57
|
+
self._kids = {} # ref -> Popen, for the jobs this process started
|
|
58
|
+
self.on_exit = None # called (no args) when a started job exits
|
|
59
|
+
|
|
60
|
+
def _wait(self, p):
|
|
61
|
+
p.wait()
|
|
62
|
+
cb = self.on_exit
|
|
63
|
+
if cb is not None:
|
|
64
|
+
cb()
|
|
65
|
+
|
|
66
|
+
def submit(self, task):
|
|
67
|
+
argv = task.argv or step_argv(task.path, task.lost)
|
|
68
|
+
os.makedirs(os.path.dirname(task.log), exist_ok=True)
|
|
69
|
+
with open(task.log, "ab") as err:
|
|
70
|
+
p = subprocess.Popen(argv, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
|
71
|
+
stderr=err, start_new_session=True,
|
|
72
|
+
env=dict(os.environ, **task.env) if task.env else None)
|
|
73
|
+
st = procs._stat(p.pid)
|
|
74
|
+
ref = "%d:%s" % (p.pid, st["start"] if st else "")
|
|
75
|
+
self._kids[ref] = p
|
|
76
|
+
threading.Thread(target=self._wait, args=(p,), name="wpk-job-wait", daemon=True).start()
|
|
77
|
+
return ref
|
|
78
|
+
|
|
79
|
+
def poll(self, refs):
|
|
80
|
+
out = {}
|
|
81
|
+
for ref in refs:
|
|
82
|
+
p = self._kids.get(ref)
|
|
83
|
+
if p is not None:
|
|
84
|
+
code = p.poll()
|
|
85
|
+
if code is None:
|
|
86
|
+
out[ref] = JobState(RUNNING)
|
|
87
|
+
else:
|
|
88
|
+
del self._kids[ref]
|
|
89
|
+
out[ref] = JobState(DONE, code=code)
|
|
90
|
+
continue
|
|
91
|
+
try:
|
|
92
|
+
pid, start = _split(ref)
|
|
93
|
+
except ValueError:
|
|
94
|
+
out[ref] = JobState(DONE)
|
|
95
|
+
continue
|
|
96
|
+
out[ref] = JobState(RUNNING) if _alive(pid, start) else \
|
|
97
|
+
JobState(DONE, code=_reap(pid, start))
|
|
98
|
+
return out
|
|
99
|
+
|
|
100
|
+
def cancel(self, ref, hard=False):
|
|
101
|
+
try:
|
|
102
|
+
pid, start = _split(ref)
|
|
103
|
+
except ValueError:
|
|
104
|
+
return
|
|
105
|
+
if ref not in self._kids and not _alive(pid, start):
|
|
106
|
+
return
|
|
107
|
+
try:
|
|
108
|
+
os.killpg(pid, signal.SIGKILL if hard else signal.SIGTERM)
|
|
109
|
+
except (ProcessLookupError, PermissionError):
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
def list_ours(self):
|
|
113
|
+
"""Local jobs are only known from their records; the dispatcher has those."""
|
|
114
|
+
return {}
|
|
115
|
+
|
|
116
|
+
def running(self):
|
|
117
|
+
return [r for r, p in self._kids.items() if p.poll() is None]
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
__all__ = ["Local", "PENDING", "RUNNING", "DONE"]
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""The ``lsf`` backend: one ``bsub`` job per step (docs/scheduler.md §5.1, §5.5).
|
|
2
|
+
|
|
3
|
+
One ``bjobs -a`` call for every job per poll. A step may start its own jobs
|
|
4
|
+
through DFM; those are not the pool's and are not counted here.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
import shlex
|
|
11
|
+
import subprocess
|
|
12
|
+
from datetime import datetime
|
|
13
|
+
|
|
14
|
+
from ... import schema
|
|
15
|
+
from . import DONE, LOST, PENDING, RUNNING, Backend, BackendError, JobState
|
|
16
|
+
from .slurm import MARGIN_S, TIMEOUT_S, node_command
|
|
17
|
+
|
|
18
|
+
QUEUED = {"PEND": PENDING, "PSUSP": PENDING, "WAIT": PENDING, "PROV": PENDING,
|
|
19
|
+
"RUN": RUNNING, "USUSP": RUNNING, "SSUSP": RUNNING}
|
|
20
|
+
# EXIT reasons that are the farm's doing: retried, not counted (§5.5).
|
|
21
|
+
FARM = {"TERM_PREEMPT": "preempted", "TERM_ADMIN": "killed by an admin",
|
|
22
|
+
"TERM_LOAD": "host overloaded", "TERM_HOST": "host failure",
|
|
23
|
+
"TERM_REQUEUE_ADMIN": "requeued by an admin", "TERM_ZOMBIE": "zombie job",
|
|
24
|
+
"TERM_UNKNOWN": "unknown", "TERM_OWNER": "killed by its owner"}
|
|
25
|
+
FIELDS = "jobid job_name stat exit_code exit_reason start_time finish_time cpu_used"
|
|
26
|
+
_SUBMITTED = re.compile(r"Job <(\d+)>")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def hhmm(s):
|
|
30
|
+
m = (int(s) + 59) // 60
|
|
31
|
+
return "%d:%02d" % (m // 60, m % 60)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def resource_string(z):
|
|
35
|
+
"""The one ``-R`` for a size: its ``resources`` merged with ``rusage[mem]``
|
|
36
|
+
and ``span[hosts=1]``. Several selects are and-ed; the size's own span
|
|
37
|
+
replaces the default; its rusage is added after the memory."""
|
|
38
|
+
parts = {"select": [], "rusage": ["mem=%d" % z.mem_mb] if z.mem_mb else []}
|
|
39
|
+
order = ["select", "rusage"]
|
|
40
|
+
for name, body in schema.lsf_sections(z.resources):
|
|
41
|
+
if name in ("select", "rusage"):
|
|
42
|
+
parts[name].append(body)
|
|
43
|
+
else:
|
|
44
|
+
parts[name] = [body]
|
|
45
|
+
if name not in order:
|
|
46
|
+
order.append(name)
|
|
47
|
+
if "span" not in parts:
|
|
48
|
+
parts["span"], order = ["hosts=1"], order + ["span"]
|
|
49
|
+
sel = parts["select"]
|
|
50
|
+
parts["select"] = [" && ".join("(%s)" % b for b in sel) if len(sel) > 1 else sel[0]] if sel else []
|
|
51
|
+
parts["rusage"] = [", ".join(parts["rusage"])] if parts["rusage"] else []
|
|
52
|
+
return " ".join("%s[%s]" % (n, parts[n][0]) for n in order if parts[n])
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def cpu_seconds(v):
|
|
56
|
+
"""bjobs ``cpu_used``: ``HH:MM:SS`` or ``1.5 second(s)``."""
|
|
57
|
+
if not v:
|
|
58
|
+
return None
|
|
59
|
+
v = v.strip()
|
|
60
|
+
m = re.match(r"([\d.]+)\s*second", v)
|
|
61
|
+
if m:
|
|
62
|
+
return float(m.group(1))
|
|
63
|
+
try:
|
|
64
|
+
parts = [float(x) for x in v.split(":")]
|
|
65
|
+
except ValueError:
|
|
66
|
+
return None
|
|
67
|
+
while len(parts) < 3:
|
|
68
|
+
parts.insert(0, 0.0)
|
|
69
|
+
return parts[0] * 3600 + parts[1] * 60 + parts[2]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def utc(v, now=None):
|
|
73
|
+
"""bjobs times (``Oct 26 10:00``, ``Oct 26 10:00:05 2026``, local) as ``...Z``."""
|
|
74
|
+
if not v or v.strip() in ("-", ""):
|
|
75
|
+
return None
|
|
76
|
+
v = " ".join(v.replace(" L", "").replace(" E", "").split())
|
|
77
|
+
now = now or datetime.now()
|
|
78
|
+
for fmt in ("%b %d %H:%M:%S %Y", "%b %d %H:%M %Y", "%Y/%m/%d-%H:%M:%S"):
|
|
79
|
+
try:
|
|
80
|
+
return schema.format_timestamp(datetime.strptime(v, fmt).astimezone())
|
|
81
|
+
except ValueError:
|
|
82
|
+
pass
|
|
83
|
+
for fmt in ("%b %d %H:%M:%S", "%b %d %H:%M"):
|
|
84
|
+
try:
|
|
85
|
+
t = datetime.strptime("%s %d" % (v, now.year), fmt + " %Y")
|
|
86
|
+
return schema.format_timestamp(t.astimezone())
|
|
87
|
+
except ValueError:
|
|
88
|
+
pass
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class Lsf(Backend):
|
|
93
|
+
name = "lsf"
|
|
94
|
+
poll_s = 15.0
|
|
95
|
+
holds_room_while_pending = True
|
|
96
|
+
|
|
97
|
+
def __init__(self, cfg, h=None):
|
|
98
|
+
self.cfg = cfg
|
|
99
|
+
self.h = h
|
|
100
|
+
s = cfg.get("lsf") or {}
|
|
101
|
+
self.bin = s.get("bin", "")
|
|
102
|
+
self.common = {"queue": s.get("queue", ""), "project": s.get("project", ""),
|
|
103
|
+
"extra": list(s.get("extra") or ())}
|
|
104
|
+
if s.get("poll"):
|
|
105
|
+
self.poll_s = float(schema.parse_duration(s["poll"]))
|
|
106
|
+
self.step_timeout_s = schema.parse_duration(cfg.get("step_timeout", "120m"))
|
|
107
|
+
|
|
108
|
+
def _run(self, name, args, ok_codes=(0,)):
|
|
109
|
+
argv = [os.path.join(self.bin, name) if self.bin else name] + list(args)
|
|
110
|
+
try:
|
|
111
|
+
p = subprocess.run(argv, capture_output=True, text=True, timeout=TIMEOUT_S,
|
|
112
|
+
stdin=subprocess.DEVNULL)
|
|
113
|
+
except (OSError, subprocess.TimeoutExpired) as e:
|
|
114
|
+
raise BackendError("%s: %s" % (name, e)) from None
|
|
115
|
+
if p.returncode not in ok_codes:
|
|
116
|
+
raise BackendError("%s: %s" % (name, (p.stderr or p.stdout).strip().splitlines()[-1:]
|
|
117
|
+
or "exit %d" % p.returncode))
|
|
118
|
+
return p
|
|
119
|
+
|
|
120
|
+
def submit_argv(self, task):
|
|
121
|
+
z = task.size
|
|
122
|
+
limit = z.time_s or (self.step_timeout_s + MARGIN_S)
|
|
123
|
+
argv = ["-J", task.name, "-W", hhmm(limit), "-n", str(z.cpus),
|
|
124
|
+
"-R", resource_string(z)]
|
|
125
|
+
q = z.queue or self.common["queue"]
|
|
126
|
+
if q:
|
|
127
|
+
argv += ["-q", q]
|
|
128
|
+
if self.common["project"]:
|
|
129
|
+
argv += ["-P", self.common["project"]]
|
|
130
|
+
argv += self.common["extra"] + list(z.extra) + ["-o", task.log]
|
|
131
|
+
cmd = " ".join(shlex.quote(a) for a in task.argv) if task.argv else \
|
|
132
|
+
node_command(self.cfg, task.path, task.lost, z)
|
|
133
|
+
return argv + ["bash", "-c", cmd]
|
|
134
|
+
|
|
135
|
+
def submit(self, task):
|
|
136
|
+
os.makedirs(os.path.dirname(task.log), exist_ok=True)
|
|
137
|
+
p = self._run("bsub", self.submit_argv(task))
|
|
138
|
+
m = _SUBMITTED.search(p.stdout)
|
|
139
|
+
if not m:
|
|
140
|
+
raise BackendError("bsub printed no job ID: %r" % p.stdout[:200])
|
|
141
|
+
return m.group(1)
|
|
142
|
+
|
|
143
|
+
def _bjobs(self, args):
|
|
144
|
+
p = self._run("bjobs", ["-a", "-o", FIELDS, "-json"] + list(args), ok_codes=(0, 255))
|
|
145
|
+
try:
|
|
146
|
+
d = json.loads(p.stdout or "{}")
|
|
147
|
+
except ValueError:
|
|
148
|
+
raise BackendError("bjobs printed no JSON: %r" % p.stdout[:200]) from None
|
|
149
|
+
out = {}
|
|
150
|
+
for r in d.get("RECORDS") or ():
|
|
151
|
+
if r.get("JOBID") and not r.get("ERROR"):
|
|
152
|
+
out[str(r["JOBID"])] = r
|
|
153
|
+
return out
|
|
154
|
+
|
|
155
|
+
def poll(self, refs):
|
|
156
|
+
refs = [r for r in refs if r]
|
|
157
|
+
if not refs:
|
|
158
|
+
return {}
|
|
159
|
+
recs = self._bjobs(refs)
|
|
160
|
+
return {r: self._state(recs[r]) if r in recs else
|
|
161
|
+
JobState(LOST, reason="unknown to the batch system", counted=False)
|
|
162
|
+
for r in refs}
|
|
163
|
+
|
|
164
|
+
@staticmethod
|
|
165
|
+
def _state(r):
|
|
166
|
+
stat = r.get("STAT", "")
|
|
167
|
+
if stat in QUEUED:
|
|
168
|
+
return JobState(QUEUED[stat])
|
|
169
|
+
try:
|
|
170
|
+
code = int(r.get("EXIT_CODE") or 0)
|
|
171
|
+
except ValueError:
|
|
172
|
+
code = None
|
|
173
|
+
why = (r.get("EXIT_REASON") or "").strip()
|
|
174
|
+
term = next((t for t in FARM if t in why), None)
|
|
175
|
+
started, ended = utc(r.get("START_TIME")), utc(r.get("FINISH_TIME"))
|
|
176
|
+
cpu = cpu_seconds(r.get("CPU_USED"))
|
|
177
|
+
if stat in ("UNKWN", "ZOMBI"):
|
|
178
|
+
return JobState(LOST, reason="job state %s" % stat, counted=False,
|
|
179
|
+
started=started, ended=ended, cpu_s=cpu)
|
|
180
|
+
if stat == "DONE":
|
|
181
|
+
return JobState(DONE, code=0, started=started, ended=ended, cpu_s=cpu)
|
|
182
|
+
if term:
|
|
183
|
+
return JobState(LOST, code=code, reason=FARM[term], counted=False, started=started,
|
|
184
|
+
ended=ended, cpu_s=cpu)
|
|
185
|
+
# EXIT: the step's own failure, or TERM_RUNLIMIT (counted, as a step timeout).
|
|
186
|
+
return JobState(DONE, code=code, started=started, ended=ended, cpu_s=cpu,
|
|
187
|
+
reason="timeout" if "TERM_RUNLIMIT" in why else (why or None))
|
|
188
|
+
|
|
189
|
+
def cancel(self, ref, hard=False):
|
|
190
|
+
if hard:
|
|
191
|
+
self._run("bkill", [ref], ok_codes=(0, 255))
|
|
192
|
+
else:
|
|
193
|
+
self._run("bkill", ["-s", "TERM", ref], ok_codes=(0, 255))
|
|
194
|
+
|
|
195
|
+
def list_ours(self):
|
|
196
|
+
from ... import registry
|
|
197
|
+
from ..dispatcher import home_id
|
|
198
|
+
prefix = "wpk:%s:" % home_id(self.h or registry.home())
|
|
199
|
+
recs = self._bjobs(["-J", prefix + "*"])
|
|
200
|
+
return {jid: r.get("JOB_NAME", "") for jid, r in recs.items()
|
|
201
|
+
if r.get("STAT") in QUEUED and r.get("JOB_NAME", "").startswith(prefix)}
|
|
202
|
+
|
|
203
|
+
def running(self):
|
|
204
|
+
return []
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"""The ``slurm`` backend: one ``sbatch`` job per step (docs/scheduler.md §5.1, §5.5).
|
|
2
|
+
|
|
3
|
+
Polite to the controller: one ``squeue`` for every live job per poll, and
|
|
4
|
+
``sacct`` only for jobs that have left the queue.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import shlex
|
|
9
|
+
import subprocess
|
|
10
|
+
|
|
11
|
+
from ... import schema
|
|
12
|
+
from . import DONE, LOST, PENDING, RUNNING, Backend, BackendError, JobState
|
|
13
|
+
|
|
14
|
+
TIMEOUT_S = 30 # a command slower than this counts as the controller down
|
|
15
|
+
MARGIN_S = 300 # run limit beyond the step timeout: the step ends itself first
|
|
16
|
+
|
|
17
|
+
QUEUED = {"PENDING": PENDING, "CONFIGURING": PENDING, "REQUEUED": PENDING,
|
|
18
|
+
"REQUEUE_HOLD": PENDING, "RESV_DEL_HOLD": PENDING, "SUSPENDED": RUNNING,
|
|
19
|
+
"RUNNING": RUNNING, "COMPLETING": RUNNING, "STAGE_OUT": RUNNING, "SIGNALING": RUNNING,
|
|
20
|
+
"RESIZING": RUNNING}
|
|
21
|
+
# Ended by the farm, not the work: retried without counting the attempt (§5.5).
|
|
22
|
+
FARM = {"PREEMPTED": "preempted", "NODE_FAIL": "node failure", "BOOT_FAIL": "node boot failure",
|
|
23
|
+
"DEADLINE": "deadline", "REVOKED": "revoked", "LAUNCH_FAILED": "launch failed"}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def hhmmss(s):
|
|
27
|
+
s = int(s)
|
|
28
|
+
return "%d:%02d:%02d" % (s // 3600, s % 3600 // 60, s % 60)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def cpu_seconds(v):
|
|
32
|
+
"""sacct ``TotalCPU``: ``MM:SS.mmm``, ``HH:MM:SS`` or ``D-HH:MM:SS``."""
|
|
33
|
+
if not v:
|
|
34
|
+
return None
|
|
35
|
+
days = 0
|
|
36
|
+
if "-" in v:
|
|
37
|
+
d, v = v.split("-", 1)
|
|
38
|
+
days = int(d)
|
|
39
|
+
try:
|
|
40
|
+
parts = [float(x) for x in v.split(":")]
|
|
41
|
+
except ValueError:
|
|
42
|
+
return None
|
|
43
|
+
while len(parts) < 3:
|
|
44
|
+
parts.insert(0, 0.0)
|
|
45
|
+
h, m, sec = parts
|
|
46
|
+
return days * 86400 + h * 3600 + m * 60 + sec
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def utc(v):
|
|
50
|
+
"""sacct's ``Start`` (the controller's local time, no zone) as ``...Z``, or None."""
|
|
51
|
+
from datetime import datetime
|
|
52
|
+
try:
|
|
53
|
+
return schema.format_timestamp(datetime.strptime(v, "%Y-%m-%dT%H:%M:%S").astimezone())
|
|
54
|
+
except (TypeError, ValueError):
|
|
55
|
+
return None
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def node_command(cfg, path, lost=None, size=None, argv=None):
|
|
59
|
+
"""What a job runs: ``node_env``, the size's ``env`` lines, and ``wpk step``
|
|
60
|
+
(or ``argv``, an IDE job's command: it gets the same environment, so
|
|
61
|
+
``claude`` and ``codex`` in its terminals are set up like a step's)."""
|
|
62
|
+
if argv:
|
|
63
|
+
cmd = " ".join(shlex.quote(a) for a in argv)
|
|
64
|
+
else:
|
|
65
|
+
cmd = "wpk step %s" % shlex.quote(path)
|
|
66
|
+
if lost:
|
|
67
|
+
cmd += " --lost %s" % shlex.quote(lost)
|
|
68
|
+
lines = [(cfg.get("node_env") or "").strip()]
|
|
69
|
+
lines += (size.env if size is not None else "").splitlines()
|
|
70
|
+
env = " && ".join(x.strip() for x in lines if x.strip())
|
|
71
|
+
return "%s && exec %s" % (env, cmd) if env else "exec " + cmd
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class Slurm(Backend):
|
|
75
|
+
name = "slurm"
|
|
76
|
+
poll_s = 15.0
|
|
77
|
+
holds_room_while_pending = True
|
|
78
|
+
|
|
79
|
+
def __init__(self, cfg, h=None):
|
|
80
|
+
self.cfg = cfg
|
|
81
|
+
self.h = h
|
|
82
|
+
s = cfg.get("slurm") or {}
|
|
83
|
+
self.bin = s.get("bin", "")
|
|
84
|
+
self.common = {"partition": s.get("partition", ""), "account": s.get("account", ""),
|
|
85
|
+
"extra": list(s.get("extra") or ())}
|
|
86
|
+
if s.get("poll"):
|
|
87
|
+
self.poll_s = float(schema.parse_duration(s["poll"]))
|
|
88
|
+
self.step_timeout_s = schema.parse_duration(cfg.get("step_timeout", "120m"))
|
|
89
|
+
|
|
90
|
+
def _run(self, name, args, ok_codes=(0,)):
|
|
91
|
+
argv = [os.path.join(self.bin, name) if self.bin else name] + list(args)
|
|
92
|
+
try:
|
|
93
|
+
p = subprocess.run(argv, capture_output=True, text=True, timeout=TIMEOUT_S,
|
|
94
|
+
stdin=subprocess.DEVNULL)
|
|
95
|
+
except (OSError, subprocess.TimeoutExpired) as e:
|
|
96
|
+
raise BackendError("%s: %s" % (name, e)) from None
|
|
97
|
+
if p.returncode not in ok_codes:
|
|
98
|
+
raise BackendError("%s: %s" % (name, (p.stderr or p.stdout).strip().splitlines()[-1:]
|
|
99
|
+
or "exit %d" % p.returncode))
|
|
100
|
+
return p
|
|
101
|
+
|
|
102
|
+
def submit_argv(self, task):
|
|
103
|
+
z = task.size
|
|
104
|
+
limit = z.time_s or (self.step_timeout_s + MARGIN_S)
|
|
105
|
+
argv = ["--parsable", "-J", task.name, "-t", hhmmss(limit), "-c", str(z.cpus)]
|
|
106
|
+
if z.mem_mb:
|
|
107
|
+
argv += ["--mem", "%dM" % z.mem_mb]
|
|
108
|
+
part = z.partition or self.common["partition"]
|
|
109
|
+
if part:
|
|
110
|
+
argv += ["-p", part]
|
|
111
|
+
if self.common["account"]:
|
|
112
|
+
argv += ["--account", self.common["account"]]
|
|
113
|
+
if z.constraint:
|
|
114
|
+
argv += ["--constraint", z.constraint]
|
|
115
|
+
argv += self.common["extra"] + list(z.extra)
|
|
116
|
+
argv += ["-o", task.log]
|
|
117
|
+
cmd = node_command(self.cfg, task.path, task.lost, z, argv=task.argv)
|
|
118
|
+
return argv + ["--wrap", cmd]
|
|
119
|
+
|
|
120
|
+
def submit(self, task):
|
|
121
|
+
os.makedirs(os.path.dirname(task.log), exist_ok=True)
|
|
122
|
+
p = self._run("sbatch", self.submit_argv(task))
|
|
123
|
+
out = p.stdout.strip().splitlines()
|
|
124
|
+
jid = out[-1].split(";")[0].strip() if out else ""
|
|
125
|
+
if not jid.isdigit():
|
|
126
|
+
raise BackendError("sbatch printed no job ID: %r" % p.stdout[:200])
|
|
127
|
+
return jid
|
|
128
|
+
|
|
129
|
+
def _queue(self):
|
|
130
|
+
"""{job id: (state, name)} of this user's jobs in the queue."""
|
|
131
|
+
p = self._run("squeue", ["--me", "-h", "-o", "%i|%T|%j"])
|
|
132
|
+
out = {}
|
|
133
|
+
for line in p.stdout.splitlines():
|
|
134
|
+
parts = line.strip().split("|", 2)
|
|
135
|
+
if len(parts) == 3:
|
|
136
|
+
out[parts[0]] = (parts[1], parts[2])
|
|
137
|
+
return out
|
|
138
|
+
|
|
139
|
+
def _acct(self, ids):
|
|
140
|
+
p = self._run("sacct", ["-j", ",".join(ids), "-X", "-n", "-P", "-o",
|
|
141
|
+
"JobID,State,ExitCode,Start,End,TotalCPU"])
|
|
142
|
+
out = {}
|
|
143
|
+
for line in p.stdout.splitlines():
|
|
144
|
+
f = line.strip().split("|")
|
|
145
|
+
if len(f) >= 6 and f[0] in ids:
|
|
146
|
+
out[f[0]] = f
|
|
147
|
+
return out
|
|
148
|
+
|
|
149
|
+
def poll(self, refs):
|
|
150
|
+
refs = [r for r in refs if r]
|
|
151
|
+
if not refs:
|
|
152
|
+
return {}
|
|
153
|
+
q = self._queue()
|
|
154
|
+
out, gone = {}, []
|
|
155
|
+
for r in refs:
|
|
156
|
+
if r in q:
|
|
157
|
+
state = q[r][0]
|
|
158
|
+
out[r] = JobState(QUEUED.get(state, RUNNING))
|
|
159
|
+
else:
|
|
160
|
+
gone.append(r)
|
|
161
|
+
if gone:
|
|
162
|
+
acct = self._acct(gone)
|
|
163
|
+
for r in gone:
|
|
164
|
+
f = acct.get(r)
|
|
165
|
+
out[r] = self._ended(f) if f else JobState(
|
|
166
|
+
LOST, reason="unknown to the batch system", counted=False)
|
|
167
|
+
return out
|
|
168
|
+
|
|
169
|
+
@staticmethod
|
|
170
|
+
def _ended(f):
|
|
171
|
+
_, state, exitcode, start, end, cpu = f[:6]
|
|
172
|
+
word = state.split()[0] if state else ""
|
|
173
|
+
try:
|
|
174
|
+
code = int(exitcode.split(":")[0])
|
|
175
|
+
except ValueError:
|
|
176
|
+
code = None
|
|
177
|
+
cpu_s = cpu_seconds(cpu)
|
|
178
|
+
started, ended = utc(start), utc(end)
|
|
179
|
+
if word in QUEUED: # sacct can be ahead of squeue for a moment
|
|
180
|
+
return JobState(QUEUED[word])
|
|
181
|
+
if word in FARM:
|
|
182
|
+
return JobState(LOST, reason=FARM[word], counted=False, started=started,
|
|
183
|
+
ended=ended, cpu_s=cpu_s)
|
|
184
|
+
if word == "CANCELLED":
|
|
185
|
+
return JobState(LOST, code=code, reason="cancelled (%s)" % state, counted=False,
|
|
186
|
+
started=started, ended=ended, cpu_s=cpu_s)
|
|
187
|
+
# COMPLETED, FAILED, TIMEOUT (the step ran out of time: counted, as a step
|
|
188
|
+
# timeout is), OUT_OF_MEMORY (the work's own doing): the executor decides.
|
|
189
|
+
return JobState(DONE, code=code, started=started, ended=ended, cpu_s=cpu_s,
|
|
190
|
+
reason=word.lower() if word != "COMPLETED" else None)
|
|
191
|
+
|
|
192
|
+
def cancel(self, ref, hard=False):
|
|
193
|
+
if hard:
|
|
194
|
+
self._run("scancel", [ref], ok_codes=(0, 1))
|
|
195
|
+
return
|
|
196
|
+
try:
|
|
197
|
+
self._run("scancel", ["--signal=TERM", "--full", ref])
|
|
198
|
+
except BackendError: # still pending: withdraw it
|
|
199
|
+
self._run("scancel", [ref], ok_codes=(0, 1))
|
|
200
|
+
|
|
201
|
+
def list_ours(self):
|
|
202
|
+
from ... import registry
|
|
203
|
+
from ..dispatcher import home_id
|
|
204
|
+
prefix = "wpk:%s:" % home_id(self.h or registry.home())
|
|
205
|
+
return {jid: name for jid, (_, name) in self._queue().items() if name.startswith(prefix)}
|
|
206
|
+
|
|
207
|
+
def running(self):
|
|
208
|
+
return []
|
|
209
|
+
|