Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
portable-ci:
runs-on: depot-ubuntu-24.04
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude-pr-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '@claude'))
runs-on: depot-ubuntu-24.04
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ Windows smoke test:

## CI
- GitHub Actions workflow: `.github/workflows/ci.yml`
- Runner target: Depot-hosted runner label `depot-ubuntu-24.04`
- Runner target: Blacksmith runner label `blacksmith-2vcpu-ubuntu-2404`

## Claude PR Runner
- Workflow: `.github/workflows/claude-pr-runner.yml`
- Trigger: mention `@claude` in PR comments/reviews (or run manually via `workflow_dispatch`)
- Runner target: Depot-hosted runner label `depot-ubuntu-24.04`
- Runner target: Blacksmith runner label `blacksmith-2vcpu-ubuntu-2404`
- Configure one auth secret:
- `ANTHROPIC_API_KEY` (API key mode), or
- `CLAUDE_CODE_OAUTH_TOKEN` (OAuth mode)
Expand Down
12 changes: 9 additions & 3 deletions docs/RUNBOOKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ Backend spec:
## Linux-Portable Run Flow
1. `pcoder` starts/ensures VM via `start-vm.cmd`.
2. VM launcher attempts WHPX acceleration, then auto-fallback to TCG.
3. Project is copied into guest over SCP.
4. Tool command runs over SSH in guest project directory.
5. Project is copied back to host after run (unless `--no-sync-back`).
3. On first boot, cloud-init installs Node.js, `codex`, and `claude` CLI tools (may take several minutes).
4. `pcoder run` waits for cloud-init to complete before running the tool.
5. Project is copied into guest over SCP.
6. Tool command runs over SSH in guest project directory.
7. Project is copied back to host after run (unless `--no-sync-back`).

**First-boot note:** The first time you boot the VM, cloud-init provisions the guest (creates the `portable` user, installs Node.js and the coding CLI tools). This can take 5–15 minutes depending on network speed and host performance. `pcoder run` automatically waits for cloud-init to finish before launching the tool. Subsequent boots skip provisioning and start much faster.

**Smoke check with tool checks:** Run `scripts/runtime/windows/smoke-check.cmd` after the first boot completes to verify that `codex` and `claude` are installed in the guest. Use `-SkipToolChecks` to skip tool presence checks if only testing VM boot and SSH connectivity.

Acceleration override (Windows troubleshooting):
- `PCODER_VM_ACCEL_MODE=auto` (default): try WHPX then fallback to TCG if launch fails.
Expand Down
14 changes: 12 additions & 2 deletions runtime/linux/cloud-init/user-data
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#cloud-config
users:
- name: portable
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: true
groups:
- sudo
ssh_authorized_keys:
- <SSH_PUBLIC_KEY_PLACEHOLDER>
ssh_pwauth: false

# Placeholder for VM provisioning during image bake.
packages:
- nodejs
- npm

runcmd:
- npm install -g @openai/codex @anthropic-ai/claude-code
12 changes: 12 additions & 0 deletions scripts/pcoder.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,18 @@ function buildRemoteRunScript(options) {

const lines = [
'set -e',
'if command -v cloud-init >/dev/null 2>&1; then',
' _ci_to=${PCODER_CLOUD_INIT_TIMEOUT:-900}',
' if ! timeout "$_ci_to" cloud-init status --wait 2>/dev/null; then',
' _ci_rc=$?',
' if [ "$_ci_rc" -eq 124 ]; then',
' echo "pcoder: cloud-init wait exceeded ${_ci_to}s; provisioning may be incomplete" >&2',
' else',
' echo "pcoder: cloud-init finished with errors (exit ${_ci_rc}); provisioning may have failed" >&2',
' fi',
' exit 1',
' fi',
'fi',
`cd ${shellEscape(remoteProjectPath)}`
];

Expand Down
7 changes: 7 additions & 0 deletions scripts/runtime/windows/start-vm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ users:
ssh_authorized_keys:
- $PublicKey
ssh_pwauth: false

packages:
- nodejs
- npm

runcmd:
- npm install -g @openai/codex @anthropic-ai/claude-code
"@
$userData | Out-File -Encoding utf8 -FilePath $cloudInitUserDataPath
}
Expand Down
Loading