feat: add apple-container runtime support#4970
Open
jsj wants to merge 6 commits intosupabase:developfrom
Open
Conversation
b2fcaa5 to
c364377
Compare
Pull Request Test Coverage Report for Build 23416634417Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Add Apple Containers as an alternative runtime for Supabase CLI-managed services. Docker remains the default runtime, while apple-container can be selected anywhere the CLI manages the service lifecycle. The primary use case today is local development, but the runtime abstraction is not limited to that environment.
Enable the analytics stack when services run on the apple-container runtime. This adds an Apple-specific log ingestion path for Vector by forwarding container logs to host-side JSONL files and configuring Vector to read those files instead of Docker's log source. Docker behavior remains unchanged.
Add explanatory comments addressing likely review questions: - Why strategy-via-conditionals instead of an interface - Kong startup order change (IP resolution needs running containers) - Analytics log forwarding architecture (no Docker log driver) - PGDATA override for Apple container volume mounts - KongId added to listServicesToRestart (behavioral change) - Host header in kong.yml for Realtime tenant routing - Stale container reconciliation rationale - Apple volume delete lacks force flag Also add saveResetTestState helper to reduce verbose save/restore boilerplate in reset_test.go.
- Add mockable variables for stopAppleAnalyticsForwarders, listProjectVolumes, dockerRemoveAll - Test that StopAppleAnalyticsForwarders is called on Apple runtime - Test that Docker volume suggestions are shown on Docker runtime - Test that Apple container volume suggestions are shown on Apple runtime - Test correct ordering: forwarders stopped before containers Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
0d219ec to
9714850
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--runtime apple-containeror[local].runtime = "apple-container"in config.toml)internal/utils/runtime.gothat dispatches container operations to either Docker SDK or Apple'scontainerCLIcontainer exec), volume mount path conflicts (PGDATA subdirectory)listServicesToRestartfor database reset (Kong caches upstream addresses that become stale when the DB container is recreated)Hostheader injection in Kong for Realtime routes (Apple containers use IPs, Realtime requires tenant ID as Host)supabase statuspretty output showing containers, networks, volumesNew files
internal/utils/apple_container.gointernal/utils/runtime.gointernal/utils/apple_analytics.gocmd/apple_log_forwarder.goTest plan
legacy/branch/createfails due to Docker daemon dependency)supabase start --runtime apple-containeron macOS with Apple Containers installedsupabase stopcleans up Apple container resourcessupabase db resetwith Apple container runtimesupabase statusshows runtime summary