container-superposition 0.1.5 → 0.1.7

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 (155) hide show
  1. package/README.md +3 -1
  2. package/dist/scripts/init.js +24 -4
  3. package/dist/scripts/init.js.map +1 -1
  4. package/dist/tool/commands/adopt.d.ts +3 -2
  5. package/dist/tool/commands/adopt.d.ts.map +1 -1
  6. package/dist/tool/commands/adopt.js +378 -67
  7. package/dist/tool/commands/adopt.js.map +1 -1
  8. package/dist/tool/commands/doctor.d.ts +3 -0
  9. package/dist/tool/commands/doctor.d.ts.map +1 -1
  10. package/dist/tool/commands/doctor.js +932 -69
  11. package/dist/tool/commands/doctor.js.map +1 -1
  12. package/dist/tool/commands/explain.d.ts.map +1 -1
  13. package/dist/tool/commands/explain.js +9 -0
  14. package/dist/tool/commands/explain.js.map +1 -1
  15. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  16. package/dist/tool/questionnaire/composer.js +212 -11
  17. package/dist/tool/questionnaire/composer.js.map +1 -1
  18. package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
  19. package/dist/tool/schema/overlay-loader.js +1 -0
  20. package/dist/tool/schema/overlay-loader.js.map +1 -1
  21. package/dist/tool/schema/project-config.d.ts +3 -1
  22. package/dist/tool/schema/project-config.d.ts.map +1 -1
  23. package/dist/tool/schema/project-config.js +164 -13
  24. package/dist/tool/schema/project-config.js.map +1 -1
  25. package/dist/tool/schema/types.d.ts +85 -11
  26. package/dist/tool/schema/types.d.ts.map +1 -1
  27. package/dist/tool/utils/merge.d.ts.map +1 -1
  28. package/dist/tool/utils/merge.js +9 -0
  29. package/dist/tool/utils/merge.js.map +1 -1
  30. package/docs/adopt.md +20 -14
  31. package/docs/creating-overlays.md +151 -2
  32. package/docs/overlay-imports.md +125 -102
  33. package/docs/overlays.md +59 -6
  34. package/docs/quick-reference.md +99 -0
  35. package/docs/specs/002-superposition-config-file/plan.md +6 -1
  36. package/docs/specs/002-superposition-config-file/spec.md +6 -0
  37. package/docs/specs/002-superposition-config-file/tasks.md +2 -0
  38. package/docs/specs/003-mkdocs2-overlay/spec.md +114 -0
  39. package/docs/specs/004-doctor-fix/spec.md +70 -0
  40. package/docs/specs/005-cuda-overlay/spec.md +101 -0
  41. package/docs/specs/006-rocm-overlay/spec.md +109 -0
  42. package/docs/team-workflow.md +7 -1
  43. package/docs/workflows.md +3 -0
  44. package/features/cross-distro-packages/README.md +18 -0
  45. package/features/cross-distro-packages/devcontainer-feature.json +3 -3
  46. package/features/cross-distro-packages/install.sh +49 -7
  47. package/overlays/.shared/README.md +80 -21
  48. package/overlays/.shared/compose/common-healthchecks.md +60 -0
  49. package/overlays/.shared/vscode/recommended-extensions.json +15 -11
  50. package/overlays/alertmanager/setup.sh +4 -19
  51. package/overlays/alertmanager/verify.sh +8 -9
  52. package/overlays/all/README.md +43 -0
  53. package/overlays/all/devcontainer.patch.json +6 -0
  54. package/overlays/all/overlay.yml +14 -0
  55. package/overlays/amp/setup.sh +5 -0
  56. package/overlays/bun/setup.sh +10 -1
  57. package/overlays/bun/verify.sh +6 -1
  58. package/overlays/claude-code/setup.sh +5 -0
  59. package/overlays/cloudflared/setup.sh +9 -12
  60. package/overlays/codex/README.md +9 -6
  61. package/overlays/codex/devcontainer.patch.json +7 -1
  62. package/overlays/codex/setup.sh +5 -0
  63. package/overlays/codex/verify.sh +8 -0
  64. package/overlays/commitlint/setup.sh +5 -0
  65. package/overlays/cuda/README.md +179 -0
  66. package/overlays/cuda/devcontainer.patch.json +7 -0
  67. package/overlays/cuda/overlay.yml +17 -0
  68. package/overlays/cuda/setup.sh +32 -0
  69. package/overlays/cuda/verify.sh +38 -0
  70. package/overlays/devcontainer-cli/README.md +50 -0
  71. package/overlays/devcontainer-cli/devcontainer.patch.json +13 -0
  72. package/overlays/devcontainer-cli/overlay.yml +16 -0
  73. package/overlays/devcontainer-cli/setup.sh +14 -0
  74. package/overlays/direnv/devcontainer.patch.json +6 -0
  75. package/overlays/direnv/setup.sh +7 -6
  76. package/overlays/dotnet/setup.sh +14 -7
  77. package/overlays/duckdb/devcontainer.patch.json +1 -2
  78. package/overlays/gcloud/devcontainer.patch.json +0 -6
  79. package/overlays/gcloud/setup.sh +51 -0
  80. package/overlays/gemini-cli/setup.sh +5 -0
  81. package/overlays/git-helpers/devcontainer.patch.json +2 -1
  82. package/overlays/go/setup.sh +15 -14
  83. package/overlays/jaeger/overlay.yml +2 -0
  84. package/overlays/just/setup.sh +5 -17
  85. package/overlays/keycloak/docker-compose.yml +6 -4
  86. package/overlays/keycloak/verify.sh +4 -3
  87. package/overlays/kind/devcontainer.patch.json +1 -2
  88. package/overlays/kind/setup.sh +8 -17
  89. package/overlays/minio/setup.sh +10 -18
  90. package/overlays/mkdocs/overlay.yml +2 -1
  91. package/overlays/mkdocs2/README.md +135 -0
  92. package/overlays/mkdocs2/devcontainer.patch.json +19 -0
  93. package/overlays/mkdocs2/overlay.yml +17 -0
  94. package/overlays/mkdocs2/setup.sh +67 -0
  95. package/overlays/mkdocs2/verify.sh +35 -0
  96. package/overlays/modern-cli-tools/devcontainer.patch.json +7 -1
  97. package/overlays/modern-cli-tools/setup.sh +21 -71
  98. package/overlays/mongodb/devcontainer.patch.json +0 -6
  99. package/overlays/mongodb/setup.sh +59 -0
  100. package/overlays/mysql/verify.sh +4 -3
  101. package/overlays/nats/.env.example +1 -1
  102. package/overlays/nats/README.md +1 -1
  103. package/overlays/nats/docker-compose.yml +1 -1
  104. package/overlays/ngrok/setup.sh +9 -6
  105. package/overlays/nodejs/setup.sh +5 -0
  106. package/overlays/openapi-tools/devcontainer.patch.json +1 -2
  107. package/overlays/openapi-tools/setup.sh +9 -8
  108. package/overlays/opencode/setup.sh +5 -0
  109. package/overlays/otel-collector/overlay.yml +2 -0
  110. package/overlays/otel-collector/setup.sh +3 -16
  111. package/overlays/otel-demo-nodejs/verify.sh +8 -9
  112. package/overlays/otel-demo-python/verify.sh +16 -10
  113. package/overlays/pandoc/README.md +286 -0
  114. package/overlays/pandoc/devcontainer.patch.json +18 -0
  115. package/overlays/pandoc/overlay.yml +19 -0
  116. package/overlays/pandoc/setup.sh +293 -0
  117. package/overlays/pandoc/verify.sh +25 -0
  118. package/overlays/playwright/devcontainer.patch.json +3 -1
  119. package/overlays/playwright/setup.sh +37 -0
  120. package/overlays/postgres/docker-compose.yml +6 -0
  121. package/overlays/powershell/setup.sh +49 -13
  122. package/overlays/pre-commit/setup.sh +12 -3
  123. package/overlays/prometheus/overlay.yml +2 -0
  124. package/overlays/promtail/verify.sh +16 -10
  125. package/overlays/pulumi/devcontainer.patch.json +1 -1
  126. package/overlays/python/setup.sh +28 -9
  127. package/overlays/python/verify.sh +4 -2
  128. package/overlays/redpanda/docker-compose.yml +3 -5
  129. package/overlays/rocm/README.md +227 -0
  130. package/overlays/rocm/devcontainer.patch.json +4 -0
  131. package/overlays/rocm/overlay.yml +17 -0
  132. package/overlays/rocm/setup.sh +45 -0
  133. package/overlays/rocm/verify.sh +47 -0
  134. package/overlays/rust/setup.sh +11 -18
  135. package/overlays/spec-kit/setup.sh +7 -3
  136. package/overlays/sqlite/setup.sh +14 -14
  137. package/overlays/sqlserver/docker-compose.yml +3 -3
  138. package/overlays/sqlserver/verify.sh +22 -5
  139. package/overlays/tempo/verify.sh +16 -10
  140. package/overlays/tilt/devcontainer.patch.json +1 -2
  141. package/overlays/tilt/setup.sh +14 -4
  142. package/overlays/windsurf-cli/setup.sh +27 -4
  143. package/overlays/windsurf-cli/verify.sh +13 -3
  144. package/package.json +2 -1
  145. package/templates/scripts/setup-utils.sh +228 -0
  146. package/tool/schema/config.schema.json +110 -8
  147. package/tool/schema/overlay-manifest.schema.json +5 -0
  148. package/overlays/.shared/compose/common-healthchecks.yml +0 -38
  149. /package/overlays/otel-demo-nodejs/{Dockerfile-otel-demo-nodejs → Dockerfile} +0 -0
  150. /package/overlays/otel-demo-nodejs/{package-otel-demo-nodejs.json → package.json} +0 -0
  151. /package/overlays/otel-demo-nodejs/{server-otel-demo-nodejs.js → server.js} +0 -0
  152. /package/overlays/otel-demo-nodejs/{tracing-otel-demo-nodejs.js → tracing.js} +0 -0
  153. /package/overlays/otel-demo-python/{Dockerfile-otel-demo-python → Dockerfile} +0 -0
  154. /package/overlays/otel-demo-python/{app-otel-demo-python.py → app.py} +0 -0
  155. /package/overlays/otel-demo-python/{requirements-otel-demo-python.txt → requirements.txt} +0 -0
