feat: server logs#9
Merged
Merged
Conversation
… 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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.