Fix linux-portable mode: install codex/claude in VM guest via cloud-init and switch CI to Blacksmith#1
Conversation
|
@copilot Goal is to create a portable app I can throw on a flash drive or copy to any windows computer and run Claude code on it with local filesystem access like a traveling Claude code app |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n first boot Co-authored-by: mjenkinsx9 <238907794+mjenkinsx9@users.noreply.github.com> Agent-Logs-Url: https://github.com/Mike-Jenkins-Org/PortableCoder/sessions/48619aa9-0370-4a91-a1e8-120bb782f44b
|
@copilot Can you see if you can get the blacksmith CI working |
…2404 Co-authored-by: mjenkinsx9 <238907794+mjenkinsx9@users.noreply.github.com> Agent-Logs-Url: https://github.com/Mike-Jenkins-Org/PortableCoder/sessions/8d3bee99-535f-4958-8347-c5cc786bb1a0
The CI was stuck in
That's exactly what this PR is building toward. The previous commit (ff63103) fixes the end-to-end path: on first boot the VM automatically installs Node.js + the |
scripts/pcoder.cjs
Outdated
|
|
||
| const lines = [ | ||
| 'set -e', | ||
| 'if command -v cloud-init >/dev/null 2>&1; then cloud-init status --wait 2>/dev/null || true; fi', |
There was a problem hiding this comment.
cloud-init status --wait can block indefinitely if cloud-init is stuck (e.g., network/DNS issues during apt/npm installs). Since this runs at the top of every remote invocation, a single provisioning failure can cause pcoder run to hang forever. Consider adding a bounded wait (e.g., wrap with timeout or implement a loop with a max duration configurable via env) and emit a clear error when the wait times out or cloud-init ends in an error state.
There was a problem hiding this comment.
Done in commit 5ab835a. The unbounded cloud-init status --wait is now wrapped with timeout (default 900 s, overridable via PCODER_CLOUD_INIT_TIMEOUT). If the wait exceeds the limit the script prints a clear message to stderr and exits 1. The same exit-1 path is taken if cloud-init itself reports an error state.
…t or error Co-authored-by: mjenkinsx9 <238907794+mjenkinsx9@users.noreply.github.com> Agent-Logs-Url: https://github.com/Mike-Jenkins-Org/PortableCoder/sessions/3e07f31f-0ce7-460c-8081-20c68e9768b5
pcoder run <tool> --mode linux-portablehas never worked end-to-end because the VM guest never hadcodexorclaudeinstalled, and the run script didn't wait for cloud-init to finish before executing the tool.Changes
start-vm.ps1—Write-CloudInitSeed: Addpackages: [nodejs, npm]andruncmd: npm install -g @openai/codex @anthropic-ai/claude-codeto the generateduser-data. Tools are now provisioned automatically on first VM boot.pcoder.cjs—buildRemoteRunScript: Prepend a bounded cloud-init wait to the remote script so the launcher blocks until first-boot provisioning completes before executing the CLI. The wait is capped at 900 seconds by default (configurable viaPCODER_CLOUD_INIT_TIMEOUT). If the wait times out or cloud-init exits with an error, a clear diagnostic message is printed to stderr and the script exits with a non-zero code. No-op on systems without cloud-init.runtime/linux/cloud-init/user-data: Replaced non-representative placeholder with content that matches whatWrite-CloudInitSeedactually generates (SSH key field left as a placeholder string).docs/RUNBOOKS.md: Document the first-boot provisioning step and note that initial runs can take 5–15 minutes while cloud-init installs packages..github/workflows/ci.ymland.github/workflows/claude-pr-runner.yml: Switched runner fromdepot-ubuntu-24.04toblacksmith-2vcpu-ubuntu-2404. The Depot runner was not provisioned for this repository, causing all CI runs to queue indefinitely without starting.README.md: Updated runner label references from Depot to Blacksmith.Original prompt
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.