Skip to content

WIP openmpi conda

WIP openmpi conda #451

Workflow file for this run

---
name: DEB 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-debian.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: [debian10, debian11, debian12, ubuntu22.04, ubuntu20.04]
container:
image: ghcr.io/khiopsml/khiops/khiopsdev-new-${{ matrix.os }}:latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
echo "MPI_IMPLEMENTATION=${{ inputs.mpi_implementation || 'openmpi' }}" >> "$GITHUB_ENV"
- name: Configure CMake
run: |
update-alternatives --set mpi /usr/bin/mpicc.$MPI_IMPLEMENTATION
update-alternatives --set mpirun /usr/bin/mpirun.$MPI_IMPLEMENTATION
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 DEB
- name: Rename the packages to include the ubuntu codename
run: |
source /etc/os-release
cd build/linux-gcc-release/packages/
for filename in *.deb
do
mv -v $filename ${filename%_*}-${VERSION_CODENAME}.${filename##*_}
done
- name: Upload the packages as artifacts
uses: actions/upload-artifact@v4
with:
# We add a `deb-` prefix so we can later recover all artifacts with the pattern `deb-*`
# Note: The more natural pattern `*-deb` or `*` does not work
name: deb-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: build/linux-gcc-release/packages/*.deb
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
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: ['debian:10', 'debian:11', 'debian:12', 'ubuntu:22.04', 'ubuntu:20.04']
container:
image: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
echo "MPI_IMPLEMENTATION=${{ inputs.mpi_implementation || 'openmpi' }}" >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: deb-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: artifacts
- name: Install Khiops core
run: |
export DEBIAN_FRONTEND="noninteractive"
apt-get update
dpkg -i ./artifacts/khiops-core* || true
apt-get -f install -y
- name: Check Khiops core installation
run: |
khiops-env --env
khiops -s
khiops_coclustering -s
- name: Install Khiops Desktop (with java)
run: |
dpkg -i ./artifacts//khiops_* || true
apt-get -f install -y
- name: Check Khiops installation
run: |
khiops-env --env
khiops -s
khiops_coclustering -s
- name: Test Khiops installation
continue-on-error: ${{ matrix.os == 'debian:11' }}
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: [debian10, debian11, debian12, ubuntu22.04, ubuntu20.04]
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"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: deb-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: artifacts
- name: Install KNI Package
run: |
apt-get update
dpkg -i ./artifacts/kni* || true
apt-get -f install -y
- 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: deb-*
merge-multiple: true
- name: Rename packages with tag version
run: |
SOURCE_VERSION=$(./scripts/khiops-version)
for PKG_FILE in *.deb
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: '*.deb'
draft: false
makeLatest: false
prerelease: true
updateOnlyUnreleased: true