mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
Boot-twice (image/boot-twice/): provisions the golden image in a container with the real provision-golden.sh, then boots the same disk twice through the control plane's own boot steps (entry-point probe, startOrcad with the workspace prelude, ensureEntryPoints). Each start is a new kernel boot id. The second boot runs offline behind a DNS sink, and must install, fetch and redo nothing (docker diff allowlist, logged lookups, sampled command lines). It must come up, carry this tree's entry points and stamp, and match every manifest version pin. ~15 s cached, ~5 min cold. It catches the pre-#781 OpenCode first run that repeated on every wake. Workflow: cloud-vm-boot-twice.yml (PRs touching image/**, GHA layer cache). Egress probe (scripts/egress-probe.ts): against dev, with bogus tokens and an echo sandbox. Firewall layer: egressPolicy()'s real policy forwards placeholders for chatgpt.com, api.anthropic.com, api.github.com and github.com with other auth headers untouched. Credential hosts fail closed, and anonymous git works without an App token (#758). Swap layer: the dev egress proxy swaps a bogus ANTHROPIC_API_KEY in for its placeholder on a custom base URL, and leaks no Vercel hop headers. Workflow: cloud-egress-probe.yml (dispatch + nightly; skips without secrets). Fix found by the harness: provision-golden.sh linked a release bundle's runtimes dir, and every VM script's `find .../runtimes -type f` skips a symlinked start point, so --release goldens had no node. Move the tree instead. No entry-point change (stamp unchanged).
84 lines
2.9 KiB
YAML
84 lines
2.9 KiB
YAML
name: Cloud VM Boot Twice
|
|
|
|
# Provisions the golden image in a container and boots the same disk twice through the control
|
|
# plane's boot steps. The second boot runs offline and must install, fetch and redo nothing.
|
|
# Local run and details: cloud/apps/sandbox-control/image/boot-twice/README.md
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
paths:
|
|
- cloud/apps/sandbox-control/image/**
|
|
- cloud/apps/sandbox-control/src/golden-images.ts
|
|
- cloud/apps/sandbox-control/src/sandbox-vm-commands.ts
|
|
- cloud/apps/sandbox-control/src/orcad-ready.ts
|
|
- .github/workflows/cloud-vm-boot-twice.yml
|
|
workflow_dispatch:
|
|
inputs:
|
|
release:
|
|
description: Orca release whose orcad bundle the image carries (vX.Y.Z or latest)
|
|
required: false
|
|
default: latest
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: cloud-vm-boot-twice-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: cloud
|
|
|
|
jobs:
|
|
boot-twice:
|
|
if: github.event_name != 'pull_request' || github.event.pull_request.draft != true
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 25
|
|
env:
|
|
RELEASE: ${{ inputs.release || 'latest' }}
|
|
CONTEXT: ${{ runner.temp }}/boot-twice
|
|
# Raises the GitHub API limit for the latest-release lookup; read-only, no secret involved.
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: ./.github/actions/setup-pnpm
|
|
with:
|
|
package-json-file: cloud/package.json
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
check-latest: true
|
|
|
|
- run: pnpm install --frozen-lockfile --filter @orca-cloud/sandbox-control...
|
|
|
|
# The context holds exactly what provisioning reads (script + env), so its bytes key the
|
|
# layer cache: an unchanged image reuses the provisioned layer and only boots.
|
|
- name: Write the image build context
|
|
run: pnpm --filter @orca-cloud/sandbox-control exec tsx image/boot-twice/boot-twice.ts --release "$RELEASE" --context-out "$CONTEXT"
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Provision the image (cached)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ${{ env.CONTEXT }}
|
|
target: harness
|
|
tags: orca-boot-twice:ci
|
|
load: true
|
|
cache-from: type=gha,scope=cloud-vm-boot-twice
|
|
cache-to: type=gha,mode=max,scope=cloud-vm-boot-twice
|
|
|
|
- name: Boot twice
|
|
run: pnpm --filter @orca-cloud/sandbox-control exec tsx image/boot-twice/boot-twice.ts --release "$RELEASE" --image orca-boot-twice:ci --report "$RUNNER_TEMP/boot-twice-report.json"
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: cloud-vm-boot-twice-report
|
|
path: ${{ runner.temp }}/boot-twice-report.json
|
|
retention-days: 14
|