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
4 changes: 2 additions & 2 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: main
description: khiops-python-tutorial repo revision
image-tag:
default: 10.7.3-a.0.0
default: 11.0.0-a.0.0
description: Development Docker Image Tag
pull_request:
paths:
Expand Down Expand Up @@ -41,7 +41,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 || '10.7.3-a.0.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '11.0.0-a.0.0' }}
# 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
18 changes: 11 additions & 7 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Conda Package
env:
# 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.7.3a.0
DEFAULT_KHIOPS_CORE_VERSION: 11.0.0a.0
DEFAULT_SAMPLES_VERSION: 11.0.0
on:
workflow_dispatch:
inputs:
khiops-core-version:
default: 10.7.3a.0
default: 11.0.0a.0
description: khiops-core version for testing
khiops-samples-version:
default: 11.0.0
Expand Down Expand Up @@ -57,10 +57,8 @@ jobs:
- name: Install Dependency Requirements for Building Conda Packages
run: conda install -y conda-build
- name: Build the Conda Package
# Note: The "khiops-dev" conda channel is needed to retrieve the "khiops-core" package.
# The "test" part of the conda recipe needs this package.
run: |
conda build --channel khiops-dev --output-folder ./khiops-conda ./packaging/conda
conda build --output-folder ./khiops-conda ./packaging/conda
Comment thread
folmos-at-orange marked this conversation as resolved.
- name: Upload Conda Package Artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -80,8 +78,8 @@ jobs:
- {os: ubuntu-24.04, json-image: '{"image": null}'}
- {os: ubuntu-22.04, json-image: '{"image": "rockylinux:8"}'}
- {os: ubuntu-22.04, json-image: '{"image": "rockylinux:9"}'}
- {os: windows-2019, json-image: '{"image": null}'}
- {os: windows-2022, json-image: '{"image": null}'}
- {os: windows-2025, json-image: '{"image": null}'}
- {os: macos-13, json-image: '{"image": null}'}
- {os: macos-14, json-image: '{"image": null}'}
- {os: macos-15, json-image: '{"image": null}'}
Expand All @@ -105,7 +103,13 @@ jobs:
echo "KHIOPS_CORE_VERSION=$KHIOPS_CORE_VERSION" >> "$GITHUB_ENV"
- name: Install the Khiops Conda package
run: |
conda install --channel khiops-dev khiops-core=$KHIOPS_CORE_VERSION
# Add the Conda `rc` label for alpha or RC pre-releases
if [[ $(echo ${KHIOPS_CORE_VERSION} | grep -E ".*(a|rc)\.[0-9]+") ]]; then
RC_LABEL="conda-forge/label/rc::"
else
RC_LABEL=""
fi
conda install ${RC_LABEL}khiops-core=$KHIOPS_CORE_VERSION
conda install --channel ./khiops-conda/ khiops
- name: Test Khiops Installation Status
run: kh-status
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Dev Docker
env:
DEFAULT_KHIOPS_REVISION: 10.7.3-a.0
DEFAULT_KHIOPS_REVISION: 11.0.0-a.0
DEFAULT_IMAGE_INCREMENT: 0
DEFAULT_SERVER_REVISION: main
DEFAULT_PYTHON_VERSIONS: 3.8 3.9 3.10 3.11 3.12 3.13
Expand All @@ -14,7 +14,7 @@ on:
inputs:
khiops-revision:
type: string
default: 10.7.3-a.0
default: 11.0.0-a.0
description: Khiops Revision
image-increment:
type: number
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: 11.0.0
description: khiops-samples repo revision
image-tag:
default: 10.7.3-a.0.0
default: 11.0.0-a.0.0
description: Development Docker Image Tag
pull_request:
paths:
Expand Down Expand Up @@ -64,7 +64,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 || '10.7.3-a.0.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-a.0.0' }}
steps:
- name: Set parameters as env
run: |
Expand Down Expand Up @@ -106,9 +106,11 @@ jobs:
kh-samples core -i train_coclustering -e
kh-samples sklearn -i khiops_classifier -e

