feat(ci): parameterize fedora version across pipeline
Add fedora_version to build, package, and publish matrices so the pipeline can target multiple Fedora releases in parallel. Force the dist tag via --define to ensure RPMs are stamped correctly regardless of build host. Update poll-upstream to check all fedora/flavour combinations before triggering a build. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,10 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: cuda13
|
||||
runner: cuda-13.0
|
||||
fedora_version: "43"
|
||||
runner:
|
||||
- cuda-13.0
|
||||
- fedora-workstation-43
|
||||
cuda_home: /usr/local/cuda-13.0
|
||||
cargo_features: "cuda cudnn flash-attn nccl"
|
||||
compute_caps: "120"
|
||||
@@ -66,7 +69,7 @@ jobs:
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: mistralrs-server-${{ matrix.name }}
|
||||
name: mistralrs-server-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||
path: artifacts/mistralrs-server-${{ matrix.name }}
|
||||
retention-days: 1
|
||||
|
||||
@@ -78,13 +81,14 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: cuda13
|
||||
fedora_version: "43"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download binary
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: mistralrs-server-${{ matrix.name }}
|
||||
name: mistralrs-server-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||
path: artifacts/
|
||||
|
||||
- name: Build RPM
|
||||
@@ -97,28 +101,37 @@ jobs:
|
||||
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
||||
rpmbuild -bb rpm/mistralrs.spec \
|
||||
--define "mistralrs_version ${version}" \
|
||||
--define "mistralrs_flavour ${{ matrix.name }}"
|
||||
--define "mistralrs_flavour ${{ matrix.name }}" \
|
||||
--define "dist .fc${{ matrix.fedora_version }}"
|
||||
env:
|
||||
TAG: ${{ inputs.tag }}
|
||||
|
||||
- name: Upload RPM
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rpm-${{ matrix.name }}
|
||||
name: rpm-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
||||
retention-days: 7
|
||||
|
||||
publish:
|
||||
needs: package
|
||||
runs-on: fedora
|
||||
concurrency:
|
||||
group: rpm-publish-fc${{ matrix.fedora_version }}
|
||||
cancel-in-progress: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- fedora_version: "43"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all RPMs
|
||||
- name: Download RPMs for fc${{ matrix.fedora_version }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: rpms/
|
||||
pattern: rpm-*
|
||||
pattern: rpm-*-fc${{ matrix.fedora_version }}
|
||||
|
||||
- name: Flatten RPM artifacts
|
||||
run: |
|
||||
@@ -136,5 +149,6 @@ RPMMACROS
|
||||
- name: Sign and publish
|
||||
run: ./script/publish-repo.sh rpms/
|
||||
env:
|
||||
FEDORA_VERSION: ${{ matrix.fedora_version }}
|
||||
RSYNC_TARGET: ${{ secrets.RSYNC_TARGET }}
|
||||
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|
||||
|
||||
@@ -23,26 +23,32 @@ jobs:
|
||||
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||
echo "Upstream latest: ${tag}"
|
||||
|
||||
- name: Get published version from our repo
|
||||
- name: Check if all packages are published
|
||||
id: published
|
||||
run: |
|
||||
# Query our own dnf repo. If the version is there, we've already built it.
|
||||
# Strip leading 'v' because RPM versions don't use it.
|
||||
version="${UPSTREAM_TAG#v}"
|
||||
http_response_code=$(curl \
|
||||
--silent \
|
||||
--write-out "%{http_code}" \
|
||||
--output /dev/null \
|
||||
--head \
|
||||
--url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm")
|
||||
if [ "${http_response_code}" = "200" ]; then
|
||||
echo "already_built=true" >> "$GITHUB_OUTPUT"
|
||||
elif [ "${http_response_code}" = "404" ]; then
|
||||
echo "already_built=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Unexpected HTTP response code: ${http_response_code}"
|
||||
exit 1
|
||||
fi
|
||||
needs_build=false
|
||||
for target in "43:cuda13"; do
|
||||
fedora_version="${target%%:*}"
|
||||
flavour="${target##*:}"
|
||||
url="https://rpm.lair.cafe/fedora/${fedora_version}/x86_64/mistralrs-server-${flavour}-${version}-1.fc${fedora_version}.x86_64.rpm"
|
||||
http_code=$(curl \
|
||||
--silent \
|
||||
--write-out "%{http_code}" \
|
||||
--output /dev/null \
|
||||
--head \
|
||||
--url "${url}")
|
||||
if [ "${http_code}" = "200" ]; then
|
||||
echo "found: ${url}"
|
||||
elif [ "${http_code}" = "404" ]; then
|
||||
echo "missing: ${url}"
|
||||
needs_build=true
|
||||
else
|
||||
echo "unexpected HTTP ${http_code} for ${url}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "already_built=$( [ "${needs_build}" = "true" ] && echo false || echo true )" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
set -euo pipefail
|
||||
|
||||
RPM_DIR="${1:?usage: $0 <rpm-directory>}"
|
||||
REMOTE_DIR="/var/www/rpm/fedora/43/x86_64"
|
||||
: "${FEDORA_VERSION:?}"
|
||||
REMOTE_DIR="/var/www/rpm/fedora/${FEDORA_VERSION}/x86_64"
|
||||
|
||||
# sign each rpm with the imported gpg key
|
||||
for rpm in "${RPM_DIR}"/*.rpm; do
|
||||
|
||||
Reference in New Issue
Block a user