Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || 'latest' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '10.2.3-b.4.with_native_10.2.3-b.4' }}
# Use the 'runner' user (1001) from github so checkout actions work properly
# https://github.com/actions/runner/issues/2033#issuecomment-1598547465
options: --user 1001
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
DEFAULT_SAMPLES_VERSION: 10.2.0
# Note: The default Khiops version must never be an alpha release as they are
# ephemeral. To test alpha versions run the workflow manually.
DEFAULT_KHIOPS_CORE_VERSION: 10.2.2
DEFAULT_KHIOPS_CORE_VERSION: 10.2.3b.4
on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Install the Khiops Conda package (Windows)
if: runner.os == 'Windows'
run: |
conda install --channel khiops-dev khiops-core=$KHIOPS_CORE_VERSION
conda install --channel conda-forge --channel khiops-dev khiops-core=$KHIOPS_CORE_VERSION
conda install --override-channels --channel conda-forge --channel ./khiops-conda/ khiops
# In Linux/macOS we need the conda-forge channel to install their pinned versions
- name: Install the Khiops Conda package (Linux/macOS)
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || 'latest' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '10.2.3-b.4.with_native_10.2.3-b.4' }}
steps:
- name: Set parameters as env
run: |
Expand Down Expand Up @@ -100,11 +100,8 @@ jobs:
kh-samples sklearn -i khiops_classifier -e

# Test that the line containing "MPI command" also contains
# an executable name under a /bin directory
# Note: this executable name can be different, depending on the MPI
# backend and OS; for instance, "orterun" for OpenMPI on Ubuntu Linux, but
# "mpiexec" for OpenMPI on Rocky Linux
kh-status | grep "MPI command" | grep -Ewq "(/.+?)/bin/.+"
# an executable named "mpiexec"
kh-status | grep "MPI command" | grep -wq "mpiexec"
release:
if: github.ref_type == 'tag'
needs: [build, test]
Expand Down
72 changes: 64 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Unit Tests
env:
DEFAULT_SAMPLES_REVISION: main
DEFAULT_KHIOPS_DESKTOP_REVISION: 10.2.3-b.3
on:
workflow_dispatch:
inputs:
Expand All @@ -11,6 +12,9 @@ on:
image-tag:
default: latest
description: Development Docker Image Tag
khiops-desktop-revision:
default: 10.2.3-b.3
description: Khiops Windows Desktop Application Version
run-long-tests:
type: boolean
required: false
Expand All @@ -32,7 +36,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || 'latest' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '10.2.3-b.4.with_native_10.2.3-b.4' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -106,9 +110,6 @@ jobs:
OMPI_MCA_rmaps_base_oversubscribe: true
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
run: |
# Make sure '/bin' is before '/usr/bin' in PATH
PATH=$(echo "/bin:"$PATH | sed 's#:/bin##')

