container-superposition 0.1.6 → 0.1.8

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.
Files changed (238) hide show
  1. package/README.md +24 -15
  2. package/dist/scripts/init.js +1 -1534
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/cli/args.d.ts +20 -0
  5. package/dist/tool/cli/args.d.ts.map +1 -0
  6. package/dist/tool/cli/args.js +325 -0
  7. package/dist/tool/cli/args.js.map +1 -0
  8. package/dist/tool/cli/run.d.ts +2 -0
  9. package/dist/tool/cli/run.d.ts.map +1 -0
  10. package/dist/tool/cli/run.js +318 -0
  11. package/dist/tool/cli/run.js.map +1 -0
  12. package/dist/tool/commands/adopt.d.ts.map +1 -1
  13. package/dist/tool/commands/adopt.js +1 -27
  14. package/dist/tool/commands/adopt.js.map +1 -1
  15. package/dist/tool/commands/doctor.d.ts +3 -0
  16. package/dist/tool/commands/doctor.d.ts.map +1 -1
  17. package/dist/tool/commands/doctor.js +1068 -70
  18. package/dist/tool/commands/doctor.js.map +1 -1
  19. package/dist/tool/commands/explain.d.ts.map +1 -1
  20. package/dist/tool/commands/explain.js +18 -0
  21. package/dist/tool/commands/explain.js.map +1 -1
  22. package/dist/tool/commands/migrate.d.ts +7 -0
  23. package/dist/tool/commands/migrate.d.ts.map +1 -0
  24. package/dist/tool/commands/migrate.js +52 -0
  25. package/dist/tool/commands/migrate.js.map +1 -0
  26. package/dist/tool/questionnaire/answers.d.ts +16 -0
  27. package/dist/tool/questionnaire/answers.d.ts.map +1 -0
  28. package/dist/tool/questionnaire/answers.js +102 -0
  29. package/dist/tool/questionnaire/answers.js.map +1 -0
  30. package/dist/tool/questionnaire/composer.d.ts +3 -3
  31. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  32. package/dist/tool/questionnaire/composer.js +902 -37
  33. package/dist/tool/questionnaire/composer.js.map +1 -1
  34. package/dist/tool/questionnaire/presets.d.ts +60 -0
  35. package/dist/tool/questionnaire/presets.d.ts.map +1 -0
  36. package/dist/tool/questionnaire/presets.js +164 -0
  37. package/dist/tool/questionnaire/presets.js.map +1 -0
  38. package/dist/tool/questionnaire/questionnaire.d.ts +10 -0
  39. package/dist/tool/questionnaire/questionnaire.d.ts.map +1 -0
  40. package/dist/tool/questionnaire/questionnaire.js +580 -0
  41. package/dist/tool/questionnaire/questionnaire.js.map +1 -0
  42. package/dist/tool/schema/manifest-migrations.d.ts +5 -0
  43. package/dist/tool/schema/manifest-migrations.d.ts.map +1 -1
  44. package/dist/tool/schema/manifest-migrations.js +45 -0
  45. package/dist/tool/schema/manifest-migrations.js.map +1 -1
  46. package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
  47. package/dist/tool/schema/overlay-loader.js +25 -0
  48. package/dist/tool/schema/overlay-loader.js.map +1 -1
  49. package/dist/tool/schema/project-config.d.ts +14 -2
  50. package/dist/tool/schema/project-config.d.ts.map +1 -1
  51. package/dist/tool/schema/project-config.js +277 -34
  52. package/dist/tool/schema/project-config.js.map +1 -1
  53. package/dist/tool/schema/target-rules.d.ts +78 -0
  54. package/dist/tool/schema/target-rules.d.ts.map +1 -0
  55. package/dist/tool/schema/target-rules.js +367 -0
  56. package/dist/tool/schema/target-rules.js.map +1 -0
  57. package/dist/tool/schema/types.d.ts +123 -12
  58. package/dist/tool/schema/types.d.ts.map +1 -1
  59. package/dist/tool/utils/merge.d.ts.map +1 -1
  60. package/dist/tool/utils/merge.js +9 -0
  61. package/dist/tool/utils/merge.js.map +1 -1
  62. package/dist/tool/utils/parameters.d.ts +76 -0
  63. package/dist/tool/utils/parameters.d.ts.map +1 -0
  64. package/dist/tool/utils/parameters.js +125 -0
  65. package/dist/tool/utils/parameters.js.map +1 -0
  66. package/dist/tool/utils/paths.d.ts +2 -0
  67. package/dist/tool/utils/paths.d.ts.map +1 -0
  68. package/dist/tool/utils/paths.js +31 -0
  69. package/dist/tool/utils/paths.js.map +1 -0
  70. package/docs/creating-overlays.md +151 -2
  71. package/docs/deployment-targets.md +88 -56
  72. package/docs/examples.md +20 -17
  73. package/docs/filesystem-contract.md +5 -0
  74. package/docs/minimal-and-editor.md +65 -5
  75. package/docs/overlay-imports.md +202 -101
  76. package/docs/overlays.md +162 -34
  77. package/docs/quick-reference.md +99 -0
  78. package/docs/specs/003-mkdocs2-overlay/spec.md +114 -0
  79. package/docs/specs/004-doctor-fix/spec.md +70 -0
  80. package/docs/specs/005-cuda-overlay/spec.md +101 -0
  81. package/docs/specs/006-rocm-overlay/spec.md +109 -0
  82. package/docs/specs/007-init-project-file/spec.md +66 -0
  83. package/docs/specs/007-target-aware-generation/spec.md +126 -0
  84. package/docs/specs/008-project-file-canonical/spec.md +83 -0
  85. package/docs/specs/009-project-env/spec.md +147 -0
  86. package/docs/specs/010-compose-env-materialization/spec.md +130 -0
  87. package/docs/specs/011-overlay-parameters/spec.md +235 -0
  88. package/overlays/.shared/README.md +105 -21
  89. package/overlays/.shared/compose/common-healthchecks.md +60 -0
  90. package/overlays/.shared/compose/nvidia-gpu-devcontainer.yml +22 -0
  91. package/overlays/.shared/vscode/recommended-extensions.json +15 -11
  92. package/overlays/alertmanager/setup.sh +4 -19
  93. package/overlays/alertmanager/verify.sh +8 -9
  94. package/overlays/all/README.md +43 -0
  95. package/overlays/all/devcontainer.patch.json +6 -0
  96. package/overlays/all/overlay.yml +14 -0
  97. package/overlays/amp/setup.sh +5 -0
  98. package/overlays/bun/setup.sh +10 -1
  99. package/overlays/bun/verify.sh +6 -1
  100. package/overlays/claude-code/setup.sh +5 -0
  101. package/overlays/cloudflared/setup.sh +9 -12
  102. package/overlays/codex/README.md +9 -6
  103. package/overlays/codex/devcontainer.patch.json +7 -1
  104. package/overlays/codex/setup.sh +5 -0
  105. package/overlays/codex/verify.sh +8 -0
  106. package/overlays/comfyui/.env.example +34 -0
  107. package/overlays/comfyui/README.md +342 -0
  108. package/overlays/comfyui/devcontainer.patch.json +15 -0
  109. package/overlays/comfyui/docker-compose.yml +39 -0
  110. package/overlays/comfyui/overlay.yml +20 -0
  111. package/overlays/comfyui/setup.sh +36 -0
  112. package/overlays/comfyui/verify.sh +103 -0
  113. package/overlays/commitlint/setup.sh +5 -0
  114. package/overlays/cuda/README.md +179 -0
  115. package/overlays/cuda/devcontainer.patch.json +7 -0
  116. package/overlays/cuda/overlay.yml +17 -0
  117. package/overlays/cuda/setup.sh +32 -0
  118. package/overlays/cuda/verify.sh +38 -0
  119. package/overlays/devcontainer-cli/README.md +50 -0
  120. package/overlays/devcontainer-cli/devcontainer.patch.json +13 -0
  121. package/overlays/devcontainer-cli/overlay.yml +16 -0
  122. package/overlays/devcontainer-cli/setup.sh +14 -0
  123. package/overlays/direnv/devcontainer.patch.json +6 -0
  124. package/overlays/direnv/setup.sh +7 -6
  125. package/overlays/dotnet/setup.sh +14 -7
  126. package/overlays/duckdb/devcontainer.patch.json +1 -2
  127. package/overlays/gcloud/devcontainer.patch.json +0 -6
  128. package/overlays/gcloud/setup.sh +51 -0
  129. package/overlays/gemini-cli/setup.sh +5 -0
  130. package/overlays/git-helpers/devcontainer.patch.json +2 -1
  131. package/overlays/go/setup.sh +15 -14
  132. package/overlays/jaeger/overlay.yml +2 -0
  133. package/overlays/just/setup.sh +5 -17
  134. package/overlays/k3d/README.md +201 -0
  135. package/overlays/k3d/devcontainer.patch.json +9 -0
  136. package/overlays/k3d/overlay.yml +19 -0
  137. package/overlays/k3d/setup.sh +34 -0
  138. package/overlays/k3d/verify.sh +38 -0
  139. package/overlays/keycloak/docker-compose.yml +6 -4
  140. package/overlays/keycloak/verify.sh +4 -3
  141. package/overlays/kind/devcontainer.patch.json +1 -2
  142. package/overlays/kind/setup.sh +8 -17
  143. package/overlays/minio/setup.sh +10 -18
  144. package/overlays/mkdocs/overlay.yml +2 -1
  145. package/overlays/mkdocs2/README.md +135 -0
  146. package/overlays/mkdocs2/devcontainer.patch.json +19 -0
  147. package/overlays/mkdocs2/overlay.yml +17 -0
  148. package/overlays/mkdocs2/setup.sh +67 -0
  149. package/overlays/mkdocs2/verify.sh +35 -0
  150. package/overlays/modern-cli-tools/devcontainer.patch.json +7 -1
  151. package/overlays/modern-cli-tools/setup.sh +21 -71
  152. package/overlays/mongodb/devcontainer.patch.json +0 -6
  153. package/overlays/mongodb/setup.sh +59 -0
  154. package/overlays/mysql/verify.sh +4 -3
  155. package/overlays/nats/.env.example +1 -1
  156. package/overlays/nats/README.md +1 -1
  157. package/overlays/nats/docker-compose.yml +1 -1
  158. package/overlays/ngrok/setup.sh +9 -6
  159. package/overlays/nodejs/setup.sh +5 -0
  160. package/overlays/ollama/.env.example +14 -0
  161. package/overlays/ollama/README.md +325 -0
  162. package/overlays/ollama/devcontainer.patch.json +14 -0
  163. package/overlays/ollama/docker-compose.yml +24 -0
  164. package/overlays/ollama/overlay.yml +22 -0
  165. package/overlays/ollama/setup.sh +106 -0
  166. package/overlays/ollama/verify.sh +99 -0
  167. package/overlays/open-webui/.env.example +5 -0
  168. package/overlays/open-webui/README.md +162 -0
  169. package/overlays/open-webui/devcontainer.patch.json +14 -0
  170. package/overlays/open-webui/docker-compose.yml +23 -0
  171. package/overlays/open-webui/overlay.yml +38 -0
  172. package/overlays/openapi-tools/devcontainer.patch.json +1 -2
  173. package/overlays/openapi-tools/setup.sh +9 -8
  174. package/overlays/opencode/setup.sh +5 -0
  175. package/overlays/otel-collector/overlay.yml +2 -0
  176. package/overlays/otel-collector/setup.sh +3 -16
  177. package/overlays/otel-demo-nodejs/verify.sh +8 -9
  178. package/overlays/otel-demo-python/verify.sh +16 -10
  179. package/overlays/pandoc/README.md +22 -15
  180. package/overlays/pandoc/devcontainer.patch.json +6 -2
  181. package/overlays/pandoc/setup.sh +217 -18
  182. package/overlays/pandoc/verify.sh +16 -4
  183. package/overlays/pgvector/.env.example +6 -0
  184. package/overlays/pgvector/README.md +215 -0
  185. package/overlays/pgvector/devcontainer.patch.json +23 -0
  186. package/overlays/pgvector/docker-compose.yml +32 -0
  187. package/overlays/pgvector/overlay.yml +44 -0
  188. package/overlays/playwright/devcontainer.patch.json +3 -1
  189. package/overlays/playwright/setup.sh +37 -0
  190. package/overlays/postgres/.env.example +5 -5
  191. package/overlays/postgres/devcontainer.patch.json +4 -4
  192. package/overlays/postgres/docker-compose.yml +15 -5
  193. package/overlays/postgres/overlay.yml +19 -1
  194. package/overlays/powershell/setup.sh +49 -13
  195. package/overlays/pre-commit/setup.sh +12 -3
  196. package/overlays/prometheus/overlay.yml +2 -0
  197. package/overlays/promtail/verify.sh +16 -10
  198. package/overlays/pulumi/devcontainer.patch.json +1 -1
  199. package/overlays/python/setup.sh +28 -9
  200. package/overlays/python/verify.sh +4 -2
  201. package/overlays/qdrant/.env.example +4 -0
  202. package/overlays/qdrant/README.md +216 -0
  203. package/overlays/qdrant/devcontainer.patch.json +20 -0
  204. package/overlays/qdrant/docker-compose.yml +25 -0
  205. package/overlays/qdrant/overlay.yml +40 -0
  206. package/overlays/redpanda/docker-compose.yml +3 -5
  207. package/overlays/rocm/README.md +227 -0
  208. package/overlays/rocm/devcontainer.patch.json +4 -0
  209. package/overlays/rocm/overlay.yml +17 -0
  210. package/overlays/rocm/setup.sh +45 -0
  211. package/overlays/rocm/verify.sh +47 -0
  212. package/overlays/rust/setup.sh +11 -18
  213. package/overlays/skaffold/README.md +256 -0
  214. package/overlays/skaffold/devcontainer.patch.json +9 -0
  215. package/overlays/skaffold/overlay.yml +20 -0
  216. package/overlays/skaffold/setup.sh +33 -0
  217. package/overlays/skaffold/verify.sh +24 -0
  218. package/overlays/spec-kit/setup.sh +7 -3
  219. package/overlays/sqlite/setup.sh +14 -14
  220. package/overlays/sqlserver/docker-compose.yml +3 -3
  221. package/overlays/sqlserver/verify.sh +22 -5
  222. package/overlays/tempo/verify.sh +16 -10
  223. package/overlays/tilt/devcontainer.patch.json +1 -2
  224. package/overlays/tilt/setup.sh +14 -4
  225. package/overlays/windsurf-cli/setup.sh +27 -4
  226. package/overlays/windsurf-cli/verify.sh +13 -3
  227. package/package.json +4 -2
  228. package/templates/scripts/setup-utils.sh +228 -0
  229. package/tool/schema/config.schema.json +141 -9
  230. package/tool/schema/overlay-manifest.schema.json +38 -0
  231. package/overlays/.shared/compose/common-healthchecks.yml +0 -38
  232. /package/overlays/otel-demo-nodejs/{Dockerfile-otel-demo-nodejs → Dockerfile} +0 -0
  233. /package/overlays/otel-demo-nodejs/{package-otel-demo-nodejs.json → package.json} +0 -0
  234. /package/overlays/otel-demo-nodejs/{server-otel-demo-nodejs.js → server.js} +0 -0
  235. /package/overlays/otel-demo-nodejs/{tracing-otel-demo-nodejs.js → tracing.js} +0 -0
  236. /package/overlays/otel-demo-python/{Dockerfile-otel-demo-python → Dockerfile} +0 -0
  237. /package/overlays/otel-demo-python/{app-otel-demo-python.py → app.py} +0 -0
  238. /package/overlays/otel-demo-python/{requirements-otel-demo-python.txt → requirements.txt} +0 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runServices": ["comfyui"],
