feat: runtime apt detection + add docker to fast_provision experiment#3374
feat: runtime apt detection + add docker to fast_provision experiment#3374AhmedTMM wants to merge 3 commits intoOpenRouterTeam:mainfrom
Conversation
The Linux branch of ensureDocker() assumed apt — fine on Debian/Ubuntu, broken on Fedora/Arch/Alpine/openSUSE. Switch to Docker's official convenience script, which handles distro detection, repo setup, and service enablement in one call. Bumps CLI 1.0.27 -> 1.0.28.
Restores apt-get as the default Linux install path and gates the get.docker.com convenience script behind the `linux_docker_install` PostHog flag (variant "test"). This lets us measure whether the convenience script reduces install failures on non-apt distros (Fedora/Arch/Alpine) before flipping the default. Exposure event ($feature_flag_called) is captured automatically by getFeatureFlag().
…riment - local.ts: prefer apt-get if `which apt-get` succeeds; otherwise fall back to Docker's convenience script. Drops the linux_docker_install PostHog flag in favor of a simple capability check. - index.ts: fast_provision test variant now pushes both "images" and "docker" — the experiment evaluates the full provisioning-speed bundle.
ReviewCode change is clean; the experiment design is what I'd push back on. Code looks right
The design concernThe flag buckets all Linux users regardless of distro on a stable hash of the install-id. That means the experiment lumps two completely different questions together:
With mixed bucketing:
Net: this measures the non-Debian bug is real, which we already know, and it doesn't fix it for the ~50% of non-Debian users the flag routes to `control`. Cleaner design: detect distro via `/etc/os-release` first. If it's Debian/Ubuntu, use the flag for A/B. Otherwise (Fedora/Arch/Alpine/openSUSE/unknown), bypass the flag and go straight to the convenience script — that path is strictly better than failing. Something like: ```ts That way:
Minor
PostHog prepTest plan explicitly says "Configure `linux_docker_install` in PostHog with control/test variants before merging" — 👍. Confirm: does the PostHog project allow the flag key pattern with underscores? (`fast_provision` does, so this should too.) And set the rollout to 0% at merge, ramp after verifying exposure events land. VerdictLGTM on the code; request changes on the design — bypass the flag for non-Debian distros so the experiment population is actually comparable. The one-existsSync-check is the only delta from what's here. Reviewed by SPA |
|
Closing per request. Design concerns in the review — experiment bucketing doesn't isolate the real question (Debian vs convenience-script on distros where both work). Reopen if you want to ship the distro-gated version. |
Summary
`local.ts` — runtime apt detection (no PostHog flag). `ensureDocker()` now prefers `apt-get install docker.io` when `which apt-get` succeeds, and falls back to Docker's official convenience script (`curl -fsSL https://get.docker.com | sh`) otherwise. This unblocks Fedora/Arch/Alpine/openSUSE users without changing behavior on Debian/Ubuntu.
`index.ts` — extend the `fast_provision` experiment. The test variant previously pushed only `images`. It now pushes `images` + `docker`, so the experiment measures the full provisioning-speed bundle (marketplace image + Docker-preinstalled image). Control behaves as before.
Bumps CLI `1.0.27` → `1.0.28`.
Test plan
🤖 Generated with Claude Code