# Test that the line containing "MPI command" also contains
# an executable named "mpiexec"
kh-status | grep "MPI command" | grep -wq "mpiexec"
# Test that the line containing "MPI command" does not contain "<empty>"
# (as given by kh-status in the absence of MPI support)
# The MPI command is not always named mpiexec, but can be orterun etc
# (as given by khiops_env)
kh-status | grep "MPI command" | grep -vwq "<empty>"
Comment thread
folmos-at-orange marked this conversation as resolved.
release:
if: github.ref_type == 'tag'
needs: [build, test]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
name: Tests
env:
DEFAULT_SAMPLES_REVISION: 11.0.0
DEFAULT_KHIOPS_DESKTOP_REVISION: 10.7.3-a.0
DEFAULT_KHIOPS_DESKTOP_REVISION: 11.0.0-a.0
on:
workflow_dispatch:
inputs:
samples-revision:
default: 11.0.0
description: Git Tag/Branch/Commit for the khiops-samples Repo
image-tag:
default: 10.7.3-a.0.0
default: 11.0.0-a.0.0
description: Development Docker Image Tag
khiops-desktop-revision:
default: 10.7.3-a.0
default: 11.0.0-a.0
description: Khiops Windows Desktop Application Version
run-expensive-tests:
type: boolean
Expand Down Expand Up @@ -43,7 +43,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 || '10.7.3-a.0.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-ubuntu22.04:${{ inputs.image-tag || '11.0.0-a.0.0' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
tests/resources/general_options/general_options/*/*._kh
retention-days: 7
check-khiops-integration-on-windows:
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Download the Khiops Desktop NSIS Installer
shell: pwsh
Expand Down Expand Up @@ -315,7 +315,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 || '10.7.3-a.0.0' }}
ghcr.io/khiopsml/khiops-python/khiopspydev-${{ matrix.container }}:${{ inputs.image-tag || '11.0.0-a.0.0' }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
Expand Down
43 changes: 29 additions & 14 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ def _infer_env_bin_dir_for_conda_based_installations():
# Match $CONDA_PREFIX/[Ll]ib/python3.X/site-packages/khiops/core/internals/runner.py
else:
conda_env_dir = current_file_path.parents[6]
env_bin_dir = os.path.join(str(conda_env_dir), "bin")

# Conda env binary dir is:
# - on Windows: conda_env_dir\Library\bin
# - on Linux/macOS: conda_env_dir\bin
if platform.system() == "Windows":
env_bin_dir = os.path.join(str(conda_env_dir), "Library", "bin")
else:
env_bin_dir = os.path.join(str(conda_env_dir), "bin")

return env_bin_dir

Expand All @@ -168,7 +175,10 @@ def _check_conda_env_bin_dir(conda_env_bin_dir):

# Conda env dir is not equal to its root dir
# Conda env bin dir exists, along with the `conda-meta` dir
# Note: On Windows, Conda env bin dir equals conda env dir\Library\bin
conda_env_dir_path = conda_env_bin_dir_path.parent
if platform.system() == "Windows":
conda_env_dir_path = conda_env_dir_path.parent
if (
str(conda_env_dir_path) != conda_env_dir_path.root # `.root` is an `str`
and conda_env_bin_dir_path.is_dir()
Expand All @@ -180,20 +190,25 @@ def _check_conda_env_bin_dir(conda_env_bin_dir):

def _infer_khiops_installation_method(trace=False):
"""Return the Khiops installation method"""
# We are in a conda environment if
# - if the CONDA_PREFIX environment variable exists and,
# - if MODL, MODL_Coclustering and mpiexec files exists in
# `$CONDA_PREFIX/bin`
#
# Note: The check that MODL and MODL_Coclustering are actually executable is done
# We are in a Conda environment if
# - the CONDA_PREFIX environment variable exists and,
# - the khiops_env script exists within:
# - `%CONDA_PREFIX\Library\bin%` on Windows
# - `$CONDA_PREFIX/bin` on Linux and MacOS
# Note: The check that the Khiops binaries are actually executable is done
# afterwards by the initializations method.
# We are in a conda env if the Khiops binaries exists within `$CONDA_PREFIX/bin`
if "CONDA_PREFIX" in os.environ and _khiops_env_file_exists(
os.path.join(os.environ["CONDA_PREFIX"], "bin")
):
installation_method = "conda"
# Otherwise, we choose between conda-based and local (default choice)
else:
installation_method = "unknown"
if "CONDA_PREFIX" in os.environ:
conda_env_dir = os.environ["CONDA_PREFIX"]
if platform.system() == "Windows":
conda_binary_dir = os.path.join(conda_env_dir, "Library", "bin")
else:
conda_binary_dir = os.path.join(conda_env_dir, "bin")
if _khiops_env_file_exists(conda_binary_dir):
installation_method = "conda"
# Otherwise (installation_method is still "unknown"), we choose between
# conda-based and local (default choice)
if installation_method == "unknown":
env_bin_dir = _infer_env_bin_dir_for_conda_based_installations()
if trace:
print(f"Environment binary dir: '{env_bin_dir}'")
Expand Down
2 changes: 1 addition & 1 deletion packaging/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requirements:
- python
run:
- python
- khiops-core =10.7.3a.0
- conda-forge/label/rc::khiops-core =11.0.0a.0
- pandas >=0.25.3
- scikit-learn >=0.22.2
run_constrained:
Expand Down
10 changes: 9 additions & 1 deletion packaging/docker/khiopspydev/Dockerfile.rocky
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,24 @@ RUN true \
# set up all the supported Python environments under conda (for the unit tests)
# relying on a variable containing all the versions
ARG PYTHON_VERSIONS

# Install Conda packages
# Use `rc` label for alpha or RC khiops-core pre-releases
RUN true \
&& export CONDA="/root/miniforge3/bin/conda" \
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
export RC_LABEL="conda-forge/label/rc::"; \
else \
export RC_LABEL=""; \
fi \
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
do \
CONDA_ENVS="py${version} py${version}_conda"; \
for CONDA_ENV in $CONDA_ENVS; \
do \
$CONDA create -y -n $CONDA_ENV python=${version}; \
done; \
$CONDA install -y -n py${version}_conda -c khiops-dev khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
done' \
&& true

Expand Down
10 changes: 9 additions & 1 deletion packaging/docker/khiopspydev/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ RUN true \
ARG PYTHON_VERSIONS
ARG KHIOPS_GCS_DRIVER_REVISION
ARG KHIOPS_S3_DRIVER_REVISION

# Install Conda packages
# Use `rc` label for alpha or RC khiops-core pre-releases
RUN true \
&& export CONDA="/root/miniforge3/bin/conda" \
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
export RC_LABEL="conda-forge/label/rc::"; \
else \
export RC_LABEL=""; \
fi \
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
do \
CONDA_ENVS="py${version} py${version}_conda"; \
Expand All @@ -52,7 +60,7 @@ RUN true \
$CONDA create -y -n $CONDA_ENV python=${version}; \
done; \
# khiops core \
$CONDA install -y -n py${version}_conda -c khiops-dev khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
# remote files drivers installed in the conda environment \
$CONDA install -y -n py${version}_conda -c khiops \
khiops-driver-s3=${KHIOPS_S3_DRIVER_REVISION} \
Expand Down