@@ -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"
@@ -3,6 +3,10 @@
3
3
 
4
4
  set -e
5
5
 
6
+ # Source shared setup utilities (provides run_spinner)
7
+ # shellcheck source=setup-utils.sh
8
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
9
+
6
10
  echo "đŸ“Ļ Installing prerequisites for spec-kit..."
7
11
 
8
12
  # Ensure uv tool bin directory is always on PATH (uv puts shims here regardless
@@ -21,11 +25,11 @@ echo "đŸ“Ļ Installing specify-cli..."
21
25
  # Pin to a uv-managed Python (avoids broken system Python 3.13 on Debian trixie
22
26
  # where stdlib modules like shutil/os can be missing due to Debian's split packages)
23
27
  UV_PYTHON_VERSION="3.12"
24
- echo " Ensuring uv-managed Python ${UV_PYTHON_VERSION} is available..."
25
- uv python install "${UV_PYTHON_VERSION}"
28
+ run_spinner "Python ${UV_PYTHON_VERSION} (uv)" uv python install --quiet "${UV_PYTHON_VERSION}"
26
29
 
27
30
  # Install specify-cli using the uv-managed Python, not the system interpreter
28
- uv tool install specify-cli --from git+https://github.com/github/spec-kit.git \
31
+ run_spinner "specify-cli" uv tool install --quiet specify-cli \
32
+ --from git+https://github.com/github/spec-kit.git \
29
33
  --python "${UV_PYTHON_VERSION}"
