kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Add a `proposed` prerelease suite to the apt.learningequality.org APT repo

Open rtibbles opened this issue 4 months ago • 6 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Add a proposed suite to the self-hosted APT repo at apt.learningequality.org. A built .deb publishes to proposed. After a smoke test it is promoted to stable. This decouples releases from Launchpad's multi-hour publish latency.

It covers both Debian packages the repo serves: kolibri (from kolibri-installer-debian) and kolibri-server. Running it in the monorepo is what lets one shared flow serve both. It replaces the abandoned kolibri-installer-debian#165. That built the flow for kolibri alone, on the now-removed gh-pages path.

Complexity: Medium Target branch: develop

Context

The self-hosted APT repo (#14965) is a reprepro archive. Its pool and metadata live in the release GCS bucket's apt/ subfolder, served as apt.learningequality.org via a Cloudflare rewrite. Each publish is a read-modify-write against the bucket: gcloud storage rsync down, reprepro operation, rsync up. Persistence is therefore inherent to the bucket — no gh-pages branch, no git history to flatten. Both kolibri and kolibri-server hand their built .deb to a shared publish workflow that includedebs into the repo.

The repo currently serves a single stable suite. Prereleases go only to Launchpad's kolibri-proposed PPA, which currently gates the release. That PPA's publish latency has run into hours. On a recent release the build finished in ~4 min but the binary was not installable for ~138 min.

The Change

  • Two suites. Add a proposed suite alongside stable in the reprepro distributions config. One repo serves both channels, for both packages.
  • Publish always targets proposed. Every .deb build enters via proposed. stable is never published to directly.
  • Promote via a dispatchable workflow. A workflow_dispatch workflow copies a staged package proposed → stable with reprepro copy — the same .deb, no rebuild.
  • Promotion is the release gate. Run it after the final proposed build passes its smoke test.
  • Retention Limit: 3. Each suite keeps the last 3 versions per package. Older .debs are pruned from the pool. Pool objects already in the bucket are not re-uploaded on publish.
  • Launchpad becomes a fire-and-forget mirror. The release flow still uploads to Launchpad but no longer waits on it. apt.le.org is the authoritative channel.

Out of Scope

  • The apt.le.org host, domain, and reprepro-on-GCS publish mechanism itself (#14965) — this builds on it.
  • The kolibri-server (#14964) and kolibri-installer-debian (#14966) migrations — prerequisites, not done here.
  • Behavioural changes to either .deb.
  • Changes to how Launchpad builds or signs packages — only its gating role changes.

Acceptance Criteria

  • [ ] The reprepro repo defines a stable and a proposed suite, both published to apt.learningequality.org.
  • [ ] Both the kolibri and kolibri-server .debs are installable from proposed via apt.
  • [ ] After the promote workflow runs, stable serves the same .deb that was staged in proposed.
  • [ ] The promoted .deb is installable from stable via apt.
  • [ ] A proposed publish leaves stable intact.
  • [ ] A promotion leaves the current proposed intact.
  • [ ] A fourth publish to a suite drops the oldest of its 3 retained versions from the pool.
  • [ ] A release completes without blocking on Launchpad.
  • [ ] apt update against either suite verifies signatures with the published key (no NO_PUBKEY).
  • [ ] Repo-setup docs cover enabling either suite (stable / proposed): sources entry plus signed-by key.

References

  • Abandoned gh-pages predecessor: learningequality/kolibri-installer-debian#165
  • reprepro: https://salsa.debian.org/debian/reprepro

AI usage

Drafted with Claude Code in an interactive session. I made the design decisions. Claude drafted the text and read kolibri-installer-debian#165, #14965, and the server/debian migration issues to ground it.

rtibbles avatar Jul 05 '26 19:07 rtibbles

@rtibbles one blocker before planning: Limit: 3 isn't supported by the reprepro we can install.

  • Ubuntu 24.04/26.04 and Debian ship reprepro 5.4.6+really5.3.2. Debian reverted 5.4, so this is 5.3.2.
  • In 5.3.2, Limit: in conf/distributions is an "Unknown header" error. Each suite holds one version per package, and a newer .deb replaces the old one in the index and the pool.

Options:

  • A — keep stock reprepro, drop retention (recommended). proposed and stable each serve their latest version. To roll back, dispatch platform-apt-repo-publish.yml with an older release's deb-url. That AC changes to "a publish replaces the suite's previous version".
  • B — build upstream reprepro 5.4.x from salsa in the publish job. This supports Limit: 3. The cost is a pinned source build of a version Debian reverted, plus a one-way migration of the live bucket's db/ to the 5.4 format.

Which one? Unless you say otherwise, I'll also assume this for the release flow:

  • Every release event (prerelease and final) publishes kolibri and kolibri-server to proposed, before block_release_step.
  • The promote workflow is workflow_dispatch (input: version) plus workflow_call. release_kolibri.yml calls it after block_release_step, so approving the release is the promotion.
  • Nothing waits on the Launchpad jobs anymore: platform-debian-server-release.yml's approval no longer needs: wait_for_copies_published. Those jobs still run to completion on their own.

rtibblesbot avatar Oct 06 '26 06:10 rtibblesbot

A seems fine to me - we can revisit the limit in future if requested by users.

rtibbles avatar Oct 06 '26 14:10 rtibbles

Thanks. This is what I'll build, using option A:

  • conf/distributions.in gets a proposed suite next to stable, and both use the same SignWith. There's no Limit:, so each suite serves only its latest version per package.
  • publish.sh always runs includedeb proposed.
  • New platform-apt-repo-promote.yml (workflow_dispatch + workflow_call) runs reprepro copy stable proposed kolibri kolibri-server in the same rsync-down/up cycle and under the same apt-repo-publish concurrency group. The .deb isn't rebuilt.
  • release_kolibri.yml:
    • Every release event, prerelease or final, publishes both .debs to proposed, ahead of block_release_step.
    • On a final release, promotion runs after block_release_step.
  • platform-debian-server-release.yml no longer publishes to the APT repo, and its approval no longer needs wait_for_copies_published. The Launchpad jobs stay but gate nothing.
  • The README documents stable and proposed source entries with signed-by.
  • The retention AC is now "a publish replaces the suite's previous version". Tests extend test_publish_roundtrip.sh:
    • publishing to proposed leaves stable intact;
    • promotion leaves proposed intact;
    • stable serves the byte-identical .deb.

rtibblesbot avatar Oct 06 '26 15:10 rtibblesbot

Plan: Every release publishes kolibri and kolibri-server to a new proposed suite on apt.learningequality.org; approving a final release copies the same .debs to stable, with Launchpad gating nothing.

  • [ ] Two suites; publish targets proposed
  • [ ] Promotion script
  • [ ] Workflows and release wiring
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • Publishing an older version replaces proposed's newer one; if proposed must keep the highest, a patch after a newer beta cannot be promoted.
  • Promotion pins pkg=version from the publish jobs; with an unpinned copy, a beta published during approval would reach stable.
  • Promotion skips a package when stable holds an equal or newer version; if a downgrade is wanted, promote.sh must allow it.
  • block_release_step waits for both proposed publishes; if not, approval can come before proposed holds the build to smoke-test.
  • platform-debian-server-release.yml keeps its own approval, now ungated by Launchpad; if it should go, dispatching that workflow alone loses its gate.

Written by rtibblesbot, an LLM-based coding agent.

rtibblesbot avatar Oct 06 '26 15:10 rtibblesbot

@rtibbles Blocked — these cannot be assumed either way:

  • Every GitHub release, prereleases included, now carries a kolibri-server_*.deb asset (upload_server_deb, release_kolibri.yml:111); the README's recovery and rollback paths republish it from there. #14979 does not ask for it — keep it, or drop it and name another source for those paths?

Written by rtibblesbot, an LLM-based coding agent.

rtibblesbot avatar Oct 06 '26 18:10 rtibblesbot

I think for now we should assume we publish both the base kolibri deb asset and the kolibri-server deb asset at the same time.

rtibbles avatar Oct 06 '26 18:10 rtibbles