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
@@ -43,15 +43,13 @@ services:
43
43
  CONSOLE_CONFIG_FILE: |
44
44
  kafka:
45
45
  brokers: ["redpanda:9092"]
46
- schemaRegistry:
47
- enabled: true
48
- urls: ["http://redpanda:8081"]
46
+ schemaRegistry:
47
+ enabled: true
48
+ urls: ["http://redpanda:8081"]
49
49
  redpanda:
50
50
  adminApi:
51
51
  enabled: true
52
52
  urls: ["http://redpanda:9644"]
53
- connect:
54
- enabled: false
55
53
  ports:
56
54
  - '${REDPANDA_CONSOLE_PORT:-8080}:8080'
57
55
  networks:
@@ -0,0 +1,227 @@
1
+ # ROCm (AMD GPU) Overlay
2
+
3
+ Enables AMD GPU passthrough for containerized ML, inference, and ROCm compute workloads.
4
+
5
+ > ⚠️ **ROCm-in-container is more fragile than CUDA.** It depends heavily on the host kernel version, AMD driver stack, specific device support, and container runtime configuration. Treat this as a separate supported profile — not a drop-in equivalent of CUDA.
6
+
7
+ ## Features
8
+
9
+ - **AMD GPU passthrough** - Device flags added to container `runArgs` so host AMD GPUs are accessible
10
+ - **Group membership** - `--group-add=video` and `--group-add=render` ensure the container user can access GPU device nodes
11
+ - **Setup check** - `setup.sh` verifies `rocm-smi` / `rocminfo` on container start and prints actionable guidance when GPU access is unavailable
12
+ - **Doctor integration** - `verify.sh` asserts `rocm-smi` exits 0 for `container-superposition doctor` checks
13
+
14
+ ## Prerequisites (host-side — out of scope for this overlay)
15
+
16
+ This overlay configures the _container_ side of GPU passthrough. The host must be prepared independently:
17
+
18
+ 1. **Supported AMD GPU** — RDNA 2+ or most CDNA GPUs. Check the [ROCm hardware compatibility matrix](https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html) before proceeding.
19
+ 2. **AMD GPU drivers (`amdgpu`)** — Install the driver package for your Linux distribution:
20
+ ```bash
21
+ # Example for Ubuntu — use amdgpu-install from AMD's repository
22
+ # https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/amdgpu-install.html
23
+ sudo apt-get install amdgpu-dkms
24
+ ```
25
+ 3. **ROCm runtime** — Install on the host (or use a container image that bundles it):
26
+ ```bash
27
+ # Example for Ubuntu
28
+ sudo apt-get install rocm
29
+ ```
30
+ 4. **Group membership** — Add your user to the `render` and `video` groups:
31
+ ```bash
32
+ sudo usermod -aG render,video $USER
33
+ # Log out and back in (or reboot) for group changes to take effect
34
+ ```
35
+ 5. **Device nodes** — Verify `/dev/kfd` and `/dev/dri` exist on the host:
36
+ ```bash
37
+ ls -la /dev/kfd /dev/dri/
38
+ ```
39
+
40
+ > ⚠️ **This overlay cannot install or replace host drivers.** Version alignment between the ROCm user-space libraries inside the container and the host kernel module is the user's responsibility.
41
+
42
+ ## How It Works
43
+
44
+ The overlay patches `devcontainer.json` with:
45
+
46
+ ```json
47
+ {
48
+ "runArgs": ["--device=/dev/kfd", "--device=/dev/dri", "--group-add=video", "--group-add=render"]
49
+ }
50
+ ```
51
+
52
+ | Flag | Purpose |
53
+ | -------------------- | ----------------------------------------------------------------- |
54
+ | `--device=/dev/kfd` | AMD Kernel Fusion Driver; required for ROCm compute |
55
+ | `--device=/dev/dri` | Direct Rendering Infrastructure; gives access to GPU render nodes |
56
+ | `--group-add=video` | Adds the container user to the `video` group (owns `/dev/dri`) |
57
+ | `--group-add=render` | Adds the container user to the `render` group (owns `/dev/kfd`) |
58
+
59
+ The container image itself must include ROCm user-space libraries (e.g., `libamdhip64`) to use ROCm APIs. See [Base Image](#base-image) below.
60
+
61
+ ## Base Image
62
+
63
+ For ROCm workloads you typically want a ROCm-capable base image. Popular choices:
64
+
65
+ | Image | Use case |
66
+ | ----------------------- | ------------------------------------ |
67
+ | `rocm/dev-ubuntu-22.04` | Ubuntu 22.04 with ROCm pre-installed |
68
+ | `rocm/dev-ubuntu-24.04` | Ubuntu 24.04 with ROCm pre-installed |
69
+ | `rocm/pytorch` | PyTorch with ROCm support |
70
+ | `rocm/tensorflow` | TensorFlow with ROCm support |
71
+
72
+ Browse all official ROCm images at [hub.docker.com/u/rocm](https://hub.docker.com/u/rocm).
73
+
74
+ To use a ROCm image, set the `image` field in your `.devcontainer/devcontainer.json` (for plain stack) or configure the appropriate service's `image` in your compose-based devcontainer setup (for compose stack).
75
+
76
+ ## Common Commands
77
+
78
+ ### Check GPU availability
79
+
80
+ ```bash
81
+ # Show GPU product name and status
82
+ rocm-smi --showproductname
83
+
84
+ # Show all GPU information
85
+ rocm-smi
86
+
87
+ # Show GPU utilisation
88
+ rocm-smi --showuse
89
+
90
+ # List all HSA (Heterogeneous System Architecture) agents
91
+ rocminfo
92
+ ```
93
+
94
+ ### Discover device nodes
95
+
96
+ ```bash
97
+ # List DRI render nodes on the host
98
+ ls -la /dev/dri/
99
+
100
+ # Show GPU device details
101
+ rocm-smi --showbus
102
+ ```
103
+
104
+ ### Query ROCm version
105
+
106
+ ```bash
107
+ # ROCm version
108
+ cat /opt/rocm/.info/version 2>/dev/null || rocminfo | grep -i 'rocm\|version' | head -n5
109
+ ```
110
+
111
+ ### Python / PyTorch ROCm smoke test
112
+
113
+ ```python
114
+ import torch
115
+ print(torch.cuda.is_available()) # True (ROCm uses the CUDA compatibility layer)
116
+ print(torch.cuda.get_device_name(0)) # e.g. "AMD Radeon RX 7900 XTX"
117
+ ```
118
+
119
+ > **Note:** PyTorch ROCm uses `torch.cuda` APIs via the HIP/CUDA compatibility layer. Install the ROCm-specific PyTorch wheel:
120
+ >
121
+ > ```bash
122
+ > pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
123
+ > ```
124
+ >
125
+ > Find the correct wheel URL at [pytorch.org/get-started/locally](https://pytorch.org/get-started/locally/).
126
+
127
+ ### TensorFlow ROCm smoke test
128
+
129
+ ```python
130
+ import tensorflow as tf
131
+ print(tf.config.list_physical_devices('GPU'))
132
+ ```
133
+
134
+ > Install the ROCm-specific TensorFlow wheel from [tensorflow/rocm releases](https://github.com/ROCm/tensorflow-upstream/releases).
135
+
136
+ ## Use Cases
137
+
138
+ - **Model inference** — Run LLM or CV model inference with AMD GPU acceleration
139
+ - **Training** — Train deep learning models without leaving the dev container
140
+ - **ROCm compute** — General-purpose GPU programming with HIP (AMD's CUDA-compatible API)
141
+ - **Jupyter notebooks** — GPU-accelerated data science with Jupyter (combine with the `jupyter` overlay)
142
+
143
+ **Integrates well with:**
144
+
145
+ - `python` — Python runtime for ML workloads
146
+ - `jupyter` — Interactive GPU notebooks
147
+
148
+ ## Troubleshooting
149
+
150
+ ### `rocm-smi: command not found`
151
+
152
+ The container image does not include the ROCm tools. Either:
153
+
154
+ 1. Switch to a ROCm base image (e.g., `rocm/dev-ubuntu-22.04`)
155
+ 2. Install ROCm tools inside the image:
156
+ ```bash
157
+ sudo apt-get install rocm-smi-lib rocminfo
158
+ ```
159
+
160
+ ### `No AMD GPU detected` / `/dev/kfd not found`
161
+
162
+ The GPU device nodes are not accessible inside the container. Work through this checklist:
163
+
164
+ 1. Verify device nodes exist on the **host**:
165
+ ```bash
166
+ ls -la /dev/kfd /dev/dri/
167
+ ```
168
+ 2. Verify the `amdgpu` kernel module is loaded on the host:
169
+ ```bash
170
+ lsmod | grep amdgpu
171
+ ```
172
+ 3. Rebuild the dev container after confirming device nodes exist.
173
+
174
+ ### `Permission denied on /dev/kfd`
175
+
176
+ The container user is not in the correct groups. Verify:
177
+
178
+ ```bash
179
+ # Inside the container, check current groups
180
+ id
181
+
182
+ # On the host, add user to groups and re-login
183
+ sudo usermod -aG render,video $USER
184
+ ```
185
+
186
+ ### `ROCm version mismatch`
187
+
188
+ The ROCm user-space library version inside the image does not match the host kernel module version. Solutions:
189
+
190
+ - Use a container image whose ROCm version matches the host ROCm installation
191
+ - Check the host ROCm version: `cat /opt/rocm/.info/version`
192
+ - Use the corresponding `rocm/dev-*` image tag
193
+
194
+ ### `--device` flag not recognised
195
+
196
+ Ensure your Docker version is 19.03+ and the Docker daemon can access the host device nodes.
197
+
198
+ ### GPU not visible in GitHub Codespaces / cloud dev environments
199
+
200
+ Cloud hosted dev environments (GitHub Codespaces, Gitpod) typically do not provide AMD GPU passthrough. Use a GPU-enabled cloud VM with AMD GPU support and run VS Code Remote SSH.
201
+
202
+ ## Known Limitations
203
+
204
+ - ROCm version support is tightly coupled to the host kernel version and AMD driver stack
205
+ - Device node names (`/dev/dri/renderD128`) may differ between hosts; the `--device=/dev/dri` flag passes the entire directory
206
+ - Not all AMD GPU architectures are supported — always consult the [ROCm compatibility matrix](https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html)
207
+ - Some frameworks (PyTorch, TensorFlow) require separate ROCm-specific wheels — see [Common Commands](#common-commands)
208
+ - ROCm setup is generally less forgiving than CUDA; when in doubt, test `rocm-smi` on the host first
209
+
210
+ ## Security Considerations
211
+
212
+ `--device=/dev/kfd` and `--device=/dev/dri` grant the container access to the GPU device nodes. This is appropriate for development but should not be used in untrusted or multi-tenant environments.
213
+
214
+ ## References
215
+
216
+ - [ROCm documentation](https://rocm.docs.amd.com/)
217
+ - [ROCm hardware compatibility matrix](https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html)
218
+ - [ROCm installation guide (Linux)](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/)
219
+ - [ROCm Docker images (hub.docker.com/u/rocm)](https://hub.docker.com/u/rocm)
220
+ - [PyTorch ROCm wheels](https://pytorch.org/get-started/locally/)
221
+ - [TensorFlow ROCm releases](https://github.com/ROCm/tensorflow-upstream/releases)
222
+
223
+ **Related Overlays:**
224
+
225
+ - `python` — Python runtime for ML workloads
226
+ - `jupyter` — GPU-accelerated interactive notebooks
227
+ - `cuda` — NVIDIA GPU passthrough (conflicts with `rocm`)
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "runArgs": ["--device=/dev/kfd", "--device=/dev/dri", "--group-add=video", "--group-add=render"]
4
+ }
@@ -0,0 +1,17 @@
1
+ id: rocm
2
+ name: ROCm (AMD GPU)
3
+ description: AMD ROCm libraries and GPU passthrough for containerized ML/inference workloads
4
+ category: dev
5
+ supports: []
6
+ requires: []
7
+ suggests: []
8
+ conflicts:
9
+ - cuda
10
+ tags:
11
+ - dev
12
+ - gpu
13
+ - rocm
14
+ - amd
15
+ - ml
16
+ - inference
17
+ ports: []
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+ # ROCm overlay setup script
3
+ # Checks that rocm-smi / rocminfo is reachable inside the container and prints
4
+ # a helpful message when the host is not configured for AMD GPU passthrough.
5
+
6
+ set -e
7
+
8
+ echo "🖥️ Setting up ROCm (AMD GPU) overlay..."
9
+
10
+ if rocm-smi --showproductname >/dev/null 2>&1; then
11
+ gpu_name="$(rocm-smi --showproductname 2>/dev/null | grep -i 'card\|gpu\|product' | head -n1)"
12
+ if [ -z "$gpu_name" ]; then
13
+ gpu_name="AMD GPU detected"
14
+ fi
15
+ echo "✓ rocm-smi found: $gpu_name"
16
+ echo "✓ ROCm overlay is ready"
17
+ elif rocminfo >/dev/null 2>&1; then
18
+ gpu_name="$(rocminfo 2>/dev/null | grep 'Marketing Name' | head -n1 | sed 's/.*: *//')"
19
+ if [ -z "$gpu_name" ]; then
20
+ gpu_name="AMD GPU detected"
21
+ fi
22
+ echo "✓ rocminfo found: $gpu_name"
23
+ echo "✓ ROCm overlay is ready"
24
+ else
25
+ echo ""
26
+ echo "⚠️ Neither rocm-smi nor rocminfo is functioning inside the container."
27
+ echo ""
28
+ echo " AMD GPU passthrough requires the following on the host:"
29
+ echo " 1. A supported AMD GPU (RDNA 2+ or CDNA — check the compatibility matrix:"
30
+ echo " https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html)"
31
+ echo " 2. AMD GPU drivers (amdgpu) installed on the host"
32
+ echo " 3. ROCm runtime installed on the host (or bundled in the container image)"
33
+ echo " 4. Your user added to the 'render' and 'video' groups:"
34
+ echo " sudo usermod -aG render,video \$USER"
35
+ echo " 5. /dev/kfd and /dev/dri devices accessible in the container"
36
+ echo ""
37
+ echo " This overlay adds the following to the container's runArgs:"
38
+ echo " --device=/dev/kfd --device=/dev/dri"
39
+ echo " --group-add=video --group-add=render"
40
+ echo " but it cannot install or replace host drivers."
41
+ echo ""
42
+ echo " Once the host is configured, rebuild the dev container."
43
+ echo ""
44
+ echo "ℹ️ ROCm overlay setup complete (rocm-smi not functioning on this host)"
45
+ fi
@@ -0,0 +1,47 @@
1
+ #!/bin/bash
2
+ # Verification script for ROCm overlay
3
+ # Asserts rocm-smi exits 0 (used by the doctor command)
4
+
5
+ # Don't exit on error - we want to report all failures
6
+ ALL_CHECKS_PASSED=true
7
+
8
+ echo "🔍 Verifying ROCm (AMD GPU) overlay..."
9
+ echo ""
10
+
11
+ echo "1️⃣ Checking rocm-smi..."
12
+ if command -v rocm-smi &> /dev/null; then
13
+ if rocm-smi --showproductname 2>/dev/null; then
14
+ echo " ✅ rocm-smi is available and AMD GPU is accessible"
15
+ elif rocm-smi 2>/dev/null; then
16
+ echo " ✅ rocm-smi is available and AMD GPU is accessible"
17
+ else
18
+ echo " ❌ rocm-smi is installed but failed to query GPU information"
19
+ echo ""
20
+ echo " Possible causes:"
21
+ echo " - AMD GPU driver (amdgpu) is not loaded on the host"
22
+ echo " - /dev/kfd or /dev/dri is not accessible in this container"
23
+ echo " - Container user is not in the 'render' or 'video' group"
24
+ echo " - ROCm version mismatch between container image and host kernel"
25
+ echo ""
26
+ echo " Resolve the above issues and retry the ROCm overlay verification."
27
+ ALL_CHECKS_PASSED=false
28
+ fi
29
+ else
30
+ echo " ❌ rocm-smi not found"
31
+ echo ""
32
+ echo " Ensure the host has:"
33
+ echo " - AMD GPU drivers (amdgpu) installed"
34
+ echo " - ROCm runtime installed on the host or bundled in the container image"
35
+ echo " - /dev/kfd and /dev/dri accessible in the container"
36
+ echo " - Container user in the 'render' and 'video' groups"
37
+ ALL_CHECKS_PASSED=false
38
+ fi
39
+
40
+ echo ""
41
+ if [ "$ALL_CHECKS_PASSED" = true ]; then
42
+ echo "✅ ROCm overlay verification complete"
43
+ exit 0
44
+ else
45
+ echo "❌ ROCm overlay verification failed"
46
+ exit 1
47
+ fi
@@ -3,34 +3,27 @@
3
3
 
4
4
  set -e
5
5
 
6
+ # Source shared setup utilities
7
+ # shellcheck source=setup-utils.sh
8
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
9
+ export CARGO_TERM_COLOR=never
10
+
6
11
  echo "🔧 Setting up Rust development environment..."
7
12
 
8
13
  # Install common Rust components and tools
9
- echo "📦 Installing Rust components..."
10
-
11
- # rustfmt (Code formatter)
12
- rustup component add rustfmt || echo "⚠️ rustfmt already installed"
13
-
14
- # clippy (Linter)
15
- rustup component add clippy || echo "⚠️ clippy already installed"
16
-
17
- # rust-src (Source code for standard library)
18
- rustup component add rust-src || echo "⚠️ rust-src already installed"
14
+ run_spinner "rustfmt component" rustup component add rustfmt
15
+ run_spinner "clippy component" rustup component add clippy
16
+ run_spinner "rust-src component" rustup component add rust-src
19
17
 
20
18
  # Install common cargo tools
21
19
  echo "📦 Installing cargo tools..."
22
-
23
- # cargo-watch (Auto-rebuild on file changes)
24
- cargo install cargo-watch || echo "⚠️ cargo-watch already installed"
25
-
26
- # cargo-edit (Manage dependencies from CLI)
27
- cargo install cargo-edit || echo "⚠️ cargo-edit already installed"
20
+ run_spinner "cargo-watch" cargo install --quiet cargo-watch
21
+ run_spinner "cargo-edit" cargo install --quiet cargo-edit
28
22
 
29
23
  # Install project dependencies if Cargo.toml exists
30
24
  if [ -f "Cargo.toml" ]; then
31
25
  echo "📦 Rust project detected, building dependencies..."
32
- cargo fetch || echo "⚠️ cargo fetch failed"
33
- cargo build || echo "⚠️ cargo build failed or skipped"
26
+ run_spinner "cargo fetch" cargo fetch
34
27
  fi
35
28
 
36
29
  echo "✓ Rust setup complete"
@@ -0,0 +1,256 @@
1
+ # Skaffold Overlay
2
+
3
+ Installs [Skaffold](https://skaffold.dev), Google's command-line tool for continuous development on Kubernetes — handling the build, push, and deploy lifecycle automatically as source files change.
4
+
5
+ > **Note:** This overlay conflicts with `tilt` because both tools serve the same "continuous Kubernetes development" role. Choose `skaffold` for a configuration-file-driven, CI-friendly pipeline, or `tilt` for a more interactive, UI-driven workflow.
6
+
7
+ ## Features
8
+
9
+ - **`skaffold dev`** — Watch source files and automatically rebuild, push, and redeploy on changes
10
+ - **`skaffold run`** — One-shot build and deploy pipeline for CI/CD integration
11
+ - **Declarative config** — `skaffold.yaml` defines the entire build-test-deploy pipeline as code
12
+ - **Multiple builders** — Docker, Buildpacks, Bazel, Jib (Maven/Gradle), and more
13
+ - **Multiple deployers** — `kubectl`, Helm, Kustomize, and Cloud Run
14
+ - **Test integration** — Container Structure Tests and custom test steps built in
15
+ - **Profile support** — Swap out configs per environment (dev, staging, prod)
16
+
17
+ ## How It Works
18
+
19
+ Skaffold is installed as a static binary in the devcontainer during `setup.sh`. It orchestrates the build-push-deploy cycle against whichever Kubernetes cluster is active in your `kubeconfig` (e.g. a k3d or kind cluster).
20
+
21
+ **Suggested overlays:**
22
+
23
+ - `kubectl-helm` — Kubernetes CLI and Helm used as Skaffold deployers
24
+ - `kind` — Full-conformance local Kubernetes cluster
25
+ - `k3d` — Lightweight local Kubernetes cluster
26
+
27
+ ## Installation
28
+
29
+ Skaffold is installed automatically during devcontainer creation via `setup.sh`:
30
+
31
+ - Downloads the Skaffold binary for your architecture (amd64/arm64)
32
+ - Installs to `/usr/local/bin/skaffold`
33
+ - Verifies the installation
34
+
35
+ ## Common Commands
36
+
37
+ ### Development Workflow
38
+
39
+ ```bash
40
+ # Continuous development — rebuild and redeploy on file changes
41
+ skaffold dev
42
+
43
+ # One-shot build + deploy
44
+ skaffold run
45
+
46
+ # Delete all resources deployed by Skaffold
47
+ skaffold delete
48
+
49
+ # Preview what Skaffold would deploy (dry run)
50
+ skaffold render
51
+ ```
52
+
53
+ ### Build and Test
54
+
55
+ ```bash
56
+ # Build images only (no deploy)
57
+ skaffold build
58
+
59
+ # Run tests only
60
+ skaffold test
61
+
62
+ # Build and push to a registry
63
+ skaffold build --push
64
+ ```
65
+
66
+ ### Profiles
67
+
68
+ ```bash
69
+ # Use a specific profile
70
+ skaffold dev --profile staging
71
+
72
+ # Combine multiple profiles
73
+ skaffold run --profile prod --profile feature-flag
74
+ ```
75
+
76
+ ### Debugging
77
+
78
+ ```bash
79
+ # Enable port-forwarding for services
80
+ skaffold dev --port-forward
81
+
82
+ # Verbose output
83
+ skaffold dev -v debug
84
+
85
+ # Show rendered manifests
86
+ skaffold render --output manifests.yaml
87
+ ```
88
+
89
+ ## Configuration
90
+
91
+ ### skaffold.yaml
92
+
93
+ Create a `skaffold.yaml` in your project root:
94
+
95
+ ```yaml
96
+ apiVersion: skaffold/v4beta11
97
+ kind: Config
98
+ metadata:
99
+ name: my-app
100
+ build:
101
+ artifacts:
102
+ - image: my-app
103
+ docker:
104
+ dockerfile: Dockerfile
105
+ deploy:
106
+ kubectl:
107
+ manifests:
108
+ - k8s/*.yaml
109
+ test:
110
+ - image: my-app
111
+ structureTests:
112
+ - ./structure-test.yaml
113
+ profiles:
114
+ - name: prod
115
+ deploy:
116
+ helm:
117
+ releases:
118
+ - name: my-app
119
+ chartPath: helm/my-app
120
+ ```
121
+
122
+ ### Common Builders
123
+
124
+ ```yaml
125
+ # Docker (default)
126
+ build:
127
+ artifacts:
128
+ - image: my-app
129
+ docker:
130
+ dockerfile: Dockerfile
131
+
132
+ # Buildpacks (no Dockerfile needed)
133
+ build:
134
+ artifacts:
135
+ - image: my-app
136
+ buildpacks:
137
+ builder: gcr.io/buildpacks/builder:v1
138
+
139
+ # Jib (Java/Maven)
140
+ build:
141
+ artifacts:
142
+ - image: my-app
143
+ jib:
144
+ project: my-module
145
+ ```
146
+
147
+ ### Common Deployers
148
+
149
+ ```yaml
150
+ # kubectl (plain manifests)
151
+ deploy:
152
+ kubectl:
153
+ manifests:
154
+ - k8s/**/*.yaml
155
+
156
+ # Helm
157
+ deploy:
158
+ helm:
159
+ releases:
160
+ - name: my-app
161
+ chartPath: helm/my-app
162
+ valuesFiles:
163
+ - helm/values.yaml
164
+
165
+ # Kustomize
166
+ deploy:
167
+ kustomize:
168
+ paths:
169
+ - k8s/overlays/dev
170
+ ```
171
+
172
+ ## Benefits vs Tilt
173
+
174
+ | Feature | Skaffold (this overlay) | Tilt |
175
+ | --------------------- | --------------------------------- | -------------------------------- |
176
+ | **Primary interface** | ✅ CLI + skaffold.yaml config | Interactive UI (port 10350) |
177
+ | **CI/CD suitability** | ✅ First-class CI support | ⚠️ UI-oriented, less CI-friendly |
178
+ | **Config format** | ✅ Declarative YAML | Starlark/Python (Tiltfile) |
179
+ | **Build systems** | ✅ Docker, Buildpacks, Jib, Bazel | Docker, Buildpacks |
180
+ | **Deploy targets** | ✅ kubectl, Helm, Kustomize, Run | kubectl, Helm |
181
+ | **Learning curve** | Lower (declarative YAML) | Programmable (more flexible) |
182
+ | **Debugging support** | ✅ Built-in debug mode | ✅ Built-in live updates |
183
+
184
+ **Choose Skaffold when:**
185
+
186
+ - You want a declarative, portable, config-file-driven pipeline
187
+ - CI/CD integration is a priority
188
+ - You need support for multiple build systems (Jib, Buildpacks, Bazel)
189
+
190
+ **Choose Tilt when:**
191
+
192
+ - You prefer an interactive browser UI for development
193
+ - You want fine-grained control over the update pipeline via a Tiltfile
194
+
195
+ ## Use Cases
196
+
197
+ - **Inner loop acceleration** — Rebuild and redeploy Kubernetes workloads on save, without manual `docker build && kubectl apply`
198
+ - **Multi-service applications** — Manage build and deploy of multiple microservices from a single `skaffold.yaml`
199
+ - **CI/CD integration** — Use `skaffold run` in pipelines for consistent build-test-deploy flows
200
+ - **Helm chart development** — Iterate on Helm charts with live cluster feedback
201
+ - **GitOps preview environments** — Render manifests for inspection or PR previews
202
+
203
+ **Integrates well with:**
204
+
205
+ - `kubectl-helm` — Used by Skaffold's deploy pipeline
206
+ - `k3d` — Lightweight local cluster for development
207
+ - `kind` — Full-conformance local cluster for testing
208
+
209
+ ## Troubleshooting
210
+
211
+ ### No kubeconfig Found
212
+
213
+ ```bash
214
+ # Ensure kubectl is configured (kubectl-helm overlay must be selected)
215
+ kubectl cluster-info
216
+
217
+ # If using k3d, merge cluster config
218
+ k3d kubeconfig merge dev --kubeconfig-merge-default
219
+
220
+ # If using kind, kubeconfig is set automatically on cluster creation
221
+ kind create cluster --name dev
222
+ ```
223
+
224
+ ### Build Failures
225
+
226
+ ```bash
227
+ # Check Docker is accessible
228
+ docker info
229
+
230
+ # Run with verbose logging
231
+ skaffold dev -v debug
232
+ ```
233
+
234
+ ### Deploy Failures
235
+
236
+ ```bash
237
+ # View Kubernetes events
238
+ kubectl get events --sort-by='.lastTimestamp'
239
+
240
+ # Tail pod logs
241
+ kubectl logs -f deployment/my-app
242
+ ```
243
+
244
+ ## References
245
+
246
+ - [Skaffold Documentation](https://skaffold.dev/docs/)
247
+ - [Skaffold GitHub](https://github.com/GoogleContainerTools/skaffold)
248
+ - [skaffold.yaml Reference](https://skaffold.dev/docs/references/yaml/)
249
+ - [Kubernetes Documentation](https://kubernetes.io/docs/)
250
+
251
+ **Related Overlays:**
252
+
253
+ - [`kubectl-helm`](../kubectl-helm/README.md) — Kubernetes CLI and Helm (recommended with Skaffold)
254
+ - [`kind`](../kind/README.md) — Full-conformance local Kubernetes cluster
255
+ - [`k3d`](../k3d/README.md) — Lightweight local Kubernetes cluster
256
+ - [`tilt`](../tilt/README.md) — Alternative interactive Kubernetes development tool (conflicts)
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "features": {
4
+ "./features/cross-distro-packages": {
5
+ "apt": "curl",
6
+ "apk": "curl"
7
+ }
8
+ }
9
+ }