30
34
 
31
35
  # Verify — use the full path as a fallback in case the shim dir is not yet in PATH
@@ -5,20 +5,20 @@ set -e
5
5
 
6
6
  echo "🔧 Setting up SQLite tools..."
7
7
 
8
- # Install litecli via pip if Python is available
9
- if command -v pip &> /dev/null || command -v pip3 &> /dev/null; then
10
- echo "đŸ“Ļ Installing litecli..."
11
- if command -v pip3 &> /dev/null; then
12
- pip3 install --user litecli || echo "âš ī¸ litecli installation failed, continuing..."
13
- else
14
- pip install --user litecli || echo "âš ī¸ litecli installation failed, continuing..."
15
- fi
16
-
17
- # Add to PATH if not already there
18
- if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
19
- echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
20
- export PATH="$HOME/.local/bin:$PATH"
21
- fi
8
+ # Install litecli via pipx (avoids --user conflicts inside virtualenvs)
9
+ if command -v pipx &> /dev/null; then
10
+ echo "đŸ“Ļ Installing litecli via pipx..."
11
+ pipx install litecli || echo "âš ī¸ litecli installation failed, continuing..."
12
+ elif command -v pip3 &> /dev/null; then
13
+ echo "đŸ“Ļ Installing litecli via pip3..."
14
+ pip3 install litecli 2>/dev/null || \
15
+ pip3 install --break-system-packages litecli || \
16
+ echo "âš ī¸ litecli installation failed, continuing..."
17
+ elif command -v pip &> /dev/null; then
18
+ echo "đŸ“Ļ Installing litecli via pip..."
19
+ pip install litecli 2>/dev/null || \
20
+ pip install --break-system-packages litecli || \
21
+ echo "âš ī¸ litecli installation failed, continuing..."
22
22
  else
