Skip to content

feat: server logs#9

Merged
aarani merged 2 commits into
mainfrom
feat/server-logs
Jun 21, 2026
Merged

feat: server logs#9
aarani merged 2 commits into
mainfrom
feat/server-logs

Conversation

@aarani

@aarani aarani commented Jun 21, 2026

Copy link
Copy Markdown
Member

No description provided.

aarani added 2 commits June 21, 2026 13:28
… exits

Firecracker microVMs expose no ACPI, so LINUX_REBOOT_CMD_POWER_OFF finds no
power-off handler and the guest kernel falls back to halting the CPU ("reboot:
System halted"). The Firecracker process then lives on forever, so the dead VM
keeps holding its host capacity slot — two crashed servers were enough to wedge
a 4-cpu/8GB host with "insufficient host capacity" on the next provision.

Use LINUX_REBOOT_CMD_RESTART instead: a guest reset is the i8042 mechanism
Firecracker traps (the same one the host-side SendCtrlAltDel Stop path uses) and
turns into a clean VMM exit, freeing the slot. Firecracker does not reboot the
guest — a guest reset terminates the process.
Add an on-demand log path so an owner can fetch their game server's
captured console output and an admin can fetch it for any server,
mirroring the existing owner-scoped / admin-all split.

A new "logs" command flows HTTP -> provisioner -> hub -> agent gRPC
stream -> runtime, which tails the per-VM firecracker.log. That file
captures the guest serial console (console=ttyS0), and since the in-VM
init wires the workload's stdout/stderr to the console, it holds the
actual server output.

- agent.Runtime.Logs(ctx, vmID, tailLines) on FakeRuntime + firecracker
  (tailBytes helper); OpLogs dispatch returns raw log bytes
- hub.Logs via a callRaw helper (call now delegates to it)
- Logs added to Provisioner/Commander, RemoteProvisioner, Fake
- GET /servers/:id/logs (owner, 404 on non-owned) and
  GET /admin/servers/:id/logs (admin, any), both with ?tail=N
  (default 1000, cap 5000); unreachable host -> 503
- frontend: api.getServerLogs/adminGetServerLogs + a Logs panel in the
  server drawer that picks the endpoint by ownership
- .dockerignore: ignore fc-assets/work/
@aarani aarani merged commit 1129ae0 into main Jun 21, 2026
3 checks passed
@aarani aarani deleted the feat/server-logs branch June 21, 2026 13:39
@aarani aarani restored the feat/server-logs branch June 21, 2026 13:48
@aarani aarani deleted the feat/server-logs branch June 21, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant