kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Migrate kolibri-image-pi into the Python monorepo

Open rtibbles opened this issue 5 months ago • 3 comments

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

Overview

Migrate kolibri-image-pi from its standalone repo into platforms/ as a co-located non-member (no Python package). It builds a Raspberry Pi OS image with Kolibri preinstalled from a Kolibri .deb — not a wheel, and not a workspace member.

Installer migration under #13720, following the kolibri-server pilot.

Complexity: Low · Target branch: develop

Context

kolibri-image-pi builds a Raspberry Pi image. Standalone repo contains:

  • base.Pifile, kolibri.Pifile (pimod image recipes);
  • files/, Makefile, smoke-test-wifi.sh;
  • no pyproject.toml and no Python package.

The build is pimod (Nature40/pimod) + shell — no Python of its own. Two PR-time workflows:

  • build_img.yml (reusable, workflow_call) — takes a Kolibri .deb (deb-url/deb-file-name), installs it into a Raspberry Pi OS Lite image, and uploads a versioned .zip (version from the .deb filename). This is the workflow the monorepo's pr_build_kolibri.yml zip job already calls (pinned …@v1.1.1).
  • pr_build.yml (standalone, on: pull_request) — fetches the latest Kolibri release .deb, calls build_img.yml, then runs the WiFi smoke test (smoke-test-wifi.sh) in a separate smoke_test job. It exists only because the repo is standalone with no Kolibri source; the smoke step lives here, not in the reusable.

The Change

  • Move the repo into platforms/raspberry-pi/ as a co-located non-member.
  • Preserve git history via git filter-repo --to-subdirectory-filter + merge --allow-unrelated-histories.
  • Migrate the reusable build_img.yml; rewire pr_build_kolibri.yml's zip job to call it locally (uses: ./.github/workflows/build_img.yml), dropping the learningequality/kolibri-image-pi/…@v1.1.1 pin and its ref: input.
  • Do not migrate pr_build.yml — pr_build_kolibri.yml already builds the image per PR against that PR's own Kolibri .deb, which supersedes the wrapper's build-against-latest-release.
  • Fold the wrapper's WiFi smoke test (smoke-test-wifi.sh) into the reusable build_img.yml (or the zip job) so it keeps running on every Kolibri PR — the reusable does not run it today, so a naive drop would silently lose that coverage.
  • Keep the pimod/Pifile image toolchain and the image cache steps.
  • Collapse duplicated PR scaffolding into the monorepo's copies.
  • Prefix-name migrated workflow files (platform-pi-*.yml).

Out of Scope

  • Migrating other installers — separate per-repo tasks under #13720.
  • Archiving the source repo.
  • Publishing/hosting the built image — done by the parent release flow, not this repo.
  • Auto-wiring the image build to the monorepo's own Kolibri .deb — keep the existing deb input; that integration is a later enhancement.
  • Making the build/validation CI blocking — the WHL smoke-test fan-in remains the sole blocking gate.

Acceptance Criteria

Code migration

  • [ ] Content at platforms/raspberry-pi/.
  • [ ] Pifiles, files/, Makefile, and smoke-test-wifi.sh kept.
  • [ ] No pyproject.toml / workspace link (non-member).
  • [ ] History + git blame preserved via git filter-repo.
  • [ ] Passes monorepo pre-commit.

CI

  • [ ] Reusable build_img.yml migrated and prefix-named; image cache steps kept.
  • [ ] pr_build_kolibri.yml's zip job calls it locally (uses: ./…); the @v1.1.1 cross-repo pin is removed.
  • [ ] pr_build.yml is not migrated.
  • [ ] The WiFi smoke test (smoke-test-wifi.sh) runs on Kolibri PRs, folded into the reusable / zip job.
  • [ ] The build consumes a Kolibri .deb (deb-url/deb-file-name) as before.
  • [ ] Duplicated PR scaffolding (call-pull-request-target, pre-commit) collapsed.

Runtime

  • [ ] The built .zip Pi image boots with Kolibri preinstalled and passes smoke-test-wifi.sh.

References

  • Source repository: https://github.com/learningequality/kolibri-image-pi
  • pimod: https://github.com/Nature40/pimod

AI usage

Used Claude Code to draft this issue from the migration-framework design; I drove scope and decisions. Claude read the source repo's build_img.yml and Makefile to ground the pimod/Pifile build details.

rtibbles avatar Jul 05 '26 00:07 rtibbles

Plan: Move kolibri-image-pi (Raspberry Pi image builder — pimod/Pifile + shell, no Python) from its standalone repo into platforms/kolibri-image-pi/ as a co-located non-member, preserving git history, and re-wire its build/PR-validation CI to run from the monorepo.

  • [ ] Filter-repo the source history onto platforms/kolibri-image-pi/ and merge it in
  • [ ] Remove kolibri-image-pi's standalone-repo-only scaffolding
  • [ ] /simplify pass
  • [ ] Re-create the reusable build workflow at the repo root
  • [ ] Re-create the path-filtered, prefix-named PR-validation workflow
  • [ ] Repoint the monorepo's fan-in builds at the migrated workflow
  • [ ] Update build-system docs to drop kolibri-image-pi from the external-repo list
  • [ ] /simplify pass
  • [ ] Full pre-commit pass and history/behavior verification
  • [ ] /simplify pass

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Jul 05 '26 17:07 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jul 05 '26 20:07 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jul 06 '26 02:07 rtibblesbot