Skip to content

ACL: add fasttrack support - #26

Open
mayankfz wants to merge 4 commits into
aclmainfrom
mayansingh/fasttrack_bridge
Open

ACL: add fasttrack support#26
mayankfz wants to merge 4 commits into
aclmainfrom
mayansingh/fasttrack_bridge

Conversation

@mayankfz

@mayankfz mayankfz commented Jul 9, 2026

Copy link
Copy Markdown

Summary

This PR adds new feature support for Fasttrack repository integration to enable faster CVE resolution through priority installation of updated RPMs from the fasttrack-preview repository.

Change Log

Implements Fasttrack preview repository support by enabling the build system to accept and utilize a fasttrack .repo file for preferential installation of CVE-patched RPMs during image builds. The changes propagate the FASTTRACK_REPO_FILE environment variable through the SDK container workflow and add logging to track which packages are installed from the fasttrack repository.

  • build_library/rpm/rpm_install.sh: Adds fasttrack preview repo file copying to installroot, logs available fasttrack packages before installation, and verifies which installed packages came from fasttrack after installation
  • run_sdk_container and sdk_lib/sdk_entry.sh: Forward FASTTRACK_REPO_FILE environment variable through the SDK container and into the build environment
  • acl/build_rpm_image.sh: Exports FASTTRACK_REPO_FILE variable to make it available for the ACL image build pipeline
  • This PR also adds a staleness check for ACL-owned specs during regular RPM builds. The build fails when an ACL spec is behind PMC, helping catch packages that need to be rebased. Known exceptions can be configured when needed.

Type of Change

  • Image build change (base image, sysexts, OEM images)
  • Package/SPEC update
  • CI/automation change
  • SDK/toolchain update
  • Configuration change
  • Documentation update
  • Bug fix

Does this affect the image build?

  • Yes
  • No

Associated Issues

https://dev.azure.com/mariner-org/ACL/_workitems/edit/21564/

Test Methodology

Merge Checklist

All applicable boxes should be checked before merging

  • Image builds successfully with this change (or image build is not affected)
  • Any updated packages/SPECs build successfully
  • Relevant kola tests pass
  • All package sources are available
  • Source files have up-to-date hashes/manifests
  • Documentation has been updated to match any changes
  • Ready to merge

@mayankfz
mayankfz marked this pull request as ready for review July 10, 2026 08:14
@mayankfz
mayankfz requested a review from a team as a code owner July 10, 2026 08:14
Copilot AI lite review requested due to automatic review settings July 10, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “FastTrack preview” repository support to the ACL image build flow by propagating a FASTTRACK_REPO_FILE environment variable into the SDK container and using it during RPM installation to prefer CVE-patched RPMs, with additional logging to help verify behavior.

Changes:

  • Forward FASTTRACK_REPO_FILE through acl/build_rpm_image.shrun_sdk_containersdk_lib/sdk_entry.sh.
  • In RPM-mode installs, copy the fasttrack .repo file into the installroot and log fasttrack-available / fasttrack-installed package information.
  • Add repoquery-based diagnostics around fasttrack availability and installed versions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sdk_lib/sdk_entry.sh Persists FASTTRACK_REPO_FILE into the SDK user environment via .bashrc.
run_sdk_container Passes FASTTRACK_REPO_FILE into the SDK container environment for builds.
build_library/rpm/rpm_install.sh Installs fasttrack repo config into installroot and adds fasttrack-related repoquery/verification logging.
acl/build_rpm_image.sh Exports FASTTRACK_REPO_FILE so it is available to the SDK container build pipeline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread run_sdk_container
Copilot AI review requested due to automatic review settings July 10, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread run_sdk_container
Comment thread run_sdk_container
Comment thread build_library/rpm/build_image_util.sh
Copilot AI review requested due to automatic review settings July 14, 2026 05:15
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from f119d70 to 10449ac Compare July 14, 2026 05:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread sdk_lib/sdk_entry.sh
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/build_image_util.sh Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 06:19
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 10449ac to 2a5f10d Compare July 14, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread run_sdk_container
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/build_image_util.sh
Comment thread build_library/rpm/rpm_install.sh Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 07:24
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 2a5f10d to 4e2aa2d Compare July 14, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread sdk_lib/sdk_entry.sh
Comment thread run_sdk_container
Comment thread build_library/rpm/rpm_install.sh
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/build_image_util.sh
Copilot AI review requested due to automatic review settings July 14, 2026 08:20
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 4e2aa2d to eeb0851 Compare July 14, 2026 08:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread run_sdk_container
Comment thread run_sdk_container
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/build_image_util.sh
Copilot AI review requested due to automatic review settings July 14, 2026 09:29
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from eeb0851 to f1292b7 Compare July 14, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/build_image_util.sh
Comment thread build_library/rpm/check_pmc_staleness.sh
Copilot AI review requested due to automatic review settings July 14, 2026 10:07
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from f1292b7 to 9ad5069 Compare July 14, 2026 10:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Comment thread sdk_lib/sdk_entry.sh
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/rpm_install.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/build_image_util.sh
Copilot AI review requested due to automatic review settings July 14, 2026 13:17
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 9ad5069 to 95c8599 Compare July 14, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.

