Skip to main content

f2r

Command line tool to create RPMs out of aliBuild output.

Prerequisites

  • aliBuild 1.16.0 or higher (writes .meta.json in the install directories)
  • Optional: To enable S3 support you need to create a config file under ~/.s3cfg, see CERN IT instructions
  • gem + fpm: yum install rubygems -y ; gem install fpm

Installation

To just install the tool: python3 -m pip install f2r

OR

Use flp-release-server role from system-configuration to fully provision a build server.

Quickstart

Build packages using aliBuild, eg:

aliBuild build O2Suite --defaults o2-dataflow --always-prefer-system

Then create RPMs providing the package and version as found under sw/<architecture>/:

f2r generate --package O2Suite --version latest-o2-dataflow

Validate created RPMs (this requires sudo):

f2r validate

Create YUM repo:

f2r repo

and sync it to S3:

f2r sync

CLI options

Simple run f2r -h to see all available options

Developers documentation

Software lifecycle

  • Make changes and merge MR when lint and tests pass
  • Bump version in pyproject.toml
  • Push a git tag matching the version: the release CI job builds the sdist and wheel with python3 -m build and uploads them to PyPI
  • Update build server using pip

Simple description of the logic

Creates tree of dependencies by recursively iterating over "alidist" recipes. It disables certain packages based on selected "defaults". It retrieves versioning information from the .meta.json file that aliBuild writes in each install directory (sw/<architecture>/<package>/<version>/.meta.json), which lists the direct runtime and build dependencies resolved for that build. Dependencies built by aliBuild are pinned to the exact RPM built from them (o2-<name> = <version>-<revision>.<os>), so installing a package pulls in the very builds it was linked against.

It is capable of generating "devel" RPMs. In such case, in addition to runtime dependencies, it also packs build dependencies, with the versions recorded in .meta.json.

A dependency listed in the recipe but not recorded in .meta.json was not built by aliBuild and is treated as a system dependency. Definitions in (devel|runtime).slc*.yaml translate system dependencies into a list of RPM packages.

Then, it uses fpm tool to generate RPMs.

When the requested top-level package is O2Suite, it additionally generates the dependency-free o2-flp-suite-buildinfo RPM, which ships /etc/o2.d/FLP_suite_alidist_revision with the full alidist commit SHA the suite was built from (taken from .meta.json, falling back to the alidist checkout HEAD). The RPM version is the commit's committer date (YYYYMMDDHHMM, UTC) and its release starts with the short SHA, so newer alidist revisions are dnf-visible upgrades and regeneration from the same revision is idempotent.

Development setup

cd flp-to-rpm
python3 -m venv env
source env/bin/activate
python3 -m pip install -e '.[dev]'

The editable install exposes the f2r command and picks up code changes without reinstalling.

Lint and unit tests

Run from the repository root:

ruff check .
ruff format --check .
python3 -m unittest discover tests

# Run a single test:
python3 -m unittest tests.testPackage.TestPackage.test_deps_with_versions

Metadata

Release files for f2r 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for f2r 3.3.0
File Size Uploaded Provenance Actions
f2r-3.3.0.tar.gz 31.0 kB Without provenance Details for f2r-3.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for f2r 3.3.0
File Interpreter ABI Platform Actions
f2r-3.3.0-py3-none-any.whl Python 3 none any Details for f2r-3.3.0-py3-none-any.whl

Total release size: 65.5 kB

Release files / f2r-3.3.0.tar.gz

Download URL f2r-3.3.0.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9501953df6ae6208247f8bbd15079d831ae1b87d69acf451f2fed60158d5ede4
BLAKE2b-256 checksum
How to use checksums
971f07a8734f95afbf7b8da8ad6615776edd38e4a471af91a4c8b109698a762f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.14

Release files / f2r-3.3.0-py3-none-any.whl

Download URL f2r-3.3.0-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c33b8b2b3b1d71d7f50dce662fc2bd087313a7946d3c3dba8dde9651b078916c
BLAKE2b-256 checksum
How to use checksums
4fe08136d6ba63e17e20355cb436e22e26bcc2a9c9785c98b373530a9ba67a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.14

Security for f2r 3.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page