4
+ "forwardPorts": [8188],
5
+ "portsAttributes": {
6
+ "8188": {
7
+ "label": "ComfyUI",
8
+ "onAutoForward": "openBrowser"
9
+ }
10
+ },
11
+ "remoteEnv": {
12
+ "COMFYUI_URL": "http://comfyui:8188",
13
+ "COMFYUI_MODELS_DIR": "/opt/comfyui-models"
14
+ }
15
+ }
@@ -0,0 +1,39 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ devcontainer:
5
+ volumes:
6
+ # Mount shared models root into devcontainer for direct filesystem access.
7
+ # When COMFYUI_MODELS_HOST_PATH is set this becomes a bind mount to that path;
8
+ # otherwise the named volume comfyui-models is used.
9
+ - ${COMFYUI_MODELS_HOST_PATH:-comfyui-models}:/opt/comfyui-models
10
+
11
+ comfyui:
12
+ image: ghcr.io/ai-dock/comfyui:${COMFYUI_VERSION:-latest-cuda}
13
+ restart: unless-stopped
14
+ volumes:
15
+ # Single root mount — ComfyUI discovers checkpoints/, loras/, etc. natively.
16
+ # Same source as the devcontainer mount above so both services share one copy.
17
+ - ${COMFYUI_MODELS_HOST_PATH:-comfyui-models}:/opt/ComfyUI/models
18
+ # Persist generated outputs (named volume by default, host path when COMFYUI_OUTPUT_PATH is set)
19
+ - ${COMFYUI_OUTPUT_PATH:-comfyui-output}:/opt/ComfyUI/output
20
+ environment:
21
+ - CLI_ARGS=${CLI_ARGS:---listen 0.0.0.0}
22
+ ports:
23
+ - '${COMFYUI_PORT:-8188}:8188'
24
+ deploy:
25
+ resources:
26
+ reservations:
27
+ devices:
28
+ - driver: nvidia
29
+ count: all
30
+ capabilities: [gpu]
31
+ networks:
32
+ - devnet
33
+
34
+ volumes:
35
+ comfyui-models:
36
+ comfyui-output:
37
+
38
+ networks:
39
+ devnet:
@@ -0,0 +1,20 @@
1
+ id: comfyui
2
+ name: ComfyUI
3
+ description: Node-based image/video generation UI for Stable Diffusion and generative AI workflows
4
+ category: dev
5
+ supports:
6
+ - compose
7
+ requires: []
8
+ suggests:
9
+ - cuda
10
+ - python
11
+ - ollama
12
+ conflicts: []
13
+ tags:
14
+ - dev
15
+ - ai
16
+ - image-generation
17
+ - stable-diffusion
18
+ - comfyui
19
+ ports:
20
+ - 8188
@@ -0,0 +1,36 @@
1
+ #!/bin/bash
2
+ # ComfyUI setup script — initializes the shared models directory
3
+
4
+ set -e
5
+
6
+ echo "🔧 Setting up ComfyUI..."
7
+
8
+ # Pre-create all expected model subdirectories inside the shared models root.
9
+ # Both the devcontainer and the ComfyUI sidecar mount this directory, so the
10
+ # subdirectories must exist before ComfyUI starts (it does not create them).
11
+ MODELS_DIR="${COMFYUI_MODELS_DIR:-/opt/comfyui-models}"
12
+
13
+ echo "📁 Initializing model subdirectories at ${MODELS_DIR}..."
14
+
15
+ # Ensure the root models directory exists and is writable by the current user.
16
+ if ! mkdir -p "${MODELS_DIR}" 2>/dev/null; then
17
+ # Likely a permission issue on a mounted volume; try with sudo if available.
18
+ if command -v sudo >/dev/null 2>&1; then
19
+ echo "⚠️ ${MODELS_DIR} is not writable, attempting to create it with sudo..."
20
+ sudo mkdir -p "${MODELS_DIR}"
21
+ sudo chown "$(id -u):$(id -g)" "${MODELS_DIR}"
22
+ else
23
+ echo "❌ Failed to create ${MODELS_DIR} (permission denied and sudo not available)." >&2
24
+ exit 1
25
+ fi
26
+ fi
27
+
28
+ if [ ! -w "${MODELS_DIR}" ]; then
29
+ echo "❌ ${MODELS_DIR} is not writable by user $(id -un). Please adjust permissions and retry." >&2
30
+ exit 1
31
+ fi
32
+
33
+ for subdir in checkpoints loras controlnet clip_vision vae embeddings upscale_models; do
34
+ mkdir -p "${MODELS_DIR}/${subdir}"
35
+ done
36
+ echo "✓ ComfyUI model subdirectories initialized at ${MODELS_DIR}"
@@ -0,0 +1,103 @@
1
+ #!/bin/bash
2
+ # Verification script for ComfyUI overlay
3
+ # Confirms the shared models directory is set up correctly and the ComfyUI service is accessible
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying ComfyUI overlay..."
8
+ echo ""
9
+
10
+ # Check shared models directory
11
+ echo "1️⃣ Checking shared models directory..."
12
+ MODELS_DIR="${COMFYUI_MODELS_DIR:-/opt/comfyui-models}"
13
+
14
+ if [ ! -d "${MODELS_DIR}" ]; then
15
+ echo " ❌ Models directory not found: ${MODELS_DIR}"
16
+ echo ""
17
+ echo "❌ ComfyUI overlay verification failed"
18
+ exit 1
19
+ fi
20
+ echo " ✅ Models directory exists: ${MODELS_DIR}"
21
+
22
+ if [ ! -w "${MODELS_DIR}" ]; then
23
+ echo " ❌ Models directory is not writable: ${MODELS_DIR}"
24
+ echo ""
25
+ echo "❌ ComfyUI overlay verification failed"
26
+ exit 1
27
+ fi
28
+ echo " ✅ Models directory is writable"
29
+
30
+ EXPECTED_SUBDIRS=(checkpoints loras controlnet clip_vision vae embeddings upscale_models)
31
+ MISSING_SUBDIRS=()
32
+ for subdir in "${EXPECTED_SUBDIRS[@]}"; do
33
+ if [ ! -d "${MODELS_DIR}/${subdir}" ]; then
34
+ MISSING_SUBDIRS+=("${subdir}")
35
+ fi
36
+ done
37
+
38
+ if [ ${#MISSING_SUBDIRS[@]} -gt 0 ]; then
39
+ echo " ❌ Missing model subdirectories: ${MISSING_SUBDIRS[*]}"
40
+ echo ""
41
+ echo "❌ ComfyUI overlay verification failed"
42
+ exit 1
43
+ fi
44
+ echo " ✅ All expected model subdirectories present"
45
+
46
+ # Check if curl is available
47
+ echo ""
48
+ echo "2️⃣ Checking curl availability..."
49
+ if ! command -v curl &> /dev/null; then
50
+ echo " ❌ curl not found"
51
+ echo ""
52
+ echo "❌ ComfyUI overlay verification failed (curl is required but not installed)"
53
+ exit 1
54
+ fi
55
+ echo " ✅ curl found"
56
+
57
+ # Check ComfyUI web UI
58
+ echo ""
59
+ echo "3️⃣ Checking ComfyUI service..."
60
+ COMFYUI_URL="${COMFYUI_URL:-http://comfyui:8188}"
61
+ COMFYUI_READY=false
62
+
63
+ set +e
64
+ for i in {1..30}; do
65
+ if curl -sf "${COMFYUI_URL}/" &> /dev/null; then
66
+ echo " ✅ ComfyUI service is ready"
67
+ COMFYUI_READY=true
68
+ break
69
+ fi
70
+ sleep 2
71
+ done
72
+ set -e
73
+
74
+ if [ "$COMFYUI_READY" = false ]; then
75
+ echo " ❌ ComfyUI service not ready after 60 seconds"
76
+ echo ""
77
+ echo " Tip: ComfyUI may take a while to start on first launch while it loads models."
78
+ echo " Check logs with: docker compose logs comfyui"
79
+ echo ""
80
+ echo "❌ ComfyUI overlay verification failed"
81
+ exit 1
82
+ fi
83
+
84
+ # Check system stats endpoint
85
+ echo ""
86
+ echo "4️⃣ Checking ComfyUI system stats..."
87
+ set +e
88
+ STATS_JSON=$(curl -sf "${COMFYUI_URL}/system_stats")
89
+ CURL_STATUS=$?
90
+ set -e
91
+
92
+ if [ $CURL_STATUS -eq 0 ] && [ -n "$STATS_JSON" ]; then
93
+ echo " ✅ ComfyUI API is responding"
94
+ else
95
+ echo " ⚠️ Could not reach /system_stats endpoint (service may still be loading)"
96
+ fi
97
+
98
+ echo ""
99
+ echo "✅ ComfyUI overlay verification complete"
100
+ echo " Models directory: ${MODELS_DIR}"
101
+ echo " Web UI: ${COMFYUI_URL}"
102
+ echo " API (example): ${COMFYUI_URL}/system_stats"
103
+ echo " Docs: https://github.com/comfyanonymous/ComfyUI"
@@ -3,6 +3,11 @@
3
3
 
4
4
  set -e
5
5
 
6
+ # Source shared setup utilities (provides load_nvm)
7
+ # shellcheck source=setup-utils.sh
8
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
9
+ load_nvm
10
+
6
11
  echo "📝 Setting up commitlint..."
7
12
 
8
13
  # Install commitlint and conventional commits config globally
@@ -0,0 +1,179 @@
1
+ # CUDA (NVIDIA GPU) Overlay
2
+
3
+ Enables NVIDIA GPU passthrough for containerized ML, inference, and CUDA compute workloads.
4
+
5
+ ## Features
6
+
7
+ - **GPU passthrough** - `--gpus=all` added to container `runArgs` so all host GPUs are available
8
+ - **VS Code devcontainer GPU hint** - `hostRequirements.gpu = true` signals that a GPU is needed
9
+ - **Setup check** - `setup.sh` verifies `nvidia-smi` on container start and prints actionable guidance when GPU access is unavailable
10
+ - **Doctor integration** - `verify.sh` asserts `nvidia-smi` exits 0 for `container-superposition doctor` checks
11
+
12
+ ## Prerequisites (host-side — out of scope for this overlay)
13
+
14
+ This overlay configures the _container_ side of GPU passthrough. The host must be prepared independently:
15
+
16
+ 1. **Supported NVIDIA GPU** — Pascal (GTX 10xx) or newer recommended
17
+ 2. **NVIDIA drivers** — Install the appropriate driver for your OS from [https://www.nvidia.com/drivers](https://www.nvidia.com/drivers)
18
+ 3. **NVIDIA Container Toolkit** — Install and configure following the [official guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html):
19
+ ```bash
20
+ # Example for Ubuntu
21
+ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
22
+ curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
23
+ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
24
+ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
25
+ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
26
+ ```
27
+ 4. **Configure the Docker runtime** — Run once after installing the toolkit:
28
+ ```bash
29
+ sudo nvidia-ctk runtime configure --runtime=docker
30
+ sudo systemctl restart docker
31
+ ```
32
+
33
+ > ⚠️ **This overlay cannot install or replace host drivers.** Version alignment between the CUDA user-space libraries inside the container and the host kernel module is the user's responsibility.
34
+
35
+ ## How It Works
36
+
37
+ The overlay patches `devcontainer.json` with two settings:
38
+
39
+ ```json
40
+ {
41
+ "runArgs": ["--gpus=all"],
42
+ "hostRequirements": {
43
+ "gpu": true
44
+ }
45
+ }
46
+ ```
47
+
48
+ - **`runArgs: ["--gpus=all"]`** — Passes all host GPUs into the container via the NVIDIA Container Runtime.
49
+ - **`hostRequirements.gpu: true`** — Tells VS Code that the host must have a GPU. VS Code will warn the user when opening the repo if no GPU is detected.
50
+
51
+ The container image itself does **not** need to be an official NVIDIA CUDA image for the passthrough to work; however, CUDA libraries (e.g., `libcuda.so`) must exist inside the image to use CUDA APIs. See [Base Image](#base-image) below.
52
+
53
+ ## Base Image
54
+
55
+ For GPU workloads you typically want a CUDA-capable base image. Popular choices:
56
+
57
+ | Image | Use case |
58
+ | ----------------------------------------- | --------------------------- |
59
+ | `nvidia/cuda:12.x.x-runtime-ubuntu22.04` | Runtime-only (inference) |
60
+ | `nvidia/cuda:12.x.x-devel-ubuntu22.04` | Full toolkit (compilation) |
61
+ | `nvcr.io/nvidia/pytorch:24.xx-py3` | PyTorch + CUDA pre-built |
62
+ | `nvcr.io/nvidia/tensorflow:24.xx-tf2-py3` | TensorFlow + CUDA pre-built |
63
+
64
+ Browse all tags at [hub.docker.com/r/nvidia/cuda](https://hub.docker.com/r/nvidia/cuda) and [catalog.ngc.nvidia.com](https://catalog.ngc.nvidia.com).
65
+
66
+ To use a CUDA image, set the `image` field in your `.devcontainer/devcontainer.json` (for plain stack) or configure the appropriate service's `image` (or its `build`/`dockerfile`) in your compose-based devcontainer setup (for compose stack).
67
+
68
+ ## Common Commands
69
+
70
+ ### Check GPU availability
71
+
72
+ ```bash
73
+ # List GPUs and driver version
74
+ nvidia-smi
75
+
76
+ # Compact GPU list
77
+ nvidia-smi -L
78
+
79
+ # Watch GPU utilisation (refreshes every second)
80
+ nvidia-smi dmon -s u
81
+ ```
82
+
83
+ ### Query CUDA version
84
+
85
+ ```bash
86
+ # CUDA runtime version (requires libcuda / nvidia-smi)
87
+ nvidia-smi | grep "CUDA Version"
88
+
89
+ # CUDA toolkit version (if nvcc is installed in the image)
90
+ nvcc --version
91
+ ```
92
+
93
+ ### Python / PyTorch smoke test
94
+
95
+ ```python
96
+ import torch
97
+ print(torch.cuda.is_available()) # True
98
+ print(torch.cuda.get_device_name(0)) # e.g. "NVIDIA GeForce RTX 4090"
99
+ ```
100
+
101
+ ### TensorFlow smoke test
102
+
103
+ ```python
104
+ import tensorflow as tf
105
+ print(tf.config.list_physical_devices('GPU'))
106
+ ```
107
+
108
+ ## Use Cases
109
+
110
+ - **Model inference** — Run LLM or CV model inference with GPU acceleration
111
+ - **Training** — Train deep learning models without leaving the dev container
112
+ - **CUDA compute** — General-purpose GPU programming with CUDA C/C++ or PyCUDA
113
+ - **Jupyter notebooks** — GPU-accelerated data science with Jupyter (combine with the `jupyter` overlay)
114
+ - **CI parity** — Reproduce GPU CI failures locally inside the same container image
115
+
116
+ **Integrates well with:**
117
+
118
+ - `python` — Python runtime for ML workloads
119
+ - `jupyter` — Interactive GPU notebooks
120
+
121
+ ## Troubleshooting
122
+
123
+ ### `nvidia-smi: command not found`
124
+
125
+ The container cannot see the GPU. Work through this checklist:
126
+
127
+ 1. Verify host drivers: `nvidia-smi` should work on the _host_ before it works inside the container.
128
+ 2. Verify NVIDIA Container Toolkit is installed: `nvidia-ctk --version`.
129
+ 3. Verify Docker is configured to use the NVIDIA runtime:
130
+ ```bash
131
+ docker info | grep -i runtime
132
+ # Should list: nvidia
133
+ ```
134
+ 4. Rebuild the dev container after configuring the toolkit.
135
+
136
+ ### `Failed to initialize NVML: Driver/library version mismatch`
137
+
138
+ The CUDA user-space library version inside the image does not match the host kernel module. Solutions:
139
+
140
+ - Use a container image whose CUDA version matches (or is older than) the driver's supported CUDA version (`nvidia-smi` shows the maximum supported CUDA version on the host).
141
+ - Update the host NVIDIA driver.
142
+
143
+ ### `--gpus` flag not recognised by Docker
144
+
145
+ Your Docker version is older than 19.03 or the NVIDIA runtime is not configured as the default. Run:
146
+
147
+ ```bash
148
+ sudo nvidia-ctk runtime configure --runtime=docker
149
+ sudo systemctl restart docker
150
+ ```
151
+
152
+ Or pass the runtime explicitly (not needed if the overlay's `runArgs` is picked up):
153
+
154
+ ```bash
155
+ docker run --runtime=nvidia --gpus all nvidia/cuda:12.0-base nvidia-smi
156
+ ```
157
+
158
+ ### GPU not visible in GitHub Codespaces / cloud dev environments
159
+
160
+ Cloud hosted dev environments (GitHub Codespaces, Gitpod) typically do not provide GPU pass-through. Use a GPU-enabled cloud VM (AWS p-instances, GCP A100, Azure NCv3) and run VS Code Remote SSH or a self-hosted Codespace runner with GPU support.
161
+
162
+ ## Security Considerations
163
+
164
+ `--gpus=all` grants the container access to all host GPUs. This is appropriate for development but should not be used in untrusted or multi-tenant environments without additional isolation.
165
+
166
+ ## References
167
+
168
+ - [NVIDIA Container Toolkit — install guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)
169
+ - [NVIDIA CUDA Docker images](https://hub.docker.com/r/nvidia/cuda)
170
+ - [NVIDIA NGC catalogue](https://catalog.ngc.nvidia.com)
171
+ - [devcontainer spec — hostRequirements](https://containers.dev/implementors/json_reference/#general-properties)
172
+
173
+ **Related Overlays:**
174
+
175
+ - `python` — Python runtime for ML workloads
176
+ - `jupyter` — GPU-accelerated interactive notebooks
177
+ - `docker-in-docker` / `docker-sock` — Build GPU-enabled container images from within the dev container
178
+
179
+ > 🔜 **ROCm (AMD GPU)** support is tracked in a separate overlay (`rocm`). When that overlay is added it must declare `cuda` in its `conflicts` to satisfy the bidirectional conflict requirement.
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runArgs": ["--gpus=all"],
4
+ "hostRequirements": {
5
+ "gpu": true
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ id: cuda
2
+ name: CUDA (NVIDIA GPU)
3
+ description: NVIDIA CUDA libraries and GPU passthrough for containerized ML/inference workloads
4
+ category: dev
5
+ supports: []
6
+ requires: []
7
+ suggests: []
8
+ conflicts:
9
+ - rocm
10
+ tags:
11
+ - dev
12
+ - gpu
13
+ - cuda
14
+ - nvidia
15
+ - ml
16
+ - inference
17
+ ports: []
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+ # CUDA overlay setup script
3
+ # Checks that nvidia-smi is reachable inside the container and prints
4
+ # a helpful message when the host is not configured for GPU passthrough.
5
+
6
+ set -e
7
+
8
+ echo "🖥️ Setting up CUDA (NVIDIA GPU) overlay..."
9
+
10
+ if nvidia-smi -L >/dev/null 2>&1; then
11
+ echo "✓ nvidia-smi found: $(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | head -n1 || nvidia-smi -L 2>/dev/null | head -n1 || echo 'GPU detected')"
12
+ echo "✓ CUDA overlay is ready"
13
+ else
14
+ echo ""
15
+ echo "⚠️ nvidia-smi is installed but failed to run inside the container."
16
+ echo ""
17
+ echo " GPU passthrough requires the following on the host:"
18
+ echo " 1. A supported NVIDIA GPU"
19
+ echo " 2. NVIDIA drivers installed on the host"
20
+ echo " 3. NVIDIA Container Toolkit installed and configured:"
21
+ echo " https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html"
22
+ echo " 4. Docker configured to use the NVIDIA runtime:"
23
+ echo " nvidia-ctk runtime configure --runtime=docker"
24
+ echo ""
25
+ echo " This overlay adds '--gpus=all' to the container's runArgs and sets"
26
+ echo " hostRequirements.gpu = true in devcontainer.json, but it cannot"
27
+ echo " install or replace host drivers."
28
+ echo ""
29
+ echo " Once the host is configured, rebuild the dev container."
30
+ echo ""
31
+ echo "ℹ️ CUDA overlay setup complete (nvidia-smi not functioning on this host)"
32
+ fi
@@ -0,0 +1,38 @@
1
+ #!/bin/bash
2
+ # Verification script for CUDA overlay
3
+ # Asserts nvidia-smi exits 0 (used by the doctor command)
4
+
5
+ set -e
6
+
7
+ echo "🔍 Verifying CUDA (NVIDIA GPU) overlay..."
8
+ echo ""
9
+
10
+ echo "1️⃣ Checking nvidia-smi..."
11
+ if command -v nvidia-smi &> /dev/null; then
12
+ if nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader 2>/dev/null; then
13
+ echo " ✅ nvidia-smi is available and GPU is accessible"
14
+ elif nvidia-smi -L; then
15
+ echo " ✅ nvidia-smi is available and GPU is accessible"
16
+ else
17
+ echo " ❌ nvidia-smi is installed but failed to query GPU information"
18
+ echo ""
19
+ echo " Possible causes:"
20
+ echo " - NVIDIA driver is not loaded or mismatched with the container CUDA version"
21
+ echo " - Insufficient permissions to access the GPU from this container"
22
+ echo " - NVIDIA Container Toolkit / runtime is misconfigured"
23
+ echo ""
24
+ echo " Resolve the above issues and retry the CUDA overlay verification."
25
+ exit 1
26
+ fi
27
+ else
28
+ echo " ❌ nvidia-smi not found"
29
+ echo ""
30
+ echo " Ensure the host has:"
31
+ echo " - NVIDIA drivers installed"
32
+ echo " - NVIDIA Container Toolkit installed and configured"
33
+ echo " - Docker runtime configured for NVIDIA (nvidia-ctk runtime configure)"
34
+ exit 1
35
+ fi
36
+
37
+ echo ""
38
+ echo "✅ CUDA overlay verification complete"
@@ -0,0 +1,50 @@
1
+ # Dev Container CLI Overlay
2
+
3
+ Installs the [official devcontainer CLI](https://github.com/devcontainers/cli) (`@devcontainers/cli`) for building, running, and testing devcontainer configurations from the command line.
4
+
5
+ Useful for projects that generate or verify devcontainer configurations programmatically — including container-superposition itself.
6
+
7
+ ## Features
8
+
9
+ - **`devcontainer` CLI** — Build, run, and test devcontainer configurations from the command line
10
+ - **Node.js LTS** — Required runtime (included if not already present)
11
+ - **VS Code Extension:** Dev Containers (ms-vscode-remote.remote-containers)
12
+
13
+ ## How It Works
14
+
15
+ The setup script installs `@devcontainers/cli` as a global npm package. Node.js LTS is included via a devcontainer feature if not already available in the environment.
16
+
17
+ ## Common Commands
18
+
19
+ ```bash
20
+ # Build a devcontainer image
21
+ devcontainer build --workspace-folder .
22
+
23
+ # Start a devcontainer
24
+ devcontainer up --workspace-folder .
25
+
26
+ # Run a command inside the devcontainer
27
+ devcontainer exec --workspace-folder . -- bash -c "echo hello"
28
+
29
+ # Check the CLI version
30
+ devcontainer --version
31
+ ```
32
+
33
+ ## Use Cases
34
+
35
+ - **CI/CD validation** — Build and test devcontainer configurations in pipelines
36
+ - **Container-superposition development** — Verify generated `.devcontainer/` outputs actually build
37
+ - **Toolchain testing** — Ensure devcontainer features and overlays compose correctly
38
+
39
+ ## Requires Docker
40
+
41
+ The devcontainer CLI needs a Docker daemon to build containers. Pair with one of:
42
+
43
+ - [`docker-sock`](../docker-sock/README.md) — bind-mount host Docker socket (simpler, works everywhere)
44
+ - [`docker-in-docker`](../docker-in-docker/README.md) — isolated Docker daemon (better for nested containers)
45
+
46
+ ## References
47
+
48
+ - [devcontainers/cli on GitHub](https://github.com/devcontainers/cli)
49
+ - [Dev Containers specification](https://containers.dev/)
50
+ - [devcontainer CLI npm package](https://www.npmjs.com/package/@devcontainers/cli)
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "features": {
4
+ "ghcr.io/devcontainers/features/node:1": {
5
+ "version": "lts"
6
+ }
7
+ },
8
+ "customizations": {
9
+ "vscode": {
10
+ "extensions": ["ms-vscode-remote.remote-containers"]
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,16 @@
1
+ id: devcontainer-cli
2
+ name: Dev Container CLI
3
+ description: Official devcontainer CLI for building and testing devcontainer configurations
4
+ category: dev
5
+ supports: []
6
+ requires: []
7
+ suggests:
8
+ - docker-sock
9
+ - docker-in-docker
10
+ conflicts: []
11
+ tags:
12
+ - dev
13
+ - devcontainer
14
+ - cli
15
+ - testing
16
+ ports: []
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ # Dev Container CLI setup script - Install @devcontainers/cli globally
3
+
4
+ set -e
5
+
6
+ # Source shared setup utilities (provides load_nvm)
7
+ # shellcheck source=setup-utils.sh
8
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
9
+ load_nvm
10
+
11
+ echo "📦 Installing @devcontainers/cli..."
12
+ npm install -g @devcontainers/cli
13
+
14
+ echo "✓ devcontainer CLI installed: $(devcontainer --version)"
@@ -1,5 +1,11 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "features": {
4
+ "./features/cross-distro-packages": {
5
+ "apt": "direnv",
6
+ "apk": "direnv"
7
+ }
8
+ },
3
9
  "remoteEnv": {
4
10
  "DIRENV_LOG_FORMAT": ""
5
11
  }
@@ -5,15 +5,11 @@ set -e
5
5
 
6
6
  echo "🔐 Setting up direnv..."
7
7
 
8
- # Install direnv from package manager
9
- sudo apt-get update -qq
10
- sudo apt-get install -y direnv
11
-
12
- # Verify installation
8
+ # Verify installation (installed via cross-distro-packages feature)
13
9
  if command -v direnv &> /dev/null; then
14
10
  echo "✓ direnv installed: $(direnv version)"
15
11
  else
16
- echo "✗ direnv installation failed"
12
+ echo "✗ direnv not found — check cross-distro-packages feature"
17
13
  exit 1
18
14
  fi
19
15
 
@@ -80,6 +76,11 @@ EOF
80
76
  echo "✓ .envrc pre-allowed (run 'direnv deny' to disable)"
81
77
  fi
82
78
 
79
+ # Ensure any pre-existing .envrc is also allowed (idempotent re-runs)
80
+ if [ -f .envrc ]; then
81
+ direnv allow .envrc 2>/dev/null || true
82
+ fi
83
+
83
84
  # Create sample .env file if it doesn't exist
84
85
  if [ ! -f .env ] && [ ! -f .env.example ]; then
85
86
  cat > .env.example << 'EOF'