The echo-based approach was mangling rpm macro tokens like
%{__plaintext_filename}. Switch to a heredoc so the content is
written verbatim.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
141 lines
4.3 KiB
YAML
141 lines
4.3 KiB
YAML
name: build-release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "mistral.rs upstream tag"
|
|
required: true
|
|
type: string
|
|
|
|
concurrency:
|
|
group: poll-and-build
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: cuda13
|
|
runner: cuda-13.0
|
|
cuda_home: /usr/local/cuda-13.0
|
|
cargo_features: "cuda cudnn flash-attn nccl"
|
|
compute_caps: "120"
|
|
build_jobs: 12
|
|
nvcc_threads: 4
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install/update Rust toolchain
|
|
run: |
|
|
if command -v rustup &> /dev/null; then
|
|
rustup update stable
|
|
else
|
|
curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y
|
|
fi
|
|
echo "${HOME}/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
#- name: Check for NCCL
|
|
# run: |
|
|
# if ! ldconfig -p | grep -q libnccl.so.2; then
|
|
# echo "ERROR: libnccl not found. Install with:"
|
|
# echo " sudo dnf config-manager addrepo --from-repofile=https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo"
|
|
# echo " sudo dnf --repo=cuda-rhel9-x86_64 install libnccl libnccl-devel"
|
|
# exit 1
|
|
# fi
|
|
|
|
- name: Clone mistral.rs at tag
|
|
run: |
|
|
git clone --depth 1 --branch "${{ inputs.tag }}" \
|
|
https://github.com/EricLBuehler/mistral.rs.git src/
|
|
|
|
- name: Build
|
|
run: ./script/build-binary.sh
|
|
env:
|
|
FLAVOUR_NAME: ${{ matrix.name }}
|
|
CUDA_HOME: ${{ matrix.cuda_home }}
|
|
CARGO_FEATURES: ${{ matrix.cargo_features }}
|
|
CUDA_COMPUTE_CAP: ${{ matrix.compute_caps }}
|
|
CARGO_BUILD_JOBS: ${{ matrix.build_jobs }}
|
|
NVCC_THREADS: ${{ matrix.nvcc_threads }}
|
|
SRC_DIR: src
|
|
|
|
- name: Upload binary artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: mistralrs-server-${{ matrix.name }}
|
|
path: artifacts/mistralrs-server-${{ matrix.name }}
|
|
retention-days: 1
|
|
|
|
package:
|
|
needs: build
|
|
runs-on: fedora
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: cuda13
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: mistralrs-server-${{ matrix.name }}
|
|
path: artifacts/
|
|
|
|
- name: Build RPM
|
|
run: |
|
|
rm -f ~/.rpmmacros
|
|
version="${TAG#v}"
|
|
rpmdev-setuptree
|
|
cp artifacts/mistralrs-server-${{ matrix.name }} ~/rpmbuild/SOURCES/
|
|
cp rpm/systemd/mistralrs@.service ~/rpmbuild/SOURCES/
|
|
cp rpm/systemd/mistralrs@.conf.example ~/rpmbuild/SOURCES/
|
|
rpmbuild -bb rpm/mistralrs.spec \
|
|
--define "mistralrs_version ${version}" \
|
|
--define "mistralrs_flavour ${{ matrix.name }}"
|
|
env:
|
|
TAG: ${{ inputs.tag }}
|
|
|
|
- name: Upload RPM
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: rpm-${{ matrix.name }}
|
|
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
|
retention-days: 7
|
|
|
|
publish:
|
|
needs: package
|
|
runs-on: fedora
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download all RPMs
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: rpms/
|
|
pattern: rpm-*
|
|
|
|
- name: Flatten RPM artifacts
|
|
run: |
|
|
find rpms/ -name '*.rpm' -exec mv --target-directory=rpms/ {} +
|
|
find rpms/ -mindepth 1 -type d -empty -delete
|
|
|
|
- name: Import signing key
|
|
run: |
|
|
echo "${{ secrets.RPM_SIGNING_KEY }}" | gpg --batch --import
|
|
cat > ~/.rpmmacros << 'RPMMACROS'
|
|
%_gpg_name ${{ secrets.RPM_SIGNING_KEY_ID }}
|
|
%__gpg_sign_cmd %{__gpg} --batch --no-armor --no-tty --pinentry-mode loopback --passphrase '' %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u "%{_gpg_name}" -sbo %{__signature_filename} --digest-algo sha256 %{__plaintext_filename}
|
|
RPMMACROS
|
|
|
|
- name: Sign and publish
|
|
run: ./script/publish-repo.sh rpms/
|
|
env:
|
|
RSYNC_TARGET: ${{ secrets.RSYNC_TARGET }}
|
|
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|