Comment thread build_library/rpm/rpm_install.sh
Comment thread run_sdk_container
Comment thread run_sdk_container
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 14:15
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 95c8599 to 0d693b1 Compare July 14, 2026 14:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/build_image_util.sh Outdated
Comment thread run_sdk_container
Comment thread build_library/rpm/rpm_install.sh
Comment thread build_library/rpm/check_pmc_staleness.sh
Copilot AI review requested due to automatic review settings July 15, 2026 06:09
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 0d693b1 to 34e733d Compare July 15, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread run_sdk_container
Comment thread run_sdk_container
Comment thread build_library/rpm/build_image_util.sh
Comment thread build_library/rpm/check_pmc_staleness.sh Outdated
Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/check_pmc_staleness.sh
Copilot AI review requested due to automatic review settings August 8, 2026 12:03
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 34e733d to 9e08940 Compare August 8, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (7)

run_sdk_container:163

  • FASTTRACK_REPO_FILE is treated as a boolean and replaced with a hard-coded in-container path via ${FASTTRACK_REPO_FILE:+...}. This prevents callers from specifying an explicit repo file path (the value they set is discarded), which makes the environment variable semantics surprising and can break non-CI usage.
        -e IMAGE_VERSION_ID="${IMAGE_VERSION_ID:-}"
        -e IMAGE_BUILD_ID="${IMAGE_BUILD_ID:-}"
        -e EXTRA_KERNEL_CMDLINE="${EXTRA_KERNEL_CMDLINE:-}"
        -e FASTTRACK_REPO_FILE="${FASTTRACK_REPO_FILE:+/mnt/host/source/src/scripts/__build__/fasttrack-repo/fasttrack-preview.repo}"

run_sdk_container:188

  • This exec invocation also replaces the caller-provided FASTTRACK_REPO_FILE value with a hard-coded path. If the intent is to support a default pipeline-generated repo file, consider setting FASTTRACK_REPO_FILE to that default earlier (when empty) rather than overwriting non-empty values here.
call_docker exec "${tty[@]}" -i -e INJECT_DOCKER_SYSEXT="${INJECT_DOCKER_SYSEXT:-false}" -e FASTTRACK_REPO_FILE="${FASTTRACK_REPO_FILE:+/mnt/host/source/src/scripts/__build__/fasttrack-repo/fasttrack-preview.repo}" "${name}" /mnt/host/source/src/scripts/sdk_lib/sdk_entry.sh "$@"

build_library/rpm/rpm_install.sh:394

  • dnf5 repoquery --repo=fasttrack-preview --available can return (and sort) a very large package list, and this block runs on every rpm_install_package invocation in fasttrack builds. This can significantly slow image builds and flood logs. Consider restricting the query to the packages being installed in this call.
    if [[ -n "${FASTTRACK_REPO_FILE:-}" ]] && [[ -f "${root_fs_dir}/etc/yum.repos.d/$(basename "${FASTTRACK_REPO_FILE}")" ]]; then
        info "=== FastTrack preview repo packages available ==="
        sudo /usr/bin/dnf5 repoquery --installroot="${root_fs_dir}" --releasever=3.0 \
            ${forcearch_arg} --repo=fasttrack-preview --available 2>/dev/null | sort || true
        info "=== End of fasttrack packages ==="

