Skip to main content

Module deploy

Module deploy 

Source
Expand description

Pull dispatch and deployment staging for the ostree backend.

§Planned Pull paths

The top-level entry point for upgrade/switch will eventually select among three paths based on the unified flag and filesystem capability:

  • Unified + reflinks (unified = true, XFS/btrfs): pull_via_composefs_unified — the planned three-store pipeline. Pulls into containers-storage first, then ZeroCopy into composefs, then synthesizes the ostree commit via FICLONE. See crate::store for the architecture diagram.

  • Non-unified + reflinks (unified = false, XFS/btrfs): pull_via_composefs — fetches from registry directly into composefs (no containers-storage), then synthesizes the ostree commit via FICLONE.

  • No reflinks (ext4): pull — the legacy ostree-native tar importer (ostree_container::store::ImageImporter).

§Planned composefs → ostree synthesis

The synthesis plan relies on import_from_composefs_repo from ostree_ext::container::composefs_import to walk the composefs filesystem tree and for each regular file:

  1. Reads uid/gid/mode/xattrs from composefs metadata. SELinux labels are computed in bulk before the walk via selabel() and looked up per-file; a NUL terminator is appended because composefs-rs omits it but the kernel stores it.
  2. Computes the ostree content checksum in-memory (SHA-256 of uid:gid:mode:xattrs:file-content).
  3. Issues ioctl(FICLONE) from the composefs object fd into a new O_TMPFILE in the ostree object directory.
  4. Applies metadata (fchown, fchmod, fsetxattr) and links the tmpfile into the ostree content-addressed path.

/etc is remapped to usr/etc; virtual toplevel paths (proc, sys, dev, etc.) are excluded — matching the ostree-container tar importer.

§Auto-detection

image_exists_in_unified_storage checks whether the target image is already present in bootc-owned containers-storage. Call sites use this to select unified = true automatically without requiring an explicit flag from the user once bootc image set-unified has been run.

Structs§

ImageState 🔒
State of a locally fetched image
LayerProgressConfig 🔒
Configuration for layer progress printing
PreparedImportMeta 🔒
RequiredHostSpec 🔒
Variant of HostSpec but required to be filled out

Enums§

MergeState 🔒
The source of data for staging a new deployment
PreparedPullResult 🔒

Constants§

BASE_IMAGE_PREFIX 🔒
BOOTC_DERIVED_KEY 🔒
Set on an ostree commit if this is a derived commit
ROLLBACK_JOURNAL_ID 🔒

Functions§

check_bootc_label 🔒
check_disk_space_composefs 🔒
Verify there is sufficient disk space to pull an image into the composefs store for the native composefs backend (uses a raw ImageManifest).
check_disk_space_inner 🔒
Core disk space check: verify that bytes_to_fetch fits within available space, leaving at least min_free bytes reserved.
check_disk_space_ostree 🔒
Verify there is sufficient disk space to pull an image into the ostree repo. Respects the repository’s configured min-free-space threshold.
check_disk_space_unified 🔒
Verify there is sufficient disk space to pull an image into the composefs store via the ostree unified-storage path (uses PreparedImportMeta).
cleanup 🔒
deploy 🔒
descriptor_of_progress 🔒
find_newest_deployment_name 🔒
fixup_etc_fstab 🔒
A workaround for https://github.com/ostreedev/ostree/issues/3193 as generated by anaconda.
get_base_commit 🔒
If commit is a bootc-derived commit (e.g. has configmaps), return its base.
handle_layer_progress_print 🔒
Write container fetch progress to standard output.
image_exists_in_unified_storage 🔒
Check whether the image exists in bootc’s unified container storage.
new_importer 🔒
Wrapper for pulling a container image, wiring up status output.
new_importer_with_config 🔒
Wrapper for pulling a container image with a custom proxy config (e.g. for unified storage).
new_proxy_config 🔒
Create an ImageProxyConfig with bootc’s user agent prefix set.
origin_from_imageref 🔒
prefix_of_progress 🔒
prepare_for_pull 🔒
prepare_for_pull_unified 🔒
Unified approach: Use bootc’s CStorage to pull the image, then prepare from containers-storage. This reuses the same infrastructure as LBIs.
prune_container_store 🔒
Gather all bound images in all deployments, then prune the image store, using the gathered images as the roots (that will not be GC’d).
pull 🔒
Wrapper for pulling a container image, wiring up status output.
pull_from_prepared 🔒
pull_unified 🔒
Unified pull: Use podman to pull to containers-storage, then read from there
rollback 🔒
Implementation of rollback functionality
stage 🔒
Stage (queue deployment of) a fetched container image.
switch_origin_inplace 🔒
wipe_ostree 🔒
write_reboot_required 🔒
Update the /run/reboot-required file with the image that will be active after a reboot.