23
23
  echo "âš ī¸ Python/pip not found, skipping litecli installation"
24
24
  echo " Install Python overlay for enhanced SQLite CLI (litecli)"
@@ -18,12 +18,12 @@ services:
18
18
  test:
19
19
  [
20
20
  'CMD-SHELL',
21
- "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P '${MSSQL_SA_PASSWORD:-YourStrong@Passw0rd}' -Q 'SELECT 1' || exit 1",
21
+ "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '${MSSQL_SA_PASSWORD:-YourStrong@Passw0rd}' -Q 'SELECT 1' -No || exit 1",
22
22
  ]
23
23
  interval: 10s
24
24
  timeout: 5s
25
- retries: 5
26
- start_period: 30s
25
+ retries: 10
26
+ start_period: 60s
27
27
 
28
28
  volumes:
29
29
  sqlserver-data:
@@ -10,10 +10,27 @@ echo ""
10
10
  # Check if SQL Server service is running
11
11
  echo "1ī¸âƒŖ Checking SQL Server service..."
12
12
  SQLSERVER_READY=false
13
- for i in {1..30}; do
14
- # Try to connect using docker exec (sqlcmd is in the container, not necessarily in dev container)
15
- if docker exec $(docker ps -qf "name=sqlserver") /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "SELECT 1" &> /dev/null; then
16
- echo " ✅ SQL Server service is ready"
13
+ MSSQL_SA_PASSWORD="${MSSQL_SA_PASSWORD:-YourStrong@Passw0rd}"
14
+ MSSQL_HOST="${MSSQL_HOST:-sqlserver}"
15
+ MSSQL_PORT="${MSSQL_PORT:-1433}"
16
+
17
+ for i in {1..60}; do
18
+ # Primary: sqlcmd via docker exec when Docker socket is available
19
+ if command -v docker &>/dev/null; then
20
+ CONTAINER=$(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server" 2>/dev/null | head -1)
21
+ if [ -n "$CONTAINER" ] && \
22
+ docker exec "$CONTAINER" /opt/mssql-tools18/bin/sqlcmd \
23
+ -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -Q "SELECT 1" -No &>/dev/null 2>&1; then
24
+ echo " ✅ SQL Server service is ready"
25
+ SQLSERVER_READY=true
26
+ break
27
+ fi
28
+ fi
29
+ # Fallback: TCP connectivity check (no Docker socket available)
30
+ if bash -c "echo > /dev/tcp/${MSSQL_HOST}/${MSSQL_PORT}" 2>/dev/null; then
31
+ # Port is open — allow a brief settle time for full SQL Server initialisation
32
+ sleep 15
33
+ echo " ✅ SQL Server port ${MSSQL_PORT} is accepting connections"
17
34
  SQLSERVER_READY=true
18
35
  break
19
36
  fi
@@ -21,7 +38,7 @@ for i in {1..30}; do
21
38
  done
22
39
 
23
40
  if [ "$SQLSERVER_READY" = false ]; then
24
- echo " ❌ SQL Server service not ready after 60 seconds"
41
+ echo " ❌ SQL Server service not ready after 120 seconds"
25
42
  echo " âš ī¸ SQL Server can take 30-60 seconds to start"
26
43
  exit 1
27
44
  fi
@@ -6,19 +6,25 @@ echo "🔍 Verifying Tempo installation..."
6
6
  # Track overall success
7
7
  ALL_CHECKS_PASSED=true
8
8
 
9
- # Check if Tempo service is running
10
- if docker ps --format '{{.Names}}' | grep -q tempo; then
11
- echo "✓ Tempo service is running"
12
- else
13
- echo "✗ Tempo service is not running"
9
+ # Wait for Tempo /ready endpoint (primary health signal).
10
+ # docker ps is informational only — not reliably accessible in all devcontainers.
11
+ TEMPO_READY=false
12
+ for i in {1..40}; do
13
+ if curl -s -o /dev/null -w "%{http_code}" http://tempo:3200/ready 2>/dev/null | grep -q "200"; then
14
+ echo "✓ Tempo HTTP API is accessible"
15
+ TEMPO_READY=true
16
+ break
17
+ fi
18
+ sleep 3
19
+ done
20
+ if [ "$TEMPO_READY" = false ]; then
21
+ echo "✗ Tempo /ready endpoint not responding after 120 s (http://tempo:3200/ready)"
14
22
  ALL_CHECKS_PASSED=false
15
23
  fi
16
24
 
17
- # Check if Tempo HTTP API is accessible
18
- if curl -s -o /dev/null -w "%{http_code}" http://tempo:3200/ready 2>/dev/null | grep -q "200"; then
19
- echo "✓ Tempo HTTP API is accessible"
20
- else
21
- echo "âš ī¸ Tempo HTTP API not responding yet (may still be starting)"
25
+ # Informational: check via docker ps if available.
26
+ if docker ps --format '{{.Names}}' 2>/dev/null | grep -q tempo; then
27
+ echo "✓ Tempo container visible in docker ps"
22
28
  fi
23
29
 
24
30
  # Final result
@@ -12,6 +12,5 @@
12
12
  "label": "Tilt UI",
13
13
  "onAutoForward": "openBrowser"
14
14
  }
