11. Job + service (macOS)
11. Job + service (macOS)¶
Result: works. A job in one VM reaches the emulator in another by IP on the default container network; usable about 1.6 s after the emulator starts.
Setup (2026-11-22)¶
As #9. spike/macos_job_service.py: start the emulator (arm64 variant of
gcr.io/cloud-spanner-emulator/emulator:latest; the image ships arm64 and
amd64) with --memory 1G, read its IP from container inspect, run #8's
probe in a second container against http://<ip>:9020. Three runs.
Raw results¶
| Run | Probe exit | Probe: live / usable (s) | Emulator start → probe exit (s) | VM footprints (MB) |
|---|---|---|---|---|
| 1 | 0 | 0.07 / 0.08 | 1.98 | emulator 393 |
| 2 | 0 | 0.35 / 0.36 | 1.61 | emulator 393 |
| 3 | 0 | 0.39 / 0.40 | 1.61 | emulator 394, probe 319 |
The probe's footprint was only captured once; in runs 1 and 2 its VM had not started, or had no readable footprint, when the script measured.
What we learned¶
- Container-to-container traffic works on macOS 27.2.1, by IP, with no
setup. Name lookup between containers would need
container system dns, which wasn't tried. - The job and its service cost about 710 MB of host memory together, against 36–39 MiB for the same pod under gVisor on smaug. The two numbers are measured differently (VM footprint versus job cgroup), so treat the gap as an order of magnitude, not a ratio.
- Every container shares one network with every other container, so jobs can reach each other's services by default. The job network policy open item applies to macOS too.
What it changes¶
- On macOS a job is a group of VMs on a network, not one sandbox. The runner passes services' addresses to the job (by environment variable or a hosts entry), where Linux gives them localhost. Hiding that difference from jobs is the runtime backend's job.
- A per-job network (if
apple/containercan make one) is the likely answer to the network policy item on macOS.