[packaging] Add Debian + RPM packaging#4
Open
shiptux wants to merge 14 commits into
Open
Conversation
Adapted from FlagAttention's working template (FlagOS Python component packaging pattern): - dh-python + pybuild + pybuild-plugin-pyproject - Architecture: all (noarch) - override_dh_auto_test runs a smoke import; pytest deferred to upstream GPU CI - packaging/debian/ + helpers/Dockerfile.deb (Ubuntu 22.04 base) - 'cp -r packaging/debian debian' inside the container to satisfy dpkg-buildpackage's debian/-at-root expectation Not yet built locally; expected to mirror FlagAttention's ~5 s build and small .deb size for the pure-Python paths.
- debian/control: move python3-torch from Depends to Recommends so
the package installs on systems where torch comes from pip / NGC
rather than from apt main archive. dh_python3 still auto-detects
torch via pyproject.toml's dependencies field via
${python3:Depends}; that's a separate follow-up if we want it
fully removed from .deb metadata.
- debian/rules: replace 'import <module>' smoke test with
importlib.util.find_spec to avoid triggering torch import at
build time. Fix '; exit 0' silent-pass bug with '&&' short-circuit.
- packaging/rpm/: mirror DEB packaging for Fedora targets.
…mismatched Dockerfile)
Triggered on push tag v*, PR touching packaging/, or manual dispatch. Runs the existing local build helper in a container and uploads the produced .deb / .rpm as actions artifacts named 'flagtensor-amd64-packages' / 'flagtensor-amd64-rpm-packages', matching the central flagos-packaging publish pipeline's components/flagtensor.yml artifact_pattern.
…orch+triton from RPM Requires
…c paths (#8); .dockerignore (#11)
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
Adds Debian (
.deb) and RPM packaging configuration underpackaging/debian/andpackaging/rpm/so this component can bedistributed alongside the rest of the FlagOS stack via standard
apt install/dnf installflows.Produced binary: python3-flagtensor (≈32 KB .deb, ≈116 KB .rpm).
What changed
packaging/debian/{control,rules,changelog,copyright,source/format}— Debian source-format-3.0-native packaging.packaging/rpm/specs/flagtensor\.spec— RPM spec usingpyproject-rpm-macros.packaging/{debian,rpm}/helpers/— single-command containerized build:bash packaging/debian/build-helpers/build-<slug>.shproduces the.deb without host build-deps; same shape for RPM.
No source code changes outside
packaging/.How it was tested
Local container build produces the noarch .deb and .rpm above.
End-to-end install in clean
ubuntu:24.04anddebian:trixiecontainers from a local signed APT repo passes
apt install+importlib.util.find_spec(<module>)smoke check.The
dh_auto_testoverride usesimportlib.util.find_specrather than
import, so the build-time smoke test validatesinstall layout (right path, importable from the dist-packages dir)
without triggering runtime imports of torch / triton / etc. — those
are user-install-time concerns, not packaging concerns.
Distribution
This artifact is consumed by a central FlagOS publish repo
(sandbox at https://github.com/shiptux/flagos-packaging; the
production endpoint remains the FlagOS Nexus mirror at
resource.flagos.net). Companion design notes in the sandboxrepo cover multi-distro strategy
(
docs/multi-distro-strategy-notes.md) and a per-distrocompatibility matrix (
docs/compatibility-status.md).Known limitations
Out of scope (separate plans)
as a known issue, not blocking this PR.
Phase 2 work, separate PR if/when needed.