diff --git a/bot_bottle/backend/firecracker/util.py b/bot_bottle/backend/firecracker/util.py index 425addd..5fd77c1 100644 --- a/bot_bottle/backend/firecracker/util.py +++ b/bot_bottle/backend/firecracker/util.py @@ -368,6 +368,11 @@ mount -t devtmpfs dev /dev 2>/dev/null mkdir -p /dev/pts && mount -t devpts devpts /dev/pts 2>/dev/null mount -o remount,rw / 2>/dev/null +# /tmp must be world-writable + sticky. The rootless rootfs build can land +# it 0755/root-owned, leaving the agent (uid 1000 node) unable to create +# scratch dirs there — git worktrees, build temp, `git init /tmp/...`, etc. +mkdir -p /tmp && chmod 1777 /tmp + # Install the per-bottle SSH pubkey from the kernel cmdline. KEY=$(sed -n 's/.*bb_pubkey=\([^ ]*\).*/\1/p' /proc/cmdline | base64 -d 2>/dev/null) if [ -n "$KEY" ]; then diff --git a/tests/unit/test_firecracker_infra_vm.py b/tests/unit/test_firecracker_infra_vm.py index 497b7c8..ea740d5 100644 --- a/tests/unit/test_firecracker_infra_vm.py +++ b/tests/unit/test_firecracker_infra_vm.py @@ -38,7 +38,9 @@ class TestBuildInfraRootfs(unittest.TestCase): # and exports PATH so gateway_init's subprocess daemons find python3. init = build.call_args.kwargs["init_script"] self.assertIn("bot_bottle.orchestrator", init) - self.assertIn("gateway_init.py", init) + # Gateway launches via the installed package (there is no + # /app/gateway_init.py file since the daemons moved into bot_bottle). + self.assertIn("bot_bottle.gateway_init", init) self.assertIn("export PATH=", init) # Persistent registry volume mounted at the DB dir before the CP starts. self.assertIn("/dev/vdb", init)