The deploy script
After making changes locally, deploy them to a running server with:infra/.instance (written by setup.sh) and:
- Syncs the project to the server via rsync
- Bakes the agent runtime into the base rootfs
- Restarts the
nightshift-servesystemd service
Explicit host
If you’re not usingsetup.sh or want to target a different server:
What gets baked
The deploy script callsinfra/bake-rootfs.sh, which mounts the base rootfs image and copies in the agent runtime — the code that runs inside every Firecracker VM:
| Destination in rootfs | Source | Purpose |
|---|---|---|
/sbin/init | Inline shell script | Minimal PID 1 — mounts filesystems, configures network, starts the agent |
/opt/nightshift/agent/ | src/nightshift/agent/ | Agent entry point and runner |
/opt/nightshift/sdk/ | src/nightshift/sdk/ | NightshiftApp, AgentConfig (imported by user agents) |
/opt/nightshift/events.py | src/nightshift/events.py | Event types |
/opt/nightshift/protocol/ | src/nightshift/protocol/ | Packaging and event serialization |
/opt/nightshift/__init__.py | src/nightshift/__init__.py | Package re-exports |
| Path | Contents |
|---|---|
/workspace/ | User project files |
/opt/nightshift/agent_pkg/ | User’s deployed agent code + manifest |
/etc/nightshift/env | Per-run environment variables |
