Skip to content

Commit

Permalink
Merge branch 'main' into bisect-improve-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk authored Feb 10, 2025
2 parents c5db2b0 + 412a453 commit bccff4e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 64 deletions.
6 changes: 2 additions & 4 deletions .github/actions/generate-matrix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ runs:
"copr_ownername": "@fedora-llvm-team",
"copr_project_tpl": "llvm-snapshots-big-merge-YYYYMMDD",
"copr_monitor_tpl": "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-big-merge-YYYYMMDD/monitor/",
"chroot_pattern": "^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-)",
"packages": "llvm"
"chroot_pattern": "^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-)"
}
EOF
)
Expand All @@ -49,8 +48,7 @@ runs:
"copr_ownername": "@fedora-llvm-team",
"copr_project_tpl": "llvm-snapshots-pgo-YYYYMMDD",
"copr_monitor_tpl": "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-pgo-YYYYMMDD/monitor/",
"chroot_pattern": "^(fedora-41)",
"packages": "llvm"
"chroot_pattern": "^(fedora-41)"
}
EOF
)
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/check-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ jobs:
--github-token-env GITHUB_TOKEN \
check "${extra_args}"\
--maintainer-handle ${{matrix.maintainer_handle}} \
--packages ${{matrix.packages}} \
--build-strategy ${{matrix.name}} \
--copr-ownername ${{matrix.copr_ownername}} \
--copr-project-tpl ${{matrix.copr_project_tpl}} \
Expand Down
57 changes: 22 additions & 35 deletions .github/workflows/fedora-copr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ jobs:
today=$(date +%Y%m%d)
yesterday=$(date -d "${today} -1 day" +%Y%m%d)
packages="$(get_packages)"
chroots="$(get_chroots)"
username=@fedora-llvm-team
{
echo "username=$username"
echo "packages=$packages"
echo "chroots=$chroots"
echo "all_chroots=$all_chroots"
echo "project_today=${{ matrix.copr_ownername }}/${{ matrix.copr_project_tpl }}" | sed "s/YYYYMMDD/$today/"
Expand Down Expand Up @@ -132,7 +130,8 @@ jobs:
source scripts/functions.sh
[[ -n "${{ matrix.extra_script_file }}" ]] && source ${{ matrix.extra_script_file }}
chroot_opts=$(for c in ${{ env.chroots }}; do echo -n " --chroot $c "; done)
# shellcheck disable=SC2207
chroot_opts=($(for c in ${{ env.chroots }}; do echo -n " --chroot $c "; done))
copr create \
--instructions "$(cat project-instructions.md)" \
Expand All @@ -144,7 +143,7 @@ jobs:
--appstream off \
--delete-after-days 32 \
--module-hotfixes on \
"$chroot_opts" "${{ env.project_today }}"
"${chroot_opts[@]}" "${{ env.project_today }}"
- name: "Enable snapshot_build build condition for all and swig:4.0 module in RHEL 8 build chroots (if any)"
shell: bash -e {0}
Expand All @@ -162,48 +161,36 @@ jobs:
copr get-chroot "${{ env.project_today }}/$chroot"
done
- name: "Create today's packages: ${{ env.packages }}"
- name: "Create today's package"
shell: bash -e {0}
run: |
source scripts/functions.sh
[[ -n "${{ matrix.extra_script_file }}" ]] && source ${{ matrix.extra_script_file }}
for pkg in ${{ env.packages }}; do
clone_url=$(echo "${{ matrix.clone_url_tpl }}" | sed "s/PKG/$pkg/")
copr add-package-scm \
--clone-url "${clone_url}" \
--commit ${{ matrix.clone_ref }} \
--spec "${pkg}.spec" \
--type git \
--method make_srpm \
--name "${pkg}" \
"${{ env.project_today }}"
done
- name: "Build packages in chroot batches in this order: ${{ env.packages }}"
clone_url=$(echo "${{ matrix.clone_url_tpl }}" | sed "s/PKG/$pkg/")
copr add-package-scm \
--clone-url "${clone_url}" \
--commit ${{ matrix.clone_ref }} \
--spec "llvm.spec" \
--type git \
--method make_srpm \
--name "llvm" \
"${{ env.project_today }}"
- name: "Build llvm package"
shell: bash -e {0}
run: |
source scripts/functions.sh
[[ -n "${{ matrix.extra_script_file }}" ]] && source ${{ matrix.extra_script_file }}
for chroot in ${{ env.chroots }}; do
# Start a new batch
after_build_id=""
for pkg in ${{ env.packages }}; do
if ! is_package_supported_by_chroot "${pkg}" "${chroot}"; then
echo "Package '${pkg}' is not supported by chroot: ${chroot}";
else
copr build-package \
--timeout $((30*3600)) \
--nowait \
--name "$pkg" "${after_build_id}" \
--chroot "${chroot}" \
${{ env.project_today }} \
| tee "${pkg}.log"
after_build_id="--after-build-id $(grep -Po 'Created builds: \K(\d+)' "${pkg}.log")"
fi
done
copr build-package \
--timeout $((30*3600)) \
--nowait \
--name "llvm" \
--chroot "${chroot}" \
${{ env.project_today }} \
| tee "llvm.log"
done
- name: "Delete target Copr project at ${{ env.project_target }} before forking to it"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ copr==2.0
# copr-cli
copr-cli==2.0
# via -r requirements.txt.in
coverage==7.6.10
coverage==7.6.11
# via -r requirements.txt.in
cryptography==43.0.1
# via pyjwt
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ munch==4.0.0
copr==2.0
requests==2.32.3
fnc
coverage==7.6.10
coverage==7.6.11
24 changes: 2 additions & 22 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,14 @@ function get_chroots() {
copr list-chroots | grep -P '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-)' | sort | tr '\n' ' '
}

# Prints the packages we care about
function get_packages() {
echo "llvm"
}

# Returns false if a package needs special handling on certain architectures
function is_package_supported_by_chroot() {
local pkg=$1
local chroot=$2

true
}

# Returns 0 if all packages on all* chroots have successful builds.
#
# *: All supported combinations of package + chroot (see is_package_supported_by_chroot).
# Returns 0 if all llvm packages on all chroots have successful builds.
function has_all_good_builds(){
local project=$1
local extra_packages=$2

copr monitor --output-format text-row --fields state,chroot,name $project | sort -k1 -k2 -k3 > /tmp/actual.txt
truncate -s 0 /tmp/expected.txt
for chroot in $(get_chroots); do
for package in $(get_packages) $extra_packages; do
if is_package_supported_by_chroot "$package" "$chroot"; then
echo "succeeded $chroot $package" >> /tmp/expected.txt
fi
done
echo "succeeded $chroot llvm" >> /tmp/expected.txt
done
sort -k1 -k2 -k3 -o /tmp/expected.txt /tmp/expected.txt
diff -bus /tmp/expected.txt /tmp/actual.txt
Expand Down

0 comments on commit bccff4e

Please sign in to comment.