15
- },
16
- "postCreateCommand": "bash .devcontainer/scripts/setup-tilt.sh"
15
+ }
17
16
  }
@@ -5,13 +5,23 @@ set -e
5
5
 
6
6
  echo "🔧 Setting up Tilt..."
7
7
 
8
- # Install Tilt
9
- echo "đŸ“Ļ Installing Tilt..."
8
+ # Source shared setup utilities
9
+ # shellcheck source=setup-utils.sh
10
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
10
11
 
11
- curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
12
+ TILT_VERSION="${TILT_VERSION:-0.37.0}"
13
+ detect_arch
14
+ TILT_ARCH="$CS_ARCH"
15
+ # tilt uses x86_64 for amd64 in its tarball names
16
+ [ "$TILT_ARCH" = "amd64" ] && TILT_ARCH="x86_64"
17
+
18
+ echo "đŸ“Ļ Installing Tilt v${TILT_VERSION} for linux.${TILT_ARCH}..."
19
+ install_binary_from_tar \
20
+ "https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux.${TILT_ARCH}.tar.gz" \
21
+ "tilt"
12
22
 
13
23
  # Verify installation
14
- if command -v tilt &> /dev/null; then
24
+ if command -v tilt &>/dev/null; then
15
25
  echo "✅ Tilt installed successfully"