build_library/rpm/rpm_install.sh:438

  • This verification loop iterates over all packages available in fasttrack-preview and runs rpm -q for each, which can be extremely expensive and noisy. A lower-cost approach is to scope the repoquery to the packages being installed in this call (or to the subset detected in the transaction log).
        done < <(sudo /usr/bin/dnf5 repoquery --installroot="${root_fs_dir}" --releasever=3.0 \
            ${forcearch_arg} --repo=fasttrack-preview --available --queryformat="%{name} %{evr}\n" 2>/dev/null || true)

build_library/rpm/check_pmc_staleness.sh:12

  • The usage header says the script only takes <installroot>, but it also supports a second argument for the exception list. Keeping the usage text accurate helps avoid confusion when it fails with Usage: ....
# package and fails the build when PMC has moved ahead.
#
# Usage:  check_pmc_staleness.sh <installroot>
#

build_library/rpm/build_image_util.sh:105

  • This PR is described as adding FastTrack repo support, but it also introduces a new build-blocking PMC staleness gate (including network repo queries) in the core RPM image build path. That’s a significant behavioral/CI policy change and should either be called out explicitly in the PR description (and rationale) or split into a separate PR so reviewers can evaluate it independently.
    # Check ACL SPECs for PMC staleness - fails the build if any package is stale.
    # The check compares pmc_base_version/pmc_base_release metadata in each
    # ACL SPEC against the current PMC repo to detect packages that need rebase.
    # Packages in the exception list are allowed to be stale (e.g. waiting for
    # ACL changes to land upstream).
    local staleness_exceptions="selinux-policy"
    if [[ -x "${BUILD_LIBRARY_DIR}/rpm/check_pmc_staleness.sh" ]]; then
        if ! "${BUILD_LIBRARY_DIR}/rpm/check_pmc_staleness.sh" "${root_fs_dir}" "${staleness_exceptions}"; then

build_library/rpm/check_pmc_staleness.sh:103

  • FASTTRACK_URL extraction only matches lines that start exactly with baseurl=. Many .repo files use whitespace (e.g. baseurl = ...) or may indent entries, which would make FASTTRACK_URL empty and cause the staleness check to silently skip (due to the repoquery failure handler).
if [[ -n "${FASTTRACK_REPO_FILE:-}" ]] && [[ -f "${FASTTRACK_REPO_FILE}" ]]; then
    # Fasttrack build: query fasttrack + PMC (fasttrack has latest, PMC covers the rest)
    FASTTRACK_URL="$(grep -m1 '^baseurl=' "${FASTTRACK_REPO_FILE}" | cut -d= -f2-)"
    info "Checking against fasttrack repo: ${FASTTRACK_URL}"

Copilot AI review requested due to automatic review settings August 25, 2026 05:13
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 9e08940 to 3d099c0 Compare August 25, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

build_library/rpm/check_pmc_staleness.sh:25

  • INSTALLROOT is required by the script interface but is never used/validated, which makes the usage misleading and can hide caller errors (e.g., passing a non-existent rootfs dir). At minimum, validate the directory exists before proceeding.
INSTALLROOT="${1:?Usage: check_pmc_staleness.sh <installroot>}"

Comment thread build_library/rpm/check_pmc_staleness.sh
Comment thread build_library/rpm/rpm_install.sh
Mayank Singh added 4 commits September 8, 2026 11:37
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
…path

Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
Copilot AI review requested due to automatic review settings September 8, 2026 12:27
@mayankfz
mayankfz force-pushed the mayansingh/fasttrack_bridge branch from 3d099c0 to 0c496f6 Compare September 8, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The current FastTrack repo injection and staleness-exception configuration have avoidable safety/operability issues that should be addressed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment on lines +131 to +139
if [[ -n "${FASTTRACK_REPO_FILE:-}" ]]; then
if [[ -f "${FASTTRACK_REPO_FILE}" ]]; then
info " Adding fasttrack preview repo: ${FASTTRACK_REPO_FILE}"
sudo cp "${FASTTRACK_REPO_FILE}" "${repo_dir}/"
else
error " FASTTRACK_REPO_FILE set but file not found: ${FASTTRACK_REPO_FILE}"
return 1
fi
fi
# ACL SPEC against the current PMC repo to detect packages that need rebase.
# Packages in the exception list are allowed to be stale (e.g. waiting for
# ACL changes to land upstream).
local staleness_exceptions="selinux-policy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants