PRD: macOS Container backend - Part II (launch step) #231

Merged
didericis merged 4 commits from feat/macos-container-launch into feat/macos-container-backend 2026-06-10 21:32:18 -04:00
Collaborator

Stacked on PR #229.

Implements the macOS Container launch path using the proxy-env solution from issue #230:

  • builds the sidecar bundle and agent image with Apple Container
  • creates a host-only internal network for the agent and a NAT egress network for the sidecar
  • starts the sidecar bundle dual-homed and discovers its internal IP from container inspect
  • starts the agent on the internal network only with HTTP(S)_PROXY, CA bundle env, and optional supervise URL
  • uses directory bind mounts because Apple Container rejects single-file bind mounts
  • keeps bottle.git/git-gate blocked for this backend until there is a safe key delivery path

Verification:

  • python3 -m compileall -q bot_bottle tests/unit/test_macos_container_launch.py tests/unit/test_macos_container_util.py tests/unit/test_macos_container_cleanup.py
  • python3 -m unittest discover tests/unit
  • npx pyright .
  • git diff --check
Stacked on PR #229. Implements the macOS Container launch path using the proxy-env solution from issue #230: - builds the sidecar bundle and agent image with Apple Container - creates a host-only internal network for the agent and a NAT egress network for the sidecar - starts the sidecar bundle dual-homed and discovers its internal IP from `container inspect` - starts the agent on the internal network only with HTTP(S)_PROXY, CA bundle env, and optional supervise URL - uses directory bind mounts because Apple Container rejects single-file bind mounts - keeps bottle.git/git-gate blocked for this backend until there is a safe key delivery path Verification: - `python3 -m compileall -q bot_bottle tests/unit/test_macos_container_launch.py tests/unit/test_macos_container_util.py tests/unit/test_macos_container_cleanup.py` - `python3 -m unittest discover tests/unit` - `npx pyright .` - `git diff --check`
didericis-codex added 1 commit 2026-06-10 19:47:13 -04:00
feat(macos-container): launch explicit-proxy bottles
lint / lint (push) Successful in 1m50s
test / unit (pull_request) Successful in 37s
test / integration (pull_request) Successful in 19s
d923871fd2
didericis changed title from macOS Container backend launch step - Part II to PRD: macOS Container backend launch step - Part II 2026-06-10 19:48:23 -04:00
didericis changed title from PRD: macOS Container backend launch step - Part II to PRD: macOS Container backend - Part II (launch step) 2026-06-10 19:48:40 -04:00
didericis reviewed 2026-06-10 21:28:31 -04:00
@@ -20,2 +36,4 @@
_REPO_DIR = str(Path(__file__).resolve().parent.parent.parent.parent)
_SIDECAR_SLEEP_SECONDS = "2147483647"
Owner

Why this value/what is this used for?

Why this value/what is this used for?
didericis added 3 commits 2026-06-10 21:32:05 -04:00
test(macos-container): add launch integration smoke
lint / lint (push) Successful in 1m44s
test / unit (pull_request) Successful in 37s
test / integration (pull_request) Successful in 20s
f7f9892b53
fix(macos-container): start builder with dns
lint / lint (push) Successful in 1m45s
test / unit (pull_request) Successful in 37s
test / integration (pull_request) Successful in 19s
d123b99347
fix(macos-container): preserve working builder dns
lint / lint (push) Successful in 1m33s
test / unit (pull_request) Successful in 30s
test / integration (pull_request) Successful in 16s
2e467d236a
didericis merged commit 2e467d236a into feat/macos-container-backend 2026-06-10 21:32:18 -04:00
didericis deleted branch feat/macos-container-launch 2026-06-10 21:32:19 -04:00
Author
Collaborator

Re: #231 (comment)

That value is just a long-lived sleep duration used to keep the detached agent container alive after launch so later container exec calls have a target. 2147483647 is the max signed 32-bit integer in seconds, so effectively "sleep forever" without relying on sleep infinity being accepted everywhere.

You are right to question it: the constant name is wrong. _SIDECAR_SLEEP_SECONDS is used for the agent container, not the sidecar. It should be renamed to something like _CONTAINER_SLEEP_SECONDS or _AGENT_SLEEP_SECONDS in the stacked cleanup/follow-up.

Re: https://gitea.dideric.is/didericis/bot-bottle/pulls/231#issuecomment-2011 That value is just a long-lived sleep duration used to keep the detached agent container alive after launch so later `container exec` calls have a target. `2147483647` is the max signed 32-bit integer in seconds, so effectively "sleep forever" without relying on `sleep infinity` being accepted everywhere. You are right to question it: the constant name is wrong. `_SIDECAR_SLEEP_SECONDS` is used for the agent container, not the sidecar. It should be renamed to something like `_CONTAINER_SLEEP_SECONDS` or `_AGENT_SLEEP_SECONDS` in the stacked cleanup/follow-up.
Sign in to join this conversation.