Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
01ca850
client sdk local emulator
BilalG1 Mar 13, 2026
25f8b1c
Gate server and admin emulator requests on credential init
BilalG1 Mar 19, 2026
51e71cf
Resolve merge conflicts in common.ts with envVars + emulator support
BilalG1 Apr 9, 2026
7d9e156
local emulator image opt
BilalG1 Apr 9, 2026
d724eb2
emulator fixes
BilalG1 Apr 10, 2026
cd087c5
Merge branch 'dev' into local-emulator-image-optimization
BilalG1 Apr 10, 2026
784f17c
emulator: fail-fast on provision errors, diagnose smoke test failures
BilalG1 Apr 10, 2026
7bf4a15
emulator: make cross-arch arm64 build survive TCG
BilalG1 Apr 10, 2026
6c5615b
emulator: drop --jitless, capture migration errors on failure
BilalG1 Apr 10, 2026
2538382
ci: run arm64 emulator build on ubuntu-24.04-arm (same-arch TCG)
BilalG1 Apr 10, 2026
54ecd7c
emulator: bounded dep wait with per-service diagnostics
BilalG1 Apr 10, 2026
5c3c436
emulator: only use -cpu cortex-a72 for cross-arch TCG
BilalG1 Apr 11, 2026
e9dfda7
Merge remote-tracking branch 'origin/dev' into client-sdk-local-emula…
BilalG1 Apr 13, 2026
e636151
emulator: move arm64 back to ubicloud cross-arch, run migrations with…
BilalG1 Apr 13, 2026
f4aca6d
emulator: swap --jitless for --no-opt on migration exec
BilalG1 Apr 13, 2026
144866a
emulator: pass --no-opt on node CLI, not via NODE_OPTIONS
BilalG1 Apr 13, 2026
5077bb2
pr comment fixes
BilalG1 Apr 13, 2026
95054ca
emulator: don't strip the clickhouse binary (breaks self-extractor)
BilalG1 Apr 13, 2026
999843b
emulator: bump cross-arch TCG -cpu to cortex-a76 (LSE for ClickHouse)
BilalG1 Apr 13, 2026
0896f14
ci: skip emulator boot/verify on arm64 (cross-arch TCG)
BilalG1 Apr 13, 2026
44e4079
emulator: add --no-wasm-tier-up to migration exec
BilalG1 Apr 13, 2026
b111ef2
Merge branch 'dev' into client-sdk-local-emulator-support
BilalG1 Apr 13, 2026
9ec08f4
emulator: dedupe probe list, factor log-stream and console-marker hel…
BilalG1 Apr 13, 2026
0ffd898
Merge branch 'emulator-arm64-ubicloud-jitless' into client-sdk-local-…
BilalG1 Apr 13, 2026
f8524e9
Merge branch 'dev' into emulator-arm64-ubicloud-jitless
BilalG1 Apr 14, 2026
9f26df0
Merge branch 'emulator-arm64-ubicloud-jitless' into client-sdk-local-…
BilalG1 Apr 14, 2026
9e38bc6
local emulator changes
BilalG1 Apr 14, 2026
9cf900a
Merge remote-tracking branch 'origin/dev' into client-sdk-local-emula…
BilalG1 Apr 14, 2026
9431105
Revert examples/middleware to origin/dev state
BilalG1 Apr 14, 2026
6e34776
Randomize CRON_SECRET in local emulator entrypoint
BilalG1 Apr 14, 2026
576a3cc
Use console.warn for emulator-already-running notice
BilalG1 Apr 14, 2026
383a036
Merge branch 'dev' into client-sdk-local-emulator-support
BilalG1 Apr 14, 2026
e30b9e0
Inject throwaway SEED keys into emulator smoke test
BilalG1 Apr 14, 2026
11567e8
emulator email-rendering, pck, and stripe fixes
BilalG1 Apr 14, 2026
73da966
Merge remote-tracking branch 'origin/dev' into client-sdk-local-emula…
BilalG1 Apr 14, 2026
04640d4
fix
BilalG1 Apr 14, 2026
4ae826d
fix copy emulator assets
BilalG1 Apr 14, 2026
0d98d55
emulator stripe fixes and gh action fix
BilalG1 Apr 14, 2026
224bc6b
Merge branch 'dev' into client-sdk-local-emulator-support
BilalG1 Apr 14, 2026
75aaf0c
emulator fix ai-chat, clickhouse queries, db sync
BilalG1 Apr 14, 2026
fa67984
Merge branch 'client-sdk-local-emulator-support' of https://github.co…
BilalG1 Apr 14, 2026
9552be8
Merge remote-tracking branch 'origin/dev' into client-sdk-local-emula…
BilalG1 Apr 14, 2026
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
Prev Previous commit
Next Next commit
emulator: fail-fast on provision errors, diagnose smoke test failures
Provisioning used to silently wait out the full 6000s timeout on any
guest-side failure because the cleanup trap only logged the error. Now
it writes STACK_CLOUD_INIT_FAILED and shuts the VM down, and the host
waiter breaks on that marker and reports it distinctly.

Also bump smoke test timeout 120s->300s, dump docker ps / container
logs / free -m / verbose curl when it fails, log the qemu accel path,
and enable /dev/kvm on the CI runner so the VM isn't stuck in TCG.
  • Loading branch information
BilalG1 committed Apr 10, 2026
commit 784f17cc2acc06e6a3f125611ce7cd91847b716a
15 changes: 14 additions & 1 deletion .github/workflows/qemu-emulator-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,20 @@ jobs:
- name: Install QEMU dependencies
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-utils genisoimage socat qemu-efi-aarch64
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-kvm qemu-utils genisoimage socat qemu-efi-aarch64

- name: Enable KVM access
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm || true
ls -la /dev/kvm || echo "no /dev/kvm present"
if [ -w /dev/kvm ]; then
echo "KVM is writable — hardware acceleration will be used"
else
echo "WARNING: /dev/kvm is not writable — will fall back to TCG (very slow)"
fi

- name: Build QEMU image
run: |
Expand Down
11 changes: 10 additions & 1 deletion docker/local-emulator/qemu/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ build_one() {
local qemu_base pid elapsed total_build_lines
local last_build_lines=0
local guest_exited=false
local guest_failed=false
local start_time=$SECONDS

cp "$base_img" "$tmp_img"
Expand All @@ -258,6 +259,7 @@ build_one() {
: > "$serial_log"
: > "$provision_log"
qemu_base="$(qemu_cmd_prefix_for_arch "$arch")"
log "QEMU command prefix (${arch}): $qemu_base"

# shellcheck disable=SC2086
$qemu_base \
Expand All @@ -282,6 +284,11 @@ build_one() {
break
fi

if contains_provision_marker "$provision_log" "$serial_log" "STACK_CLOUD_INIT_FAILED"; then
guest_failed=true
break
fi

if [ -f "$provision_log" ]; then
total_build_lines="$(line_count "$provision_log")"
if [ "$total_build_lines" -gt "$last_build_lines" ]; then
Expand All @@ -308,7 +315,9 @@ build_one() {
echo ""

if ! contains_provision_marker "$provision_log" "$serial_log" "STACK_CLOUD_INIT_DONE"; then
if [ "$guest_exited" = true ]; then
if [ "$guest_failed" = true ]; then
err "Guest provisioning reported failure for emulator (${arch})"
elif [ "$guest_exited" = true ]; then
err "Provisioning exited before completion for emulator (${arch})"
else
err "Provisioning timed out for emulator (${arch})"
Expand Down
30 changes: 24 additions & 6 deletions docker/local-emulator/qemu/cloud-init/emulator/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ write_files:
-v stack-inbucket-data:/data/inbucket \
-d stack-local-emulator-slim

smoke_timeout=120
smoke_timeout=300
smoke_elapsed=0
smoke_passed=false
while [ "$smoke_elapsed" -lt "$smoke_timeout" ]; do
Expand All @@ -286,13 +286,22 @@ write_files:
smoke_elapsed=$((smoke_elapsed + 2))
done

docker stop smoke-test 2>/dev/null || true
sleep 2

if [ "$smoke_passed" = "false" ]; then
log "SMOKE TEST FAILED: backend /health?db=1 did not return 200 within ${smoke_timeout}s"
log "--- docker ps -a ---"
docker ps -a 2>&1 | while IFS= read -r line; do log "ps: $line"; done || true
log "--- smoke-test container logs (last 200 lines) ---"
docker logs --tail 200 smoke-test 2>&1 | while IFS= read -r line; do log "smoke-test: $line"; done || true
log "--- free -m ---"
free -m 2>&1 | while IFS= read -r line; do log "mem: $line"; done || true
log "--- curl -v /health?db=1 ---"
curl -v --max-time 5 http://127.0.0.1:8102/health?db=1 2>&1 | while IFS= read -r line; do log "curl: $line"; done || true
docker stop smoke-test 2>/dev/null || true
exit 1
fi

docker stop smoke-test 2>/dev/null || true
sleep 2
log "Smoke test passed (${smoke_elapsed}s)."

log "Flattening image (docker export/import)..."
Expand Down Expand Up @@ -363,8 +372,17 @@ write_files:

cleanup() {
local status=$?
if [ "$status" -ne 0 ] && [ -n "${STACK_PROVISION_LOG_FILE:-}" ]; then
printf 'ERROR: provision-build exited with code %s\n' "$status" >> "$STACK_PROVISION_LOG_FILE"
if [ "$status" -ne 0 ]; then
if [ -n "${STACK_PROVISION_LOG_FILE:-}" ]; then
printf 'ERROR: provision-build exited with code %s\n' "$status" >> "$STACK_PROVISION_LOG_FILE"
printf '%s\n' "STACK_CLOUD_INIT_FAILED" >> "$STACK_PROVISION_LOG_FILE"
fi
for dev in /dev/console /dev/ttyAMA0 /dev/ttyS0; do
echo "STACK_CLOUD_INIT_FAILED" > "$dev" 2>/dev/null || true
done
sync || true
(sleep 2 && shutdown -P now) &
(sleep 15 && poweroff -f) &
fi
}
trap cleanup EXIT
Expand Down
Loading