203 switch to openmpi for linux packages #342
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: RPM Packages | |
on: | |
workflow_dispatch: | |
inputs: | |
mpi_implementation: | |
description: mpi implementation | |
type: choice | |
default: openmpi | |
options: [mpich, openmpi] | |
pull_request: | |
paths: ['**CMakeLists.txt', '**.cmake', .github/workflows/pack-rpm.yml] | |
push: | |
tags: ['*'] | |
# Cancel any ongoing run of this workflow on the same PR or ref | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref | |
}} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [rocky8, rocky9] | |
container: | |
image: ghcr.io/khiopsml/khiops/khiopsdev-new-${{ matrix.os }}:latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Put OS info on the environment | |
run: | | |
source /etc/os-release | |
echo "ID=$ID" >> "$GITHUB_ENV" | |
VERSION_CODENAME=$(echo $PLATFORM_ID | cut -d":" -f2) | |
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV" | |
if [ -z "${{ github.event.inputs.mpi_implementation }}" ] ; | |
then | |
echo "MPI_IMPLEMENTATION=openmpi" >> "$GITHUB_ENV" | |
else | |
echo "MPI_IMPLEMENTATION=${{ github.event.inputs.mpi_implementation }}" >> "$GITHUB_ENV" | |
fi | |
- name: Configure CMake | |
run: | | |
source /etc/profile.d/modules.sh | |
module unload mpi | |
module load mpi/${{ env.MPI_IMPLEMENTATION}}-x86_64 | |
cmake --preset linux-gcc-release -DBUILD_JARS=ON | |
- name: Build Khiops binaries | |
run: | | |
cmake --build --preset linux-gcc-release --parallel \ | |
--target MODL MODL_Coclustering KhiopsNativeInterface norm_jar khiops_jar | |
- name: Build package with CPack | |
run: cd build/linux-gcc-release && cpack -G RPM | |
- name: Rename packages with codename | |
run: | | |
source /etc/os-release | |
ARCH=$(arch) | |
cd build/linux-gcc-release/packages | |
for filename in *.rpm | |
do | |
mv -v $filename ${filename%.${ARCH}*}.${{ env.VERSION_CODENAME }}.${ARCH}.rpm | |
done | |
- name: Upload the packages as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
# We add a `rpm-` prefix so we can later recover all artifacts with the pattern `rpm-*` | |
# Note: The more natural pattern `*-rpm` or `*` does not work | |
name: rpm-${{ env.ID }}-${{ env.VERSION_CODENAME }} | |
path: build/linux-gcc-release/packages/*.rpm | |
if-no-files-found: error | |
# Test packages on a brand new runner to check: | |
# - the installation process (including dependencies installation) | |
# - that executable works (run with -v) | |
# - that it executes a small test | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
rocky_version: [8, 9] | |
container: | |
image: rockylinux:${{ matrix.rocky_version }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set environment variables | |
run: | | |
source /etc/os-release | |
echo "ID=$ID" >> "$GITHUB_ENV" | |
VERSION=$(echo $PLATFORM_ID | cut -d":" -f2) | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
if [ -z "${{ github.event.inputs.mpi_implementation }}" ] ; | |
then | |
echo "MPI_IMPLEMENTATION=openmpi" >> "$GITHUB_ENV" | |
else | |
echo "MPI_IMPLEMENTATION=${{ github.event.inputs.mpi_implementation }}" >> "$GITHUB_ENV" | |
fi | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: rpm-${{ env.ID }}-${{ env.VERSION }} | |
path: artifacts | |
- run: yum update -y | |
- name: Install Khiops core | |
run: | | |
yum install -y ./artifacts/khiops-core* | |
- name: Check Khiops core installation | |
run: | | |
khiops-env --env | |
khiops -v | |
khiops_coclustering -v | |
- name: Install Khiops Desktop (with java) | |
run: | | |
yum install -y ./artifacts/khiops-* | |
- name: Check Khiops installation | |
run: | | |
khiops-env --env | |
khiops -v | |
khiops_coclustering -v | |
- name: Test Khiops installation | |
uses: ./.github/actions/test-khiops-install | |
test-kni: | |
needs: build | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [rocky8, rocky9] | |
container: | |
image: ghcr.io/khiopsml/khiops/khiopsdev-new-${{ matrix.os }}:latest | |
steps: | |
- name: Put OS info on the environment | |
run: | | |
source /etc/os-release | |
echo "ID=$ID" >> "$GITHUB_ENV" | |
VERSION=$(echo $PLATFORM_ID | cut -d":" -f2) | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: rpm-${{ env.ID }}-${{ env.VERSION }} | |
path: artifacts | |
- name: Install KNI Package | |
run: | | |
yum update -y | |
yum install -y ./artifacts/kni* | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Test KNI package | |
uses: ./.github/actions/test-kni | |
# Release is only executed on tags | |
release: | |
if: github.ref_type == 'tag' | |
# We release even if the tests fail (we delete from the release whatever fails manually) | |
needs: build | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Download package artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
# See the upload-artifact step in the build job for the explanation of this pattern | |
pattern: rpm-* | |
merge-multiple: true | |
- name: Rename packages with tag version | |
run: | | |
# Renames the packge only if the source version differs from the tag | |
SOURCE_VERSION=$(./scripts/khiops-version) | |
for PKG_FILE in *.rpm | |
do | |
NEW_PKG_FILE=$(echo $PKG_FILE | sed "s/-${SOURCE_VERSION}-/-${{ github.ref_name }}-/") | |
if [[ "$PKG_FILE" != "$NEW_PKG_FILE" ]] | |
then | |
mv $PKG_FILE $NEW_PKG_FILE | |
fi | |
done | |
- name: Upload packages to the release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
artifacts: '*.rpm' | |
body: '**For testing purposes only**' | |
draft: false | |
makeLatest: false | |
prerelease: true | |
updateOnlyUnreleased: true |