16
26
  tilt version
17
27
  else
@@ -5,15 +5,38 @@ set -e
5
5
 
6
6
  echo "đŸ“Ļ Installing Codeium Windsurf CLI..."
7
7
 
8
- # Install windsurf globally via npm
9
- npm install -g @codeium/windsurf-cli
8
+ # Windsurf CLI is distributed as a binary release from GitHub, not via npm
9
+ ARCH=$(uname -m)
10
+ case "$ARCH" in
11
+ x86_64) ARCH_TAG="x86_64" ;;
12
+ aarch64|arm64) ARCH_TAG="aarch64" ;;
13
+ *) echo "âš ī¸ Unsupported architecture: $ARCH, skipping windsurf-cli installation"; exit 0 ;;
14
+ esac
15
+
16
+ WINDSURF_VERSION=$(curl -fsSL https://api.github.com/repos/codeium-ai/windsurf-cli/releases/latest 2>/dev/null | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
17
+
18
+ if [ -z "$WINDSURF_VERSION" ]; then
19
+ echo "âš ī¸ Could not determine latest windsurf-cli version, trying known stable"
20
+ WINDSURF_VERSION="v0.1.0"
21
+ fi
22
+
23
+ echo " Downloading windsurf-cli ${WINDSURF_VERSION} for ${ARCH_TAG}..."
24
+ DOWNLOAD_URL="https://github.com/codeium-ai/windsurf-cli/releases/download/${WINDSURF_VERSION}/windsurf-linux-${ARCH_TAG}"
25
+
26
+ if curl -fsSL --head "$DOWNLOAD_URL" >/dev/null 2>&1; then
27
+ curl -fsSL "$DOWNLOAD_URL" -o /tmp/windsurf
28
+ sudo install -m 0755 /tmp/windsurf /usr/local/bin/windsurf
29
+ rm -f /tmp/windsurf
30
+ else
31
+ echo "âš ī¸ windsurf-cli binary not available for this platform — skipping"
32
+ exit 0
33
+ fi
10
34
 
11
35
  # Verify installation
12
36
  if command -v windsurf &>/dev/null; then
13
37
  echo "✓ Windsurf CLI installed successfully: $(windsurf --version 2>/dev/null || echo 'installed')"
14
38
  else
15
- echo "✗ Windsurf CLI installation failed"
16
- exit 1
39
+ echo "âš ī¸ windsurf-cli not found after install — may need a shell restart"
17
40
  fi
18
41
 
19
42
  echo "✓ windsurf-cli setup complete"
@@ -5,10 +5,20 @@ set -e
5
5
 
6
6
  echo "🔍 Verifying windsurf-cli overlay setup..."
7
7
 
8
- # Check if windsurf CLI is installed
8
+ # windsurf-cli is a best-effort install — it is skipped on unsupported platforms
9
+ # (arm64 Linux). Exit 0 gracefully when it was intentionally not installed.
9
10
  if ! command -v windsurf &>/dev/null; then
10
- echo "✗ windsurf CLI is not installed or not in PATH"
11
- exit 1
11
+ ARCH=$(uname -m)
12
+ case "$ARCH" in
13
+ aarch64|arm64)
14
+ echo "â„šī¸ windsurf-cli skipped (not available for $ARCH)"
15
+ exit 0
16
+ ;;
17
+ *)
18
+ echo "✗ windsurf CLI is not installed or not in PATH"
19
+ exit 1
20
+ ;;
21
+ esac
12
22
  fi
13
23
 
14
24
  echo "✓ windsurf CLI is installed: $(windsurf --version 2>/dev/null || echo 'installed')"