@atomic-chat/core 0.5.1 → 0.13.2
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/README.md +22 -0
- package/dist/app-daemon.js +20 -67
- package/dist/app-daemon.js.map +1 -1
- package/dist/backend/advisor/advisor.d.ts +132 -0
- package/dist/backend/advisor/advisor.js +537 -0
- package/dist/backend/advisor/advisor.js.map +1 -0
- package/dist/backend/advisor/index.d.ts +6 -0
- package/dist/backend/advisor/index.js +7 -0
- package/dist/backend/advisor/index.js.map +1 -0
- package/dist/backend/advisor/policy.d.ts +81 -0
- package/dist/backend/advisor/policy.js +154 -0
- package/dist/backend/advisor/policy.js.map +1 -0
- package/dist/backend/catalog/archive.d.ts +21 -7
- package/dist/backend/catalog/archive.js +57 -17
- package/dist/backend/catalog/archive.js.map +1 -1
- package/dist/backend/catalog/bundled-manifest-baseline.js +42 -26
- package/dist/backend/catalog/bundled-manifest-baseline.js.map +1 -1
- package/dist/backend/catalog/cuda-family.d.ts +12 -2
- package/dist/backend/catalog/cuda-family.js +30 -7
- package/dist/backend/catalog/cuda-family.js.map +1 -1
- package/dist/backend/catalog/index.d.ts +5 -0
- package/dist/backend/catalog/index.js +5 -0
- package/dist/backend/catalog/index.js.map +1 -1
- package/dist/backend/catalog/manifest.d.ts +5 -3
- package/dist/backend/catalog/manifest.js +12 -9
- package/dist/backend/catalog/manifest.js.map +1 -1
- package/dist/backend/catalog/migrate.d.ts +8 -6
- package/dist/backend/catalog/migrate.js +26 -15
- package/dist/backend/catalog/migrate.js.map +1 -1
- package/dist/backend/catalog/prism-catalog.d.ts +42 -0
- package/dist/backend/catalog/prism-catalog.js +101 -0
- package/dist/backend/catalog/prism-catalog.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.d.ts +2 -0
- package/dist/backend/catalog/prism-manifest-baseline.js +11 -0
- package/dist/backend/catalog/prism-manifest-baseline.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.json +134 -0
- package/dist/backend/catalog/prism-manifest.d.ts +90 -0
- package/dist/backend/catalog/prism-manifest.js +171 -0
- package/dist/backend/catalog/prism-manifest.js.map +1 -0
- package/dist/backend/catalog/turboquant-catalog.d.ts +60 -0
- package/dist/backend/catalog/turboquant-catalog.js +162 -0
- package/dist/backend/catalog/turboquant-catalog.js.map +1 -0
- package/dist/backend/catalog/turboquant-index.d.ts +104 -0
- package/dist/backend/catalog/turboquant-index.js +260 -0
- package/dist/backend/catalog/turboquant-index.js.map +1 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +1 -0
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/install/runtime-backend.d.ts +6 -6
- package/dist/backend/install/runtime-backend.js +23 -20
- package/dist/backend/install/runtime-backend.js.map +1 -1
- package/dist/backend/install/service.d.ts +106 -5
- package/dist/backend/install/service.js +247 -21
- package/dist/backend/install/service.js.map +1 -1
- package/dist/backend/installed/bundled.d.ts +19 -0
- package/dist/backend/installed/bundled.js +45 -0
- package/dist/backend/installed/bundled.js.map +1 -0
- package/dist/backend/installed/index.d.ts +1 -0
- package/dist/backend/installed/index.js +1 -0
- package/dist/backend/installed/index.js.map +1 -1
- package/dist/backend/installed/installed.js +3 -0
- package/dist/backend/installed/installed.js.map +1 -1
- package/dist/backend/optimal/optimal-cache.d.ts +27 -8
- package/dist/backend/optimal/optimal-cache.js +38 -19
- package/dist/backend/optimal/optimal-cache.js.map +1 -1
- package/dist/backend/optimal/optimal-store.js +1 -1
- package/dist/backend/optimal/optimal-store.js.map +1 -1
- package/dist/backend/select/categories.d.ts +2 -1
- package/dist/backend/select/categories.js +8 -1
- package/dist/backend/select/categories.js.map +1 -1
- package/dist/backend/select/features.d.ts +13 -5
- package/dist/backend/select/features.js +36 -6
- package/dist/backend/select/features.js.map +1 -1
- package/dist/backend/select/index.d.ts +2 -0
- package/dist/backend/select/index.js +2 -0
- package/dist/backend/select/index.js.map +1 -1
- package/dist/backend/select/prism.d.ts +54 -0
- package/dist/backend/select/prism.js +212 -0
- package/dist/backend/select/prism.js.map +1 -0
- package/dist/backend/select/recovery.d.ts +4 -2
- package/dist/backend/select/recovery.js +17 -5
- package/dist/backend/select/recovery.js.map +1 -1
- package/dist/backend/select/tiers.d.ts +20 -11
- package/dist/backend/select/tiers.js +49 -11
- package/dist/backend/select/tiers.js.map +1 -1
- package/dist/backend/select/turboquant-tiers.d.ts +45 -0
- package/dist/backend/select/turboquant-tiers.js +114 -0
- package/dist/backend/select/turboquant-tiers.js.map +1 -0
- package/dist/backend/types.d.ts +6 -69
- package/dist/cli/commands/backends.d.ts +10 -0
- package/dist/cli/commands/backends.js +142 -0
- package/dist/cli/commands/backends.js.map +1 -0
- package/dist/cli/commands/hardware.d.ts +13 -0
- package/dist/cli/commands/hardware.js +71 -0
- package/dist/cli/commands/hardware.js.map +1 -0
- package/dist/cli/commands/host-step.d.ts +28 -0
- package/dist/cli/commands/host-step.js +67 -0
- package/dist/cli/commands/host-step.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +4 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/serve.js +4 -4
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +6 -1
- package/dist/cli/commands/shared.js +7 -0
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/io.d.ts +11 -0
- package/dist/cli/io.js +28 -3
- package/dist/cli/io.js.map +1 -1
- package/dist/cli/launch.js +2 -2
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +11 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client/control-client.d.ts +128 -7
- package/dist/client/control-client.js +211 -12
- package/dist/client/control-client.js.map +1 -1
- package/dist/cloud/registry.js +9 -1
- package/dist/cloud/registry.js.map +1 -1
- package/dist/config/paths.d.ts +137 -0
- package/dist/config/paths.js +163 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/contracts/backend-advisor.d.ts +225 -0
- package/dist/contracts/backend-advisor.js +14 -0
- package/dist/contracts/backend-advisor.js.map +1 -0
- package/dist/contracts/control-api.d.ts +7 -1
- package/dist/contracts/control-api.js +7 -1
- package/dist/contracts/control-api.js.map +1 -1
- package/dist/contracts/decision.d.ts +394 -0
- package/dist/contracts/decision.js +69 -0
- package/dist/contracts/decision.js.map +1 -0
- package/dist/contracts/diffusion.d.ts +62 -9
- package/dist/contracts/embedding.d.ts +103 -0
- package/dist/contracts/embedding.js +24 -0
- package/dist/contracts/embedding.js.map +1 -0
- package/dist/contracts/engine-builds.d.ts +108 -0
- package/dist/contracts/engine-builds.js +11 -0
- package/dist/contracts/engine-builds.js.map +1 -0
- package/dist/contracts/engines.d.ts +157 -0
- package/dist/contracts/engines.js +50 -0
- package/dist/contracts/engines.js.map +1 -0
- package/dist/contracts/environment.d.ts +774 -0
- package/dist/contracts/environment.js +116 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/errors.d.ts +43 -2
- package/dist/contracts/errors.js +41 -0
- package/dist/contracts/errors.js.map +1 -1
- package/dist/contracts/events.d.ts +82 -4
- package/dist/contracts/hardware.d.ts +79 -6
- package/dist/contracts/hardware.js +9 -5
- package/dist/contracts/hardware.js.map +1 -1
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/model-compatibility.d.ts +97 -0
- package/dist/contracts/model-compatibility.js +6 -0
- package/dist/contracts/model-compatibility.js.map +1 -0
- package/dist/contracts/model-setup.d.ts +115 -0
- package/dist/contracts/model-setup.js +33 -0
- package/dist/contracts/model-setup.js.map +1 -0
- package/dist/contracts/model-yml.d.ts +14 -0
- package/dist/contracts/model-yml.js +1 -0
- package/dist/contracts/model-yml.js.map +1 -1
- package/dist/contracts/session.d.ts +45 -2
- package/dist/contracts/session.js +14 -1
- package/dist/contracts/session.js.map +1 -1
- package/dist/contracts/settings.d.ts +44 -1
- package/dist/contracts/settings.js.map +1 -1
- package/dist/core/atomic-core.d.ts +44 -5
- package/dist/core/atomic-core.js +24 -0
- package/dist/core/atomic-core.js.map +1 -1
- package/dist/core/create.js +517 -23
- package/dist/core/create.js.map +1 -1
- package/dist/core/gpu/index.d.ts +6 -0
- package/dist/core/gpu/index.js +7 -0
- package/dist/core/gpu/index.js.map +1 -0
- package/dist/core/gpu/policy.d.ts +68 -0
- package/dist/core/gpu/policy.js +99 -0
- package/dist/core/gpu/policy.js.map +1 -0
- package/dist/core/gpu/residency.d.ts +44 -0
- package/dist/core/gpu/residency.js +101 -0
- package/dist/core/gpu/residency.js.map +1 -0
- package/dist/core/gpu-residency.d.ts +39 -0
- package/dist/core/gpu-residency.js +32 -0
- package/dist/core/gpu-residency.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/managed-engines.d.ts +207 -0
- package/dist/core/managed-engines.js +579 -0
- package/dist/core/managed-engines.js.map +1 -0
- package/dist/core/managed-environment.d.ts +72 -0
- package/dist/core/managed-environment.js +218 -0
- package/dist/core/managed-environment.js.map +1 -0
- package/dist/core/model-setup/index.d.ts +4 -0
- package/dist/core/model-setup/index.js +5 -0
- package/dist/core/model-setup/index.js.map +1 -0
- package/dist/core/model-setup/plan.d.ts +56 -0
- package/dist/core/model-setup/plan.js +158 -0
- package/dist/core/model-setup/plan.js.map +1 -0
- package/dist/core/model-setup/service.d.ts +92 -0
- package/dist/core/model-setup/service.js +329 -0
- package/dist/core/model-setup/service.js.map +1 -0
- package/dist/core/model-setup/store.d.ts +29 -0
- package/dist/core/model-setup/store.js +116 -0
- package/dist/core/model-setup/store.js.map +1 -0
- package/dist/core/model-setup/wiring.d.ts +59 -0
- package/dist/core/model-setup/wiring.js +132 -0
- package/dist/core/model-setup/wiring.js.map +1 -0
- package/dist/core/prism.d.ts +36 -0
- package/dist/core/prism.js +42 -0
- package/dist/core/prism.js.map +1 -0
- package/dist/core/public-server.d.ts +7 -0
- package/dist/core/public-server.js +2 -0
- package/dist/core/public-server.js.map +1 -1
- package/dist/core/sessions.d.ts +6 -1
- package/dist/core/sessions.js +18 -14
- package/dist/core/sessions.js.map +1 -1
- package/dist/core/types.d.ts +27 -1
- package/dist/core/types.js.map +1 -1
- package/dist/decision/args.d.ts +110 -0
- package/dist/decision/args.js +126 -0
- package/dist/decision/args.js.map +1 -0
- package/dist/decision/backoff.d.ts +25 -0
- package/dist/decision/backoff.js +33 -0
- package/dist/decision/backoff.js.map +1 -0
- package/dist/decision/engine-candidates.d.ts +52 -0
- package/dist/decision/engine-candidates.js +138 -0
- package/dist/decision/engine-candidates.js.map +1 -0
- package/dist/decision/engine-fallback.d.ts +41 -0
- package/dist/decision/engine-fallback.js +57 -0
- package/dist/decision/engine-fallback.js.map +1 -0
- package/dist/decision/engine-version.d.ts +27 -0
- package/dist/decision/engine-version.js +54 -0
- package/dist/decision/engine-version.js.map +1 -0
- package/dist/decision/engine.d.ts +114 -0
- package/dist/decision/engine.js +253 -0
- package/dist/decision/engine.js.map +1 -0
- package/dist/decision/http.d.ts +36 -0
- package/dist/decision/http.js +73 -0
- package/dist/decision/http.js.map +1 -0
- package/dist/decision/index.d.ts +20 -0
- package/dist/decision/index.js +21 -0
- package/dist/decision/index.js.map +1 -0
- package/dist/decision/model-facts.d.ts +32 -0
- package/dist/decision/model-facts.js +40 -0
- package/dist/decision/model-facts.js.map +1 -0
- package/dist/decision/outcome.d.ts +35 -0
- package/dist/decision/outcome.js +105 -0
- package/dist/decision/outcome.js.map +1 -0
- package/dist/decision/process.d.ts +67 -0
- package/dist/decision/process.js +133 -0
- package/dist/decision/process.js.map +1 -0
- package/dist/decision/readiness.d.ts +74 -0
- package/dist/decision/readiness.js +165 -0
- package/dist/decision/readiness.js.map +1 -0
- package/dist/decision/request.d.ts +11 -0
- package/dist/decision/request.js +56 -0
- package/dist/decision/request.js.map +1 -0
- package/dist/decision/service.d.ts +202 -0
- package/dist/decision/service.js +711 -0
- package/dist/decision/service.js.map +1 -0
- package/dist/decision/upstream-version.d.ts +23 -0
- package/dist/decision/upstream-version.js +34 -0
- package/dist/decision/upstream-version.js.map +1 -0
- package/dist/decision/wiring.d.ts +67 -0
- package/dist/decision/wiring.js +101 -0
- package/dist/decision/wiring.js.map +1 -0
- package/dist/diffusion/args.d.ts +4 -2
- package/dist/diffusion/args.js +10 -3
- package/dist/diffusion/args.js.map +1 -1
- package/dist/diffusion/image-job.js +1 -1
- package/dist/diffusion/image-job.js.map +1 -1
- package/dist/diffusion/install.d.ts +35 -11
- package/dist/diffusion/install.js +74 -49
- package/dist/diffusion/install.js.map +1 -1
- package/dist/diffusion/job-kind.d.ts +33 -7
- package/dist/diffusion/jobs.d.ts +6 -1
- package/dist/diffusion/jobs.js +60 -18
- package/dist/diffusion/jobs.js.map +1 -1
- package/dist/diffusion/parse.d.ts +1 -2
- package/dist/diffusion/parse.js +1 -13
- package/dist/diffusion/parse.js.map +1 -1
- package/dist/diffusion/progress.js +3 -0
- package/dist/diffusion/progress.js.map +1 -1
- package/dist/diffusion/server-process.d.ts +6 -0
- package/dist/diffusion/server-process.js +3 -2
- package/dist/diffusion/server-process.js.map +1 -1
- package/dist/diffusion/service.d.ts +52 -6
- package/dist/diffusion/service.js +215 -40
- package/dist/diffusion/service.js.map +1 -1
- package/dist/diffusion/session.d.ts +27 -3
- package/dist/diffusion/session.js +108 -17
- package/dist/diffusion/session.js.map +1 -1
- package/dist/diffusion/state.d.ts +19 -1
- package/dist/diffusion/state.js +10 -0
- package/dist/diffusion/state.js.map +1 -1
- package/dist/diffusion/tracker.d.ts +15 -1
- package/dist/diffusion/tracker.js +32 -6
- package/dist/diffusion/tracker.js.map +1 -1
- package/dist/diffusion/types.d.ts +7 -0
- package/dist/diffusion/types.js +11 -0
- package/dist/diffusion/types.js.map +1 -1
- package/dist/diffusion/video-estimate.d.ts +214 -0
- package/dist/diffusion/video-estimate.js +402 -0
- package/dist/diffusion/video-estimate.js.map +1 -0
- package/dist/diffusion/video-eta.d.ts +90 -0
- package/dist/diffusion/video-eta.js +248 -0
- package/dist/diffusion/video-eta.js.map +1 -0
- package/dist/diffusion/video-history.d.ts +45 -0
- package/dist/diffusion/video-history.js +121 -0
- package/dist/diffusion/video-history.js.map +1 -0
- package/dist/diffusion/video-job.d.ts +13 -5
- package/dist/diffusion/video-job.js +42 -15
- package/dist/diffusion/video-job.js.map +1 -1
- package/dist/diffusion/video-recipe.js +3 -0
- package/dist/diffusion/video-recipe.js.map +1 -1
- package/dist/diffusion/video-tiling.d.ts +54 -0
- package/dist/diffusion/video-tiling.js +70 -0
- package/dist/diffusion/video-tiling.js.map +1 -0
- package/dist/diffusion/wiring.d.ts +14 -1
- package/dist/diffusion/wiring.js +7 -0
- package/dist/diffusion/wiring.js.map +1 -1
- package/dist/downloads/protocol.d.ts +3 -8
- package/dist/downloads/protocol.js.map +1 -1
- package/dist/embedding/args.d.ts +39 -0
- package/dist/embedding/args.js +46 -0
- package/dist/embedding/args.js.map +1 -0
- package/dist/embedding/engine.d.ts +50 -0
- package/dist/embedding/engine.js +100 -0
- package/dist/embedding/engine.js.map +1 -0
- package/dist/embedding/ffmpeg.d.ts +18 -0
- package/dist/embedding/ffmpeg.js +63 -0
- package/dist/embedding/ffmpeg.js.map +1 -0
- package/dist/embedding/index.d.ts +16 -0
- package/dist/embedding/index.js +17 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/model-facts.d.ts +51 -0
- package/dist/embedding/model-facts.js +84 -0
- package/dist/embedding/model-facts.js.map +1 -0
- package/dist/embedding/process.d.ts +66 -0
- package/dist/embedding/process.js +131 -0
- package/dist/embedding/process.js.map +1 -0
- package/dist/embedding/readiness.d.ts +56 -0
- package/dist/embedding/readiness.js +114 -0
- package/dist/embedding/readiness.js.map +1 -0
- package/dist/embedding/request.d.ts +43 -0
- package/dist/embedding/request.js +285 -0
- package/dist/embedding/request.js.map +1 -0
- package/dist/embedding/service.d.ts +152 -0
- package/dist/embedding/service.js +602 -0
- package/dist/embedding/service.js.map +1 -0
- package/dist/embedding/wiring.d.ts +51 -0
- package/dist/embedding/wiring.js +79 -0
- package/dist/embedding/wiring.js.map +1 -0
- package/dist/engine-builds/builds.d.ts +54 -0
- package/dist/engine-builds/builds.js +151 -0
- package/dist/engine-builds/builds.js.map +1 -0
- package/dist/engine-builds/index.d.ts +10 -0
- package/dist/engine-builds/index.js +11 -0
- package/dist/engine-builds/index.js.map +1 -0
- package/dist/engine-builds/install.d.ts +42 -0
- package/dist/engine-builds/install.js +100 -0
- package/dist/engine-builds/install.js.map +1 -0
- package/dist/engine-builds/manifest.d.ts +121 -0
- package/dist/engine-builds/manifest.js +254 -0
- package/dist/engine-builds/manifest.js.map +1 -0
- package/dist/engine-builds/order.d.ts +24 -0
- package/dist/engine-builds/order.js +44 -0
- package/dist/engine-builds/order.js.map +1 -0
- package/dist/engine-builds/select.d.ts +123 -0
- package/dist/engine-builds/select.js +223 -0
- package/dist/engine-builds/select.js.map +1 -0
- package/dist/engine-builds/service.d.ts +123 -0
- package/dist/engine-builds/service.js +392 -0
- package/dist/engine-builds/service.js.map +1 -0
- package/dist/engines/descriptor-order.d.ts +28 -0
- package/dist/engines/descriptor-order.js +60 -0
- package/dist/engines/descriptor-order.js.map +1 -0
- package/dist/engines/engine-build.d.ts +23 -0
- package/dist/engines/engine-build.js +58 -0
- package/dist/engines/engine-build.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.js +11 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/llamacpp.d.ts +71 -0
- package/dist/engines/llamacpp.js +176 -0
- package/dist/engines/llamacpp.js.map +1 -0
- package/dist/engines/managed.d.ts +49 -0
- package/dist/engines/managed.js +88 -0
- package/dist/engines/managed.js.map +1 -0
- package/dist/engines/service.d.ts +46 -0
- package/dist/engines/service.js +61 -0
- package/dist/engines/service.js.map +1 -0
- package/dist/engines/versions.d.ts +65 -0
- package/dist/engines/versions.js +259 -0
- package/dist/engines/versions.js.map +1 -0
- package/dist/hardware/cpu-flags.d.ts +44 -0
- package/dist/hardware/cpu-flags.js +206 -0
- package/dist/hardware/cpu-flags.js.map +1 -0
- package/dist/hardware/drm-sysfs.d.ts +51 -0
- package/dist/hardware/drm-sysfs.js +67 -0
- package/dist/hardware/drm-sysfs.js.map +1 -0
- package/dist/hardware/facts.d.ts +42 -0
- package/dist/hardware/facts.js +92 -0
- package/dist/hardware/facts.js.map +1 -0
- package/dist/hardware/index.d.ts +19 -3
- package/dist/hardware/index.js +19 -3
- package/dist/hardware/index.js.map +1 -1
- package/dist/hardware/merge.d.ts +55 -0
- package/dist/hardware/merge.js +141 -0
- package/dist/hardware/merge.js.map +1 -0
- package/dist/hardware/nvidia-smi.d.ts +43 -0
- package/dist/hardware/nvidia-smi.js +118 -0
- package/dist/hardware/nvidia-smi.js.map +1 -0
- package/dist/hardware/probe-common.d.ts +72 -0
- package/dist/hardware/probe-common.js +106 -0
- package/dist/hardware/probe-common.js.map +1 -0
- package/dist/hardware/probe-darwin.d.ts +20 -0
- package/dist/hardware/probe-darwin.js +76 -0
- package/dist/hardware/probe-darwin.js.map +1 -0
- package/dist/hardware/probe-linux.d.ts +9 -0
- package/dist/hardware/probe-linux.js +133 -0
- package/dist/hardware/probe-linux.js.map +1 -0
- package/dist/hardware/probe-windows.d.ts +7 -0
- package/dist/hardware/probe-windows.js +50 -0
- package/dist/hardware/probe-windows.js.map +1 -0
- package/dist/hardware/probe.d.ts +16 -0
- package/dist/hardware/probe.js +65 -0
- package/dist/hardware/probe.js.map +1 -0
- package/dist/hardware/service.d.ts +60 -0
- package/dist/hardware/service.js +114 -0
- package/dist/hardware/service.js.map +1 -0
- package/dist/hardware/vulkan.d.ts +47 -0
- package/dist/hardware/vulkan.js +148 -0
- package/dist/hardware/vulkan.js.map +1 -0
- package/dist/hardware/windows-video.d.ts +97 -0
- package/dist/hardware/windows-video.js +214 -0
- package/dist/hardware/windows-video.js.map +1 -0
- package/dist/host/app-daemon.d.ts +47 -0
- package/dist/host/app-daemon.js +146 -0
- package/dist/host/app-daemon.js.map +1 -0
- package/dist/host/index.d.ts +5 -3
- package/dist/host/index.js +5 -3
- package/dist/host/index.js.map +1 -1
- package/dist/host/log-file.d.ts +74 -0
- package/dist/host/log-file.js +214 -0
- package/dist/host/log-file.js.map +1 -0
- package/dist/host/recipes/enable-wsl.d.ts +63 -0
- package/dist/host/recipes/enable-wsl.js +73 -0
- package/dist/host/recipes/enable-wsl.js.map +1 -0
- package/dist/host/recipes/executor-io-windows.d.ts +69 -0
- package/dist/host/recipes/executor-io-windows.js +235 -0
- package/dist/host/recipes/executor-io-windows.js.map +1 -0
- package/dist/host/recipes/executor-io.d.ts +80 -0
- package/dist/host/recipes/executor-io.js +211 -0
- package/dist/host/recipes/executor-io.js.map +1 -0
- package/dist/host/recipes/executor.d.ts +81 -0
- package/dist/host/recipes/executor.js +678 -0
- package/dist/host/recipes/executor.js.map +1 -0
- package/dist/host/recipes/guest-executor.d.ts +29 -0
- package/dist/host/recipes/guest-executor.js +76 -0
- package/dist/host/recipes/guest-executor.js.map +1 -0
- package/dist/host/recipes/index.d.ts +16 -0
- package/dist/host/recipes/index.js +17 -0
- package/dist/host/recipes/index.js.map +1 -0
- package/dist/host/recipes/install-container-runtime.d.ts +389 -0
- package/dist/host/recipes/install-container-runtime.js +796 -0
- package/dist/host/recipes/install-container-runtime.js.map +1 -0
- package/dist/host/recipes/openpgp.d.ts +23 -0
- package/dist/host/recipes/openpgp.js +153 -0
- package/dist/host/recipes/openpgp.js.map +1 -0
- package/dist/host/recipes/request-file.d.ts +96 -0
- package/dist/host/recipes/request-file.js +103 -0
- package/dist/host/recipes/request-file.js.map +1 -0
- package/dist/lock/process-journal.d.ts +5 -2
- package/dist/lock/process-journal.js.map +1 -1
- package/dist/models/capabilities.d.ts +7 -0
- package/dist/models/capabilities.js +17 -1
- package/dist/models/capabilities.js.map +1 -1
- package/dist/models/compatibility/index.d.ts +10 -0
- package/dist/models/compatibility/index.js +11 -0
- package/dist/models/compatibility/index.js.map +1 -0
- package/dist/models/compatibility/inspect.d.ts +19 -0
- package/dist/models/compatibility/inspect.js +59 -0
- package/dist/models/compatibility/inspect.js.map +1 -0
- package/dist/models/compatibility/resolve.d.ts +59 -0
- package/dist/models/compatibility/resolve.js +219 -0
- package/dist/models/compatibility/resolve.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.d.ts +2 -0
- package/dist/models/compatibility/rules-baseline.js +10 -0
- package/dist/models/compatibility/rules-baseline.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.json +292 -0
- package/dist/models/compatibility/rules-service.d.ts +36 -0
- package/dist/models/compatibility/rules-service.js +109 -0
- package/dist/models/compatibility/rules-service.js.map +1 -0
- package/dist/models/compatibility/rules.d.ts +81 -0
- package/dist/models/compatibility/rules.js +164 -0
- package/dist/models/compatibility/rules.js.map +1 -0
- package/dist/models/compatibility/service.d.ts +59 -0
- package/dist/models/compatibility/service.js +137 -0
- package/dist/models/compatibility/service.js.map +1 -0
- package/dist/models/decision-checkpoint.d.ts +22 -0
- package/dist/models/decision-checkpoint.js +33 -0
- package/dist/models/decision-checkpoint.js.map +1 -0
- package/dist/models/gguf/classify.d.ts +27 -1
- package/dist/models/gguf/classify.js +78 -2
- package/dist/models/gguf/classify.js.map +1 -1
- package/dist/models/gguf/index.d.ts +1 -0
- package/dist/models/gguf/index.js +1 -0
- package/dist/models/gguf/index.js.map +1 -1
- package/dist/models/gguf/tensors.d.ts +56 -0
- package/dist/models/gguf/tensors.js +236 -0
- package/dist/models/gguf/tensors.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/router/resolve.d.ts +7 -1
- package/dist/router/resolve.js +14 -1
- package/dist/router/resolve.js.map +1 -1
- package/dist/runtime/container/argv.d.ts +88 -0
- package/dist/runtime/container/argv.js +406 -0
- package/dist/runtime/container/argv.js.map +1 -0
- package/dist/runtime/container/docker-binary.d.ts +4 -0
- package/dist/runtime/container/docker-binary.js +34 -0
- package/dist/runtime/container/docker-binary.js.map +1 -0
- package/dist/runtime/container/env.d.ts +17 -0
- package/dist/runtime/container/env.js +52 -0
- package/dist/runtime/container/env.js.map +1 -0
- package/dist/runtime/container/exec.d.ts +27 -0
- package/dist/runtime/container/exec.js +79 -0
- package/dist/runtime/container/exec.js.map +1 -0
- package/dist/runtime/container/execution-journal.d.ts +55 -0
- package/dist/runtime/container/execution-journal.js +167 -0
- package/dist/runtime/container/execution-journal.js.map +1 -0
- package/dist/runtime/container/heartbeat.d.ts +47 -0
- package/dist/runtime/container/heartbeat.js +78 -0
- package/dist/runtime/container/heartbeat.js.map +1 -0
- package/dist/runtime/container/index.d.ts +30 -0
- package/dist/runtime/container/index.js +31 -0
- package/dist/runtime/container/index.js.map +1 -0
- package/dist/runtime/container/operations.d.ts +40 -0
- package/dist/runtime/container/operations.js +233 -0
- package/dist/runtime/container/operations.js.map +1 -0
- package/dist/runtime/container/pull.d.ts +48 -0
- package/dist/runtime/container/pull.js +280 -0
- package/dist/runtime/container/pull.js.map +1 -0
- package/dist/runtime/container/reconcile.d.ts +34 -0
- package/dist/runtime/container/reconcile.js +79 -0
- package/dist/runtime/container/reconcile.js.map +1 -0
- package/dist/runtime/container/types.d.ts +124 -0
- package/dist/runtime/container/types.js +2 -0
- package/dist/runtime/container/types.js.map +1 -0
- package/dist/runtime/container/watchdog.d.ts +114 -0
- package/dist/runtime/container/watchdog.js +418 -0
- package/dist/runtime/container/watchdog.js.map +1 -0
- package/dist/runtime/container/wiring.d.ts +78 -0
- package/dist/runtime/container/wiring.js +92 -0
- package/dist/runtime/container/wiring.js.map +1 -0
- package/dist/runtime/container/wsl-exec.d.ts +13 -0
- package/dist/runtime/container/wsl-exec.js +18 -0
- package/dist/runtime/container/wsl-exec.js.map +1 -0
- package/dist/runtime/environment/cached-document.d.ts +128 -0
- package/dist/runtime/environment/cached-document.js +218 -0
- package/dist/runtime/environment/cached-document.js.map +1 -0
- package/dist/runtime/environment/canonical-json.d.ts +78 -0
- package/dist/runtime/environment/canonical-json.js +86 -0
- package/dist/runtime/environment/canonical-json.js.map +1 -0
- package/dist/runtime/environment/descriptor-provider.d.ts +121 -0
- package/dist/runtime/environment/descriptor-provider.js +159 -0
- package/dist/runtime/environment/descriptor-provider.js.map +1 -0
- package/dist/runtime/environment/descriptor.d.ts +35 -0
- package/dist/runtime/environment/descriptor.js +239 -0
- package/dist/runtime/environment/descriptor.js.map +1 -0
- package/dist/runtime/environment/diagnostics.d.ts +50 -0
- package/dist/runtime/environment/diagnostics.js +114 -0
- package/dist/runtime/environment/diagnostics.js.map +1 -0
- package/dist/runtime/environment/document-fields.d.ts +39 -0
- package/dist/runtime/environment/document-fields.js +96 -0
- package/dist/runtime/environment/document-fields.js.map +1 -0
- package/dist/runtime/environment/environment-manifest-provider.d.ts +65 -0
- package/dist/runtime/environment/environment-manifest-provider.js +89 -0
- package/dist/runtime/environment/environment-manifest-provider.js.map +1 -0
- package/dist/runtime/environment/environment-manifest.d.ts +35 -0
- package/dist/runtime/environment/environment-manifest.js +131 -0
- package/dist/runtime/environment/environment-manifest.js.map +1 -0
- package/dist/runtime/environment/guest-host.d.ts +43 -0
- package/dist/runtime/environment/guest-host.js +88 -0
- package/dist/runtime/environment/guest-host.js.map +1 -0
- package/dist/runtime/environment/host-exec.d.ts +38 -0
- package/dist/runtime/environment/host-exec.js +145 -0
- package/dist/runtime/environment/host-exec.js.map +1 -0
- package/dist/runtime/environment/host-step-failure.d.ts +33 -0
- package/dist/runtime/environment/host-step-failure.js +34 -0
- package/dist/runtime/environment/host-step-failure.js.map +1 -0
- package/dist/runtime/environment/index.d.ts +56 -0
- package/dist/runtime/environment/index.js +57 -0
- package/dist/runtime/environment/index.js.map +1 -0
- package/dist/runtime/environment/installations.d.ts +25 -0
- package/dist/runtime/environment/installations.js +70 -0
- package/dist/runtime/environment/installations.js.map +1 -0
- package/dist/runtime/environment/inventory.d.ts +42 -0
- package/dist/runtime/environment/inventory.js +57 -0
- package/dist/runtime/environment/inventory.js.map +1 -0
- package/dist/runtime/environment/linux-blockers.d.ts +130 -0
- package/dist/runtime/environment/linux-blockers.js +251 -0
- package/dist/runtime/environment/linux-blockers.js.map +1 -0
- package/dist/runtime/environment/linux-docker-facts.d.ts +200 -0
- package/dist/runtime/environment/linux-docker-facts.js +342 -0
- package/dist/runtime/environment/linux-docker-facts.js.map +1 -0
- package/dist/runtime/environment/linux-docker-network.d.ts +80 -0
- package/dist/runtime/environment/linux-docker-network.js +195 -0
- package/dist/runtime/environment/linux-docker-network.js.map +1 -0
- package/dist/runtime/environment/linux-host.d.ts +22 -0
- package/dist/runtime/environment/linux-host.js +98 -0
- package/dist/runtime/environment/linux-host.js.map +1 -0
- package/dist/runtime/environment/linux-plan.d.ts +126 -0
- package/dist/runtime/environment/linux-plan.js +392 -0
- package/dist/runtime/environment/linux-plan.js.map +1 -0
- package/dist/runtime/environment/linux-probe.d.ts +245 -0
- package/dist/runtime/environment/linux-probe.js +315 -0
- package/dist/runtime/environment/linux-probe.js.map +1 -0
- package/dist/runtime/environment/linux-provisioner.d.ts +102 -0
- package/dist/runtime/environment/linux-provisioner.js +734 -0
- package/dist/runtime/environment/linux-provisioner.js.map +1 -0
- package/dist/runtime/environment/provisioner-descriptors.d.ts +17 -0
- package/dist/runtime/environment/provisioner-descriptors.js +62 -0
- package/dist/runtime/environment/provisioner-descriptors.js.map +1 -0
- package/dist/runtime/environment/recovery.d.ts +74 -0
- package/dist/runtime/environment/recovery.js +121 -0
- package/dist/runtime/environment/recovery.js.map +1 -0
- package/dist/runtime/environment/rootfs-download.d.ts +2 -0
- package/dist/runtime/environment/rootfs-download.js +47 -0
- package/dist/runtime/environment/rootfs-download.js.map +1 -0
- package/dist/runtime/environment/service.d.ts +280 -0
- package/dist/runtime/environment/service.js +776 -0
- package/dist/runtime/environment/service.js.map +1 -0
- package/dist/runtime/environment/state.d.ts +163 -0
- package/dist/runtime/environment/state.js +479 -0
- package/dist/runtime/environment/state.js.map +1 -0
- package/dist/runtime/environment/store-models.d.ts +19 -0
- package/dist/runtime/environment/store-models.js +30 -0
- package/dist/runtime/environment/store-models.js.map +1 -0
- package/dist/runtime/environment/store.d.ts +210 -0
- package/dist/runtime/environment/store.js +438 -0
- package/dist/runtime/environment/store.js.map +1 -0
- package/dist/runtime/environment/windows-environment-record.d.ts +48 -0
- package/dist/runtime/environment/windows-environment-record.js +89 -0
- package/dist/runtime/environment/windows-environment-record.js.map +1 -0
- package/dist/runtime/environment/windows-forwarding.d.ts +27 -0
- package/dist/runtime/environment/windows-forwarding.js +84 -0
- package/dist/runtime/environment/windows-forwarding.js.map +1 -0
- package/dist/runtime/environment/windows-guest-setup.d.ts +48 -0
- package/dist/runtime/environment/windows-guest-setup.js +157 -0
- package/dist/runtime/environment/windows-guest-setup.js.map +1 -0
- package/dist/runtime/environment/windows-host.d.ts +46 -0
- package/dist/runtime/environment/windows-host.js +163 -0
- package/dist/runtime/environment/windows-host.js.map +1 -0
- package/dist/runtime/environment/windows-plan.d.ts +78 -0
- package/dist/runtime/environment/windows-plan.js +216 -0
- package/dist/runtime/environment/windows-plan.js.map +1 -0
- package/dist/runtime/environment/windows-probe.d.ts +135 -0
- package/dist/runtime/environment/windows-probe.js +261 -0
- package/dist/runtime/environment/windows-probe.js.map +1 -0
- package/dist/runtime/environment/windows-provisioner.d.ts +113 -0
- package/dist/runtime/environment/windows-provisioner.js +782 -0
- package/dist/runtime/environment/windows-provisioner.js.map +1 -0
- package/dist/runtime/environment/wiring.d.ts +117 -0
- package/dist/runtime/environment/wiring.js +354 -0
- package/dist/runtime/environment/wiring.js.map +1 -0
- package/dist/runtime/foundation-models/runtime.d.ts +8 -0
- package/dist/runtime/foundation-models/runtime.js +5 -2
- package/dist/runtime/foundation-models/runtime.js.map +1 -1
- package/dist/runtime/llamacpp/args.d.ts +10 -1
- package/dist/runtime/llamacpp/args.js +43 -7
- package/dist/runtime/llamacpp/args.js.map +1 -1
- package/dist/runtime/llamacpp/fit-margin.d.ts +46 -0
- package/dist/runtime/llamacpp/fit-margin.js +47 -0
- package/dist/runtime/llamacpp/fit-margin.js.map +1 -0
- package/dist/runtime/llamacpp/index.d.ts +1 -0
- package/dist/runtime/llamacpp/index.js +1 -0
- package/dist/runtime/llamacpp/index.js.map +1 -1
- package/dist/runtime/llamacpp/load-plan.d.ts +23 -1
- package/dist/runtime/llamacpp/load-plan.js +82 -1
- package/dist/runtime/llamacpp/load-plan.js.map +1 -1
- package/dist/runtime/llamacpp/policy.d.ts +16 -0
- package/dist/runtime/llamacpp/policy.js +20 -0
- package/dist/runtime/llamacpp/policy.js.map +1 -1
- package/dist/runtime/llamacpp/probe.d.ts +21 -1
- package/dist/runtime/llamacpp/probe.js +32 -6
- package/dist/runtime/llamacpp/probe.js.map +1 -1
- package/dist/runtime/llamacpp/runtime.d.ts +56 -1
- package/dist/runtime/llamacpp/runtime.js +142 -15
- package/dist/runtime/llamacpp/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/index.d.ts +8 -0
- package/dist/runtime/managed-engines/index.js +9 -0
- package/dist/runtime/managed-engines/index.js.map +1 -0
- package/dist/runtime/managed-engines/runtime.d.ts +140 -0
- package/dist/runtime/managed-engines/runtime.js +402 -0
- package/dist/runtime/managed-engines/runtime.js.map +1 -0
- package/dist/runtime/managed-engines/spec.d.ts +70 -0
- package/dist/runtime/managed-engines/spec.js +39 -0
- package/dist/runtime/managed-engines/spec.js.map +1 -0
- package/dist/runtime/managed-models/check.d.ts +50 -0
- package/dist/runtime/managed-models/check.js +157 -0
- package/dist/runtime/managed-models/check.js.map +1 -0
- package/dist/runtime/managed-models/compatibility.d.ts +256 -0
- package/dist/runtime/managed-models/compatibility.js +594 -0
- package/dist/runtime/managed-models/compatibility.js.map +1 -0
- package/dist/runtime/managed-models/delete.d.ts +15 -0
- package/dist/runtime/managed-models/delete.js +60 -0
- package/dist/runtime/managed-models/delete.js.map +1 -0
- package/dist/runtime/managed-models/guest-files.d.ts +8 -0
- package/dist/runtime/managed-models/guest-files.js +49 -0
- package/dist/runtime/managed-models/guest-files.js.map +1 -0
- package/dist/runtime/managed-models/index.d.ts +17 -0
- package/dist/runtime/managed-models/index.js +18 -0
- package/dist/runtime/managed-models/index.js.map +1 -0
- package/dist/runtime/managed-models/location.d.ts +22 -0
- package/dist/runtime/managed-models/location.js +53 -0
- package/dist/runtime/managed-models/location.js.map +1 -0
- package/dist/runtime/managed-models/migrate.d.ts +30 -0
- package/dist/runtime/managed-models/migrate.js +119 -0
- package/dist/runtime/managed-models/migrate.js.map +1 -0
- package/dist/runtime/managed-models/model-dir.d.ts +36 -0
- package/dist/runtime/managed-models/model-dir.js +136 -0
- package/dist/runtime/managed-models/model-dir.js.map +1 -0
- package/dist/runtime/managed-models/quant-format.d.ts +71 -0
- package/dist/runtime/managed-models/quant-format.js +299 -0
- package/dist/runtime/managed-models/quant-format.js.map +1 -0
- package/dist/runtime/managed-models/registry.d.ts +26 -0
- package/dist/runtime/managed-models/registry.js +66 -0
- package/dist/runtime/managed-models/registry.js.map +1 -0
- package/dist/runtime/managed-text/adapter.d.ts +266 -0
- package/dist/runtime/managed-text/adapter.js +96 -0
- package/dist/runtime/managed-text/adapter.js.map +1 -0
- package/dist/runtime/managed-text/backend-target.d.ts +3 -0
- package/dist/runtime/managed-text/backend-target.js +52 -0
- package/dist/runtime/managed-text/backend-target.js.map +1 -0
- package/dist/runtime/managed-text/deployment.d.ts +14 -0
- package/dist/runtime/managed-text/deployment.js +32 -0
- package/dist/runtime/managed-text/deployment.js.map +1 -0
- package/dist/runtime/managed-text/engine-cache.d.ts +15 -0
- package/dist/runtime/managed-text/engine-cache.js +64 -0
- package/dist/runtime/managed-text/engine-cache.js.map +1 -0
- package/dist/runtime/managed-text/gateway.d.ts +158 -0
- package/dist/runtime/managed-text/gateway.js +535 -0
- package/dist/runtime/managed-text/gateway.js.map +1 -0
- package/dist/runtime/managed-text/generation-defaults.d.ts +23 -0
- package/dist/runtime/managed-text/generation-defaults.js +51 -0
- package/dist/runtime/managed-text/generation-defaults.js.map +1 -0
- package/dist/runtime/managed-text/index.d.ts +26 -0
- package/dist/runtime/managed-text/index.js +27 -0
- package/dist/runtime/managed-text/index.js.map +1 -0
- package/dist/runtime/managed-text/lifecycle.d.ts +276 -0
- package/dist/runtime/managed-text/lifecycle.js +859 -0
- package/dist/runtime/managed-text/lifecycle.js.map +1 -0
- package/dist/runtime/managed-text/load-policy.d.ts +47 -0
- package/dist/runtime/managed-text/load-policy.js +111 -0
- package/dist/runtime/managed-text/load-policy.js.map +1 -0
- package/dist/runtime/managed-text/mount-source.d.ts +14 -0
- package/dist/runtime/managed-text/mount-source.js +18 -0
- package/dist/runtime/managed-text/mount-source.js.map +1 -0
- package/dist/runtime/managed-text/readiness.d.ts +13 -0
- package/dist/runtime/managed-text/readiness.js +24 -0
- package/dist/runtime/managed-text/readiness.js.map +1 -0
- package/dist/runtime/managed-text/request-rules.d.ts +18 -0
- package/dist/runtime/managed-text/request-rules.js +62 -0
- package/dist/runtime/managed-text/request-rules.js.map +1 -0
- package/dist/runtime/managed-text/types.d.ts +88 -0
- package/dist/runtime/managed-text/types.js +12 -0
- package/dist/runtime/managed-text/types.js.map +1 -0
- package/dist/runtime/managed-text/wsl-deployment.d.ts +24 -0
- package/dist/runtime/managed-text/wsl-deployment.js +70 -0
- package/dist/runtime/managed-text/wsl-deployment.js.map +1 -0
- package/dist/runtime/mlx/errors.d.ts +6 -1
- package/dist/runtime/mlx/errors.js +7 -2
- package/dist/runtime/mlx/errors.js.map +1 -1
- package/dist/runtime/mlx/runtime.d.ts +36 -1
- package/dist/runtime/mlx/runtime.js +85 -4
- package/dist/runtime/mlx/runtime.js.map +1 -1
- package/dist/runtime/shared/backend-output.d.ts +23 -0
- package/dist/runtime/shared/backend-output.js +32 -0
- package/dist/runtime/shared/backend-output.js.map +1 -0
- package/dist/runtime/shared/bounded-output.d.ts +24 -0
- package/dist/runtime/shared/bounded-output.js +63 -0
- package/dist/runtime/shared/bounded-output.js.map +1 -0
- package/dist/runtime/shared/external-sessions.js +9 -1
- package/dist/runtime/shared/external-sessions.js.map +1 -1
- package/dist/runtime/shared/gpu-occupancy.d.ts +60 -0
- package/dist/runtime/shared/gpu-occupancy.js +10 -0
- package/dist/runtime/shared/gpu-occupancy.js.map +1 -0
- package/dist/runtime/shared/index.d.ts +4 -0
- package/dist/runtime/shared/index.js +4 -0
- package/dist/runtime/shared/index.js.map +1 -1
- package/dist/runtime/shared/local-runtime.d.ts +35 -0
- package/dist/runtime/shared/ports.d.ts +6 -0
- package/dist/runtime/shared/ports.js +12 -1
- package/dist/runtime/shared/ports.js.map +1 -1
- package/dist/runtime/shared/process.d.ts +11 -0
- package/dist/runtime/shared/process.js +20 -0
- package/dist/runtime/shared/process.js.map +1 -1
- package/dist/runtime/shared/redact-args.d.ts +7 -0
- package/dist/runtime/shared/redact-args.js +26 -0
- package/dist/runtime/shared/redact-args.js.map +1 -0
- package/dist/runtime/shared/sidecar.d.ts +15 -0
- package/dist/runtime/shared/sidecar.js +43 -8
- package/dist/runtime/shared/sidecar.js.map +1 -1
- package/dist/runtime/tensorrt-llm/adapter.d.ts +250 -0
- package/dist/runtime/tensorrt-llm/adapter.js +1011 -0
- package/dist/runtime/tensorrt-llm/adapter.js.map +1 -0
- package/dist/runtime/tensorrt-llm/check.d.ts +12 -0
- package/dist/runtime/tensorrt-llm/check.js +21 -0
- package/dist/runtime/tensorrt-llm/check.js.map +1 -0
- package/dist/runtime/tensorrt-llm/compatibility.d.ts +100 -0
- package/dist/runtime/tensorrt-llm/compatibility.js +181 -0
- package/dist/runtime/tensorrt-llm/compatibility.js.map +1 -0
- package/dist/runtime/tensorrt-llm/engine.d.ts +3 -0
- package/dist/runtime/tensorrt-llm/engine.js +24 -0
- package/dist/runtime/tensorrt-llm/engine.js.map +1 -0
- package/dist/runtime/tensorrt-llm/host-facts.d.ts +55 -0
- package/dist/runtime/tensorrt-llm/host-facts.js +87 -0
- package/dist/runtime/tensorrt-llm/host-facts.js.map +1 -0
- package/dist/runtime/tensorrt-llm/index.d.ts +30 -0
- package/dist/runtime/tensorrt-llm/index.js +31 -0
- package/dist/runtime/tensorrt-llm/index.js.map +1 -0
- package/dist/runtime/tensorrt-llm/installation.d.ts +23 -0
- package/dist/runtime/tensorrt-llm/installation.js +53 -0
- package/dist/runtime/tensorrt-llm/installation.js.map +1 -0
- package/dist/runtime/tensorrt-llm/kv-cache.d.ts +25 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js +28 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js.map +1 -0
- package/dist/runtime/tensorrt-llm/prelaunch.d.ts +20 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js +168 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js.map +1 -0
- package/dist/runtime/tensorrt-llm/route-policy.d.ts +19 -0
- package/dist/runtime/tensorrt-llm/route-policy.js +17 -0
- package/dist/runtime/tensorrt-llm/route-policy.js.map +1 -0
- package/dist/runtime/tensorrt-llm/settings.d.ts +7 -0
- package/dist/runtime/tensorrt-llm/settings.js +48 -0
- package/dist/runtime/tensorrt-llm/settings.js.map +1 -0
- package/dist/runtime/vllm/adapter.d.ts +46 -0
- package/dist/runtime/vllm/adapter.js +425 -0
- package/dist/runtime/vllm/adapter.js.map +1 -0
- package/dist/runtime/vllm/engine.d.ts +16 -0
- package/dist/runtime/vllm/engine.js +37 -0
- package/dist/runtime/vllm/engine.js.map +1 -0
- package/dist/runtime/vllm/index.d.ts +11 -0
- package/dist/runtime/vllm/index.js +12 -0
- package/dist/runtime/vllm/index.js.map +1 -0
- package/dist/runtime/vllm/memory.d.ts +69 -0
- package/dist/runtime/vllm/memory.js +123 -0
- package/dist/runtime/vllm/memory.js.map +1 -0
- package/dist/runtime/vllm/settings.d.ts +52 -0
- package/dist/runtime/vllm/settings.js +151 -0
- package/dist/runtime/vllm/settings.js.map +1 -0
- package/dist/runtime/wsl/guest-paths.d.ts +33 -0
- package/dist/runtime/wsl/guest-paths.js +83 -0
- package/dist/runtime/wsl/guest-paths.js.map +1 -0
- package/dist/runtime/wsl/guest-scope.d.ts +14 -0
- package/dist/runtime/wsl/guest-scope.js +98 -0
- package/dist/runtime/wsl/guest-scope.js.map +1 -0
- package/dist/runtime/wsl/index.d.ts +12 -0
- package/dist/runtime/wsl/index.js +13 -0
- package/dist/runtime/wsl/index.js.map +1 -0
- package/dist/runtime/wsl/keeper.d.ts +29 -0
- package/dist/runtime/wsl/keeper.js +48 -0
- package/dist/runtime/wsl/keeper.js.map +1 -0
- package/dist/runtime/wsl/transport.d.ts +106 -0
- package/dist/runtime/wsl/transport.js +181 -0
- package/dist/runtime/wsl/transport.js.map +1 -0
- package/dist/server/control/index.d.ts +1 -1
- package/dist/server/control/router.js +15 -0
- package/dist/server/control/router.js.map +1 -1
- package/dist/server/control/routes/backends.js +26 -0
- package/dist/server/control/routes/backends.js.map +1 -1
- package/dist/server/control/routes/decision.d.ts +10 -0
- package/dist/server/control/routes/decision.js +43 -0
- package/dist/server/control/routes/decision.js.map +1 -0
- package/dist/server/control/routes/diffusion-video.js +4 -0
- package/dist/server/control/routes/diffusion-video.js.map +1 -1
- package/dist/server/control/routes/diffusion.d.ts +1 -1
- package/dist/server/control/routes/diffusion.js +4 -9
- package/dist/server/control/routes/diffusion.js.map +1 -1
- package/dist/server/control/routes/embedding.d.ts +9 -0
- package/dist/server/control/routes/embedding.js +43 -0
- package/dist/server/control/routes/embedding.js.map +1 -0
- package/dist/server/control/routes/engine-builds.d.ts +14 -0
- package/dist/server/control/routes/engine-builds.js +82 -0
- package/dist/server/control/routes/engine-builds.js.map +1 -0
- package/dist/server/control/routes/engines.d.ts +17 -0
- package/dist/server/control/routes/engines.js +152 -0
- package/dist/server/control/routes/engines.js.map +1 -0
- package/dist/server/control/routes/environments.d.ts +16 -0
- package/dist/server/control/routes/environments.js +207 -0
- package/dist/server/control/routes/environments.js.map +1 -0
- package/dist/server/control/routes/hardware.d.ts +1 -1
- package/dist/server/control/routes/hardware.js +11 -6
- package/dist/server/control/routes/hardware.js.map +1 -1
- package/dist/server/control/routes/model-setups.d.ts +11 -0
- package/dist/server/control/routes/model-setups.js +55 -0
- package/dist/server/control/routes/model-setups.js.map +1 -0
- package/dist/server/control/routes/models.d.ts +3 -2
- package/dist/server/control/routes/models.js +45 -2
- package/dist/server/control/routes/models.js.map +1 -1
- package/dist/server/control/types.d.ts +167 -9
- package/dist/server/control/types.js.map +1 -1
- package/dist/server/http.d.ts +9 -1
- package/dist/server/http.js +51 -1
- package/dist/server/http.js.map +1 -1
- package/dist/server/public/decision-preview.d.ts +17 -0
- package/dist/server/public/decision-preview.js +119 -0
- package/dist/server/public/decision-preview.js.map +1 -0
- package/dist/server/public/decision.d.ts +32 -0
- package/dist/server/public/decision.js +135 -0
- package/dist/server/public/decision.js.map +1 -0
- package/dist/server/public/embedding.d.ts +31 -0
- package/dist/server/public/embedding.js +126 -0
- package/dist/server/public/embedding.js.map +1 -0
- package/dist/server/public/errors.d.ts +2 -1
- package/dist/server/public/errors.js +5 -2
- package/dist/server/public/errors.js.map +1 -1
- package/dist/server/public/forward.js +75 -3
- package/dist/server/public/forward.js.map +1 -1
- package/dist/server/public/gates.d.ts +13 -0
- package/dist/server/public/gates.js +37 -14
- package/dist/server/public/gates.js.map +1 -1
- package/dist/server/public/index.d.ts +5 -2
- package/dist/server/public/index.js +14 -1
- package/dist/server/public/index.js.map +1 -1
- package/dist/server/public/listing.d.ts +13 -2
- package/dist/server/public/listing.js +33 -9
- package/dist/server/public/listing.js.map +1 -1
- package/dist/server/public/policy.d.ts +9 -0
- package/dist/server/public/policy.js +68 -0
- package/dist/server/public/policy.js.map +1 -0
- package/dist/server/public/responses.js +10 -0
- package/dist/server/public/responses.js.map +1 -1
- package/dist/server/public/trace.d.ts +2 -2
- package/dist/server/public/trace.js +6 -2
- package/dist/server/public/trace.js.map +1 -1
- package/dist/server/public/types.d.ts +84 -1
- package/dist/settings/decision.d.ts +15 -0
- package/dist/settings/decision.js +88 -0
- package/dist/settings/decision.js.map +1 -0
- package/dist/settings/embedding.d.ts +12 -0
- package/dist/settings/embedding.js +82 -0
- package/dist/settings/embedding.js.map +1 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/index.js +2 -0
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/schema/atomic-prism.json +433 -0
- package/dist/settings/schema/tensorrt-llm.json +253 -0
- package/dist/settings/schema/vllm.json +273 -0
- package/dist/settings/schema.js +58 -0
- package/dist/settings/schema.js.map +1 -1
- package/dist/settings/store.d.ts +13 -2
- package/dist/settings/store.js +44 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/dist/util/result.d.ts +19 -0
- package/dist/util/result.js +15 -0
- package/dist/util/result.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/settings/schema/atomic-prism.json +433 -0
- package/src/settings/schema/tensorrt-llm.json +253 -0
- package/src/settings/schema/vllm.json +273 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `linux.install-container-runtime` recipe (design D2/D3): Docker Engine and the NVIDIA
|
|
3
|
+
* Container Toolkit from the vendors' own apt or dnf repositories, the NVIDIA runtime registered
|
|
4
|
+
* with Docker, the NVIDIA CDI spec generated (task 2.23, F-5: Docker 28.2+ passes `--gpus` through
|
|
5
|
+
* it), `docker.service` enabled, and the user added to the `docker` group. This is the one
|
|
6
|
+
* piece of code in the product that runs as root on a user's machine, so its shape is deliberate:
|
|
7
|
+
*
|
|
8
|
+
* - **Data in, argv out.** `buildInstallContainerRuntimeSteps` is pure. Every command is an argv
|
|
9
|
+
* array taken from `INSTALL_CONTAINER_RUNTIME_RECIPE` with validated values substituted into whole
|
|
10
|
+
* arguments; nothing is ever handed to a shell.
|
|
11
|
+
* - **The recipe is its own digest.** Every command, path, URL, key fingerprint and file body lives
|
|
12
|
+
* in the frozen `INSTALL_CONTAINER_RUNTIME_RECIPE`, and `INSTALL_CONTAINER_RUNTIME_RECIPE_DIGEST`
|
|
13
|
+
* is its canonical hash. A change to any of them changes the digest, which a test pins.
|
|
14
|
+
* - **Only what is missing.** Parameters name components, never packages or commands. The executor
|
|
15
|
+
* re-checks each one on the machine and skips what is already there, so a replay is a no-op.
|
|
16
|
+
* - **Nothing removed, nothing upgraded.** No step removes a package or a file, or upgrades the
|
|
17
|
+
* system. `assertPermittedCommand` is an allowlist the executor applies to every argv before it
|
|
18
|
+
* runs, and a test scans every step this module can build for the forbidden words. `apt-get
|
|
19
|
+
* install` always carries `--no-remove`: without it apt's resolver may remove a conflicting
|
|
20
|
+
* package to satisfy the install. `dnf install` has two ways to take a package away:
|
|
21
|
+
* `--allowerasing` (forbidden) and RPM `Obsoletes`, which a plain install always honours — no
|
|
22
|
+
* dnf option turns that off (libdnf and libdnf5 set `SOLVER_FLAG_YUM_OBSOLETES` unconditionally;
|
|
23
|
+
* `obsoletes=False` only changes candidate selection). containerd.io obsoletes `containerd` and
|
|
24
|
+
* `runc`, older docker-ce releases obsolete `docker-ce-selinux`, and nvidia-container-toolkit
|
|
25
|
+
* obsoletes old `nvidia-container-runtime` and `nvidia-container-runtime-hook`. So two checks run
|
|
26
|
+
* before any dnf install, and either refuses it: a static per-component conflict list, and a live
|
|
27
|
+
* one — `dnf repoquery --obsoletes <package>` for each package still to install, then
|
|
28
|
+
* `rpm --query <name>` for each name it obsoletes. Both ask rpm by package name only, because
|
|
29
|
+
* libsolv matches Obsoletes against names, not against what a package provides. An installed
|
|
30
|
+
* package of such a name is refused, never replaced. Only the packages the recipe names are
|
|
31
|
+
* queried, not the dependencies the install pulls in (nvidia-container-toolkit-base, which the
|
|
32
|
+
* toolkit requires, repeats the toolkit's Obsoletes).
|
|
33
|
+
* - **A package query fails closed.** A package counts as absent only when `rpm` or `dpkg-query`
|
|
34
|
+
* says so in its own words; a database it cannot open, a lock or any other reply fails the step,
|
|
35
|
+
* so a broken query can never make a conflict look absent.
|
|
36
|
+
*
|
|
37
|
+
* What `recipe_digest` covers: everything in `INSTALL_CONTAINER_RUNTIME_RECIPE` — argv templates,
|
|
38
|
+
* paths, URLs, key fingerprints, file bodies, modes, the environment, the conflict lists. What it
|
|
39
|
+
* does not cover: the code in this file and in `executor.ts` (how steps are ordered and named,
|
|
40
|
+
* `PERMITTED`, the check-then-act logic, the restart rule). A change there is a code change like
|
|
41
|
+
* any other; it does not by itself invalidate plans users have already approved.
|
|
42
|
+
*/
|
|
43
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
44
|
+
import { canonicalDigest } from '../../runtime/environment/index.js';
|
|
45
|
+
/** A value that is the object's own property — never one inherited from `Object.prototype`. */
|
|
46
|
+
function own(record, key) {
|
|
47
|
+
return Object.hasOwn(record, key) ? record[key] : undefined;
|
|
48
|
+
}
|
|
49
|
+
function invalid(message) {
|
|
50
|
+
throw new AtomicCoreError('MANAGED_HOST_STEP_INVALID', message);
|
|
51
|
+
}
|
|
52
|
+
export const INSTALL_CONTAINER_RUNTIME_RECIPE_ID = 'linux.install-container-runtime';
|
|
53
|
+
/**
|
|
54
|
+
* What a plan can ask the recipe for, in the order the recipe applies them. `docker-restart` is not
|
|
55
|
+
* a step of its own: it is the user's consent (design D5) to restart a Docker that was already
|
|
56
|
+
* running when `nvidia-runtime` changes its configuration. `nvidia-cdi` (task 2.23, F-5) generates
|
|
57
|
+
* the CDI spec after the runtime is configured, and needs no restart.
|
|
58
|
+
*/
|
|
59
|
+
export const CONTAINER_RUNTIME_COMPONENTS = [
|
|
60
|
+
'docker-engine',
|
|
61
|
+
'nvidia-container-toolkit',
|
|
62
|
+
'nvidia-runtime',
|
|
63
|
+
'nvidia-cdi',
|
|
64
|
+
'docker-restart',
|
|
65
|
+
'docker-service',
|
|
66
|
+
'docker-group',
|
|
67
|
+
];
|
|
68
|
+
/** Deep-freezes the recipe so the object the digest describes is the object that runs. */
|
|
69
|
+
function frozen(value) {
|
|
70
|
+
if (value !== null && typeof value === 'object') {
|
|
71
|
+
for (const child of Object.values(value))
|
|
72
|
+
frozen(child);
|
|
73
|
+
Object.freeze(value);
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Key fingerprints, pinned. Docker's rpm key is the one Docker's Fedora install guide tells the
|
|
79
|
+
* user to verify. Docker's deb key and NVIDIA's key are not printed in the vendors' current guides;
|
|
80
|
+
* these are the primary-key fingerprints of the keys the guides' URLs served on 2026-09-28, as
|
|
81
|
+
* `gpg --show-keys` reports them (`test/fixtures/host-keys/`). Docker's deb key is also the value
|
|
82
|
+
* Docker's Debian/Ubuntu guides printed for years ("9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88").
|
|
83
|
+
*/
|
|
84
|
+
const DOCKER_DEB_KEY = '9DC858229FC7DD38854AE2D88D81803C0EBFCD88';
|
|
85
|
+
const DOCKER_RPM_KEY = '060A61C51B558A7F742B77AAC52FEB6B621E9F35';
|
|
86
|
+
const NVIDIA_KEY = 'C95B321B61E88C1809C4F759DDCAE044F796ECB0';
|
|
87
|
+
const DOCKER_ACTIVE = ['systemctl', 'is-active', '--quiet', 'docker'];
|
|
88
|
+
/**
|
|
89
|
+
* Clears a failed or `start-limit-hit` docker.service and docker.socket before a start or restart
|
|
90
|
+
* (task 2.23, F-6): after a failed start systemd refuses further starts for a while, so a retry of
|
|
91
|
+
* the same step would fail on the leftover state rather than on the cause. Its exit status is ignored:
|
|
92
|
+
* on a unit that is not failed it does nothing.
|
|
93
|
+
*/
|
|
94
|
+
const DOCKER_RESET_FAILED = ['systemctl', 'reset-failed', 'docker.service', 'docker.socket'];
|
|
95
|
+
/** Where the spec goes (ruling R-core-8): the path `nvidia-cdi-refresh` regenerates. */
|
|
96
|
+
const CDI_SPEC = '/var/run/cdi/nvidia.yaml';
|
|
97
|
+
/** The toolkit's unit (1.18+) that regenerates the spec after a driver update and on boot. */
|
|
98
|
+
const CDI_REFRESH_UNIT = 'nvidia-cdi-refresh.path';
|
|
99
|
+
/**
|
|
100
|
+
* Why docker.service did not start: `systemctl` itself only says "see journalctl". The last 40
|
|
101
|
+
* lines, message text only; run solely after a start or restart failed, never as a step of its own.
|
|
102
|
+
*/
|
|
103
|
+
const DOCKER_JOURNAL = ['journalctl', '-u', 'docker.service', '-n', '40', '--no-pager', '-o', 'cat'];
|
|
104
|
+
/**
|
|
105
|
+
* The whole recipe as data. `{{name}}` marks a whole-argument or in-file substitution of a
|
|
106
|
+
* validated parameter; there is no other kind of template.
|
|
107
|
+
*/
|
|
108
|
+
export const INSTALL_CONTAINER_RUNTIME_RECIPE = frozen({
|
|
109
|
+
recipe_id: INSTALL_CONTAINER_RUNTIME_RECIPE_ID,
|
|
110
|
+
revision: 2,
|
|
111
|
+
/**
|
|
112
|
+
* The environment every command runs with, instead of the caller's. `sudo` and `pkexec` already
|
|
113
|
+
* scrub most of it, but a variable like `APT_CONFIG` or `LD_PRELOAD` must never reach a root
|
|
114
|
+
* package manager, whoever started us.
|
|
115
|
+
*/
|
|
116
|
+
environment: {
|
|
117
|
+
PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
|
118
|
+
LANG: 'C',
|
|
119
|
+
LC_ALL: 'C',
|
|
120
|
+
DEBIAN_FRONTEND: 'noninteractive',
|
|
121
|
+
},
|
|
122
|
+
packages: {
|
|
123
|
+
'docker-engine': ['docker-ce', 'docker-ce-cli', 'containerd.io'],
|
|
124
|
+
'nvidia-container-toolkit': ['nvidia-container-toolkit'],
|
|
125
|
+
},
|
|
126
|
+
apt: {
|
|
127
|
+
/** Release → suite. Only these releases are buildable; `VERSION_CODENAME` is never trusted. */
|
|
128
|
+
suites: {
|
|
129
|
+
ubuntu: { '22.04': 'jammy', '24.04': 'noble', '26.04': 'resolute' },
|
|
130
|
+
debian: { '12': 'bookworm', '13': 'trixie' },
|
|
131
|
+
},
|
|
132
|
+
architectures: { x86_64: 'amd64', aarch64: 'arm64' },
|
|
133
|
+
repositories: {
|
|
134
|
+
'docker-engine': {
|
|
135
|
+
key: {
|
|
136
|
+
url: 'https://download.docker.com/linux/{{distro}}/gpg',
|
|
137
|
+
path: '/etc/apt/keyrings/docker.asc',
|
|
138
|
+
encoding: 'armored',
|
|
139
|
+
fingerprints: [DOCKER_DEB_KEY],
|
|
140
|
+
},
|
|
141
|
+
source: {
|
|
142
|
+
path: '/etc/apt/sources.list.d/docker.list',
|
|
143
|
+
content: 'deb [arch={{deb_arch}} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{distro}} {{suite}} stable\n',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
'nvidia-container-toolkit': {
|
|
147
|
+
key: {
|
|
148
|
+
url: 'https://nvidia.github.io/libnvidia-container/gpgkey',
|
|
149
|
+
path: '/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg',
|
|
150
|
+
encoding: 'binary',
|
|
151
|
+
fingerprints: [NVIDIA_KEY],
|
|
152
|
+
},
|
|
153
|
+
source: {
|
|
154
|
+
path: '/etc/apt/sources.list.d/nvidia-container-toolkit.list',
|
|
155
|
+
content: 'deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/$(ARCH) /\n',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
/** Refresh one source list only: no other repository is fetched, no list is cleaned up. */
|
|
160
|
+
refresh: [
|
|
161
|
+
'apt-get',
|
|
162
|
+
'update',
|
|
163
|
+
'-o',
|
|
164
|
+
'Dir::Etc::sourcelist={{source}}',
|
|
165
|
+
'-o',
|
|
166
|
+
'Dir::Etc::sourceparts=-',
|
|
167
|
+
'-o',
|
|
168
|
+
'APT::Get::List-Cleanup=0',
|
|
169
|
+
'-o',
|
|
170
|
+
'DPkg::Lock::Timeout=300',
|
|
171
|
+
],
|
|
172
|
+
installed: ['dpkg-query', '--show', '--showformat=${Status}', '{{package}}'],
|
|
173
|
+
/**
|
|
174
|
+
* Missing packages are appended. `--no-remove` makes apt fail rather than remove a package its
|
|
175
|
+
* resolver finds in the way; `confold` keeps the user's config on a dependency's upgrade; the
|
|
176
|
+
* lock timeout waits out unattended-upgrades instead of failing on dpkg's lock.
|
|
177
|
+
*/
|
|
178
|
+
install: [
|
|
179
|
+
'apt-get',
|
|
180
|
+
'install',
|
|
181
|
+
'-y',
|
|
182
|
+
'--no-install-recommends',
|
|
183
|
+
'--no-remove',
|
|
184
|
+
'-o',
|
|
185
|
+
'Dpkg::Options::=--force-confdef',
|
|
186
|
+
'-o',
|
|
187
|
+
'Dpkg::Options::=--force-confold',
|
|
188
|
+
'-o',
|
|
189
|
+
'DPkg::Lock::Timeout=300',
|
|
190
|
+
],
|
|
191
|
+
/**
|
|
192
|
+
* Installed packages that installing a component would have removed or replaced, per component.
|
|
193
|
+
* Docker's guide has these removed first; we never remove anything, so we refuse instead. With
|
|
194
|
+
* `--no-remove`, apt fails rather than removing; the check gives the clearer answer first.
|
|
195
|
+
*/
|
|
196
|
+
conflicts: {
|
|
197
|
+
'docker-engine': ['docker.io', 'podman-docker', 'containerd', 'runc'],
|
|
198
|
+
'nvidia-container-toolkit': [],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
dnf: {
|
|
202
|
+
/** Fedora's `VERSION_ID` is a plain release number; the descriptor decides which ones qualify. */
|
|
203
|
+
versions: { fedora: '^[1-9][0-9]$' },
|
|
204
|
+
repositories: {
|
|
205
|
+
'docker-engine': {
|
|
206
|
+
key: {
|
|
207
|
+
url: 'https://download.docker.com/linux/fedora/gpg',
|
|
208
|
+
path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-docker-ce',
|
|
209
|
+
encoding: 'armored',
|
|
210
|
+
fingerprints: [DOCKER_RPM_KEY],
|
|
211
|
+
},
|
|
212
|
+
source: {
|
|
213
|
+
path: '/etc/yum.repos.d/docker-ce.repo',
|
|
214
|
+
// Docker's own `docker-ce.repo`, stable channel only, with the key we pinned instead of
|
|
215
|
+
// a URL dnf would import from without asking anyone.
|
|
216
|
+
content: [
|
|
217
|
+
'[docker-ce-stable]',
|
|
218
|
+
'name=Docker CE Stable - $basearch',
|
|
219
|
+
'baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/stable',
|
|
220
|
+
'enabled=1',
|
|
221
|
+
'gpgcheck=1',
|
|
222
|
+
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-docker-ce',
|
|
223
|
+
'',
|
|
224
|
+
].join('\n'),
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
'nvidia-container-toolkit': {
|
|
228
|
+
key: {
|
|
229
|
+
url: 'https://nvidia.github.io/libnvidia-container/gpgkey',
|
|
230
|
+
path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-nvidia-container-toolkit',
|
|
231
|
+
encoding: 'armored',
|
|
232
|
+
fingerprints: [NVIDIA_KEY],
|
|
233
|
+
},
|
|
234
|
+
source: {
|
|
235
|
+
path: '/etc/yum.repos.d/nvidia-container-toolkit.repo',
|
|
236
|
+
// NVIDIA's `nvidia-container-toolkit.repo`, stable channel only, same substitution.
|
|
237
|
+
content: [
|
|
238
|
+
'[nvidia-container-toolkit]',
|
|
239
|
+
'name=nvidia-container-toolkit',
|
|
240
|
+
'baseurl=https://nvidia.github.io/libnvidia-container/stable/rpm/$basearch',
|
|
241
|
+
'repo_gpgcheck=1',
|
|
242
|
+
'gpgcheck=0',
|
|
243
|
+
'enabled=1',
|
|
244
|
+
'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nvidia-container-toolkit',
|
|
245
|
+
'',
|
|
246
|
+
].join('\n'),
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* Whether a package of exactly this name is installed: its name once per installed version, or
|
|
252
|
+
* exit 1 and "package <name> is not installed" (no `--quiet`, which would hide that answer). The
|
|
253
|
+
* `\\n` is the two characters rpm's query format expands itself, as a shell would pass `'%{NAME}\\n'`.
|
|
254
|
+
*/
|
|
255
|
+
installed: ['rpm', '--query', '--queryformat=%{NAME}\\n', '{{package}}'],
|
|
256
|
+
/** No option here stops RPM `Obsoletes`; the two checks above the install do (see header). */
|
|
257
|
+
install: ['dnf', 'install', '-y', '--setopt=install_weak_deps=False'],
|
|
258
|
+
/**
|
|
259
|
+
* What a package from the configured repos `Obsoletes`, one per line. It installs and removes
|
|
260
|
+
* nothing, but it is not free of effects: it refreshes dnf's metadata cache, and `-y` accepts the
|
|
261
|
+
* import of the signing key of every enabled repository that has `repo_gpgcheck` on — the same
|
|
262
|
+
* keys, and the same prompt, the install itself would answer. `skip_if_unavailable=False`: a
|
|
263
|
+
* repository that cannot be read fails the query instead of being skipped into an empty answer.
|
|
264
|
+
*/
|
|
265
|
+
obsoletes: [
|
|
266
|
+
'dnf',
|
|
267
|
+
'repoquery',
|
|
268
|
+
'--quiet',
|
|
269
|
+
'-y',
|
|
270
|
+
'--setopt=skip_if_unavailable=False',
|
|
271
|
+
'--obsoletes',
|
|
272
|
+
'{{package}}',
|
|
273
|
+
],
|
|
274
|
+
/**
|
|
275
|
+
* Per component: Docker's Fedora guide has the first twelve removed first; the rest are what the
|
|
276
|
+
* component's packages `Obsolete` (containerd.io: containerd, runc; older docker-ce releases:
|
|
277
|
+
* docker-ce-selinux; nvidia-container-toolkit: nvidia-container-runtime ≤ 3.5.0-1,
|
|
278
|
+
* nvidia-container-runtime-hook ≤ 1.4.0-2). The live check covers anything else they obsolete.
|
|
279
|
+
*/
|
|
280
|
+
conflicts: {
|
|
281
|
+
'docker-engine': [
|
|
282
|
+
'moby-engine',
|
|
283
|
+
'docker',
|
|
284
|
+
'docker-client',
|
|
285
|
+
'docker-client-latest',
|
|
286
|
+
'docker-common',
|
|
287
|
+
'docker-latest',
|
|
288
|
+
'docker-latest-logrotate',
|
|
289
|
+
'docker-logrotate',
|
|
290
|
+
'docker-selinux',
|
|
291
|
+
'docker-engine-selinux',
|
|
292
|
+
'docker-engine',
|
|
293
|
+
'podman-docker',
|
|
294
|
+
'containerd',
|
|
295
|
+
'runc',
|
|
296
|
+
'docker-ce-selinux',
|
|
297
|
+
],
|
|
298
|
+
'nvidia-container-toolkit': ['nvidia-container-runtime', 'nvidia-container-runtime-hook'],
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
file_mode: 0o644,
|
|
302
|
+
runtime: {
|
|
303
|
+
daemon_json: '/etc/docker/daemon.json',
|
|
304
|
+
configure: ['nvidia-ctk', 'runtime', 'configure', '--runtime=docker'],
|
|
305
|
+
docker_active: DOCKER_ACTIVE,
|
|
306
|
+
/** Which runtimes the running daemon actually loaded, as opposed to what daemon.json says. */
|
|
307
|
+
loaded: ['docker', 'info', '--format', '{{json .Runtimes}}'],
|
|
308
|
+
restart: ['systemctl', 'restart', 'docker'],
|
|
309
|
+
reset_failed: DOCKER_RESET_FAILED,
|
|
310
|
+
journal: DOCKER_JOURNAL,
|
|
311
|
+
},
|
|
312
|
+
/**
|
|
313
|
+
* The NVIDIA CDI spec (task 2.23, F-5; ruling R-core-8): `nvidia-ctk cdi list` says whether a
|
|
314
|
+
* `nvidia.com/gpu` device is already defined — the same check the core's probe makes — and only
|
|
315
|
+
* when none is does `generate` write the spec, to the fixed path, never another. Where the toolkit
|
|
316
|
+
* ships `nvidia-cdi-refresh.path` (NVIDIA Container Toolkit 1.18+), it is enabled so the spec is
|
|
317
|
+
* rewritten after a driver update or a reboot (`/var/run` is a tmpfs); where it does not, nothing
|
|
318
|
+
* fails, and the next probe after a reboot plans the spec again.
|
|
319
|
+
*/
|
|
320
|
+
cdi: {
|
|
321
|
+
spec: CDI_SPEC,
|
|
322
|
+
list: ['nvidia-ctk', 'cdi', 'list'],
|
|
323
|
+
generate: ['nvidia-ctk', 'cdi', 'generate', `--output=${CDI_SPEC}`],
|
|
324
|
+
/**
|
|
325
|
+
* The core's probe runs `nvidia-ctk cdi list` as the user, so the spec must be world-readable.
|
|
326
|
+
* Whether `generate` leaves it `0644` differs across toolkit releases (the CDI library writes a
|
|
327
|
+
* `0600` temporary file and renames it), so the step reads the mode and fixes it only when the
|
|
328
|
+
* file is not readable by others (task 2.23, review round 1).
|
|
329
|
+
*/
|
|
330
|
+
mode: ['stat', '--format=%a', CDI_SPEC],
|
|
331
|
+
make_readable: ['chmod', '0644', CDI_SPEC],
|
|
332
|
+
refresh_unit: CDI_REFRESH_UNIT,
|
|
333
|
+
refresh_present: ['systemctl', 'list-unit-files', '--no-legend', CDI_REFRESH_UNIT],
|
|
334
|
+
refresh_enabled: ['systemctl', 'is-enabled', CDI_REFRESH_UNIT],
|
|
335
|
+
refresh_enable: ['systemctl', 'enable', '--now', CDI_REFRESH_UNIT],
|
|
336
|
+
},
|
|
337
|
+
service: {
|
|
338
|
+
enabled: ['systemctl', 'is-enabled', 'docker'],
|
|
339
|
+
active: DOCKER_ACTIVE,
|
|
340
|
+
reset_failed: DOCKER_RESET_FAILED,
|
|
341
|
+
enable: ['systemctl', 'enable', '--now', 'docker'],
|
|
342
|
+
journal: DOCKER_JOURNAL,
|
|
343
|
+
},
|
|
344
|
+
group: {
|
|
345
|
+
uid: ['id', '-u', '{{user}}'],
|
|
346
|
+
groups: ['id', '-nG', '{{user}}'],
|
|
347
|
+
add: ['usermod', '-aG', 'docker', '{{user}}'],
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
export const INSTALL_CONTAINER_RUNTIME_RECIPE_DIGEST = canonicalDigest(INSTALL_CONTAINER_RUNTIME_RECIPE);
|
|
351
|
+
// ---------------------------------------------------------------------------------------------
|
|
352
|
+
// Parameters
|
|
353
|
+
// ---------------------------------------------------------------------------------------------
|
|
354
|
+
/** POSIX portable user name; a leading `-` would be read as an option. */
|
|
355
|
+
const USER_NAME = /^[A-Za-z_][A-Za-z0-9._-]{0,31}$/;
|
|
356
|
+
const PARAMETER_KEYS = ['user', 'arch', 'family', 'distro_id', 'version_id', 'components'];
|
|
357
|
+
function familyOf(distro) {
|
|
358
|
+
if (own(INSTALL_CONTAINER_RUNTIME_RECIPE.apt.suites, distro) !== undefined)
|
|
359
|
+
return 'apt';
|
|
360
|
+
if (own(INSTALL_CONTAINER_RUNTIME_RECIPE.dnf.versions, distro) !== undefined)
|
|
361
|
+
return 'dnf';
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
/** The apt suite for a release, from own properties only: `constructor`/`name` is not a release. */
|
|
365
|
+
function aptSuite(distro, version) {
|
|
366
|
+
const releases = own(INSTALL_CONTAINER_RUNTIME_RECIPE.apt.suites, distro);
|
|
367
|
+
return releases === undefined ? undefined : own(releases, version);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Checks untrusted parameters against what this recipe can build, and returns them normalised
|
|
371
|
+
* (components in recipe order). The descriptor's distribution list is the core's business; this
|
|
372
|
+
* only refuses what the compiled recipe has no commands for.
|
|
373
|
+
*/
|
|
374
|
+
export function validateInstallContainerRuntimeParameters(raw) {
|
|
375
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
|
|
376
|
+
return { ok: false, problems: ['parameters must be an object'] };
|
|
377
|
+
const input = raw;
|
|
378
|
+
const problems = [];
|
|
379
|
+
for (const key of Object.keys(input))
|
|
380
|
+
if (!PARAMETER_KEYS.includes(key))
|
|
381
|
+
problems.push(`unknown parameter ${key}`);
|
|
382
|
+
const { user, arch, family, distro_id: distro, version_id: version, components } = input;
|
|
383
|
+
if (typeof user !== 'string' || !USER_NAME.test(user))
|
|
384
|
+
problems.push('user must be a POSIX user name');
|
|
385
|
+
if (arch !== 'x86_64' && arch !== 'aarch64')
|
|
386
|
+
problems.push('arch must be x86_64 or aarch64');
|
|
387
|
+
if (family !== 'apt' && family !== 'dnf')
|
|
388
|
+
problems.push('family must be apt or dnf');
|
|
389
|
+
if (typeof distro !== 'string' || typeof version !== 'string') {
|
|
390
|
+
problems.push('distro_id and version_id must be strings');
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
const expected = familyOf(distro);
|
|
394
|
+
if (expected === null)
|
|
395
|
+
problems.push(`the recipe has no commands for distribution ${distro}`);
|
|
396
|
+
else if (expected !== family)
|
|
397
|
+
problems.push(`${distro} uses ${expected}, not ${String(family)}`);
|
|
398
|
+
else if (expected === 'apt' && aptSuite(distro, version) === undefined)
|
|
399
|
+
problems.push(`the recipe has no apt suite for ${distro} ${version}`);
|
|
400
|
+
else if (expected === 'dnf' &&
|
|
401
|
+
!new RegExp(own(INSTALL_CONTAINER_RUNTIME_RECIPE.dnf.versions, distro)).test(version))
|
|
402
|
+
problems.push(`${version} is not a ${distro} release number`);
|
|
403
|
+
}
|
|
404
|
+
let ordered = [];
|
|
405
|
+
if (!Array.isArray(components)) {
|
|
406
|
+
problems.push('components must be a list');
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
for (const component of components)
|
|
410
|
+
if (!CONTAINER_RUNTIME_COMPONENTS.includes(component))
|
|
411
|
+
problems.push(`unknown component ${String(component)}`);
|
|
412
|
+
if (new Set(components).size !== components.length)
|
|
413
|
+
problems.push('a component is repeated');
|
|
414
|
+
if (components.length === 0)
|
|
415
|
+
problems.push('components is empty: nothing to do');
|
|
416
|
+
ordered = CONTAINER_RUNTIME_COMPONENTS.filter((component) => components.includes(component));
|
|
417
|
+
}
|
|
418
|
+
// Root needs no group (design D4); adding it would only ever be a mistake or an attack.
|
|
419
|
+
if (user === 'root' && ordered.includes('docker-group'))
|
|
420
|
+
problems.push('root is never added to the docker group');
|
|
421
|
+
if (problems.length > 0)
|
|
422
|
+
return { ok: false, problems };
|
|
423
|
+
return {
|
|
424
|
+
ok: true,
|
|
425
|
+
parameters: {
|
|
426
|
+
user: user,
|
|
427
|
+
arch: arch,
|
|
428
|
+
family: family,
|
|
429
|
+
distro_id: distro,
|
|
430
|
+
version_id: version,
|
|
431
|
+
components: ordered,
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
function validated(parameters) {
|
|
436
|
+
const result = validateInstallContainerRuntimeParameters(parameters);
|
|
437
|
+
if (!result.ok)
|
|
438
|
+
invalid(`invalid recipe parameters: ${result.problems.join('; ')}`);
|
|
439
|
+
return result.parameters;
|
|
440
|
+
}
|
|
441
|
+
/** Canonical-JSON sha256 of the normalised parameters: what `parameters_digest` must equal. */
|
|
442
|
+
export function installContainerRuntimeParametersDigest(parameters) {
|
|
443
|
+
return canonicalDigest(validated(parameters));
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* The parameters for an install plan from `assessLinux` (task 2.4), for the core to put behind a
|
|
447
|
+
* `pending_host_step` (task 2.6). Each system change maps to one component; anything the recipe
|
|
448
|
+
* cannot do, or a group line for an account other than the host's user, is refused.
|
|
449
|
+
*/
|
|
450
|
+
export function parametersFromPlan(plan, host) {
|
|
451
|
+
if (plan.recipe_id !== INSTALL_CONTAINER_RUNTIME_RECIPE_ID)
|
|
452
|
+
invalid(`the plan is for recipe ${plan.recipe_id}, not ${INSTALL_CONTAINER_RUNTIME_RECIPE_ID}`);
|
|
453
|
+
const wanted = new Set();
|
|
454
|
+
const { packages } = INSTALL_CONTAINER_RUNTIME_RECIPE;
|
|
455
|
+
for (const change of plan.system_changes) {
|
|
456
|
+
switch (change.code) {
|
|
457
|
+
case 'add-repository':
|
|
458
|
+
wanted.add(change.params?.['vendor'] === 'docker' ? 'docker-engine' : 'nvidia-container-toolkit');
|
|
459
|
+
break;
|
|
460
|
+
case 'install-packages':
|
|
461
|
+
for (const name of (change.params?.['packages'] ?? '').split(',').filter(Boolean)) {
|
|
462
|
+
if (packages['docker-engine'].includes(name))
|
|
463
|
+
wanted.add('docker-engine');
|
|
464
|
+
else if (packages['nvidia-container-toolkit'].includes(name))
|
|
465
|
+
wanted.add('nvidia-container-toolkit');
|
|
466
|
+
else
|
|
467
|
+
invalid(`the recipe does not install package ${name}`);
|
|
468
|
+
}
|
|
469
|
+
break;
|
|
470
|
+
case 'configure-nvidia-runtime':
|
|
471
|
+
wanted.add('nvidia-runtime');
|
|
472
|
+
break;
|
|
473
|
+
case 'generate-cdi-spec':
|
|
474
|
+
wanted.add('nvidia-cdi');
|
|
475
|
+
break;
|
|
476
|
+
case 'restart-docker':
|
|
477
|
+
wanted.add('docker-restart');
|
|
478
|
+
break;
|
|
479
|
+
case 'enable-docker-service':
|
|
480
|
+
wanted.add('docker-service');
|
|
481
|
+
break;
|
|
482
|
+
case 'add-user-to-docker-group':
|
|
483
|
+
if (change.params?.['user'] !== host.user)
|
|
484
|
+
invalid(`the plan adds ${String(change.params?.['user'])} to the docker group, not ${host.user}`);
|
|
485
|
+
wanted.add('docker-group');
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return validated({ ...host, components: [...wanted] });
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* This recipe as the core's Linux provisioner consumes it (task 2.6): it builds the parameters of a
|
|
493
|
+
* pending host step from the plan and their digest, with the same functions the executor checks
|
|
494
|
+
* them against. The provisioner cannot import this module itself (it imports the environment
|
|
495
|
+
* module), so the core passes it in.
|
|
496
|
+
*/
|
|
497
|
+
export const INSTALL_CONTAINER_RUNTIME_BINDING = {
|
|
498
|
+
recipe_id: INSTALL_CONTAINER_RUNTIME_RECIPE_ID,
|
|
499
|
+
recipe_digest: INSTALL_CONTAINER_RUNTIME_RECIPE_DIGEST,
|
|
500
|
+
parameters: (plan, host) => parametersFromPlan(plan, host),
|
|
501
|
+
parametersDigest: (parameters) => installContainerRuntimeParametersDigest(parameters),
|
|
502
|
+
};
|
|
503
|
+
function fill(template, values) {
|
|
504
|
+
return template.replace(/\{\{([a-z_]+)\}\}/g, (_match, name) => {
|
|
505
|
+
const value = own(values, name);
|
|
506
|
+
if (value === undefined)
|
|
507
|
+
invalid(`no value for {{${name}}}`);
|
|
508
|
+
return value;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
const argv = (template, values) => template.map((part) => fill(part, values));
|
|
512
|
+
const VENDOR_IDS = {
|
|
513
|
+
'docker-engine': 'docker',
|
|
514
|
+
'nvidia-container-toolkit': 'nvidia',
|
|
515
|
+
};
|
|
516
|
+
/** The ordered steps for these parameters. Throws on parameters that do not validate. */
|
|
517
|
+
export function buildInstallContainerRuntimeSteps(input) {
|
|
518
|
+
const parameters = validated(input);
|
|
519
|
+
const recipe = INSTALL_CONTAINER_RUNTIME_RECIPE;
|
|
520
|
+
const wants = (component) => parameters.components.includes(component);
|
|
521
|
+
const family = recipe[parameters.family];
|
|
522
|
+
const values = {
|
|
523
|
+
distro: parameters.distro_id,
|
|
524
|
+
user: parameters.user,
|
|
525
|
+
deb_arch: recipe.apt.architectures[parameters.arch],
|
|
526
|
+
suite: aptSuite(parameters.distro_id, parameters.version_id) ?? '',
|
|
527
|
+
};
|
|
528
|
+
const steps = [];
|
|
529
|
+
const vendors = ['docker-engine', 'nvidia-container-toolkit'].filter(wants);
|
|
530
|
+
for (const vendor of vendors) {
|
|
531
|
+
const { key, source } = family.repositories[vendor];
|
|
532
|
+
steps.push({
|
|
533
|
+
id: `${VENDOR_IDS[vendor]}-key`,
|
|
534
|
+
kind: 'install-key',
|
|
535
|
+
url: fill(key.url, values),
|
|
536
|
+
path: key.path,
|
|
537
|
+
encoding: key.encoding,
|
|
538
|
+
fingerprints: [...key.fingerprints],
|
|
539
|
+
mode: recipe.file_mode,
|
|
540
|
+
});
|
|
541
|
+
steps.push({
|
|
542
|
+
id: `${VENDOR_IDS[vendor]}-source`,
|
|
543
|
+
kind: 'write-source',
|
|
544
|
+
path: source.path,
|
|
545
|
+
content: fill(source.content, values),
|
|
546
|
+
mode: recipe.file_mode,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
if (vendors.length > 0) {
|
|
550
|
+
const packages = vendors.flatMap((vendor) => recipe.packages[vendor]);
|
|
551
|
+
const query = (name) => ({ package: name, argv: argv(family.installed, { package: name }) });
|
|
552
|
+
steps.push({
|
|
553
|
+
id: 'packages',
|
|
554
|
+
kind: 'install-packages',
|
|
555
|
+
packages,
|
|
556
|
+
queries: packages.map(query),
|
|
557
|
+
conflicts: vendors.flatMap((vendor) => family.conflicts[vendor].map((name) => ({ ...query(name), component: vendor }))),
|
|
558
|
+
refresh: parameters.family === 'apt'
|
|
559
|
+
? vendors.map((vendor) => argv(recipe.apt.refresh, { source: recipe.apt.repositories[vendor].source.path }))
|
|
560
|
+
: [],
|
|
561
|
+
obsoletes: parameters.family === 'dnf'
|
|
562
|
+
? {
|
|
563
|
+
queries: packages.map((name) => ({
|
|
564
|
+
package: name,
|
|
565
|
+
argv: argv(recipe.dnf.obsoletes, { package: name }),
|
|
566
|
+
})),
|
|
567
|
+
// The presence query without its trailing `{{package}}`: the executor appends each name.
|
|
568
|
+
installed: recipe.dnf.installed.slice(0, -1),
|
|
569
|
+
}
|
|
570
|
+
: null,
|
|
571
|
+
install: [...family.install],
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
if (wants('nvidia-runtime')) {
|
|
575
|
+
steps.push({
|
|
576
|
+
id: 'nvidia-runtime',
|
|
577
|
+
kind: 'configure-runtime',
|
|
578
|
+
daemon_json: recipe.runtime.daemon_json,
|
|
579
|
+
configure: [...recipe.runtime.configure],
|
|
580
|
+
docker_active: [...recipe.runtime.docker_active],
|
|
581
|
+
loaded: [...recipe.runtime.loaded],
|
|
582
|
+
restart: [...recipe.runtime.restart],
|
|
583
|
+
reset_failed: [...recipe.runtime.reset_failed],
|
|
584
|
+
journal: [...recipe.runtime.journal],
|
|
585
|
+
restart_approved: wants('docker-restart'),
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
if (wants('nvidia-cdi')) {
|
|
589
|
+
steps.push({
|
|
590
|
+
id: 'nvidia-cdi',
|
|
591
|
+
kind: 'generate-cdi',
|
|
592
|
+
spec: recipe.cdi.spec,
|
|
593
|
+
list: [...recipe.cdi.list],
|
|
594
|
+
generate: [...recipe.cdi.generate],
|
|
595
|
+
mode: [...recipe.cdi.mode],
|
|
596
|
+
make_readable: [...recipe.cdi.make_readable],
|
|
597
|
+
refresh_unit: recipe.cdi.refresh_unit,
|
|
598
|
+
refresh_present: [...recipe.cdi.refresh_present],
|
|
599
|
+
refresh_enabled: [...recipe.cdi.refresh_enabled],
|
|
600
|
+
refresh_enable: [...recipe.cdi.refresh_enable],
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
if (wants('docker-service')) {
|
|
604
|
+
steps.push({
|
|
605
|
+
id: 'docker-service',
|
|
606
|
+
kind: 'enable-service',
|
|
607
|
+
enabled: [...recipe.service.enabled],
|
|
608
|
+
active: [...recipe.service.active],
|
|
609
|
+
reset_failed: [...recipe.service.reset_failed],
|
|
610
|
+
enable: [...recipe.service.enable],
|
|
611
|
+
journal: [...recipe.service.journal],
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
if (wants('docker-group')) {
|
|
615
|
+
steps.push({
|
|
616
|
+
id: 'docker-group',
|
|
617
|
+
kind: 'add-to-docker-group',
|
|
618
|
+
user: parameters.user,
|
|
619
|
+
uid: argv(recipe.group.uid, values),
|
|
620
|
+
groups: argv(recipe.group.groups, values),
|
|
621
|
+
add: argv(recipe.group.add, values),
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
return steps;
|
|
625
|
+
}
|
|
626
|
+
/** Every argv a step can run, checks included — what the forbidden-word scan reads. */
|
|
627
|
+
export function commandsOf(step) {
|
|
628
|
+
switch (step.kind) {
|
|
629
|
+
case 'install-key':
|
|
630
|
+
case 'write-source':
|
|
631
|
+
return [];
|
|
632
|
+
case 'install-packages':
|
|
633
|
+
return [
|
|
634
|
+
...step.queries.map((query) => query.argv),
|
|
635
|
+
...step.conflicts.map((conflict) => conflict.argv),
|
|
636
|
+
...(step.obsoletes === null
|
|
637
|
+
? []
|
|
638
|
+
: [
|
|
639
|
+
...step.obsoletes.queries.map((query) => query.argv),
|
|
640
|
+
[...step.obsoletes.installed, 'obsoleted-name'],
|
|
641
|
+
]),
|
|
642
|
+
...step.refresh,
|
|
643
|
+
[...step.install, ...step.packages],
|
|
644
|
+
];
|
|
645
|
+
case 'configure-runtime':
|
|
646
|
+
return [step.configure, step.docker_active, step.loaded, step.reset_failed, step.restart, step.journal];
|
|
647
|
+
case 'generate-cdi':
|
|
648
|
+
return [
|
|
649
|
+
step.list,
|
|
650
|
+
step.generate,
|
|
651
|
+
step.mode,
|
|
652
|
+
step.make_readable,
|
|
653
|
+
step.refresh_present,
|
|
654
|
+
step.refresh_enabled,
|
|
655
|
+
step.refresh_enable,
|
|
656
|
+
];
|
|
657
|
+
case 'enable-service':
|
|
658
|
+
return [step.enabled, step.active, step.reset_failed, step.enable, step.journal];
|
|
659
|
+
case 'add-to-docker-group':
|
|
660
|
+
return [step.uid, step.groups, step.add];
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
// ---------------------------------------------------------------------------------------------
|
|
664
|
+
// The allowlist every command passes before it runs
|
|
665
|
+
// ---------------------------------------------------------------------------------------------
|
|
666
|
+
/** Every package the recipe itself installs: the only ones `dnf repoquery` is asked about. */
|
|
667
|
+
export const RECIPE_PACKAGES = new Set([
|
|
668
|
+
...INSTALL_CONTAINER_RUNTIME_RECIPE.packages['docker-engine'],
|
|
669
|
+
...INSTALL_CONTAINER_RUNTIME_RECIPE.packages['nvidia-container-toolkit'],
|
|
670
|
+
]);
|
|
671
|
+
const PACKAGE_NAME = /^[A-Za-z0-9_][A-Za-z0-9._+-]{0,127}$/;
|
|
672
|
+
/**
|
|
673
|
+
* A package name — what an RPM `Obsoletes` names, as `dnf repoquery` prints it without its version
|
|
674
|
+
* constraint. Never an option, a path or any other kind of capability.
|
|
675
|
+
*/
|
|
676
|
+
export function isPackageName(value) {
|
|
677
|
+
return PACKAGE_NAME.test(value);
|
|
678
|
+
}
|
|
679
|
+
/** Words that remove or upgrade. None may appear in any argument of any command. */
|
|
680
|
+
export const FORBIDDEN_WORDS = [
|
|
681
|
+
'rm',
|
|
682
|
+
'purge',
|
|
683
|
+
'remove',
|
|
684
|
+
'autoremove',
|
|
685
|
+
'erase',
|
|
686
|
+
'upgrade',
|
|
687
|
+
'dist-upgrade',
|
|
688
|
+
'full-upgrade',
|
|
689
|
+
'distro-sync',
|
|
690
|
+
'reinstall',
|
|
691
|
+
'downgrade',
|
|
692
|
+
'-e',
|
|
693
|
+
'--erase',
|
|
694
|
+
'--allowerasing',
|
|
695
|
+
'--auto-remove',
|
|
696
|
+
'--autoremove',
|
|
697
|
+
];
|
|
698
|
+
const { runtime, cdi, service } = INSTALL_CONTAINER_RUNTIME_RECIPE;
|
|
699
|
+
/**
|
|
700
|
+
* Programs the recipe only ever runs in fixed shapes, with every such shape, whole. Compared element
|
|
701
|
+
* by element (`sameArgv`), never as joined text: `['enable', '--now docker']` is not
|
|
702
|
+
* `['enable', '--now', 'docker']` (task 2.23, review round 1).
|
|
703
|
+
*/
|
|
704
|
+
const EXACT_COMMANDS = {
|
|
705
|
+
'docker': { shapes: [runtime.loaded], why: 'docker is only ever asked which runtimes it loaded' },
|
|
706
|
+
'journalctl': {
|
|
707
|
+
shapes: [DOCKER_JOURNAL],
|
|
708
|
+
why: 'journalctl only ever reads the last lines of docker.service',
|
|
709
|
+
},
|
|
710
|
+
'nvidia-ctk': {
|
|
711
|
+
shapes: [runtime.configure, cdi.list, cdi.generate],
|
|
712
|
+
why: 'nvidia-ctk only ever configures the docker runtime, lists CDI devices or writes the one CDI spec',
|
|
713
|
+
},
|
|
714
|
+
// systemctl only ever touches docker.service (and its socket) and the CDI refresh unit.
|
|
715
|
+
'systemctl': {
|
|
716
|
+
shapes: [
|
|
717
|
+
runtime.docker_active,
|
|
718
|
+
runtime.restart,
|
|
719
|
+
runtime.reset_failed,
|
|
720
|
+
service.enabled,
|
|
721
|
+
service.active,
|
|
722
|
+
service.enable,
|
|
723
|
+
service.reset_failed,
|
|
724
|
+
cdi.refresh_present,
|
|
725
|
+
cdi.refresh_enabled,
|
|
726
|
+
cdi.refresh_enable,
|
|
727
|
+
],
|
|
728
|
+
why: 'systemctl is only ever run in the shapes this recipe builds',
|
|
729
|
+
},
|
|
730
|
+
'stat': { shapes: [cdi.mode], why: 'stat only ever reads the mode of the CDI spec' },
|
|
731
|
+
'chmod': { shapes: [cdi.make_readable], why: 'chmod only ever makes the CDI spec readable' },
|
|
732
|
+
};
|
|
733
|
+
/** The same argv: the same length, and every argument equal in its own position. */
|
|
734
|
+
export function sameArgv(a, b) {
|
|
735
|
+
return a.length === b.length && a.every((argument, index) => argument === b[index]);
|
|
736
|
+
}
|
|
737
|
+
/** Program → the first argument it may be run with. Nothing else is ever run as root. */
|
|
738
|
+
const PERMITTED = {
|
|
739
|
+
'apt-get': ['install', 'update'],
|
|
740
|
+
'dpkg-query': ['--show'],
|
|
741
|
+
'dnf': ['install', 'repoquery'],
|
|
742
|
+
'rpm': ['--query'],
|
|
743
|
+
'nvidia-ctk': ['runtime', 'cdi'],
|
|
744
|
+
'systemctl': ['is-active', 'is-enabled', 'enable', 'restart', 'reset-failed', 'list-unit-files'],
|
|
745
|
+
'id': ['-u', '-nG'],
|
|
746
|
+
'docker': ['info'],
|
|
747
|
+
'usermod': ['-aG'],
|
|
748
|
+
'journalctl': ['-u'],
|
|
749
|
+
'stat': ['--format=%a'],
|
|
750
|
+
'chmod': ['0644'],
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* Throws unless `argv` is one of the command shapes this recipe runs. The executor calls it on
|
|
754
|
+
* every command, so even a bug in step building cannot reach a shell, a removal or an upgrade.
|
|
755
|
+
*/
|
|
756
|
+
export function assertPermittedCommand(argv) {
|
|
757
|
+
const [program, first] = argv;
|
|
758
|
+
const refuse = (why) => {
|
|
759
|
+
throw new AtomicCoreError('MANAGED_HOST_STEP_INVALID', `refusing to run ${JSON.stringify(argv)}: ${why}`);
|
|
760
|
+
};
|
|
761
|
+
if (program === undefined)
|
|
762
|
+
refuse('empty command');
|
|
763
|
+
const allowed = own(PERMITTED, program);
|
|
764
|
+
if (allowed === undefined)
|
|
765
|
+
refuse(`${String(program)} is not a program this recipe runs`);
|
|
766
|
+
if (first === undefined || !allowed.includes(first))
|
|
767
|
+
refuse(`${String(first)} is not permitted here`);
|
|
768
|
+
for (const word of argv)
|
|
769
|
+
if (FORBIDDEN_WORDS.includes(word))
|
|
770
|
+
refuse(`${word} is forbidden`);
|
|
771
|
+
// An index refresh is only ever of one explicit source list, never of the whole system.
|
|
772
|
+
if (program === 'apt-get' && first === 'update' && !argv.includes('Dir::Etc::sourceparts=-'))
|
|
773
|
+
refuse('apt-get update must be restricted to one source list');
|
|
774
|
+
if (program === 'apt-get' && first === 'install' && !argv.includes('--no-remove'))
|
|
775
|
+
refuse('apt-get install must carry --no-remove, so the resolver can never remove a package');
|
|
776
|
+
// The queries (they install and remove nothing) are allowed in exactly the shapes the recipe
|
|
777
|
+
// builds, and nothing else.
|
|
778
|
+
if (program === 'dnf' && first === 'repoquery') {
|
|
779
|
+
const [, , ...rest] = argv;
|
|
780
|
+
const target = rest[4];
|
|
781
|
+
if (rest.length !== 5 ||
|
|
782
|
+
!sameArgv(rest.slice(0, 4), ['--quiet', '-y', '--setopt=skip_if_unavailable=False', '--obsoletes']) ||
|
|
783
|
+
target === undefined ||
|
|
784
|
+
!RECIPE_PACKAGES.has(target))
|
|
785
|
+
refuse('dnf repoquery is only ever asked what one of the recipe’s packages obsoletes');
|
|
786
|
+
}
|
|
787
|
+
if (program === 'rpm' &&
|
|
788
|
+
!(argv.length === 4 && argv[2] === '--queryformat=%{NAME}\\n' && isPackageName(argv[3])))
|
|
789
|
+
refuse('rpm is only ever asked whether a package of one exact name is installed');
|
|
790
|
+
if (program === 'usermod' && (argv[2] !== 'docker' || argv.length !== 4 || argv[3] === 'root'))
|
|
791
|
+
refuse('usermod only ever adds a non-root user to docker');
|
|
792
|
+
const exact = own(EXACT_COMMANDS, program);
|
|
793
|
+
if (exact !== undefined && !exact.shapes.some((shape) => sameArgv(argv, shape)))
|
|
794
|
+
refuse(exact.why);
|
|
795
|
+
}
|
|
796
|
+
//# sourceMappingURL=install-container-runtime.js.map
|