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:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: cuda13
|
- name: cuda13
|
||||||
runner: cuda-13.0
|
fedora_version: "43"
|
||||||
|
runner:
|
||||||
|
- cuda-13.0
|
||||||
|
- fedora-workstation-43
|
||||||
cuda_home: /usr/local/cuda-13.0
|
cuda_home: /usr/local/cuda-13.0
|
||||||
cargo_features: "cuda cudnn flash-attn nccl"
|
cargo_features: "cuda cudnn flash-attn nccl"
|
||||||
compute_caps: "120"
|
compute_caps: "120"
|
||||||
@@ -66,7 +69,7 @@ jobs:
|
|||||||
- name: Upload binary artifact
|
- name: Upload binary artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mistralrs-server-${{ matrix.name }}
|
name: mistralrs-server-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||||
path: artifacts/mistralrs-server-${{ matrix.name }}
|
path: artifacts/mistralrs-server-${{ matrix.name }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
@@ -78,13 +81,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- name: cuda13
|
- name: cuda13
|
||||||
|
fedora_version: "43"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download binary
|
- name: Download binary
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mistralrs-server-${{ matrix.name }}
|
name: mistralrs-server-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
|
||||||
- name: Build RPM
|
- name: Build RPM
|
||||||
@@ -97,28 +101,37 @@ jobs:
|
|||||||
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
||||||
rpmbuild -bb rpm/mistralrs.spec \
|
rpmbuild -bb rpm/mistralrs.spec \
|
||||||
--define "mistralrs_version ${version}" \
|
--define "mistralrs_version ${version}" \
|
||||||
--define "mistralrs_flavour ${{ matrix.name }}"
|
--define "mistralrs_flavour ${{ matrix.name }}" \
|
||||||
|
--define "dist .fc${{ matrix.fedora_version }}"
|
||||||
env:
|
env:
|
||||||
TAG: ${{ inputs.tag }}
|
TAG: ${{ inputs.tag }}
|
||||||
|
|
||||||
- name: Upload RPM
|
- name: Upload RPM
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: rpm-${{ matrix.name }}
|
name: rpm-${{ matrix.name }}-fc${{ matrix.fedora_version }}
|
||||||
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: package
|
needs: package
|
||||||
runs-on: fedora
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download all RPMs
|
- name: Download RPMs for fc${{ matrix.fedora_version }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: rpms/
|
path: rpms/
|
||||||
pattern: rpm-*
|
pattern: rpm-*-fc${{ matrix.fedora_version }}
|
||||||
|
|
||||||
- name: Flatten RPM artifacts
|
- name: Flatten RPM artifacts
|
||||||
run: |
|
run: |
|
||||||
@@ -136,5 +149,6 @@ RPMMACROS
|
|||||||
- name: Sign and publish
|
- name: Sign and publish
|
||||||
run: ./script/publish-repo.sh rpms/
|
run: ./script/publish-repo.sh rpms/
|
||||||
env:
|
env:
|
||||||
|
FEDORA_VERSION: ${{ matrix.fedora_version }}
|
||||||
RSYNC_TARGET: ${{ secrets.RSYNC_TARGET }}
|
RSYNC_TARGET: ${{ secrets.RSYNC_TARGET }}
|
||||||
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|
||||||
|
|||||||
@@ -23,26 +23,32 @@ jobs:
|
|||||||
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||||
echo "Upstream latest: ${tag}"
|
echo "Upstream latest: ${tag}"
|
||||||
|
|
||||||
- name: Get published version from our repo
|
- name: Check if all packages are published
|
||||||
id: published
|
id: published
|
||||||
run: |
|
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}"
|
version="${UPSTREAM_TAG#v}"
|
||||||
http_response_code=$(curl \
|
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 \
|
--silent \
|
||||||
--write-out "%{http_code}" \
|
--write-out "%{http_code}" \
|
||||||
--output /dev/null \
|
--output /dev/null \
|
||||||
--head \
|
--head \
|
||||||
--url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm")
|
--url "${url}")
|
||||||
if [ "${http_response_code}" = "200" ]; then
|
if [ "${http_code}" = "200" ]; then
|
||||||
echo "already_built=true" >> "$GITHUB_OUTPUT"
|
echo "found: ${url}"
|
||||||
elif [ "${http_response_code}" = "404" ]; then
|
elif [ "${http_code}" = "404" ]; then
|
||||||
echo "already_built=false" >> "$GITHUB_OUTPUT"
|
echo "missing: ${url}"
|
||||||
|
needs_build=true
|
||||||
else
|
else
|
||||||
echo "Unexpected HTTP response code: ${http_response_code}"
|
echo "unexpected HTTP ${http_code} for ${url}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
echo "already_built=$( [ "${needs_build}" = "true" ] && echo false || echo true )" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
env:
|
||||||
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
RPM_DIR="${1:?usage: $0 <rpm-directory>}"
|
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
|
# sign each rpm with the imported gpg key
|
||||||
for rpm in "${RPM_DIR}"/*.rpm; do
|
for rpm in "${RPM_DIR}"/*.rpm; do
|
||||||
|
|||||||
Reference in New Issue
Block a user