# This is needed so that the Git tag is parsed and the khiops-python
# version is retrieved
git config --global --add safe.directory $(realpath .)
Expand Down Expand Up @@ -147,6 +148,64 @@ jobs:
tests/resources/dictionary/copy_output_kdic/*.kdic
tests/resources/general_options/general_options/*/*._kh
retention-days: 7
check-khiops-integration-on-windows:
runs-on: windows-2019
steps:
- name: Download the Khiops Desktop NSIS Installer
shell: pwsh
run: |
$KHIOPS_DESKTOP_REVISION = '${{ inputs.khiops-desktop-revision || env.DEFAULT_KHIOPS_DESKTOP_REVISION }}'
$KHIOPS_DOWNLOAD_URL = "https://github.com/KhiopsML/khiops/releases/download/${KHIOPS_DESKTOP_REVISION}/khiops-${KHIOPS_DESKTOP_REVISION}-setup.exe"
Invoke-WebRequest "${KHIOPS_DOWNLOAD_URL}" `
-OutFile .\khiops-setup.exe `
-UseBasicParsing; `
Unblock-File .\khiops-setup.exe
- name: Install the Khiops Desktop Application
shell: pwsh
run: |
# Execute the installer
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
Start-Process `
-FilePath .\khiops-setup.exe `
-ArgumentList '/S' `
-Wait
- name: Checkout sources
uses: actions/checkout@v4
with:
# Get Git tags so that versioneer can function correctly
# See issue https://github.com/actions/checkout/issues/701
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install khiops-python dev dependencies
shell: pwsh
run: |
# The following git command is required,
# as the Git repository is in a directory the current user does not own,
# Python versioneer fails to compute the current version correctly otherwise
git config --global --add safe.directory $(Resolve-Path '.' | % {$_.toString()}); `
python setup.py egg_info; `
Get-Content .\khiops.egg-info\requires.txt `
| Select-String -Pattern '^\[' -NotMatch `
| % {$_.Line} `
| ForEach-Object {pip install $_.toString()}; `
Remove-Item -r -force khiops.egg-info
- name: Setup and Install Test Requirements
run: pip install -r test-requirements.txt
- name: Test Khiops Integration
env:
KHIOPS_PROC_NUMBER: 4
shell: pwsh
run: |
# Refresh environment variables by using the Chocolatey tool
# Otherwise, the env vars set in the registry by the Khiops installer do not get updated
# See also https://github.com/actions/runner-images/discussions/6065#discussioncomment-3517318
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
python -c "import khiops.core as kh; kh.get_runner().print_status()"
check-mpiexec-on-linux:
strategy:
fail-fast: false
Expand All @@ -158,7 +217,7 @@ jobs:
# because the `env` context is only accessible at the step level;
# hence, it is hard-coded
image: |-
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || 'latest' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '10.2.3-b.4.with_native_10.2.3-b.4' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -191,9 +250,6 @@ jobs:
# Force > 2 CPU cores to launch mpiexec
KHIOPS_PROC_NUMBER: 4
run: |-
# Make sure '/bin' is before '/usr/bin' in PATH
PATH=$(echo "/bin:"$PATH | sed 's#:/bin##')

# Make sure MPI support is not loaded through env modules
# Note: As Docker container's shell is non-interactive, environment
# modules are currently not initializing the shell anyway
Expand Down
27 changes: 6 additions & 21 deletions doc/notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,14 @@ Environment Variables
---------------------

The default Khiops local runner used by the `khiops.core.api` functions can be customized via the
environment variables listed below. They can be split into three groups:

- part of the Khiops API:

- ``KHIOPS_PROC_NUMBER``: number of processes launched by Khiops
- ``KHIOPS_MEMORY_LIMIT``: memory limit of the Khiops executables in megabytes;
ignored if set above the system memory limit
- ``KHIOPS_TMP_DIR``: path to Khiops' temporary directory

- other environment variables:

- ``KHIOPS_HOME``: *Windows only* path to the Khiops installation directory
- ``KHIOPS_SAMPLES_DIR``: path to the Khiops sample datasets directory

- advanced configuration variables. Most of the time the user does not need modify
them:

- ``KHIOPS_MPI_COMMAND_ARGS``: arguments to the ``mpiexec`` command
- ``KHIOPS_MPIEXEC_PATH``: path to the ``mpiexec`` command
- ``KHIOPS_MPI_LIB``: *Linux and MacOS only* path to the MPI library; added to
the beginning of ``LD_LIBRARY_PATH``
environment variables listed below:


- ``KHIOPS_PROC_NUMBER``: number of processes launched by Khiops
- ``KHIOPS_MEMORY_LIMIT``: memory limit of the Khiops executables in megabytes;
ignored if set above the system memory limit
- ``KHIOPS_TMP_DIR``: path to Khiops' temporary directory
- ``KHIOPS_SAMPLES_DIR``: path to the Khiops sample datasets directory (only for the Khiops Python library)

.. _core-api-input-types:

Expand Down
Loading
Loading