Skip to main content

pfl-inspired plugin for Gentoo Build Publisher

Project description

gbp-fl

A pfl-inspired plugin for Gentoo Build Publisher.

Gentoo's binary packages (binpkgs) are all collected into Gentoo Build Publisher "builds". The gbp-fl tool is both a plugin for Gentoo Build Publisher and a CLI tool.

As a plugin for Gentoo Build Publisher, when builds are pushed to GBP, gbp-fl indexes the files for all the packages in the build. It also provides a convenient web API for querying the index.

As a CLI tool, gbp-fl provides a plugin for gbpcli that adds the ability to search the index from the command line. It queries the web API for doing so. With the latest versions of Gentoo Build Publisher, it also provides the ability to fetch the binpkgs directly from the GBP server.

Rationale

I'm not sure that this is useful, but it was fun to work on. However it might be nice to learn about what kinds of packages belong on different systems and how they compare, for example. Or one might want to fetch a file from a package on one machine to use on another. Who knows.

Installation

Server Plugin

To use gbp-fl you must first install the plugin on the GBP server. This assumes you already have a working Gentoo Build Publisher installation. If not, refer to the GBP Install Guide first.

Install the gbp-fl package into the GBP instance:

cd /home/gbp
sudo -u gbp -H ./bin/pip install gbp-fl[server]

Restart the GBP web app and task workers.

systemctl restart gentoo-build-publisher-wsgi.service
systemctl restart gentoo-build-publisher-worker.service

Client Plugin

To use the gbp-fl command-line interface requires the gbpcli tool. The recommended way to install it on non-servers is via pipx:

pipx install gbpcli

Then add gbp-fl to the gbpcli environment:

pipx inject gbpcli gbp-fl

Usage

From the server, files from builds will automatically get indexed when they are pulled. Builds that are purged from GBP are also automatically removed from the files index. In addition the GraphQL API is automatically provided through the web interface.

From the command-line interface, the fl subcommand is automatically made available after installation.

To search for files, for example.

$ gbp fl search <keyword>

This command will display any filenames that matching the keyword for all the builds that are hosted on the Gentoo Build Publisher instance. To restrict the search to an particular screen name, use the -m argument.

screenshot

The search command displays the machine, build, package and path of the files that are a match. In addition the file size and timestamp are displayed.

The binpkg files can even be downloaded to the local machine using the fetch command:

$ gbp fl fetch <pkgspec>

screenshot

Other commands are forthcoming, for example gbp fl stats to display statistics about files in a given build/machine. gbp fl fetch will gain the ability to fetch individual files from individual packages, etc. Also the "special" --mine argument will be added to gbp fl search

Architecture

gbp-fl us both a plugin for Gentoo Build Publisher (server) and gbpcli (client), much like gbp-ps.

There are 4 main components to gbp-fl:

  • The database layer where file metadata are indexes. There is an abstract interface for this with different backends able to support the interface. Currently there are Django ORM and memory (for testing) interfaces. In the future other interfaces may be added (perhaps OpenSearch?).

  • The signal handling layer plugs into Gentoo Pubild Publisher's postpull and postdelete signals to index (and un-index) the builds as they come and go.

  • The GraphQL layer plugs into Gentoo Build Publisher's GraphQL subsystem. This registers a few types and queries specific to gbp-fl and provides their respective resolvers.

  • The CLI layer plugs into the gbpcli command-line interface to add the fl subcommand (and gbp-fl's own sub-subcommands) then it accesses the GraphQL interface on the server to make queries based on the commands.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gbp_fl-0.4.1.tar.gz (66.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gbp_fl-0.4.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file gbp_fl-0.4.1.tar.gz.

File metadata

  • Download URL: gbp_fl-0.4.1.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for gbp_fl-0.4.1.tar.gz
Algorithm Hash digest
SHA256 73c49684f2d98595bf0a96f6a1a9f4e7c17999549f24522386ee44506323ecb0
MD5 3a4af2fb267e5c03a05fcf6eab9495f5
BLAKE2b-256 0a218d7c65f3e39b4e54f6723733e33834ae3a5b92ae2d2655448431dfb7210f

See more details on using hashes here.

File details

Details for the file gbp_fl-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: gbp_fl-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for gbp_fl-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f217a7510a55636a130849f17d02bb119d4b068a48a0b529eecb037878baca56
MD5 31db55bfd8c494d7a494b60ea38b8d23
BLAKE2b-256 fa0295ea788cb984801b2c4e9968bd73f55c07606073c799477525a1a4b358e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page