Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions deploy/install_prefill_worker_launchd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,24 @@ cat > "$PLIST" <<EOF
EOF

chmod 644 "$PLIST"
launchctl bootout "gui/$(id -u)/$LABEL" 2>/dev/null || true
launchctl bootstrap "gui/$(id -u)" "$PLIST"
DOMAIN="gui/$(id -u)"
launchctl bootout "$DOMAIN/$LABEL" 2>/dev/null || true
for _ in {1..20}; do
if ! launchctl print "$DOMAIN/$LABEL" >/dev/null 2>&1; then
break
fi
sleep 0.25
done
for attempt in 1 2 3; do
if launchctl bootstrap "$DOMAIN" "$PLIST"; then
break
fi
if [[ "$attempt" -eq 3 ]]; then
echo "failed to bootstrap $LABEL after $attempt attempts" >&2
exit 1
fi
sleep 2
done
launchctl kickstart -k "$DOMAIN/$LABEL"
echo "installed $LABEL -> $PLIST"

3 changes: 3 additions & 0 deletions tests/inference_engine/bridge/test_prefill_worker_launchd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def test_worker_installer_emits_full_cache_compatibility_contract():
assert 'PEER="${KAKEYA_WORKER_PEER:-}"' in source
assert "<string>--peer</string>" in source
assert 'chmod 644 "$PLIST"' in source
assert 'launchctl print "$DOMAIN/$LABEL"' in source
assert "for attempt in 1 2 3" in source
assert 'launchctl kickstart -k "$DOMAIN/$LABEL"' in source


def test_head_runtime_discovers_and_uses_worker_cache_port():
Expand Down
Loading