No description
Find a file
Achilleas Koutsou a7a1f1ac07 dnfjson: size-based cache management
Functions for managing repository cache management based on a max
desirable size for the entire dnf-json cache directory.
While none of the functions are currently used, the workflow should
be as follows:
- Update the timestamp of a repository whenever it's used in a
  transaction by calling `touchRepo()` with the repository ID and the
  current time.
- Update the internal cache information when desired by calling
  `updateInfo()`.  This should be called for example after multiple
  depsolve transactions are run for a single build request.
- Shrink the cache to below the configured maxSize by calling
  `shrink()`.

The most important work happens in `updateInfo()`.  It collects all the
information it needs from the on-disk cache directories and organises it
in a way that makes it convenient for the `shrink()` function to run
efficiently.  It stores three important pieces of information:
1. repoElements: a map that links a repository ID with all the
   information about a repository's cache:
    - the top-level elements (files and directories) for the cache
    - size of the repository cache (total of all elements)
    - most recent mtime from all the elements which, if the
      `touchRepo()` call is consistently used, should reflect the most
      recent time the repository was used
2. repoRecency: a list of repository IDs sorted by mtime (oldest first)
3. size: the total size of the cache (total of all repository caches)

This way, when `shrink()` is called, the paths associated with the
least-recently-used repositories can be easily deleted by iterating on
repoRecency, obtaining the repository info from the map, deleting every
path in the repoElements array, and subtracting the repository's size
from the total.  The `shrink()` function stops when the new size is
below the maxSize (or when all repositories have been deleted).
2022-06-10 12:45:41 +01:00
.devcontainer Devcontainer update to Fedora 36. 2022-05-04 10:44:21 +02:00
.github github: run unit tests on Fedora and force dnf 2022-06-01 11:36:52 +01:00
cmd osbuild-worker: Correct cast of dnfjson error in depsolve job 2022-06-08 23:07:37 +02:00
containers entrypoint - add parameters for socket bind address and port 2022-05-04 09:13:40 +02:00
distribution spec: remove dnf-json service and socket 2022-06-01 11:36:52 +01:00
docs Doc: remove unused doc/news directory 2021-11-24 14:55:47 +01:00
image-types image-types: Add research document for GCE image type 2022-04-14 19:07:31 +01:00
internal dnfjson: size-based cache management 2022-06-10 12:45:41 +01:00
repositories distro: add an alias for rhel-91 2022-05-03 18:13:28 +02:00
schutzbot COMPOSER-1576: Start building RPMs on 8.6 and 9.0 GA before we can test 2022-06-06 12:53:43 +02:00
templates packer: pin the vector version 2022-06-07 09:08:22 +02:00
test Blacklist amdgpu module on Azure images 2022-06-09 14:18:45 +01:00
tools genall: move to cmd/ and rename to gen-manifests 2022-06-01 11:36:52 +01:00
vendor go.mod: Update openshift-online/ocm-sdk-go 2022-05-19 22:18:42 +02:00
.env docker-compose: integrate dev container 2022-02-27 20:55:03 +00:00
.gitignore tools: AppSRE packer build 2022-01-05 22:13:55 +01:00
.gitlab-ci.yml save report.html from cloud-image-val as an artifact 2022-06-08 16:14:35 +02:00
.gitleaks.toml gitleaks: add allow list for test passwords and keys 2021-10-01 16:56:26 +02:00
.golangci.yml golangci: enable gosec in golangci 2021-12-13 12:17:30 +02:00
.packit.yaml packit: Enable Koji build integration 2022-05-10 13:29:32 +02:00
.pylintrc github/workflows: check dnf-json with pylint 2022-03-08 12:42:12 +01:00
codecov.yml codevoc: fix threshold 2020-05-17 10:12:06 +02:00
CONTRIBUTING.md Improve contributing.md 2021-11-23 08:25:07 +01:00
DEPLOYING.md Add DEPLOYING.md 2020-10-20 15:43:30 +02:00
dnf-json dnfjson: drop repo checksums 2022-06-01 11:36:52 +01:00
docker-compose.yml docker-compose: integrate dev container 2022-02-27 20:55:03 +00:00
go.mod go.mod: Update openshift-online/ocm-sdk-go 2022-05-19 22:18:42 +02:00
go.sum go.mod: Update openshift-online/ocm-sdk-go 2022-05-19 22:18:42 +02:00
HACKING.md docker-compose: integrate dev container 2022-02-27 20:55:03 +00:00
krb5.conf upload/koji: add support for GSSAPI/Kerberos auth 2020-08-27 17:29:57 +01:00
LICENSE Revert "Fill in the license template" 2019-11-15 15:26:51 +01:00
Makefile OSBuild - add support for generic S3 services 2022-04-07 15:01:01 +02:00
osbuild-composer.spec add cloud-image-val to aws test 2022-06-08 16:14:35 +02:00
README.md Add build requirement in README.md 2022-01-28 15:16:47 +01:00
Schutzfile Update dependency of osbuild to v57 2022-06-06 12:53:43 +02:00

OSBuild Composer

Operating System Image Composition Services

The composer project is a set of HTTP services for composing operating system images. It builds on the pipeline execution engine of osbuild and defines its own class of images that it supports building.

Multiple APIs are available to access a composer service. This includes support for the lorax-composer API, and as such can serve as drop-in replacement for lorax-composer.

You can control a composer instance either directly via the provided APIs, or through higher-level user-interfaces from external projects. This, for instance, includes a Cockpit Module or using the composer-cli command-line tool.

Project

Contributing

Please refer to the developer guide to learn about our workflow, code style and more.

About

Composer is a middleman between the workhorses from osbuild and the user-interfaces like cockpit-composer, composer-cli, or others. It defines a set of high-level image compositions that it supports building. Builds of these compositions can be requested via the different APIs of Composer, which will then translate the requests into pipeline-descriptions for osbuild. The pipeline output is then either provided back to the user, or uploaded to a user specified target.

The following image visualizes the overall architecture of the OSBuild infrastructure and the place that Composer takes:

overview

Consult the osbuild-composer(7) man-page for an introduction into composer, information on running your own composer instance, as well as details on the provided infrastructure and services.

Requirements

The requirements for this project are:

  • osbuild >= 26
  • systemd >= 244

At build-time, the following software is required:

  • go >= 1.16
  • python-docutils >= 0.13
  • krb5-devel for fedora/rhel or libkrb5-dev for debian/ubuntu`

Build

The standard go package system is used. Consult upstream documentation for detailed help. In most situations the following commands are sufficient to build and install from source:

mkdir build
go build -o build ./...

The man-pages require python-docutils and can be built via:

make man

Repository:

Pull request gating

Each pull request against osbuild-composer starts a series of automated tests. Tests run via GitHub Actions and Jenkins. Each push to the pull request will launch theses tests automatically.

Jenkins only tests pull requests from members of the osbuild organization in GitHub. A member of the osbuild organization must say ok to test in a pull request comment to approve testing. Anyone can ask for testing to run by saying the bot's favorite word, schutzbot, in a pull request comment. Testing will begin shortly after the comment is posted.

Test results in Jenkins are available by clicking the Details link on the right side of the Schutzbot check in the pull request page.

License:

  • Apache-2.0
  • See LICENSE file for details.